/* Paleta neón estilo Hitster */
:root {
    --bg: #0b0b14;
    --card: #111122;
    --accent-pink: #ff00c8;
    --accent-blue: #00d9ff;
    --accent-red: #ec2f2f;
    --accent-orange: #eb5c28;
    --text: #f7f7ff;
    --muted: #9aa0b5;
    --border: #1f1f33;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background:
        linear-gradient(rgba(0, 217, 255, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 217, 255, 0.022) 1px, transparent 1px),
        radial-gradient(circle at 20% 20%, rgba(255, 0, 200, 0.12), transparent 25%),
        radial-gradient(circle at 80% 10%, rgba(0, 217, 255, 0.12), transparent 20%),
        radial-gradient(circle at 50% 80%, rgba(255, 0, 200, 0.08), transparent 30%),
        var(--bg);
    background-size: 44px 44px, 44px 44px, auto, auto, auto, auto;
    animation: bg-grid-drift 28s linear infinite;
    color: var(--text);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

@keyframes bg-grid-drift {
    from {
        background-position: 0 0, 0 0, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    }

    to {
        background-position: 44px 44px, 44px 44px, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    }
}

a {
    color: var(--accent-blue);
    text-decoration: none;
}

/* PANTALLAS */
.screen {
    display: none;
    flex: 1;
    overflow: auto;
}

.screen.active {
    display: flex;
}

#lobbyScreen {
    position: relative;
    min-height: 100dvh;
    overflow-x: clip;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* PANTALLA DE SETUP */
#setupScreen {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.setup-hero {
    text-align: center;
    margin-bottom: 40px;
}

.setup-hero h1 {
    margin: 0 0 10px 0;
    font-size: 48px;
    background: linear-gradient(120deg, var(--accent-pink), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.setup-hero p {
    margin: 0;
    color: var(--muted);
    font-size: 18px;
}

.setup-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0f0f1d;
    color: var(--text);
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.footer-info {
    text-align: center;
    margin-top: 20px;
    color: var(--muted);
    font-size: 12px;
}

/* PANTALLA DE JUEGO */
#gameScreen {
    flex-direction: column;
}

.game-shell {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 16px;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .game-shell {
        grid-template-columns: 1fr;
    }
}

.game-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 40px;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.game-header h1 {
    margin: 0;
    font-size: 24px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* SECCIONES DEL JUEGO */
.game-content {
    max-width: 100%;
    margin: 0;
    width: 100%;
    padding: 0 20px;
}

.player-turn {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.player-turn select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0f0f1d;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.card-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

#lobbyScreen .card-section {
    animation: lobby-card-shadow-orbit 3.4s linear infinite;
}

@keyframes lobby-card-shadow-orbit {
    0% {
        box-shadow: 0px 2px 3px var(--accent-pink), 0px -2px 3px var(--accent-blue);
    }

    25% {
        box-shadow: 2px 0px 3px var(--accent-pink), -2px 0px 3px var(--accent-blue);
    }

    50% {
        box-shadow: 0px -2px 3px var(--accent-pink), 0px 2px 3px var(--accent-blue);
    }

    75% {
        box-shadow: -2px 0px 3px var(--accent-pink), 2px 0px 3px var(--accent-blue);
    }

    100% {
        box-shadow: 0px 2px 3px var(--accent-pink), 0px -2px 3px var(--accent-blue);
    }
}

.card-face {
    background: linear-gradient(135deg, rgba(255, 0, 200, 0.15), rgba(0, 217, 255, 0.12));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

.card-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px 0;
}

.card-meta {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

.card-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.audio-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.audio-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.card-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    align-items: center;
}

.flip-card {
    background: transparent;
    width: 55%;
    aspect-ratio: 3 / 4;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card-inner.card-active {
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.6), 0 10px 40px rgba(255, 0, 200, 0.3);
}

/* Efecto sheen (brillo que pasa sobre la carta) */
@keyframes sheen {
    0% {
        transform: translateX(-50%);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateX(50%);
        opacity: 0;
    }
}

.flip-card-inner.sheen-effect::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.1) 40%,
            rgba(255, 255, 255, 0.5) 50%,
            rgba(255, 255, 255, 0.1) 60%,
            transparent 100%);
    transform: translateX(-100%);
    animation: sheen 0.8s ease-out;
    pointer-events: none;
    z-index: 10;
    border-radius: 12px;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px;
    -webkit-backface-visibility: hidden;
}

.flip-card-front {
    background: linear-gradient(135deg, rgba(255, 0, 200, 0.2), rgba(0, 217, 255, 0.15));
    border: 2px solid var(--border);
    color: var(--text);
}

.flip-card-back {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid var(--accent-blue);
    transform: rotateY(180deg);
    color: var(--text);
    padding: 30px 24px;
    gap: 12px;
}

.flip-label {
    font-weight: 700;
    font-size: 14px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.flip-placeholder {
    font-size: 30px;
    opacity: 0.7;
    line-height: 1;
}

.reveal-hint {
    color: var(--accent-blue);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.answer-row {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 217, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.answer-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.answer-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-pink);
    line-height: 1.3;
    word-break: break-word;
}

.answer-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-blue);
    transition: filter 0.2s ease;
}

.host-card-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 4px;
}

.host-flip-card {
    width: min(260px, 92%);
    aspect-ratio: 4 / 5;
    margin: 4px auto;
}

.host-card-front,
.host-card-back {
    justify-content: center;
    text-align: center;
}

.host-card-front-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 16px;
}

.host-card-front-icons {
    font-size: 36px;
    letter-spacing: 8px;
    opacity: 0.95;
}

.host-card-back {
    gap: 14px;
    justify-content: center;
}

.host-card-value {
    width: 100%;
    background: rgba(0, 217, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
    word-break: break-word;
}

.hidden-text {
    filter: blur(6px);
}

.hidden-text.revealed {
    filter: blur(0);
}

.btn-secondary.full {
    width: 100%;
    text-align: center;
}

.card-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.audio-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.audio-buttons {
    display: flex;
    gap: 8px;
}

.audio-progress {
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: #1e1e30;
    overflow: hidden;
}

.audio-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(120deg, var(--accent-blue), var(--accent-pink));
    transition: width 0.1s linear;
}

/* LÍNEA DE TIEMPO */
.timeline-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.timeline-section h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
    color: var(--accent-blue);
}

.timeline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px;
    background: #251b3c;
    border-radius: 8px;
    min-height: 50px;
}

.timeline-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(255, 0, 200, 0.2), rgba(0, 217, 255, 0.2));
    border: 2px solid var(--accent-pink);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.timeline-card-preview {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.18), rgba(0, 217, 255, 0.08));
    border: 2px dashed var(--accent-blue);
    color: var(--accent-blue);
}

.timeline-card-preview-turn {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.timeline-card-preview-bet {
    background: linear-gradient(135deg, rgba(255, 0, 200, 0.2), rgba(255, 0, 200, 0.08));
    border: 2px dashed var(--accent-pink);
    color: var(--accent-pink);
}

.timeline-preview-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timeline-empty {
    color: var(--muted);
    font-size: 12px;
}

/* CHECKS */
.checks-section {
    background: var(--card);
    border: 2px solid var(--accent-blue);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.checks-section h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: var(--accent-blue);
    font-size: 16px;
}

.checkbox-group {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(0, 217, 255, 0.05);
    border-radius: 8px;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.checkbox-line input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-pink);
}

.checkbox-line label {
    cursor: pointer;
    font-size: 14px;
    margin: 0;
}

.checks-buttons {
    display: flex;
    gap: 10px;
}

/* SIDEBAR PUNTAJES */
.score-sidebar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    position: sticky;
    top: 12px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow: auto;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.score-header {
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--accent-blue);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th,
.table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    color: var(--accent-blue);
    font-weight: 700;
}

.host-score-table th,
.host-score-table td {
    vertical-align: middle;
}

.host-score-table td:nth-child(2),
.host-score-table td:nth-child(3),
.host-score-table td:nth-child(4) {
    text-align: center;
}

.score-offline-tag {
    font-size: 11px;
    color: var(--muted);
    margin-left: 6px;
}

.score-resource-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.score-resource-value {
    font-weight: 700;
    white-space: nowrap;
}

.score-resource-buttons {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.score-adjust-btn {
    width: 30px;
    min-width: 30px;
    padding: 4px 0;
    line-height: 1;
}

.score-actions-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.score-remove-btn {
    width: 30px;
    min-width: 30px;
    padding: 4px 0;
    line-height: 1;
    font-weight: 800;
}

.score-skip-btn {
    width: 30px;
    min-width: 30px;
    padding: 4px 0;
    line-height: 1;
    font-weight: 800;
}

/* Apuestas */
.betting-panel {
    border: 1px dashed white;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
    background: rgba(0, 217, 255, 0.04);
}

.betting-header {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 8px;
}

.betting-header h4 {
    margin: 0;
    font-size: 16px;
}

.betting-hint {
    color: var(--muted);
    font-size: 12px;
}

.betting-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    align-items: end;
    margin-bottom: 10px;
}

.betting-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.betting-form select,
.betting-form input[type='number'] {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0f0f1d;
    color: var(--text);
    font-size: 14px;
}

.bets-list {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: #0f0f1d;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 46px;
}

.bets-list.empty {
    color: var(--muted);
    font-size: 13px;
}

.bet-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 0, 200, 0.07);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
}

.bet-row strong {
    color: var(--accent-blue);
}

.bet-row .type {
    color: var(--muted);
    font-size: 12px;
}

.bet-row button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
}

.bet-row button:hover {
    border-color: var(--accent-pink);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    width: min(480px, 90%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.modal h3 {
    margin: 0 0 8px 0;
}

.modal-hint {
    margin: 0 0 16px 0;
    color: var(--muted);
    font-size: 13px;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.modal-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.modal-grid select {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0f0f1d;
    color: var(--text);
    font-size: 14px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.table tbody tr:hover {
    background: rgba(0, 217, 255, 0.05);
}

/* BOTONES */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(120deg, var(--accent-pink), var(--accent-blue));
    color: #ffffff;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: 1px 1px 1px #78cae3;
    /* box-shadow: 1px 1px 1px var(--accent-blue); */
}

.btn-danger {
    background: linear-gradient(120deg, var(--accent-red), var(--accent-orange));
    color: #ffffff;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover {
    transform: translateY(-1px) scale(1.01);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary.small,
.btn-secondary.small,
.btn-danger.small {
    padding: 6px 10px;
    font-size: 12px;
}

.mode-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 5px;
    background: rgba(0, 217, 255, 0.12);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    font-weight: 700;
    font-size: 12px;
}


.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.panel h2 {
    margin-top: 0;
    font-size: 18px;
    color: var(--accent-blue);
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 14px;
}

input,
select,
button {
    font: inherit;
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0f0f1d;
    color: var(--text);
}

button {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: linear-gradient(120deg, var(--accent-pink), var(--accent-blue));
    color: #0b0b14;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

button:hover:not(:disabled) {
    transform: translateY(-1px) scale(1.01);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

.inline {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.small-btn {
    padding: 8px 12px;
    font-size: 13px;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.table th,
.table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    background: #1b1b2d;
    border: 1px solid var(--border);
}

.card-face {
    background: linear-gradient(135deg, rgba(255, 0, 200, 0.15), rgba(0, 217, 255, 0.12));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    min-height: 140px;
    display: grid;
    gap: 6px;
    position: relative;
}

.card-face .title {
    font-size: 20px;
    font-weight: 700;
}

.card-face .meta {
    color: var(--muted);
    font-size: 14px;
}

.reveal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.hidden-text {
    filter: blur(6px);
    transition: filter 0.2s ease;
}

.hidden-text.revealed {
    filter: blur(0);
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.checkbox-line input {
    width: 18px;
    height: 18px;
}

.audio-progress {
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: #1e1e30;
    overflow: hidden;
    margin-top: 6px;
}

.audio-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(120deg, var(--accent-blue), var(--accent-pink));
    transition: width 0.1s linear;
}

.footer-note {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

/* Modal de Victoria */
@keyframes pulse-victory {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

.victory-modal {
    max-width: 600px;
    animation: pulse-victory 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: linear-gradient(135deg, rgba(255, 0, 200, 0.15), rgba(0, 217, 255, 0.15));
    border: 2px solid var(--accent-pink);
    box-shadow: 0 0 60px rgba(255, 0, 200, 0.4), 0 0 100px rgba(0, 217, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.victory-modal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 0, 200, 0.1), transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(0, 217, 255, 0.1), transparent 50%);
    pointer-events: none;
}

.victory-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px 30px;
}

.victory-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}

.victory-modal h2 {
    margin: 20px 0 10px 0;
    font-size: 48px;
    background: linear-gradient(120deg, var(--accent-pink), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: 2px;
}

.victory-message {
    font-size: 18px;
    color: var(--text);
    margin: 15px 0;
    font-weight: 600;
}

.victory-message strong {
    color: var(--accent-pink);
}

.victory-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin: 8px 0 20px 0;
    font-style: italic;
}

.victory-player {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(120deg, var(--accent-blue), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 20px;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background-color: rgba(0, 217, 255, 0.08);
}

.victory-modal .modal-actions {
    justify-content: center;
    padding: 20px 30px 40px 30px;
    position: relative;
    z-index: 1;
}

.victory-modal .btn-primary {
    padding: 15px 40px;
    font-size: 16px;
}

@keyframes postgame-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.postgame-overlay {
    position: fixed;
    inset: 0;
    z-index: 1450;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 18% 22%, rgba(0, 217, 255, 0.15), transparent 42%),
        radial-gradient(circle at 78% 72%, rgba(255, 0, 200, 0.16), transparent 45%),
        rgba(5, 6, 14, 0.92);
}

.postgame-overlay[hidden] {
    display: none !important;
}

.postgame-overlay.postgame-overlay-final {
    background:
        radial-gradient(circle at 20% 24%, rgba(255, 189, 89, 0.2), transparent 42%),
        radial-gradient(circle at 80% 70%, rgba(0, 217, 255, 0.18), transparent 45%),
        rgba(5, 6, 14, 0.95);
}

.postgame-stage {
    width: min(860px, 96vw);
    border-radius: 18px;
    border: 2px solid var(--accent-blue);
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.2), rgba(255, 0, 200, 0.18));
    box-shadow: 0 0 42px rgba(0, 217, 255, 0.45), 0 0 68px rgba(255, 0, 200, 0.28);
    padding: 40px 28px;
    text-align: center;
    animation: postgame-fade-in 0.36s ease;
}

.postgame-overlay.postgame-overlay-final .postgame-stage {
    width: min(980px, 97vw);
    min-height: min(72vh, 680px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-color: #ffbd59;
    background: linear-gradient(135deg, rgba(255, 189, 89, 0.24), rgba(0, 217, 255, 0.16));
    box-shadow: 0 0 48px rgba(255, 189, 89, 0.34), 0 0 76px rgba(0, 217, 255, 0.26);
}

.postgame-kicker {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 12px;
}

.postgame-title {
    margin: 0;
    font-size: clamp(34px, 6vw, 62px);
    font-weight: 800;
    line-height: 1.06;
    background: linear-gradient(120deg, var(--accent-blue), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.postgame-player {
    margin-top: 20px;
    font-size: clamp(26px, 5vw, 46px);
    font-weight: 800;
    color: var(--text);
}

.postgame-value {
    margin-top: 10px;
    font-size: clamp(18px, 3.2vw, 28px);
    color: var(--accent-blue);
    font-weight: 700;
}

.postgame-progress {
    margin-top: 26px;
    font-size: 13px;
    color: var(--muted);
}

.postgame-overlay.postgame-overlay-final .postgame-title {
    font-size: clamp(44px, 7vw, 88px);
    background: linear-gradient(120deg, #ffbd59, var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.postgame-overlay.postgame-overlay-final .postgame-player {
    font-size: clamp(28px, 4.8vw, 52px);
}

.postgame-overlay.postgame-overlay-final .postgame-value {
    font-size: clamp(20px, 3vw, 32px);
    color: #ffde9f;
}

.turn-change-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 6, 14, 0.72);
    z-index: 1100;
    padding: 20px;
}

.turn-change-overlay[hidden] {
    display: none !important;
}

.turn-change-modal {
    width: min(760px, 96vw);
    border-radius: 16px;
    border: 2px solid var(--accent-blue);
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.2), rgba(255, 0, 200, 0.16));
    box-shadow: 0 0 42px rgba(0, 217, 255, 0.45), 0 0 68px rgba(255, 0, 200, 0.3);
    padding: 34px 30px;
    text-align: center;
    animation: pulse-victory 0.3s ease;
}

.turn-change-label {
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.turn-change-text {
    font-size: clamp(32px, 5vw, 54px);
    font-weight: 800;
    line-height: 1.12;
    background: linear-gradient(120deg, var(--accent-blue), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.betting-alert-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1150;
    pointer-events: none;
    padding: min(30vh, 240px) 20px 20px 20px;
    background: rgba(5, 6, 14, 0.3);
}

.betting-alert-overlay[hidden] {
    display: none !important;
}

.betting-alert-modal {
    width: min(760px, 96vw);
    border-radius: 16px;
    border: 2px solid var(--accent-blue);
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.36), rgba(255, 0, 200, 0.3));
    box-shadow: 0 0 42px rgba(0, 217, 255, 0.45), 0 0 68px rgba(255, 0, 200, 0.3);
    padding: 30px 26px;
    text-align: center;
    animation: betting-alert-zoom 0.28s ease-out;
    will-change: transform, opacity;
}

.betting-alert-label {
    font-size: 16px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.betting-alert-text {
    font-size: clamp(34px, 5vw, 54px);
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(120deg, var(--accent-blue), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.spotify-connect-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 6, 14, 0.82);
    z-index: 1300;
    padding: 20px;
}

.spotify-connect-overlay[hidden] {
    display: none !important;
}

.spotify-connect-modal {
    width: min(620px, 95vw);
    border-radius: 16px;
    border: 2px solid var(--accent-blue);
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.22), rgba(255, 0, 200, 0.18));
    box-shadow: 0 0 42px rgba(0, 217, 255, 0.45), 0 0 68px rgba(255, 0, 200, 0.28);
    padding: 28px 24px;
    text-align: center;
    animation: betting-alert-zoom 0.28s ease-out;
}

.spotify-connect-label {
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.spotify-connect-title {
    font-size: clamp(30px, 5vw, 46px);
    font-weight: 800;
    line-height: 1.08;
    background: linear-gradient(120deg, var(--accent-blue), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.spotify-connect-desc {
    margin: 10px 0 18px 0;
    color: var(--text);
    opacity: 0.92;
    font-size: 15px;
}

.spotify-connect-progress {
    margin: 12px 0 0 0;
    color: var(--accent-blue);
    font-weight: 700;
    font-size: 14px;
}

.loading-dots {
    display: inline-flex;
    min-width: 18px;
}

.loading-dots span {
    animation: loading-dot-blink 1.1s infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes loading-dot-blink {

    0%,
    20% {
        opacity: 0.15;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.2;
    }
}

@keyframes betting-alert-zoom {
    0% {
        transform: scale(0.76);
        opacity: 0;
    }

    70% {
        transform: scale(1.04);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes turn-beat {
    0% {
        transform: scale(1);
        text-shadow: 0 0 0 rgba(0, 217, 255, 0.2);
    }

    35% {
        transform: scale(1.04);
        text-shadow: 0 0 16px rgba(0, 217, 255, 0.75), 0 0 22px rgba(255, 0, 200, 0.45);
    }

    100% {
        transform: scale(1);
        text-shadow: 0 0 0 rgba(0, 217, 255, 0.2);
    }
}

@keyframes turn-panel-pulse {
    0% {
        box-shadow: 0 0 0 rgba(0, 217, 255, 0.2);
    }

    50% {
        box-shadow: 0 0 24px rgba(0, 217, 255, 0.35), 0 0 36px rgba(255, 0, 200, 0.22);
    }

    100% {
        box-shadow: 0 0 0 rgba(0, 217, 255, 0.2);
    }
}

.turn-title-beat {
    animation: turn-beat 0.9s ease-in-out infinite;
    color: var(--accent-blue);
}

.turn-highlight {
    border: 2px solid var(--accent-blue) !important;
    box-shadow: 0 0 28px rgba(0, 217, 255, 0.45), inset 0 0 18px rgba(0, 217, 255, 0.06) !important;
    animation: turn-highlight-pulse 0.75s ease-in-out infinite !important;
}

@keyframes turn-highlight-pulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 217, 255, 0.35), inset 0 0 14px rgba(0, 217, 255, 0.05);
    }

    50% {
        box-shadow: 0 0 44px rgba(0, 217, 255, 0.7), 0 0 70px rgba(255, 0, 200, 0.25), inset 0 0 26px rgba(0, 217, 255, 0.1);
    }
}

/* ============================================================
   ARCADE OVERHAUL — Phase Clarity, Animations & UX Polish
   ============================================================ */

/* ----- Phase indicator banner (player UI) ----- */
.player-phase-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid var(--accent-blue);
    background: rgba(0, 217, 255, 0.05);
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    text-align: center;
    margin-bottom: 10px;
}

.player-phase-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.player-phase-texts {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.player-phase-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.player-phase-name {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-blue);
    line-height: 1;
    transition: color 0.35s ease;
}

.player-phase-desc {
    font-size: 11px;
    color: var(--muted);
}

.player-phase-banner[data-phase="DRAW"] {
    border-color: #ff9f00;
    background: rgba(255, 159, 0, 0.07);
}

.player-phase-banner[data-phase="DRAW"] .player-phase-name {
    color: #ff9f00;
}

.player-phase-banner[data-phase="CHOOSING"] {
    border-color: var(--accent-pink);
    background: rgba(255, 0, 200, 0.08);
    animation: turn-panel-pulse 0.75s ease-in-out infinite;
}

.player-phase-banner[data-phase="CHOOSING"] .player-phase-name {
    color: var(--accent-pink);
    animation: turn-beat 0.65s ease-in-out infinite;
}

.player-phase-banner[data-phase="LISTENING"] {
    border-color: #00e676;
    background: rgba(0, 230, 118, 0.07);
}

.player-phase-banner[data-phase="LISTENING"] .player-phase-name {
    color: #00e676;
}

.player-phase-banner[data-phase="ANSWERING"] {
    border-color: var(--accent-blue);
    background: rgba(0, 217, 255, 0.09);
    box-shadow: 0 0 16px rgba(0, 217, 255, 0.3);
}

.player-phase-banner[data-phase="BETTING"] {
    border-color: var(--accent-pink);
    background: rgba(255, 0, 200, 0.09);
    animation: turn-panel-pulse 0.65s ease-in-out infinite;
    box-shadow: 0 0 18px rgba(255, 0, 200, 0.4);
}

.player-phase-banner[data-phase="BETTING"] .player-phase-name {
    color: var(--accent-pink);
    animation: turn-beat 0.65s ease-in-out infinite;
}

.player-phase-banner[data-phase="REVEAL"] {
    border-color: #ffbd59;
    background: rgba(255, 189, 89, 0.08);
}

.player-phase-banner[data-phase="REVEAL"] .player-phase-name {
    color: #ffbd59;
}

.player-phase-banner[data-phase="RESOLUTION"] {
    border-color: #76ff03;
    background: rgba(118, 255, 3, 0.07);
}

.player-phase-banner[data-phase="RESOLUTION"] .player-phase-name {
    color: #76ff03;
}

/* ----- MY TURN flash overlay ----- */
.my-turn-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(0, 217, 255, 0.2) 0%, transparent 70%);
    animation: my-turn-bg-fade 1.9s ease-out forwards;
}

.my-turn-overlay[hidden] {
    display: none !important;
}

@keyframes my-turn-bg-fade {
    0% {
        opacity: 0;
    }

    14% {
        opacity: 1;
    }

    70% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.my-turn-content {
    text-align: center;
    animation: my-turn-zoom 1.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes my-turn-zoom {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    24% {
        transform: scale(1.08);
        opacity: 1;
    }

    42% {
        transform: scale(0.96);
    }

    58% {
        transform: scale(1.02);
        opacity: 1;
    }

    78% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.82);
        opacity: 0;
    }
}

.my-turn-headline {
    font-size: clamp(54px, 16vw, 104px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.04em;
    background: linear-gradient(120deg, var(--accent-blue) 0%, var(--accent-pink) 50%, var(--accent-blue) 100%);
    background-size: 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 32px rgba(0, 217, 255, 0.95));
    animation: shimmer-text 0.65s linear infinite;
}

.my-turn-sub {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    margin-top: 16px;
}

@keyframes shimmer-text {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

/* ----- Roulette: large glowing number ----- */
#playerRouletteNumber {
    font-size: 62px !important;
    font-weight: 900 !important;
    letter-spacing: 4px !important;
    color: var(--accent-pink) !important;
    display: block;
    line-height: 1.1;
    animation: roulette-num-glow 0.14s steps(1) infinite;
}

@keyframes roulette-num-glow {
    0% {
        text-shadow: 0 0 18px rgba(255, 0, 200, 0.9), 0 0 36px rgba(255, 0, 200, 0.5);
    }

    50% {
        text-shadow: 0 0 34px rgba(255, 0, 200, 1), 0 0 68px rgba(0, 217, 255, 0.6), 0 0 110px rgba(255, 0, 200, 0.35);
    }
}

#stopRouletteBtn {
    font-size: 20px !important;
    font-weight: 900 !important;
    letter-spacing: 0.18em !important;
    padding: 18px 44px !important;
    border-radius: 14px !important;
    animation: stop-throb 0.44s ease-in-out infinite alternate;
}

@keyframes stop-throb {
    from {
        transform: scale(1);
        box-shadow: 0 0 14px rgba(236, 47, 47, 0.55);
    }

    to {
        transform: scale(1.07);
        box-shadow: 0 0 40px rgba(236, 47, 47, 1), 0 0 70px rgba(255, 100, 0, 0.5);
    }
}

/* ----- Timer bar ----- */
.timer-bar-wrap {
    margin: 4px 0 12px;
}

.timer-bar-label {
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.06em;
    color: var(--accent-blue);
    margin-bottom: 6px;
    transition: color 0.3s;
}

.timer-bar-label.urgent {
    color: var(--accent-red);
    animation: timer-blink 0.38s ease-in-out infinite alternate;
}

@keyframes timer-blink {
    from {
        opacity: 0.55;
    }

    to {
        opacity: 1;
    }
}

.timer-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    overflow: hidden;
}

.timer-bar-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-pink));
    transition: width 1s linear, background 0.5s ease;
    width: 100%;
}

.timer-bar-fill.urgent {
    background: linear-gradient(90deg, var(--accent-red), var(--accent-orange));
    animation: timer-bar-urgent 0.38s ease-in-out infinite alternate;
}

@keyframes timer-bar-urgent {
    from {
        opacity: 0.7;
    }

    to {
        opacity: 1;
        box-shadow: 0 0 12px rgba(236, 47, 47, 0.85);
    }
}

/* ----- Passive panel phase display ----- */
.passive-phase-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 12px;
    text-align: center;
    min-height: 130px;
    justify-content: center;
}

.passive-phase-emoji {
    font-size: 54px;
    line-height: 1;
    animation: float-icon 3.2s ease-in-out infinite;
}

@keyframes float-icon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.passive-phase-pill {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 12px;
}

.passive-phase-msg {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

/* ----- btn-pulse: highlight next required action ----- */
.btn-pulse {
    animation: btn-next-glow 0.88s ease-in-out infinite !important;
    transform: translateY(0);
}

@keyframes btn-next-glow {
    0% {
        box-shadow: 0 0 0 rgba(0, 217, 255, 0.25);
        transform: translateY(0);
    }

    50% {
        box-shadow: 0 0 24px rgba(0, 217, 255, 0.8), 0 0 42px rgba(255, 0, 200, 0.4);
        transform: translateY(-3px);
    }

    100% {
        box-shadow: 0 0 0 rgba(0, 217, 255, 0.25);
        transform: translateY(0);
    }
}

/* ----- Resource counter animation ----- */
.resource-pop {
    animation: resource-bounce 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes resource-bounce {
    0% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.5);
    }

    100% {
        transform: scale(1);
    }
}

/* ----- Floating coin/card popup ----- */
.coin-popup {
    position: fixed;
    font-size: 20px;
    font-weight: 800;
    pointer-events: none;
    z-index: 3500;
    animation: coin-popup-up 1.25s ease-out forwards;
}

@keyframes coin-popup-up {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.8);
    }

    18% {
        opacity: 1;
        transform: translateY(-12px) scale(1.2);
    }

    65% {
        opacity: 0.9;
        transform: translateY(-30px) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-52px) scale(0.9);
    }
}

/* ----- Host phase badge — colored per phase ----- */
#phaseBadge {
    font-size: 13px;
    padding: 6px 14px;
    letter-spacing: 0.12em;
    transition: background 0.35s, border-color 0.35s, color 0.35s;
}

#phaseBadge[data-phase="DRAW"] {
    background: rgba(255, 159, 0, 0.14);
    border-color: #ff9f00;
    color: #ff9f00;
}

#phaseBadge[data-phase="CHOOSING"] {
    background: rgba(255, 0, 200, 0.14);
    border-color: var(--accent-pink);
    color: var(--accent-pink);
    animation: badge-phase-pulse 0.62s ease-in-out infinite;
}

#phaseBadge[data-phase="LISTENING"] {
    background: rgba(0, 230, 118, 0.12);
    border-color: #00e676;
    color: #00e676;
}

#phaseBadge[data-phase="ANSWERING"] {
    background: rgba(0, 217, 255, 0.14);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    animation: badge-phase-pulse 0.95s ease-in-out infinite;
}

#phaseBadge[data-phase="BETTING"] {
    background: rgba(255, 0, 200, 0.14);
    border-color: var(--accent-pink);
    color: var(--accent-pink);
    animation: badge-phase-pulse 0.58s ease-in-out infinite;
}

#phaseBadge[data-phase="REVEAL"] {
    background: rgba(255, 189, 89, 0.14);
    border-color: #ffbd59;
    color: #ffbd59;
}

#phaseBadge[data-phase="RESOLUTION"] {
    background: rgba(118, 255, 3, 0.11);
    border-color: #76ff03;
    color: #76ff03;
}

@keyframes badge-phase-pulse {

    0%,
    100% {
        box-shadow: none;
    }

    50% {
        box-shadow: 0 0 18px currentColor;
    }
}

/* ----- Enhanced betting alert ----- */
.betting-alert-modal {
    background: linear-gradient(135deg, rgba(255, 0, 200, 0.58), rgba(0, 217, 255, 0.48));
    box-shadow: 0 0 60px rgba(255, 0, 200, 0.8), 0 0 100px rgba(0, 217, 255, 0.5);
    border: 2px solid var(--accent-pink);
}

.betting-alert-icon {
    display: block;
    font-size: 44px;
    margin-bottom: 6px;
    animation: bet-icon-shake 0.24s ease-in-out infinite alternate;
}

@keyframes bet-icon-shake {
    from {
        transform: rotate(-9deg) scale(1);
    }

    to {
        transform: rotate(9deg) scale(1.12);
    }
}

/* ----- Lobby player cards ----- */
#lobbyPlayers>div {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#lobbyPlayers>div:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 217, 255, 0.2);
}

/* ----- card-section subtle hover glow ----- */
.card-section {
    transition: box-shadow 0.3s ease;
}

.card-section:hover {
    box-shadow: 0 4px 28px rgba(0, 217, 255, 0.1);
}

/* ============================================================
   LOBBY REDESIGN — Characters, Animations & Arcade Feel
   ============================================================ */

/* ----- Inner content wrapper ----- */
.lobby-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
    height: 100%;
    max-height: 90%;
    /* overflow-y: scroll; */
}

/* ----- Floating muñequitos ----- */
.lobby-floaties {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.lobby-float {
    position: absolute;
    font-size: var(--size, 26px);
    opacity: 0.55;
    animation: lobby-float-anim var(--dur, 8s) ease-in-out infinite;
    user-select: none;
    will-change: transform;
}

@keyframes lobby-float-anim {
    0% {
        transform: translateY(0) rotate(var(--rot0, -8deg)) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-28px) rotate(var(--rot1, 10deg)) scale(1.12);
        opacity: 0.85;
    }

    100% {
        transform: translateY(0) rotate(var(--rot0, -8deg)) scale(1);
        opacity: 0.5;
    }
}

/* ----- Title ----- */
.lobby-title-main {
    font-size: clamp(34px, 7vw, 72px);
    font-weight: 900;
    letter-spacing: 0.04em;
    background: linear-gradient(120deg, var(--accent-pink) 0%, var(--accent-blue) 50%, var(--accent-pink) 100%);
    background-size: 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer-text 4s linear infinite;
    line-height: 1;
    filter: drop-shadow(0 0 18px rgba(0, 217, 255, 0.4));
}

.lobby-title-sub {
    font-size: 13px;
    color: var(--muted);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-top: 8px;
    font-weight: 600;
}

/* ----- Layout grid (setup + qr) ----- */
.lobby-top-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

@media (max-width: 720px) {
    .lobby-top-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .lobby-inner {
        padding: 14px 12px 20px;
    }

    #lobbyScreen .lobby-inner>header {
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
    }

    #lobbyScreen .lobby-inner>header>div:first-child {
        width: 100%;
        flex-direction: row !important;
        justify-content: center;
        min-width: 0 !important;
    }

    #lobbyScreen .lobby-inner>header>div:nth-child(2) {
        width: 100%;
        padding: 0 !important;
    }

    .lobby-title-main {
        font-size: clamp(28px, 10vw, 42px);
    }

    .lobby-title-sub {
        letter-spacing: 0.1em;
        font-size: 11px;
    }

    .lobby-code-display {
        letter-spacing: 0.12em;
        font-size: clamp(30px, 12vw, 46px);
        line-height: 1.05;
    }

    .lobby-players-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .lobby-qr-frame {
        width: 100%;
    }

    .lobby-qr-frame img,
    #qrImage {
        width: min(74vw, 210px) !important;
        height: min(74vw, 210px) !important;
    }

    .lobby-float {
        opacity: 0.35;
    }
}

/* ----- Room code display ----- */
.lobby-code-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
    margin-bottom: 8px;
}

.lobby-code-display {
    font-size: clamp(38px, 8vw, 68px);
    font-weight: 900;
    letter-spacing: 0.22em;
    font-family: 'Courier New', 'Lucida Console', monospace;
    background: linear-gradient(120deg, var(--accent-blue), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 14px rgba(0, 217, 255, 0.55));
    line-height: 1;
    animation: code-glow-pulse 2.5s ease-in-out infinite;
}

@keyframes code-glow-pulse {

    0%,
    100% {
        filter: drop-shadow(0 0 12px rgba(0, 217, 255, 0.5));
    }

    50% {
        filter: drop-shadow(0 0 28px rgba(0, 217, 255, 0.9)) drop-shadow(0 0 48px rgba(255, 0, 200, 0.4));
    }
}

/* ----- QR frame ----- */
.lobby-qr-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 2px solid var(--accent-blue);
    background: rgba(0, 217, 255, 0.05);
    animation: qr-frame-glow 2.2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes qr-frame-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 217, 255, 0.2);
        border-color: var(--accent-blue);
    }

    50% {
        box-shadow: 0 0 44px rgba(0, 217, 255, 0.5), 0 0 70px rgba(255, 0, 200, 0.22);
        border-color: var(--accent-pink);
    }
}

.lobby-qr-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--muted);
}

.lobby-qr-code-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.14em;
    font-family: 'Courier New', monospace;
    color: var(--accent-blue);
}

/* ----- Players section ----- */
.lobby-players-section {
    margin-bottom: 0;
}

.lobby-players-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.lobby-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    min-height: 80px;
}

/* ----- Player card ----- */
.lobby-player-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: box-shadow 0.25s, border-color 0.25s, transform 0.2s;
    position: relative;
}

.lobby-player-card.is-new {
    animation: player-card-enter 0.5s ease-out both;
}

.lobby-player-card:hover {
    box-shadow: 0 8px 32px rgba(0, 217, 255, 0.22);
    border-color: var(--accent-blue);
    transform: translateY(-3px);
}

.lobby-player-card.is-host {
    border-color: var(--accent-pink);
    background: rgba(255, 0, 200, 0.06);
}

.lobby-player-card.is-host:hover {
    box-shadow: 0 8px 32px rgba(255, 0, 200, 0.28);
    border-color: var(--accent-pink);
}

@keyframes player-card-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----- Player avatar circle ----- */
.player-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.player-name-text {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
    color: var(--text);
}

.player-role-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
}

.player-role-badge.host-badge {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
    background: rgba(255, 0, 200, 0.1);
}

.player-online-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #00e676;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.9);
    animation: online-pulse 1.6s ease-in-out infinite;
}

@keyframes online-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.55;
        transform: scale(0.82);
    }
}

/* ----- Waiting indicator ----- */
.lobby-waiting {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.06em;
}

.lobby-waiting-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-blue);
    animation: wait-bounce 1.3s ease-in-out infinite;
}

.lobby-waiting-dot:nth-child(2) {
    animation-delay: 0.18s;
}

.lobby-waiting-dot:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes wait-bounce {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.35;
    }

    40% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ----- Player count badge ----- */
.lobby-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    transition: background 0.3s, border-color 0.3s;
}

.lobby-count-badge.ready {
    background: rgba(0, 230, 118, 0.12);
    border-color: #00e676;
    color: #00e676;
}

.lobby-footer {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(12, 14, 28, 0.72);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.lobby-footer-brand {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
}

.lobby-footer-meta {
    font-size: 12px;
    text-align: right;
}

@media (max-width: 768px) {
    .lobby-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 12px;
    }

    .lobby-footer-brand {
        font-size: 11px;
        letter-spacing: 0.06em;
    }

    .lobby-footer-meta {
        text-align: left;
        font-size: 11px;
        line-height: 1.35;
    }
}

/* ----- Join toast notification ----- */
.join-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 4000;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.3), rgba(255, 0, 200, 0.25));
    border: 1px solid var(--accent-blue);
    border-radius: 14px;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    box-shadow: 0 8px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(0, 217, 255, 0.25);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: join-toast-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    will-change: transform, opacity;
}

.join-toast.leaving {
    animation: join-toast-out 0.35s ease-in forwards;
}

.join-toast-icon {
    font-size: 24px;
    animation: join-toast-icon-spin 0.6s ease-out;
}

@keyframes join-toast-icon-spin {
    from {
        transform: rotate(-180deg) scale(0.5);
    }

    to {
        transform: rotate(0deg) scale(1);
    }
}

@keyframes join-toast-in {
    from {
        opacity: 0;
        transform: translateX(70px) scale(0.88);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes join-toast-out {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateX(70px) scale(0.9);
    }
}

/* ===== How To Play modal ===== */
.rules-modal {
    width: min(600px, 94vw);
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 24px 24px;
}

.rules-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.rules-icon {
    font-size: 40px;
    line-height: 1;
}

.rules-title {
    margin: 0 0 2px 0;
    font-size: 22px;
    color: var(--text);
}

.rules-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.rules-objective {
    background: rgba(0, 217, 255, 0.08);
    border: 1px solid rgba(0, 217, 255, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.rules-objective-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1.3;
}

.rules-section {
    margin-bottom: 20px;
}

.rules-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-blue);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.rules-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rules-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.5;
}

.rules-item-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1.3;
}

/* Flow steps */
.rules-flow {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.rules-flow::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-blue), var(--accent-pink));
    border-radius: 2px;
}

.rules-flow-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 8px 0;
    position: relative;
}

.rules-flow-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.rules-flow-body {
    padding-top: 4px;
}

.rules-flow-label {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.rules-flow-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

/* Coins grid */
.rules-coins-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rules-coin-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
}

.rules-coin-sign {
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    flex-shrink: 0;
    min-width: 32px;
    text-align: center;
}

.rules-coin-sign.gain {
    background: rgba(0, 230, 118, 0.15);
    color: #00e676;
}

.rules-coin-sign.lose {
    background: rgba(236, 47, 47, 0.15);
    color: #ec5555;
}

/* ===== Tutorial modal ===== */
.tut-modal {
    width: min(480px, 94vw);
    padding: 20px 22px 22px;
}

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

.tut-step-counter {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.tut-x-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 17px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 6px;
    transition: color 0.2s;
    line-height: 1;
}

.tut-x-btn:hover {
    color: var(--text);
}

/* Dots */
.tut-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 14px;
}

.tut-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    border: none;
    padding: 0;
    transition: background 0.25s, transform 0.25s;
}

.tut-dot.active {
    background: var(--accent-blue);
    transform: scale(1.5);
}

/* Scene container */
.tut-scene {
    display: none;
    height: 160px;
    position: relative;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
}

.tut-scene.active {
    display: flex;
}

/* Shared elements */
.tut-big-em {
    font-size: 52px;
    line-height: 1;
}

.tut-big-em.sm {
    font-size: 36px;
}

.tut-big-em.spk {
    font-size: 48px;
}

.tut-scene-arrow {
    font-size: 26px;
    color: var(--accent-blue);
    animation: tut-arr 1s ease-in-out infinite alternate;
}

@keyframes tut-arr {
    from {
        transform: translateX(-3px);
        opacity: 0.6;
    }

    to {
        transform: translateX(3px);
        opacity: 1;
    }
}

.tut-phone-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* ---- Scene 0: Join ---- */
.tut-qr-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.tut-qr-box {
    width: 72px;
    height: 72px;
    background: repeating-conic-gradient(rgba(255, 255, 255, 0.15) 0% 25%, transparent 0% 50%) 0 0 / 9px 9px;
    border: 2px solid var(--accent-blue);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.tut-scan-beam {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    box-shadow: 0 0 8px var(--accent-blue);
    animation: tut-scan 2s ease-in-out infinite;
}

@keyframes tut-scan {
    0% {
        top: 0;
    }

    50% {
        top: calc(100% - 2px);
    }

    100% {
        top: 0;
    }
}

.tut-qr-caption {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.tut-join-check {
    font-size: 20px;
    animation: tut-check-pop 3s ease-in-out infinite;
}

@keyframes tut-check-pop {

    0%,
    55% {
        opacity: 0;
        transform: scale(0.4);
    }

    72% {
        opacity: 1;
        transform: scale(1.3);
    }

    82%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ---- Scene 1: Turn ---- */
.tut-turn-badge {
    font-size: 12px;
    font-weight: 900;
    color: var(--accent-blue);
    padding: 4px 10px;
    border: 2px solid var(--accent-blue);
    border-radius: 8px;
    letter-spacing: 0.05em;
    animation: tut-badge-glow 1.4s ease-in-out infinite;
}

@keyframes tut-badge-glow {

    0%,
    100% {
        box-shadow: 0 0 0 rgba(0, 217, 255, 0);
    }

    50% {
        box-shadow: 0 0 14px rgba(0, 217, 255, 0.65);
    }
}

.tut-pill-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tut-ctrl-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 18px;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
}

.tut-ctrl-pill.pulse-pill {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    animation: tut-pill-pulse 1.3s ease-in-out infinite;
}

@keyframes tut-pill-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 rgba(0, 217, 255, 0);
    }

    50% {
        box-shadow: 0 0 12px rgba(0, 217, 255, 0.55);
    }
}

/* ---- Scene 2: Roulette ---- */
.tut-roulette-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.tut-roulette-box {
    width: 88px;
    height: 64px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--accent-pink);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 18px rgba(255, 0, 200, 0.25);
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.tut-roulette-strip {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: tut-reel 3.5s cubic-bezier(0.15, 0.1, 0.25, 1) infinite;
}

.tut-roulette-strip div {
    height: 64px;
    line-height: 64px;
    font-size: 28px;
    font-weight: 900;
    color: var(--accent-pink);
}

@keyframes tut-reel {
    0% {
        transform: translateY(0);
    }

    75% {
        transform: translateY(-384px);
    }

    100% {
        transform: translateY(-384px);
    }
}

.tut-stop-pill {
    background: linear-gradient(135deg, var(--accent-red), #ff6435);
    border: none;
    border-radius: 10px;
    padding: 8px 22px;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    cursor: default;
    animation: tut-stop-throb 1.2s ease-in-out infinite;
}

@keyframes tut-stop-throb {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(236, 47, 47, 0);
    }

    50% {
        transform: scale(1.07);
        box-shadow: 0 0 14px rgba(236, 47, 47, 0.55);
    }
}

/* ---- Scene 3: Listen ---- */
.tut-notes-wrap {
    position: relative;
    width: 70px;
    height: 120px;
}

.tut-note {
    position: absolute;
    font-size: 20px;
    bottom: 0;
}

.tut-note.n1 {
    left: 0;
    animation: tut-float-note 2.2s ease-out infinite;
}

.tut-note.n2 {
    left: 25px;
    animation: tut-float-note 2.2s ease-out 0.75s infinite;
}

.tut-note.n3 {
    left: 48px;
    animation: tut-float-note 2.2s ease-out 1.5s infinite;
}

@keyframes tut-float-note {
    0% {
        opacity: 0;
        transform: translateY(0) rotate(0deg);
    }

    15% {
        opacity: 1;
    }

    80% {
        opacity: 0.7;
    }

    100% {
        opacity: 0;
        transform: translateY(-100px) rotate(18deg);
    }
}

/* ---- Scene 4: Timeline placement ---- */
.tut-tl-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tut-tl-row {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.tut-tl-card {
    width: 62px;
    height: 78px;
    background: rgba(0, 217, 255, 0.08);
    border: 1px solid var(--accent-blue);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--accent-blue);
}

.tut-tl-slot {
    width: 62px;
    height: 78px;
    border: 2px dashed var(--accent-pink);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tut-mystery {
    font-size: 28px;
    font-weight: 900;
    color: var(--accent-pink);
    animation: tut-mystery-drop 2.8s ease-out infinite;
}

@keyframes tut-mystery-drop {

    0%,
    8% {
        opacity: 0;
        transform: translateY(-44px);
    }

    35% {
        opacity: 1;
        transform: translateY(0);
    }

    75% {
        opacity: 1;
        transform: translateY(0);
    }

    92%,
    100% {
        opacity: 0;
        transform: translateY(0);
    }
}

.tut-tl-line {
    width: 194px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-pink), var(--accent-blue));
    border-radius: 2px;
    margin-top: -2px;
}

/* ---- Scene 5: Bet ---- */
.tut-bet-stage {
    display: flex;
    align-items: center;
    gap: 28px;
}

.tut-bet-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.tut-bet-center {
    width: 48px;
    height: 48px;
    border: 2px solid var(--accent-pink);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    color: var(--accent-pink);
    animation: tut-center-pulse 1.6s ease-in-out infinite;
}

@keyframes tut-center-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 rgba(255, 0, 200, 0);
    }

    50% {
        box-shadow: 0 0 18px rgba(255, 0, 200, 0.5);
    }
}

.tut-flying-coin {
    font-size: 22px;
}

.tut-flying-coin.ca {
    animation: tut-coin-a 2.4s ease-in-out infinite;
}

.tut-flying-coin.cb {
    animation: tut-coin-b 2.4s ease-in-out 0.5s infinite;
}

@keyframes tut-coin-a {

    0%,
    10% {
        opacity: 0;
        transform: translate(0, 0);
    }

    20% {
        opacity: 1;
        transform: translate(0, 0);
    }

    72% {
        opacity: 1;
        transform: translate(76px, -8px);
    }

    85%,
    100% {
        opacity: 0;
        transform: translate(84px, -8px);
    }
}

@keyframes tut-coin-b {

    0%,
    10% {
        opacity: 0;
        transform: translate(0, 0);
    }

    20% {
        opacity: 1;
        transform: translate(0, 0);
    }

    72% {
        opacity: 1;
        transform: translate(-76px, -8px);
    }

    85%,
    100% {
        opacity: 0;
        transform: translate(-84px, -8px);
    }
}

/* ---- Scene 6: Result ---- */
.tut-result-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tut-result-card {
    width: 78px;
    height: 90px;
    background: rgba(0, 217, 255, 0.07);
    border: 2px solid var(--accent-blue);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tut-result-year {
    font-size: 20px;
    font-weight: 900;
    color: var(--accent-blue);
    animation: tut-year-reveal 3.2s ease-out infinite;
}

@keyframes tut-year-reveal {

    0%,
    25% {
        opacity: 0;
        transform: scale(0.4);
    }

    48% {
        opacity: 1;
        transform: scale(1.15);
    }

    58%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.tut-result-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.tut-result-check {
    font-size: 32px;
    animation: tut-icon-appear 3.2s ease-out 0.4s infinite;
}

.tut-result-trophy {
    font-size: 32px;
    animation: tut-icon-appear 3.2s ease-out 0.9s infinite;
}

@keyframes tut-icon-appear {

    0%,
    38% {
        opacity: 0;
        transform: scale(0) translateY(10px);
    }

    60% {
        opacity: 1;
        transform: scale(1.2) translateY(-3px);
    }

    70%,
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Text + Nav */
.tut-text {
    text-align: center;
    margin-bottom: 16px;
}

.tut-step-name {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 5px;
    color: var(--text);
}

.tut-step-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}

.tut-nav {
    display: flex;
    gap: 10px;
}

.tut-nav button {
    flex: 1;
}

/* Help FAB (player screen fixed buttons) */
.help-fab-group {
    position: fixed;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 500;
}

.help-fab-btn {
    background: rgba(17, 17, 34, 0.88);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.help-fab-btn:hover {
    color: var(--text);
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.2);
}