/* Player (phone) screens – mobile first, big tap targets. */

.player {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    transition: background-color 0.4s;
}

.player[data-result="correct"] {
    background: radial-gradient(800px 500px at 50% 0%, rgba(48, 164, 108, 0.55), transparent 70%), #0e1022;
}

.player[data-result="wrong"],
.player[data-result="none"] {
    background: radial-gradient(800px 500px at 50% 0%, rgba(229, 72, 77, 0.5), transparent 70%), #0e1022;
}

.player-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, 34rem);
    margin: 0 auto;
    padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem 1.25rem;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    animation: screen-in 0.35s var(--ease);
}

.screen-center {
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
}

@keyframes screen-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

.player-logo {
    width: 6rem;
    height: 6rem;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.entry-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    width: 100%;
    padding: 1.5rem;
}

.entry-input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    background: #fff;
    color: #14162b;
    font-size: 1.3rem;
    font-weight: 800;
    text-align: center;
}

.entry-input:focus {
    border-color: var(--brand);
    outline: none;
}

.btn-block {
    width: 100%;
    font-size: 1.2rem;
    padding: 0.85em;
}

.turnstile-box {
    display: flex;
    justify-content: center;
    min-height: 0;
}

.turnstile-box:empty {
    display: none;
}

.form-error {
    min-height: 1.2em;
    margin: 0;
    color: #ff9b9e;
    font-weight: 700;
}

.form-error:empty {
    display: none;
}

.big-emoji {
    margin: 0;
    font-size: 4rem;
    line-height: 1;
    animation: pop 0.6s var(--ease);
}

@keyframes pop {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    70% {
        transform: scale(1.1);
    }
}

.player-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 8vw, 2.6rem);
    font-weight: 900;
}

.player-text {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.8;
}

.player-question {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 6.5vw, 2.2rem);
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

/* ---------- Answering ---------- */

.question-layout {
    gap: 1rem;
}

.question-top {
    display: flex;
    justify-content: space-between;
}

.timer-pill {
    min-width: 4.5rem;
    justify-content: center;
}

.question-small {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    overflow-wrap: anywhere;
}

.player-answers {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 1fr;
    gap: 0.75rem;
}

.player-answers .answer-tile {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    min-height: 7rem;
    font-size: 1.1rem;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.player-answers .answer-tile:active {
    transform: translateY(4px) scale(0.98);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--tile) 70%, #000);
}

.player-answers .answer-letter {
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
}

@media (max-height: 560px) {
    .player-answers .answer-tile {
        min-height: 4.5rem;
    }
}

/* ---------- Waiting & results ---------- */

.waiting-choice {
    min-height: 0;
    padding: 1rem;
    animation: pop 0.5s var(--ease);
}

.waiting-choice .answer-letter {
    width: 4rem;
    height: 4rem;
    font-size: 2rem;
}

.result-icon {
    display: grid;
    place-items: center;
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    font-size: 3.2rem;
    font-weight: 900;
    animation: pop 0.6s var(--ease);
}

[data-result="correct"] .result-icon {
    background: var(--ok);
}

[data-result="wrong"] .result-icon,
[data-result="none"] .result-icon {
    background: var(--bad);
}

.result-points {
    margin: 0;
    padding: 0.5rem 1.2rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.3);
    font-size: 1.3rem;
    font-weight: 800;
}

.result-streak {
    margin: 0;
    font-weight: 700;
}

.result-streak:empty {
    display: none;
}

.result-rank {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    opacity: 0.9;
}

/* ---------- Bottom bar ---------- */

.player-bar {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.25rem max(0.8rem, env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-weight: 800;
}

.bar-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
