* {
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto Mono', monospace;
    background: #111;
    height: 100vh;
    overflow: hidden;
    color: #333;
    cursor: default;
}

.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #333 0%, #000 100%);
    z-index: -1;
}

.dirt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://www.transparenttextures.com/patterns/dirty-old-shirt.png');
    opacity: 0.3;
    pointer-events: none;
    z-index: 900;
}


/* UI */

#game-ui {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.top-bar {
    height: 50px;
    background: #222;
    border-bottom: 4px solid #444;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    color: #fff;
    flex-shrink: 0;
}

.stats-box {
    display: flex;
    gap: 15px;
}


/* STŮL */

.workbench-grid {
    flex: 1;
    display: flex;
    gap: 10px;
    padding: 10px;
    background: url('https://www.transparenttextures.com/patterns/wood-pattern.png'), #5d4037;
    overflow: hidden;
    min-height: 0;
}

.section-paper {
    flex: 1;
    display: flex;
    justify-content: center;
    overflow-y: auto;
}

.clipboard {
    background: #f4e7be;
    width: 100%;
    max-width: 350px;
    padding: 15px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
    font-family: 'Permanent Marker';
    display: flex;
    flex-direction: column;
    position: relative;
    color: #000080;
}

#job-info {
    flex: 1;
    margin-top: 10px;
    font-family: 'Roboto Mono';
    font-weight: bold;
    font-size: 0.9rem;
    overflow-y: auto;
}

.task-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #555;
    padding: 5px 0;
}

.action-btn {
    background: #fff;
    border: 2px solid #000;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.8rem;
    padding: 2px 5px;
}

.paper-buttons {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    flex-shrink: 0;
}

.paper-buttons button {
    flex: 1;
    padding: 10px;
    border: 2px solid #333;
    font-weight: bold;
    cursor: pointer;
    background: #fff;
}

.stamp {
    position: absolute;
    bottom: 60px;
    right: 20px;
    border: 4px solid green;
    color: green;
    font-size: 2rem;
    transform: rotate(-15deg);
    opacity: 0;
    pointer-events: none;
}

.section-pc {
    flex: 1.5;
    display: flex;
    justify-content: center;
    align-items: center;
}

.monitor {
    background: #ccc;
    padding: 15px;
    border-radius: 10px;
    border: 4px solid #999;
    width: 100%;
    height: 100%;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px #000;
}

.screen {
    flex: 1;
    background: #000080;
    border: 4px solid #888;
    border-radius: 5px;
    padding: 10px;
    overflow-y: auto;
    color: #fff;
    font-family: 'Courier Prime', monospace;
    margin-bottom: 10px;
}

.pc-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 5px;
    flex-shrink: 0;
}

.pc-buttons button {
    padding: 15px;
    background: #ddd;
    border: 2px solid #888;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 3px #888;
}

.pc-buttons button:active {
    transform: translateY(3px);
}

.btn-sleep {
    background: #ffcccc !important;
    color: #d32f2f;
}

.section-tools {
    width: 220px;
    display: flex;
    flex-direction: column;
}

.toolbox {
    background: #b71c1c;
    flex: 1;
    border: 4px solid #7f0000;
    padding: 10px;
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tool-head {
    text-align: center;
    font-weight: bold;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 5px;
    flex-shrink: 0;
}

#inventory-list {
    list-style: none;
    padding: 0;
    overflow-y: auto;
    flex: 1;
    font-size: 0.9rem;
    margin-top: 5px;
}

#inventory-list li {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 0;
}


/* --- GARÁŽ (VRAKY) - OPRAVENA VÝŠKA --- */

.garage-floor {
    height: 300px;
    /* Zvětšeno místo pro vraky */
    background: #222;
    border-top: 5px solid #ffcc00;
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding-bottom: 60px;
    /* Extra místo dole pro prsty */
}

.floor-head {
    color: #ffcc00;
    font-weight: bold;
    margin-bottom: 5px;
    font-family: 'Teko';
    letter-spacing: 1px;
}

.cars-list {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    height: 100%;
    align-items: flex-start;
}

.car-card {
    background: #444;
    border: 2px solid #666;
    min-width: 200px;
    height: 210px;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 5px 15px #000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
}

.car-visual {
    width: 100%;
    height: 60px;
    background: #333;
    border-radius: 5px;
    margin-bottom: 5px;
    position: relative;
    border: 1px solid #555;
    overflow: hidden;
}

.car-icon {
    position: absolute;
    bottom: 5px;
    left: 10%;
    width: 80%;
    height: 30px;
    background: #ccc;
    border-radius: 5px 5px 0 0;
    border: 1px solid #000;
}

.car-roof {
    position: absolute;
    bottom: 35px;
    left: 20%;
    width: 60%;
    height: 15px;
    background: #999;
    border-radius: 5px 5px 0 0;
    border: 1px solid #000;
}

.sedan .car-icon {
    background: #5d4037;
}

.hatch .car-icon {
    background: #1565c0;
    width: 70%;
    left: 15%;
}

.sport .car-icon {
    background: #c62828;
    height: 25px;
}

.sport .car-roof {
    height: 12px;
    bottom: 30px;
}

.car-info {
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
}


/* Velká tlačítka pro prodej */

.car-actions {
    display: flex;
    gap: 5px;
    width: 100%;
    margin-top: 5px;
}

.car-actions button {
    flex: 1;
    cursor: pointer;
    font-weight: bold;
    border: none;
    padding: 12px;
    font-size: 1rem;
    border-radius: 3px;
}


/* MODALY */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #ddd;
    border: 4px solid #fff;
    padding: 20px;
    width: 95%;
    max-width: 500px;
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}

.shop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.shop-item {
    background: #fff;
    border: 1px solid #999;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.btn-buy {
    background: #4CAF50;
    color: #fff;
    border: none;
    padding: 8px 15px;
    margin-top: 5px;
    font-weight: bold;
    cursor: pointer;
}

.btn-close {
    background: red;
    color: #fff;
    border: none;
    float: right;
    cursor: pointer;
    padding: 5px 10px;
    font-weight: bold;
}


/* MINIHRY UI */

.machine-box {
    background: #333;
    color: #fff;
    border: 4px solid #aaa;
}

.game-layer {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.btn-action.big {
    padding: 20px 50px;
    font-size: 1.5rem;
    cursor: pointer;
    margin-top: 10px;
    border: 3px solid #fff;
    background: #444;
    color: #fff;
    border-radius: 10px;
}

.btn-action.big:active {
    background: #666;
    transform: scale(0.95);
}

#bolt-head {
    font-size: 100px;
    cursor: pointer;
    transition: transform 0.1s;
    user-select: none;
}

.progress-container {
    width: 200px;
    height: 20px;
    background: #555;
    border: 1px solid #fff;
}

#bolt-prog {
    height: 100%;
    width: 0%;
    background: lime;
    transition: width 0.1s;
}

.oil-container {
    width: 60px;
    height: 150px;
    border: 2px solid #fff;
    background: #000;
    position: relative;
}

#oil-liquid {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: gold;
    height: 0%;
    transition: height 0.05s linear;
}

.oil-target {
    position: absolute;
    bottom: 65%;
    height: 15%;
    width: 100%;
    background: rgba(0, 255, 0, 0.5);
    border-top: 2px solid lime;
    border-bottom: 2px solid lime;
}

.wire-row {
    display: flex;
    gap: 10px;
    margin: 10px;
    height: 40px;
}

.dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #fff;
    cursor: pointer;
    opacity: 0.5;
}

.dot.active {
    opacity: 1;
    box-shadow: 0 0 10px currentColor;
}

.dot.red {
    background: red;
}

.dot.blue {
    background: blue;
}

.dot.green {
    background: green;
}

.gauge-box {
    width: 200px;
    height: 100px;
    background: #222;
    border-radius: 100px 100px 0 0;
    position: relative;
    border: 2px solid #fff;
    overflow: hidden;
}

.gauge-green-zone {
    position: absolute;
    bottom: 0;
    left: 60%;
    width: 20%;
    height: 100%;
    background: rgba(0, 255, 0, 0.4);
    transform-origin: bottom center;
}

#gauge-needle {
    width: 4px;
    height: 90px;
    background: red;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform-origin: bottom center;
    transform: rotate(-90deg);
    transition: transform 0.1s linear;
}


/* DRIVING */

.car-cockpit {
    width: 100%;
    height: 100%;
    background: #111;
    display: flex;
    flex-direction: column;
}

.windshield {
    flex: 2;
    background: #444;
    position: relative;
    overflow: hidden;
    perspective: 600px;
}

#road-scene {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #111 0%, #333 100%);
    perspective: 500px;
    overflow: hidden;
}

.horizon {
    position: absolute;
    top: 0;
    width: 100%;
    height: 30%;
    background: #000;
    z-index: 1;
}

.road-surface {
    position: absolute;
    top: 30%;
    left: 10%;
    width: 80%;
    height: 70%;
    background: #555;
    transform: rotateX(20deg);
    transform-origin: top center;
    border-left: 10px solid #fff;
    border-right: 10px solid #fff;
    z-index: 2;
}

.lane-line {
    position: absolute;
    top: 0;
    width: 4px;
    height: 100%;
    background: repeating-linear-gradient(to bottom, #fff 0, #fff 20px, transparent 20px, transparent 40px);
    opacity: 0.6;
}

.lane-line.left {
    left: 33%;
}

.lane-line.right {
    left: 66%;
}

#player-car {
    position: absolute;
    bottom: 20px;
    left: 50%;
    width: 80px;
    height: 50px;
    background: transparent;
    z-index: 10;
    transition: left 0.1s;
    transform: translateX(-50%);
}

.car-rear {
    width: 100%;
    height: 100%;
    background: #d32f2f;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 0 10px #000;
    border: 2px solid #000;
}

.obstacle {
    position: absolute;
    width: 60px;
    height: 40px;
    background: #333;
    border: 2px solid #fff;
    top: 150px;
    left: 50%;
    z-index: 5;
    transform: translateX(-50%);
}

.hud {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #0f0;
    padding: 10px;
    font-family: monospace;
    border: 1px solid #0f0;
    z-index: 20;
}

.dashboard {
    height: 120px;
    background: #222;
    display: flex;
    padding: 10px;
    gap: 20px;
    z-index: 30;
    border-top: 5px solid #444;
    flex-shrink: 0;
}

.steer-btn {
    flex: 1;
    font-size: 1.5rem;
    background: #333;
    color: #fff;
    border: 2px solid #555;
    cursor: pointer;
    border-radius: 10px;
}

.steer-btn:active {
    background: #444;
    border-color: #fff;
}


/* START */

.intro-panel {
    background: #d32f2f;
    padding: 40px;
    border: 10px solid #8e0000;
    text-align: center;
    width: 400px;
    box-shadow: 0 0 50px #000;
    color: #fff;
}

.intro-panel h1 {
    font-family: 'Teko';
    font-size: 4rem;
    margin: 0;
    text-shadow: 2px 2px 0 #000;
}

.btn-start {
    background: #fff;
    color: #000;
    font-size: 1.5rem;
    padding: 15px 40px;
    border: 4px solid #000;
    font-weight: bold;
    margin-top: 20px;
    cursor: pointer;
    font-family: 'Teko';
}