/* ====================================================================
   Losování — Forum Nová Karolina
   Paleta vychází z brandu FNK: pískové odstíny, olivový akcent, inkoust.
   ==================================================================== */

:root {
    --ink: #1d1d1b;
    --ink-2: #2b2b28;
    --grey: #757167;
    --sand: #d1cdc3;
    --sand-2: #c9c5ba;
    --sand-3: #e8e5df;
    --accent: #ff2684;
    --accent-2: #e01f74;
    --white: #fff;

    --radius: 4px;
    --radius-lg: 10px;
    --font: 'Montserrat', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

html, body {
    height: 100%;
    font-family: var(--font);
    color: var(--ink);
    background: var(--sand-3);
    -webkit-font-smoothing: antialiased;
}

kbd {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius);
    background: rgba(29, 29, 27, .08);
    border: 1px solid rgba(29, 29, 27, .12);
    font: inherit;
    font-size: .9em;
    font-weight: 600;
}

.screen[hidden] { display: none; }

/* ====================================================================
   KROK 1 — seznam
   ==================================================================== */

.screen--setup {
    min-height: 100%;
    display: flex;
    justify-content: center;
    padding: clamp(24px, 5vh, 64px) 24px;
    background:
        radial-gradient(120% 90% at 50% 0%, #f4f2ee 0%, var(--sand-3) 45%, var(--sand) 100%);
}

.setup {
    width: 100%;
    max-width: 720px;
}

.setup__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.setup__logo {
    width: min(260px, 60vw);
    height: auto;
    display: block;
}

.setup__title {
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 800;
    letter-spacing: -.02em;
    text-transform: uppercase;
}

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: clamp(20px, 4vw, 36px);
    box-shadow: 0 20px 60px rgba(29, 29, 27, .10);
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 0;
}

.field__label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--grey);
}

.field__label em { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; }

.field__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.field__hint {
    font-size: 14px;
    color: var(--grey);
}

.link-btn {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.link-btn:hover { color: var(--accent-2); }
.link-btn:disabled { color: var(--sand-2); cursor: not-allowed; text-decoration: none; }

.field__hint strong { color: var(--ink); }

.input, .textarea {
    width: 100%;
    font-family: var(--font);
    font-size: 16px;
    color: var(--ink);
    background: #fbfaf8;
    border: 1.5px solid var(--sand);
    border-radius: var(--radius);
    padding: 14px 16px;
    transition: border-color .15s, background .15s;
}

.textarea {
    line-height: 1.65;
    resize: vertical;
    min-height: 200px;
}

.input:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--white);
}

.field--options { gap: 12px; }

.radio {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border: 1.5px solid var(--sand);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.radio:hover { border-color: var(--sand-2); background: #fbfaf8; }

.radio input { position: absolute; opacity: 0; pointer-events: none; }

.radio__box {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border: 2px solid var(--sand-2);
    border-radius: 50%;
    transition: border-color .15s, box-shadow .15s;
}

.radio input:checked ~ .radio__box {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 4px var(--accent);
}

.radio:has(input:checked) { border-color: var(--accent); background: rgba(255, 38, 132, .06); }

.radio input:focus-visible ~ .radio__box { outline: 2px solid var(--accent); outline-offset: 3px; }

.radio__text { display: flex; flex-direction: column; gap: 3px; }
.radio__text strong { font-size: 15px; font-weight: 600; }
.radio__text em { font-style: normal; font-size: 14px; color: var(--grey); }

.setup__actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn {
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 15px 28px;
    border: 1.5px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .1s;
}

.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--ink); color: var(--white); }
.btn--primary:hover:not(:disabled) { background: var(--accent); }
.btn--primary:disabled { background: var(--sand); color: #948f85; cursor: not-allowed; }

.btn--ghost { background: transparent; color: var(--grey); border-color: var(--sand); }
.btn--ghost:hover { color: var(--ink); border-color: var(--ink); }

.setup__note {
    margin-top: 22px;
    text-align: center;
    font-size: 14px;
    color: var(--grey);
}

/* ====================================================================
   KROK 2 — losování
   ==================================================================== */

.screen--draw {
    position: fixed;
    inset: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: var(--white);
}

/* Fotka Fora — nahraď assets/background.jpg vlastním snímkem.
   Když soubor chybí, zůstane fallback gradient pod ním. */
.stage__bg {
    position: absolute;
    inset: 0;
    background-color: var(--ink);
    background-image: url('./background.jpg'), linear-gradient(135deg, #33322d 0%, var(--ink) 55%, #14140f 100%);
    background-size: cover;
    background-position: center;
    transform: scale(1.04);
    filter: saturate(.85);
}

.stage__veil {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(70% 60% at 50% 48%, rgba(0, 0, 0, .30) 0%, rgba(0, 0, 0, .70) 100%),
        linear-gradient(to bottom, rgba(29, 29, 27, .75) 0%, rgba(29, 29, 27, .45) 30%, rgba(29, 29, 27, .45) 65%, rgba(29, 29, 27, .85) 100%);
}

.stage__confetti {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.stage__top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(20px, 3vh, 40px) clamp(24px, 4vw, 56px) 0;
}

.stage__logo {
    width: clamp(160px, 16vw, 280px);
    height: auto;
    display: block;
}

.stage__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    text-align: right;
}

.stage__drawtitle {
    font-size: clamp(15px, 1.6vw, 22px);
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.stage__drawtitle:empty { display: none; }

.stage__pool {
    font-size: clamp(13px, 1.2vw, 16px);
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .62);
}

.stage__pool strong { color: var(--accent); font-weight: 700; }

.stage__main {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(18px, 3vh, 34px);
    padding: 3vh clamp(24px, 4vw, 56px);
    min-height: 0;
}

.display {
    position: relative;
    width: min(1180px, 88vw);
    min-height: clamp(180px, 30vh, 320px);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 5vh, 56px) clamp(28px, 4vw, 64px);
    cursor: pointer;
    user-select: none;
    transition: box-shadow .3s;
}

.display:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; }

.display.is-spinning { box-shadow: 0 30px 90px rgba(0, 0, 0, .55); }

.display.is-winner {
    box-shadow: 0 30px 90px rgba(0, 0, 0, .45), 0 0 0 6px var(--accent);
    animation: punch .65s cubic-bezier(.2, .9, .2, 1);
}

@keyframes punch {
    0%   { transform: scale(.94); }
    55%  { transform: scale(1.035); }
    100% { transform: scale(1); }
}

.display__badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent);
    color: var(--white);
    font-size: clamp(14px, 1.5vw, 19px);
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 9px 22px;
    border-radius: 999px;
    white-space: nowrap;
}

.display__badge[hidden] { display: none; }

.display__inner {
    width: 100%;
    min-width: 0;
    text-align: center;
}

.display__name {
    display: block;
    color: var(--ink);
    font-weight: 900;
    letter-spacing: -.015em;
    line-height: 1.06;
    font-size: 96px;
    white-space: nowrap;
    will-change: filter, transform;
}

.display__name.is-blurred { filter: blur(2.2px); }
.display__name.is-empty { color: var(--grey); font-weight: 700; }

.draw-btn {
    font-family: var(--font);
    font-size: clamp(16px, 1.7vw, 22px);
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--white);
    background: var(--accent);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: clamp(14px, 1.8vh, 20px) clamp(34px, 4vw, 60px);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .1s;
}

.draw-btn:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
.draw-btn:active:not(:disabled) { transform: translateY(1px); }
.draw-btn:focus-visible { outline: 3px solid var(--white); outline-offset: 4px; }

/* Během točení je z tlačítka „Zastavit“ — jiná barva, ať se nedá splést. */
.draw-btn.is-stop {
    background: transparent;
    border-color: var(--white);
    color: var(--white);
}

.draw-btn.is-stop:hover { background: rgba(255, 255, 255, .16); border-color: var(--white); }

.draw-btn:disabled {
    background: transparent;
    border-color: rgba(255, 255, 255, .25);
    color: rgba(255, 255, 255, .45);
    cursor: not-allowed;
}

/* --- lišta vylosovaných --- */

.stage__winners {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px clamp(24px, 4vw, 56px) clamp(18px, 3vh, 30px);
    min-height: 0;
}

.stage__winners[hidden] { display: none; }

.winners__label {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .45);
}

.winners__list {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.winners__list::-webkit-scrollbar { display: none; }

.winner {
    flex: 0 0 auto;
    display: flex;
    align-items: baseline;
    gap: 9px;
    padding: 6px 20px 6px 0;
    margin-right: 20px;
    border-right: 1px solid rgba(255, 255, 255, .22);
    white-space: nowrap;
    animation: winner-in .45s cubic-bezier(.2, .9, .2, 1);
}

.winner:last-child { border-right: 0; margin-right: 0; }

.winner__cup {
    font-size: clamp(14px, 1.4vw, 19px);
    line-height: 1;
}

.winner__rank {
    font-size: clamp(13px, 1.2vw, 16px);
    font-weight: 800;
    color: var(--accent);
}

.winner__name {
    font-size: clamp(15px, 1.5vw, 20px);
    font-weight: 600;
    color: var(--white);
    max-width: 26vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes winner-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* --- ovládací tlačítka (nenápadná, mizí při losování) --- */

.stage__controls {
    position: absolute;
    right: clamp(16px, 2vw, 28px);
    bottom: clamp(16px, 2vh, 24px);
    z-index: 6;
    display: flex;
    gap: 8px;
    opacity: .45;
    transition: opacity .25s;
}

.stage__controls:hover { opacity: 1; }
.screen--draw.is-busy .stage__controls { opacity: 0; pointer-events: none; }

.ctrl {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: var(--white);
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: var(--radius);
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background .15s;
}

.ctrl:hover { background: rgba(255, 255, 255, .22); }

.ctrl svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- menší obrazovky --- */

@media (max-width: 900px) {
    .stage__top { flex-direction: column; align-items: flex-start; gap: 10px; }
    .stage__meta { align-items: flex-start; text-align: left; }
    .winner__name { max-width: 40vw; }
}
