/*------------------------------------*\
    CSS Variables
\*------------------------------------*/

:root {
    --color-bg: #5B2D8E;
    --color-bg-dark: #3A1B5E;
    --color-bg-light: #7E4BB5;

    --color-surface: #ffffff;
    --color-surface-alt: #F5F5F7;
    --color-text: #1A1A2E;
    --color-text-light: #6B7280;
    --color-text-white: #ffffff;
    --color-border: #E5E7EB;

    --color-primary: #5B2D8E;
    --color-primary-hover: #4A2375;
    --color-primary-light: #7E4BB5;

    --color-secondary: #FF8C42;
    --color-secondary-hover: #E67A35;

    --color-answer-1: #E63946;
    --color-answer-2: #457B9D;
    --color-answer-3: #E9A820;
    --color-answer-4: #2A9D5C;

    --color-correct: #2A9D5C;
    --color-correct-bg: #ECFDF5;
    --color-wrong: #E63946;
    --color-wrong-bg: #FEF2F2;
    --color-danger: #E63946;
    --color-danger-hover: #C4172F;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);

    --font-main: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/*------------------------------------*\
    Reset & Base
\*------------------------------------*/

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    color: var(--color-text);
    line-height: 1.5;
    background: var(--color-surface-alt);
}

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

img {
    max-width: 100%;
    height: auto;
}

/*------------------------------------*\
    Layout
\*------------------------------------*/

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

.main-content {
    padding-top: 28px;
    padding-bottom: 40px;
}

/*------------------------------------*\
    Header (Admin)
\*------------------------------------*/

.header {
    background: var(--color-surface);
    color: var(--color-text);
    padding: 0;
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 800;
}

.header-title a {
    color: var(--color-primary);
}

.header-icon {
    font-size: 1.4rem;
}

.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.header-user {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.7;
    padding: 0 4px;
}

/*------------------------------------*\
    Buttons
\*------------------------------------*/

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-text-white);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 2px 8px rgba(91, 45, 142, 0.3);
}

.btn-secondary {
    background: var(--color-secondary);
    color: var(--color-text-white);
}

.btn-secondary:hover {
    background: var(--color-secondary-hover);
    box-shadow: 0 2px 8px rgba(255, 140, 66, 0.3);
}

.btn-danger {
    background: var(--color-danger);
    color: var(--color-text-white);
}

.btn-danger:hover {
    background: var(--color-danger-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-ghost:hover {
    background: var(--color-surface-alt);
    border-color: #D1D5DB;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.05rem;
    border-radius: var(--radius);
}

.btn-full {
    width: 100%;
}

/*------------------------------------*\
    Forms
\*------------------------------------*/

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--color-surface);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(91, 45, 142, 0.1);
}

.form-help {
    display: block;
    font-size: 0.78rem;
    color: var(--color-text-light);
    margin-top: 4px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-row .form-group-small {
    flex: 0 0 150px;
}

/*------------------------------------*\
    Cards
\*------------------------------------*/

.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}

/*------------------------------------*\
    Tables
\*------------------------------------*/

.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table th {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-light);
}

.table td {
    font-size: 0.9rem;
}

.table tr:last-child td {
    border-bottom: none;
}

/*------------------------------------*\
    Alerts
\*------------------------------------*/

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 0.875rem;
}

.alert-error {
    background: var(--color-wrong-bg);
    color: var(--color-wrong);
    border: 1px solid var(--color-wrong);
}

/*------------------------------------*\
    Page Header
\*------------------------------------*/

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

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-text);
}

.page-header-actions {
    display: flex;
    gap: 8px;
}

/*------------------------------------*\
    Sections
\*------------------------------------*/

.section {
    margin-bottom: 32px;
}

.section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--color-text);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h3 {
    margin-bottom: 0;
}

/*------------------------------------*\
    Empty State
\*------------------------------------*/

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--color-text-light);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--color-border);
}

/*------------------------------------*\
    Badges
\*------------------------------------*/

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-waiting {
    background: #FEF3C7;
    color: #92400E;
}

.badge-active, .badge-question {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-results, .badge-leaderboard {
    background: #EDE9FE;
    color: #5B21B6;
}

.badge-finished {
    background: var(--color-surface-alt);
    color: var(--color-text-light);
}

/*------------------------------------*\
    Session Cards
\*------------------------------------*/

.session-cards {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.session-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    min-width: 260px;
    border-left: 4px solid var(--color-primary);
    transition: box-shadow 0.2s, transform 0.2s;
}

.session-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

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

.session-pin {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-primary);
}

.session-card-body {
    margin-bottom: 12px;
}

.session-players {
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.session-card-actions {
    display: flex;
    gap: 8px;
}

/*------------------------------------*\
    Quiz Cards
\*------------------------------------*/

.quiz-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.quiz-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.quiz-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.quiz-card-body {
    padding: 20px;
    flex: 1;
}

.quiz-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.quiz-card-desc {
    color: var(--color-text-light);
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.quiz-card-code {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 1px;
    font-family: monospace;
    margin-bottom: 4px;
}

.quiz-card-count {
    font-size: 0.8rem;
    color: var(--color-primary);
    font-weight: 600;
}

.quiz-card-actions {
    display: flex;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface-alt);
}

/*------------------------------------*\
    Question List (Admin)
\*------------------------------------*/

.question-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.question-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.15s;
}

.question-item:hover {
    box-shadow: var(--shadow-card);
}

.question-item-drag {
    cursor: grab;
    color: var(--color-text-light);
    font-size: 1.2rem;
}

.question-item-number {
    background: var(--color-primary);
    color: var(--color-text-white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.question-item-text {
    flex: 1;
    font-weight: 600;
}

.question-item-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--color-text-light);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.question-item-actions {
    display: flex;
    gap: 6px;
}

.question-item.dragging {
    opacity: 0.4;
}

.question-item.drag-over {
    border-top: 3px solid var(--color-secondary);
}

.question-item[draggable="true"] .question-item-drag:active {
    cursor: grabbing;
}

.question-check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.input-time {
    width: 56px;
    padding: 6px 4px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font-main);
    font-weight: 600;
    text-align: center;
    transition: border-color 0.2s;
}

.input-time:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(91, 45, 142, 0.1);
}

.input-time-suffix {
    color: var(--color-text-light);
    font-size: 0.85rem;
    font-weight: 600;
}

.question-batch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-surface-alt);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid var(--color-border);
}

.question-batch-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
}

.question-batch-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.question-batch-actions label {
    font-weight: 600;
    color: var(--color-text);
}

/*------------------------------------*\
    Answer Fields (Question Editor)
\*------------------------------------*/

.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.answer-field {
    border-radius: var(--radius);
    padding: 16px;
    border: 3px solid transparent;
}

.answer-field-1 { background: rgba(230, 57, 70, 0.06); border-color: var(--color-answer-1); }
.answer-field-2 { background: rgba(69, 123, 157, 0.06); border-color: var(--color-answer-2); }
.answer-field-3 { background: rgba(233, 168, 32, 0.06); border-color: var(--color-answer-3); }
.answer-field-4 { background: rgba(42, 157, 92, 0.06); border-color: var(--color-answer-4); }

.answer-field-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.answer-field-letter {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--color-text-white);
    flex-shrink: 0;
}

.answer-field-1 .answer-field-letter { background: var(--color-answer-1); }
.answer-field-2 .answer-field-letter { background: var(--color-answer-2); }
.answer-field-3 .answer-field-letter { background: var(--color-answer-3); }
.answer-field-4 .answer-field-letter { background: var(--color-answer-4); }

.answer-field-header label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.answer-field input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 1rem;
    background: var(--color-surface);
    transition: border-color 0.2s;
}

.answer-field input[type="text"]:focus {
    outline: none;
    border-color: inherit;
}

/*------------------------------------*\
    Answer Shapes
\*------------------------------------*/

.answer-shape {
    display: inline-block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.shape-triangle {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 22px solid var(--color-answer-1);
}

.shape-diamond {
    width: 18px;
    height: 18px;
    background: var(--color-answer-2);
    transform: rotate(45deg);
}

.shape-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-answer-3);
}

.shape-square {
    width: 20px;
    height: 20px;
    background: var(--color-answer-4);
    border-radius: 3px;
}

/*------------------------------------*\
    Game Control (Admin)
\*------------------------------------*/

.game-control-top {
    margin-bottom: 24px;
}

.game-info-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 32px;
}

.game-pin-display {
    text-align: center;
}

.game-pin-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.game-pin-code {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: 4px;
}

.btn-pin-edit {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--color-text-light);
    padding: 2px 6px;
    margin-left: 4px;
    border-radius: 4px;
    vertical-align: middle;
}

.btn-pin-edit:hover {
    color: var(--color-primary);
    background: var(--color-bg-light);
}

.pin-edit-form {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-top: 6px;
}

.pin-edit-form input {
    width: 120px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 3px;
    padding: 4px 8px;
}

.game-info-stats {
    display: flex;
    gap: 32px;
    flex: 1;
}

.game-stat {
    text-align: center;
}

.game-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
}

.game-stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--color-text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-control-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.game-control-actions .btn-primary {
    background: var(--color-secondary);
}

.game-control-actions .btn-primary:hover {
    background: var(--color-secondary-hover);
}

.game-control-secondary {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border);
}

.answer-progress {
    flex: 1;
    min-width: 200px;
    background: var(--color-border);
    border-radius: 20px;
    height: 32px;
    position: relative;
    overflow: hidden;
}

.answer-progress-bar {
    height: 100%;
    background: var(--color-secondary);
    border-radius: 20px;
    transition: width 0.3s ease;
    width: 0%;
}

.answer-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text);
}

.game-current-question {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
}

.game-current-question h4 {
    font-size: 0.75rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.current-question-text {
    font-size: 1.1rem;
    font-weight: 700;
}

.game-players-list {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
}

.game-players-list h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.players-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.player-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-surface-alt);
    border-radius: 20px;
    padding: 6px 14px;
    transition: background 0.2s;
}

.player-tag:hover {
    background: #EEECF1;
}

.player-rank {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--color-text-light);
    min-width: 20px;
}

.player-name {
    font-weight: 600;
    font-size: 0.875rem;
    flex: 1;
}

.player-score {
    font-size: 0.75rem;
    color: var(--color-primary);
    font-weight: 700;
    margin-left: auto;
}

/*------------------------------------*\
    GameControl: Live Panel
\*------------------------------------*/

.gc-live-panel {
    margin-bottom: 24px;
}

.gc-live-question {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}

.gc-live-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.gc-live-question-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
}

.gc-live-timer {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-secondary);
    min-width: 48px;
    text-align: center;
}

.gc-live-question-text {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.gc-live-answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.gc-live-answer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.gc-live-answer-1 { background: var(--color-answer-1); }
.gc-live-answer-2 { background: var(--color-answer-2); }
.gc-live-answer-3 { background: var(--color-answer-3); }
.gc-live-answer-4 { background: var(--color-answer-4); }

.gc-live-answer.gc-correct {
    box-shadow: 0 0 0 3px #2A9D5C;
}

.gc-live-answer.gc-dimmed {
    opacity: 0.4;
}

.gc-live-answer-letter {
    font-weight: 800;
    font-size: 1rem;
    min-width: 22px;
}

.gc-live-answer-text {
    flex: 1;
}

.gc-live-answer-count {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 2px 8px;
    font-weight: 800;
    font-size: 0.85rem;
    min-width: 20px;
    text-align: center;
}

.gc-live-answer-pct {
    font-weight: 800;
    font-size: 1rem;
    min-width: 44px;
    text-align: right;
    opacity: 0;
    transition: opacity 0.3s;
}

.gc-live-answer-pct.visible {
    opacity: 1;
}

.gc-live-results {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}

.gc-live-results h4 {
    font-size: 0.75rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.gc-live-distribution {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gc-dist-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gc-dist-label {
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gc-dist-bar-wrap {
    flex: 1;
    height: 24px;
    background: var(--color-surface-alt);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.gc-dist-bar {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
    min-width: 0;
}

.gc-dist-bar-1 { background: var(--color-answer-1); }
.gc-dist-bar-2 { background: var(--color-answer-2); }
.gc-dist-bar-3 { background: var(--color-answer-3); }
.gc-dist-bar-4 { background: var(--color-answer-4); }
.gc-dist-bar-0 { background: #ccc; }

.gc-dist-no-answer {
    color: var(--color-text-light);
    font-style: italic;
}

.gc-dist-pct {
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 44px;
    text-align: right;
}

.gc-dist-correct {
    color: #2A9D5C;
}

.gc-live-leaderboard {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}

.gc-live-leaderboard h4 {
    font-size: 0.75rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.gc-live-leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gc-lb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--color-surface-alt);
}

.gc-lb-rank {
    font-weight: 800;
    font-size: 1rem;
    min-width: 32px;
    color: var(--color-primary);
}

.gc-lb-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
}

.gc-lb-score {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-secondary);
}

/*------------------------------------*\
    Toast
\*------------------------------------*/

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ably-status {
    position: fixed;
    bottom: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    font-size: 0;
    overflow: hidden;
    color: transparent;
}

.ably-status-connected { background: #2A9D5C; }
.ably-status-polling { background: #E9A820; }
.ably-status-failed { background: #E63946; }

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text-white);
    background: #1E293B;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 400px;
}

.toast-success { background: var(--color-correct); }
.toast-error { background: var(--color-wrong); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/*------------------------------------*\
    Modal
\*------------------------------------*/

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-box h3 {
    margin-bottom: 12px;
    font-weight: 800;
}

.modal-box p {
    color: var(--color-text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

.modal-box .modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 24px;
}

/*------------------------------------*\
    Login
\*------------------------------------*/

.login-body {
    background: var(--color-surface-alt);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 8px;
}

.login-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-primary);
}

.login-logo p {
    color: var(--color-text-light);
    font-size: 0.875rem;
}

/*------------------------------------*\
    Player (Mobile)
\*------------------------------------*/

.player-body {
    background: linear-gradient(160deg, var(--color-bg-dark) 0%, var(--color-bg) 50%, var(--color-bg-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.player-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.player-logo {
    text-align: center;
    margin-bottom: 20px;
    color: var(--color-text-white);
}



.player-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
}

.player-form {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.player-form .form-group input {
    font-size: 1.3rem;
    text-align: center;
    padding: 14px;
    font-weight: 700;
    letter-spacing: 4px;
    border-radius: var(--radius);
}

.player-form .form-group input#nickname {
    letter-spacing: normal;
}

.player-form .btn {
    background: var(--color-secondary);
    border-radius: var(--radius);
    font-size: 1.05rem;
    padding: 14px;
}

.player-form .btn:hover {
    background: var(--color-secondary-hover);
}

.player-waiting {
    display: none;
    text-align: center;
    color: var(--color-text-white);
    padding: 40px 20px;
}

.waiting-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--color-text-white);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.waiting-text {
    font-size: 1.2rem;
    font-weight: 700;
}

.waiting-nickname {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 8px;
}

.waiting-player-count {
    margin-top: 20px;
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.8;
}

/*------------------------------------*\
    Player Game Screens
\*------------------------------------*/

.player-game-body {
    padding: 0;
    display: block;
}

.player-screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    flex-direction: column;
}

.player-screen:first-child {
    display: flex;
}

/* Waiting for next question */
.player-game-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: var(--color-text-white);
    text-align: center;
    padding: 20px;
}

.player-score-display {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 16px;
}

/* Question text on player */
.player-question-header {
    padding: 16px 16px 0;
    flex-shrink: 0;
}

.player-question-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
}

.player-question-card p {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.4;
    text-align: center;
}

/* Timer bar */
.player-timer-bar {
    height: 6px;
    background: var(--color-secondary);
    transition: width 0.1s linear;
    width: 100%;
    flex-shrink: 0;
}

/* Timer text on player */
.player-timer-text {
    display: block;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-secondary);
    margin-bottom: 6px;
    transition: color 0.3s;
}

.player-timer-text.timer-warning {
    color: #E63946;
}

/* Answer buttons - vertical list */
.player-answers-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px 16px;
    flex: 1;
}

.player-answer-btn {
    border: none;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.3s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
    padding: 16px 20px;
    min-height: 60px;
    text-align: left;
    background: var(--color-surface);
    box-shadow: var(--shadow);
}

.player-answer-btn:active {
    transform: scale(0.97);
}

.player-answer-btn.disabled {
    pointer-events: none;
    opacity: 0.4;
}

.player-answer-btn.selected {
    opacity: 1;
    transform: scale(0.97);
}

.player-answer-btn.selected.answer-btn-1 { background: var(--color-answer-1); }
.player-answer-btn.selected.answer-btn-2 { background: var(--color-answer-2); }
.player-answer-btn.selected.answer-btn-3 { background: var(--color-answer-3); }
.player-answer-btn.selected.answer-btn-4 { background: var(--color-answer-4); }

.player-answer-btn.selected .player-answer-text {
    color: var(--color-text-white);
}

.player-answer-btn.answer-correct {
    background: var(--color-correct) !important;
    opacity: 1 !important;
    border: 3px solid #1B7A3D;
}

.player-answer-btn.answer-correct .player-answer-text {
    color: var(--color-text-white);
}

.player-answer-btn.answer-correct .player-answer-letter {
    background: #1B7A3D;
}

.player-answer-btn.answer-wrong {
    background: var(--color-wrong) !important;
    opacity: 1 !important;
    border: 3px solid #B82030;
}

.player-answer-btn.answer-wrong .player-answer-text {
    color: var(--color-text-white);
}

.player-answer-btn.answer-wrong .player-answer-letter {
    background: #B82030;
}

/* Result banner (inline on question screen) */
.player-result-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    z-index: 100;
}

.result-banner-content {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.result-banner-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: var(--color-text-white);
    flex-shrink: 0;
}

.result-banner-correct .result-banner-icon {
    background: var(--color-correct);
}

.result-banner-wrong .result-banner-icon {
    background: var(--color-wrong);
}

.result-banner-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-text);
}

.player-answer-letter {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-text-white);
    flex-shrink: 0;
}

.answer-btn-1 .player-answer-letter { background: var(--color-answer-1); }
.answer-btn-2 .player-answer-letter { background: var(--color-answer-2); }
.answer-btn-3 .player-answer-letter { background: var(--color-answer-3); }
.answer-btn-4 .player-answer-letter { background: var(--color-answer-4); }

.player-answer-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.3;
}


/* Leaderboard (player) */
.player-leaderboard-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 20px;
    color: var(--color-text-white);
}

.player-leaderboard-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 24px;
}

.player-leaderboard-list {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.player-lb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    padding: 12px 16px;
}

.player-lb-row.player-lb-me {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.player-lb-rank {
    font-size: 1.2rem;
    font-weight: 900;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.player-lb-row:nth-child(1) .player-lb-rank { color: #FFD700; }
.player-lb-row:nth-child(2) .player-lb-rank { color: #C0C0C0; }
.player-lb-row:nth-child(3) .player-lb-rank { color: #CD7F32; }

.player-lb-name {
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
    text-align: left;
}

.player-lb-score {
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-secondary);
}

.player-leaderboard-score {
    font-size: 1.2rem;
    font-weight: 700;
    opacity: 0.9;
}

/* Finished */
.player-finished-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 20px;
}

.player-finished-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    width: 100%;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
}

.player-finished-card h2 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 8px;
    color: var(--color-text);
}

.final-score {
    font-size: 1rem;
    color: var(--color-text-light);
}

.final-score-value {
    font-size: 3.5rem;
    font-weight: 900;
    margin: 8px 0;
    color: var(--color-primary);
}

.final-rank {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-secondary);
}

/*------------------------------------*\
    Display (Projection Screen)
\*------------------------------------*/

.display-body {
    background: linear-gradient(160deg, var(--color-bg-dark) 0%, var(--color-bg) 100%);
    color: var(--color-text-white);
    min-height: 100vh;
    overflow: hidden;
}

.display-screen {
    display: none;
    width: 100vw;
    min-height: 100vh;
    padding: 40px 60px;
}

.display-screen.display-active {
    display: flex;
    flex-direction: column;
}

/* Waiting screen */
.display-waiting-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
}

.display-logo {
    margin-bottom: 40px;
}


.display-logo h1 {
    font-size: 5rem;
    font-weight: 900;
}

.display-join-info {
    margin-bottom: 40px;
}

.display-join-url {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    opacity: 0.9;
}

.display-pin-box {
    display: inline-block;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 28px 56px;
    margin-bottom: 24px;
}

.display-pin-label {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.display-pin-code {
    font-size: 5.5rem;
    font-weight: 900;
    color: var(--color-primary);
    letter-spacing: 10px;
}

.display-join-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
}

.display-join-row .display-pin-box {
    margin-bottom: 0;
}

.display-qr {
    background: var(--color-surface);
    padding: 20px;
    border-radius: var(--radius-lg);
    display: inline-block;
}

.display-qr img {
    width: 200px;
    height: 200px;
}

.display-player-count {
    font-size: 2.2rem;
    font-weight: 700;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Starting screen (transitional) */
.display-starting-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
}

.display-starting-message h2 {
    font-size: 5rem;
    font-weight: 900;
    margin-bottom: 12px;
    animation: startingPulse 1.5s ease-in-out infinite;
}

.display-starting-message p {
    font-size: 2.5rem;
    opacity: 0.85;
    margin-bottom: 40px;
}

@keyframes startingPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

.display-starting-join {
    margin-bottom: 30px;
    opacity: 0.8;
}

.display-starting-join .display-join-url {
    font-size: 2rem;
}

.display-starting-join .display-pin-box {
    padding: 16px 40px;
}

.display-starting-join .display-pin-code {
    font-size: 3.5rem;
    letter-spacing: 8px;
}

.display-starting-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.display-starting-row .display-pin-box {
    margin-bottom: 0;
}

.display-qr-small {
    transform: scale(0.7);
    transform-origin: center;
    margin: 0;
}

/* Question screen */
#display-question {
    justify-content: space-between;
    padding: 30px 60px;
}

.display-question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.display-question-number {
    font-size: 1.8rem;
    font-weight: 700;
    opacity: 0.8;
}

.display-timer {
    position: relative;
    width: 100px;
    height: 100px;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 6;
}

.timer-circle {
    fill: none;
    stroke: var(--color-secondary);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.1s linear;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.4rem;
    font-weight: 800;
}

/* Timer bar (display - linear, under question) */
.display-timer-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
}

.display-timer-bar-fill {
    height: 100%;
    background: var(--color-secondary);
    border-radius: 4px;
    transition: width 0.1s linear;
    width: 100%;
}

.display-question-text {
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.3;
    flex-shrink: 0;
}

.display-question-image {
    text-align: center;
    margin-bottom: 20px;
}

.display-question-image img {
    max-height: 200px;
    border-radius: var(--radius);
}

.display-answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
    max-height: 440px;
}

.display-answer {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px 40px;
    border-radius: var(--radius-lg);
    font-size: 2.4rem;
    font-weight: 700;
    transition: opacity 0.3s, transform 0.3s;
}

.display-answer-1 { background: var(--color-answer-1); }
.display-answer-2 { background: var(--color-answer-2); }
.display-answer-3 { background: var(--color-answer-3); }
.display-answer-4 { background: var(--color-answer-4); }

.display-answer.dimmed {
    opacity: 0.3;
}

.display-answer.correct {
    box-shadow: 0 0 0 4px var(--color-text-white), 0 0 20px rgba(255, 255, 255, 0.3);
    transform: scale(1.03);
}

.display-answer-letter {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.display-answer-text {
    flex: 1;
}

.display-answer-pct {
    margin-left: auto;
    font-size: 2.6rem;
    font-weight: 900;
    opacity: 0;
    transition: opacity 0.4s;
}

.display-answer-pct:not(:empty) {
    opacity: 1;
}

.display-vote-bubble {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--color-text-white);
    border-radius: var(--radius-xl);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.8rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
}

.display-vote-bubble.vote-bubble-active {
    opacity: 1;
    transform: translateY(0);
}

.vote-bubble-count {
    font-size: 2.5rem;
    font-weight: 900;
}

.vote-bubble-label {
    opacity: 0.8;
}

/* Results screen */
#display-results {
    align-items: center;
    justify-content: center;
}

.display-results-header h2 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 40px;
    text-align: center;
}

.display-results-bars {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-bar-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.result-bar-shape {
    flex-shrink: 0;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-bar-letter {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.result-bar-container {
    flex: 1;
    height: 84px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.result-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding: 0 16px;
    transition: width 0.8s ease;
    min-width: fit-content;
}

.result-bar-fill-1 { background: var(--color-answer-1); }
.result-bar-fill-2 { background: var(--color-answer-2); }
.result-bar-fill-3 { background: var(--color-answer-3); }
.result-bar-fill-4 { background: var(--color-answer-4); }

.result-bar-text {
    font-size: 1.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.result-bar-pct {
    font-size: 2.2rem;
    font-weight: 800;
    flex-shrink: 0;
    width: 80px;
    text-align: right;
}

.result-bar-correct {
    font-size: 2.2rem;
    flex-shrink: 0;
    width: 56px;
    text-align: center;
}

/* Leaderboard screen */
#display-leaderboard {
    align-items: center;
    justify-content: center;
}

.display-leaderboard-header h2 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 40px;
    text-align: center;
}

.display-leaderboard-list {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 28px 40px;
    animation: slideInRight 0.4s ease;
}

.leaderboard-row:nth-child(1) { animation-delay: 0.0s; }
.leaderboard-row:nth-child(2) { animation-delay: 0.1s; }
.leaderboard-row:nth-child(3) { animation-delay: 0.2s; }
.leaderboard-row:nth-child(4) { animation-delay: 0.3s; }
.leaderboard-row:nth-child(5) { animation-delay: 0.4s; }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

.leaderboard-rank {
    font-size: 3rem;
    font-weight: 900;
    width: 70px;
    text-align: center;
    flex-shrink: 0;
}

.leaderboard-row:nth-child(1) .leaderboard-rank { color: #FFD700; }
.leaderboard-row:nth-child(2) .leaderboard-rank { color: #C0C0C0; }
.leaderboard-row:nth-child(3) .leaderboard-rank { color: #CD7F32; }

.leaderboard-name {
    flex: 1;
    font-size: 2.6rem;
    font-weight: 700;
}

.leaderboard-score {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--color-secondary);
}

/* Podium screen */
#display-podium {
    align-items: center;
    justify-content: center;
}

.display-podium-header h2 {
    font-size: 4.5rem;
    font-weight: 900;
    margin-bottom: 60px;
    text-align: center;
}

.display-podium-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 800px;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: podiumRise 0.6s ease;
}

.podium-place:nth-child(1) { animation-delay: 0.2s; }
.podium-place:nth-child(2) { animation-delay: 0.0s; }
.podium-place:nth-child(3) { animation-delay: 0.4s; }

@keyframes podiumRise {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.podium-name {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.podium-score {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    opacity: 0.8;
}

.podium-bar {
    width: 220px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 24px;
    font-size: 4rem;
    font-weight: 900;
}

.podium-bar-1 {
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 100%);
    height: 280px;
    color: #92400E;
}

.podium-bar-2 {
    background: linear-gradient(180deg, #E8E8E8 0%, #C0C0C0 100%);
    height: 210px;
    color: #475569;
}

.podium-bar-3 {
    background: linear-gradient(180deg, #DCA06D 0%, #CD7F32 100%);
    height: 150px;
    color: #78350F;
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    width: 12px;
    height: 12px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% { opacity: 1; transform: translateY(0) rotate(0deg); }
    100% { opacity: 0; transform: translateY(100vh) rotate(720deg); }
}

/*------------------------------------*\
    Animations
\*------------------------------------*/

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.player-answer-btn {
    animation: fadeInUp 0.3s ease both;
}

.player-answer-btn:nth-child(1) { animation-delay: 0.05s; }
.player-answer-btn:nth-child(2) { animation-delay: 0.1s; }
.player-answer-btn:nth-child(3) { animation-delay: 0.15s; }
.player-answer-btn:nth-child(4) { animation-delay: 0.2s; }

/*------------------------------------*\
    Responsive
\*------------------------------------*/

@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    .main-content {
        padding-top: 16px;
    }

    /* Header compact on mobile */
    .header .container {
        height: auto;
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 4px;
    }

    .header-title {
        font-size: 0.95rem;
    }

    .header-actions .btn {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* Page header stacks on mobile */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 16px;
    }

    .page-header h2 {
        font-size: 1.2rem;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1;
        text-align: center;
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .answers-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .form-group-small {
        flex: 1;
    }

    .quiz-cards {
        grid-template-columns: 1fr;
    }

    /* Game control mobile */
    .game-info-card {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .game-pin-code {
        font-size: 1.6rem;
    }

    .game-info-stats {
        width: 100%;
        justify-content: space-around;
        gap: 16px;
    }

    .game-control-actions {
        flex-direction: column;
        gap: 8px;
    }

    .game-control-actions .btn {
        width: 100%;
    }

    .game-control-secondary {
        justify-content: space-between;
    }

    .game-control-secondary .btn {
        flex: 1;
        text-align: center;
    }

    .gc-bottom-grid {
        margin-top: 16px;
    }

    /* Session cards stack on mobile */
    .session-cards {
        flex-direction: column;
    }

    .session-card {
        width: 100%;
    }
}
