/* ============================================================
   Minecraft styl – Postavme si dům
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
    --mc-bg: #1a1a1a;
    --mc-panel: #2d2d2d;
    --mc-panel-light: #3a3a3a;
    --mc-border-dark: #111;
    --mc-border-light: #555;
    --mc-green: #5a8f2e;
    --mc-green-light: #6fb33a;
    --mc-red: #8f2e2e;
    --mc-red-light: #b33a3a;
    --mc-blue: #2e5a8f;
    --mc-blue-light: #3a6fb3;
    --mc-gold: #c9a227;
    --mc-text: #e0e0e0;
    --mc-text-dim: #aaa;
    --mc-font-pixel: 'Press Start 2P', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--mc-bg);
    color: var(--mc-text);
    font-family: Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
}

/* ---- Header ---- */
.mc-header {
    background: #111;
    border-bottom: 3px solid var(--mc-green);
    padding: 12px 16px;
}
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.game-title {
    font-family: var(--mc-font-pixel);
    font-size: 13px;
    color: var(--mc-green-light);
    text-shadow: 2px 2px #000;
}
.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-info {
    color: var(--mc-text-dim);
    font-size: 13px;
}

/* ---- Main ---- */
.mc-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* ---- Panely ---- */
.mc-panel {
    background: var(--mc-panel);
    border: 2px solid var(--mc-border-dark);
    box-shadow: inset -2px -2px 0 var(--mc-border-dark), inset 2px 2px 0 var(--mc-border-light);
    border-radius: 2px;
    padding: 16px;
    margin-bottom: 16px;
}
.mc-panel h2 {
    font-family: var(--mc-font-pixel);
    font-size: 10px;
    color: var(--mc-gold);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #444;
}
.mc-panel h3 {
    font-family: var(--mc-font-pixel);
    font-size: 8px;
    color: var(--mc-text-dim);
    margin-bottom: 10px;
}

/* ---- Tlačítka ---- */
.mc-btn {
    display: inline-block;
    padding: 8px 16px;
    font-family: var(--mc-font-pixel);
    font-size: 9px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    border-radius: 2px;
    text-align: center;
    transition: filter 0.1s;
    box-shadow: inset -2px -2px 0 rgba(0,0,0,0.4), inset 2px 2px 0 rgba(255,255,255,0.1);
}
.mc-btn:hover { filter: brightness(1.15); }
.mc-btn:active { box-shadow: inset 2px 2px 0 rgba(0,0,0,0.4); }

.mc-btn-green { background: var(--mc-green); color: #fff; }
.mc-btn-red { background: var(--mc-red); color: #fff; }
.mc-btn-blue { background: var(--mc-blue); color: #fff; }
.mc-btn-gold { background: var(--mc-gold); color: #111; }
.mc-btn-gray { background: #555; color: #fff; }

/* ---- Formuláře ---- */
.mc-form { max-width: 400px; margin: 0 auto; }
.mc-form label {
    display: block;
    font-size: 12px;
    color: var(--mc-text-dim);
    margin-bottom: 4px;
}
.mc-input {
    width: 100%;
    background: #111;
    border: 2px solid #444;
    color: var(--mc-text);
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 2px;
    margin-bottom: 14px;
    outline: none;
}
.mc-input:focus { border-color: var(--mc-green); }

/* ---- Zprávy ---- */
.messages { margin-bottom: 16px; }
.message {
    padding: 10px 14px;
    border-radius: 2px;
    margin-bottom: 8px;
    font-size: 13px;
}
.message-error { background: #5a1a1a; border-left: 4px solid var(--mc-red-light); }
.message-success { background: #1a3a1a; border-left: 4px solid var(--mc-green-light); }
.message-info { background: #1a2a3a; border-left: 4px solid var(--mc-blue-light); }

/* ---- Tabulky ---- */
.mc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mc-table th {
    background: #222;
    color: var(--mc-gold);
    font-size: 11px;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 2px solid #444;
}
.mc-table td { padding: 7px 10px; border-bottom: 1px solid #333; }
.mc-table tr:hover td { background: var(--mc-panel-light); }

/* ---- Progress bar ---- */
.mc-progress {
    background: #111;
    border: 1px solid #444;
    border-radius: 2px;
    height: 16px;
    overflow: hidden;
}
.mc-progress-bar {
    height: 100%;
    background: var(--mc-green);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-family: var(--mc-font-pixel);
    color: #fff;
}
.mc-progress-bar.full { background: var(--mc-gold); }

/* ---- Grid layout ---- */
.mc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mc-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 700px) {
    .mc-grid-2, .mc-grid-3 { grid-template-columns: 1fr; }
}

/* ---- Badge / chip ---- */
.mc-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: bold;
}
.mc-badge-green { background: var(--mc-green); color: #fff; }
.mc-badge-red { background: var(--mc-red); color: #fff; }
.mc-badge-gold { background: var(--mc-gold); color: #111; }
.mc-badge-gray { background: #555; color: #fff; }

/* ---- QR tisk ---- */
.print-only { display: none; }
@media print {
    body { background: #fff; color: #000; }
    .mc-header, .no-print { display: none !important; }
    .print-only { display: block !important; }
    .qr-card {
        break-inside: avoid;
        border: 2px solid #000 !important;
        background: #fff !important;
    }
}
.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.qr-card {
    background: #fff;
    color: #000;
    border: 2px solid #333;
    border-radius: 4px;
    padding: 12px;
    text-align: center;
}
.qr-card img { width: 120px; height: 120px; display: block; margin: 0 auto 8px; }
.qr-card .qr-name { font-weight: bold; font-size: 13px; }
.qr-card .qr-team { font-size: 11px; color: #666; }

/* ---- Login stránka ---- */
.login-wrap {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-box {
    width: 100%;
    max-width: 380px;
    padding: 32px 24px;
}
.login-logo {
    font-family: var(--mc-font-pixel);
    font-size: 11px;
    color: var(--mc-green-light);
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.8;
}
.login-sub {
    text-align: center;
    color: var(--mc-text-dim);
    font-size: 12px;
    margin-bottom: 24px;
}

/* ---- Skener ---- */
#qr-reader { border: 2px solid var(--mc-green) !important; border-radius: 4px; }
.scan-result {
    background: var(--mc-panel-light);
    border-left: 4px solid var(--mc-green);
    padding: 12px;
    margin-top: 12px;
    border-radius: 2px;
}

/* ---- Fáze 5: Časomíra v headeru ---- */
.timer-widget {
    display: flex;
    align-items: center;
    margin: 0 12px;
}
.timer-label {
    font-family: var(--mc-font-pixel);
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 3px;
    border: 2px solid;
    white-space: nowrap;
}
.timer-running {
    color: #5ddb5d;
    border-color: #3a8f3a;
    background: #1a3a1a;
    animation: timer-pulse 2s ease-in-out infinite;
}
.timer-paused {
    color: #f0c040;
    border-color: #8f6a00;
    background: #2a2000;
}
.timer-ended {
    color: var(--mc-gold);
    border-color: var(--mc-gold);
    background: #2a1a00;
}
.timer-idle {
    color: var(--mc-text-dim);
    border-color: #444;
    background: transparent;
}
@keyframes timer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ---- Fáze 5: Notifikační banner ---- */
.notif-banner {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.notif-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    gap: 12px;
}
.notif-game_over {
    background: #7a1c1c;
    color: #ffd700;
    border-bottom: 2px solid #c0392b;
}
.notif-house_slot_90 {
    background: #5a4000;
    color: #f0c040;
    border-bottom: 2px solid #8f6a00;
}
.notif-furnace_ready,
.notif-craft_ready {
    background: #1a3a1a;
    color: #5ddb5d;
    border-bottom: 2px solid #3a8f3a;
}
.notif-furnace_built,
.notif-craft_built {
    background: #1a2a3a;
    color: #7ab8f5;
    border-bottom: 2px solid #2e5a8f;
}
.notif-player_blocked {
    background: #3a1a1a;
    color: #f07070;
    border-bottom: 2px solid #8f2e2e;
}
.notif-msg { flex: 1; }
.notif-close {
    background: transparent;
    border: 1px solid currentColor;
    color: inherit;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 13px;
    opacity: 0.7;
    flex-shrink: 0;
}
.notif-close:hover { opacity: 1; }

/* ---- Fáze 5: Ovládání časomíry (dashboard správce) ---- */
.timer-control-panel {
    background: var(--mc-panel);
    border: 2px solid var(--mc-border-light);
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.timer-control-panel h3 {
    font-family: var(--mc-font-pixel);
    font-size: 10px;
    margin-bottom: 12px;
    color: var(--mc-text-dim);
}
.timer-big {
    font-family: var(--mc-font-pixel);
    font-size: 20px;
    color: #5ddb5d;
    margin-bottom: 14px;
    display: inline-block;
}
.timer-big.paused { color: #f0c040; }
.timer-big.idle { color: var(--mc-text-dim); }
.timer-big.ended { color: var(--mc-gold); }
.timer-control-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================================
   Fáze 8 – Responsive / Mobile polish
   ============================================================ */

/* ---- Větší touch cíle na mobilech ---- */
@media (max-width: 600px) {
    /* Tlačítka větší pro prsty */
    .mc-btn {
        padding: 12px 18px;
        font-size: 9px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    /* Formulářová pole */
    .mc-input { padding: 12px 14px; font-size: 16px; /* zabrání zoom na iOS */ }

    /* Main padding menší */
    .mc-main { padding: 12px 10px; }
    .mc-panel { padding: 12px 12px; margin-bottom: 12px; }

    /* Header – titulek menší, timer pod názvem */
    .game-title { font-size: 9px; }
    .user-info { font-size: 11px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .timer-label { font-size: 8px; padding: 3px 7px; }
    .timer-widget { margin: 0 4px; }

    /* Mřížky na 1 sloupec */
    .mc-grid-2, .mc-grid-3 { grid-template-columns: 1fr; }

    /* Notifikace */
    .notif-item { font-size: 12px; padding: 8px 10px; }
}

/* ---- Scrollovatelné tabulky na mobilu ---- */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 4px;
}
.table-scroll .mc-table { min-width: 500px; }

/* ---- Kartový inventář (náhrada za tabulku na mobilu) ---- */
.inv-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.inv-card {
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 4px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.inv-card-emoji { font-size: 24px; flex-shrink: 0; }
.inv-card-info { flex: 1; min-width: 120px; }
.inv-card-name { font-weight: bold; font-size: 14px; }
.inv-card-meta { font-size: 11px; color: #888; margin-top: 2px; }
.inv-card-action { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.inv-card-action input[type=number] {
    width: 60px;
    background: #111;
    border: 1px solid #444;
    color: #fff;
    padding: 6px 8px;
    border-radius: 2px;
    font-size: 14px;
}

/* ---- Hráč karta (náhrada za řádek tabulky) ---- */
.player-row-card {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.player-row-card.blocked { border-color: var(--mc-red); }
.player-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
}
.player-row-name { font-weight: bold; font-size: 15px; }
.player-row-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #aaa;
    margin-bottom: 8px;
}
.player-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #111;
    border: 1px solid #333;
    border-radius: 3px;
    padding: 4px 8px;
    min-width: 42px;
}
.player-stat-val { font-weight: bold; color: #e0e0e0; font-size: 14px; }
.player-stat-key { font-size: 9px; color: #666; }
.player-row-tools {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.tool-chip {
    font-size: 11px;
    padding: 2px 8px;
    background: #222;
    border: 1px solid #444;
    border-radius: 3px;
    color: #aaa;
}
.tool-chip.active { border-color: var(--mc-gold); color: var(--mc-gold); }

/* ---- Skenování surovin – větší stavové panely ---- */
.scan-step-label {
    font-size: 11px;
    color: #888;
    text-align: center;
    margin-bottom: 8px;
}
.big-resource, .big-player {
    font-size: 18px;
}
@media (max-width: 600px) {
    .big-resource, .big-player { font-size: 16px; padding: 12px; }
}

/* ---- Krok-indikátor ---- */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}
.step-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #333;
    border: 2px solid #555;
}
.step-dot.active { background: var(--mc-green); border-color: var(--mc-green-light); }
.step-dot.done   { background: #555; border-color: #777; }
