:root {
    --bg: #0b1b3a;
    --bg-light: #142a55;
    --accent: #f4b400;
    --accent-dark: #c98e00;
    --text: #f5f7ff;
    --card: #1e3a73;
    --card-used: #0c1730;
    --green: #2e8b57;
    --red: #b3392c;
    font-size: 18px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Tahoma, sans-serif;
    min-height: 100vh;
}

a { color: var(--accent); }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

h1, h2, h3 { font-weight: 700; }

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: #1a1a1a;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: var(--bg-light); color: var(--text); }
.btn.danger { background: var(--red); color: #fff; }
.btn.success { background: var(--green); color: #fff; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.card-box {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.list { display: flex; flex-direction: column; gap: 12px; }
.list-item {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-light); padding: 16px 20px; border-radius: 10px;
}

input, textarea, select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--card);
    background: #0e1f42;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
}

label { font-size: .9rem; opacity: .85; display: block; margin-bottom: 4px; }
.field { margin-bottom: 14px; }

.top-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px;
}

/* ---- Herní obrazovka: vyplní celou plochu projektoru/monitoru bez ohledu na rozlišení, nic nepřeteče ani se neoseká ---- */
html.game-screen, html.game-screen body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}
body.game-screen {
    display: flex;
}
.board-wrap {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    padding: 1.6vh 1.6vw;
    gap: 1.4vh;
    margin: 0;
    max-width: none;
}
.board-header {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 1vh 1vw;
    flex-shrink: 0;
}
.board-header h1 { font-size: clamp(1.1rem, 2.6vh, 2rem); margin: 0; }
.picker-banner {
    background: var(--accent); color: #1a1a1a; padding: .8vh 1.4vw;
    border-radius: 8px; font-weight: 700; font-size: clamp(.9rem, 2vh, 1.3rem);
}

.board {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto repeat(5, 1fr);
    gap: .8vh .8vw;
}
.topic-header {
    background: var(--card);
    padding: .8vh .4vw;
    text-align: center;
    font-weight: 700;
    border-radius: 8px;
    font-size: clamp(.75rem, 1.9vh, 1.3rem);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.q-card {
    background: var(--card);
    border-radius: 8px;
    width: 100%;
    height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: clamp(1.1rem, 4.2vh, 2.8rem); font-weight: 700;
    color: var(--accent);
    cursor: pointer;
    transition: transform .15s, background .2s;
    user-select: none;
}
.q-card:hover { transform: scale(1.04); }
.q-card.used {
    background: var(--card-used);
    color: #3a4a6b;
    cursor: default;
    pointer-events: none;
}

.scoreboard {
    display: flex; gap: .8vw; flex-wrap: wrap; justify-content: center;
    flex-shrink: 0;
}
.team-score {
    background: var(--bg-light); border-radius: 10px; padding: .8vh 1.2vw;
    min-width: 11vw; text-align: center; border: 3px solid transparent;
}
.team-score.is-picker { border-color: var(--accent); }
.team-score .name { font-weight: 700; font-size: clamp(.75rem, 1.7vh, 1.1rem); }
.team-score .points-row { display: flex; align-items: center; justify-content: center; gap: 6px; }
.team-score .points { font-size: clamp(1rem, 2.6vh, 1.6rem); color: var(--accent); }
.edit-score-btn {
    background: none; border: 1px solid var(--card); color: var(--text);
    border-radius: 6px; padding: 2px 6px; font-size: .85rem; cursor: pointer; opacity: .7;
}
.edit-score-btn:hover { opacity: 1; background: var(--card); }

/* ---- Modal s otázkou ---- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.75);
    display: flex; align-items: center; justify-content: center;
    z-index: 50;
}
.modal-card {
    background: var(--bg-light);
    border-radius: 16px;
    width: min(800px, 92vw);
    max-height: 92vh;
    overflow-y: auto;
    padding: clamp(16px, 3.5vh, 40px);
    text-align: center;
    transform: scale(.6) rotateY(90deg);
    opacity: 0;
    animation: flip-in .4s ease-out forwards;
}
@keyframes flip-in {
    to { transform: scale(1) rotateY(0); opacity: 1; }
}
.modal-value { font-size: clamp(1rem, 2.6vh, 1.4rem); color: var(--accent); margin-bottom: 14px; font-weight: 700; }
.modal-question { font-size: clamp(1.2rem, 3.4vh, 1.8rem); margin-bottom: 28px; line-height: 1.4; }
.modal-answer {
    font-size: clamp(1.1rem, 3vh, 1.6rem); color: var(--green); margin-bottom: 28px; font-weight: 700;
    border-top: 1px solid var(--card); padding-top: 20px;
}
.award-row {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px;
}
.award-team {
    background: var(--card); border-radius: 10px; padding: 10px 14px;
    display: flex; align-items: center; gap: 10px;
}
.award-team .name { font-weight: 700; min-width: 90px; }

/* ---- Konec hry ---- */
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-row {
    display: flex; align-items: center; gap: 16px;
    background: var(--card); border-radius: 10px; padding: 14px 20px;
    font-size: 1.3rem;
}
.rank-row.rank-first {
    background: var(--accent); color: #1a1a1a;
}
.rank-pos { font-weight: 700; width: 32px; }
.rank-name { flex: 1; text-align: left; font-weight: 700; }
.rank-points { font-weight: 700; }
