/* ============================================
   Shared game-page components

   These were previously copy-pasted with small variations into every
   public game page. Class names are kept as they were so markup did not
   have to change; only the values are now token-driven.

   Loaded after styles.css and shell.css.
   ============================================ */

/* --- Kick sign-in card --- */

.auth-section {
    padding: var(--space-7) var(--space-6);
    text-align: center;
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
}

.auth-section h2 {
    font-size: var(--fs-lg);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.auth-section p {
    color: var(--text-muted);
    margin-bottom: var(--space-5);
}

.signin-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
}

/* Kick green is reserved for this button only. */
.kick-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-width: 220px;
    padding: 13px var(--space-6);
    border: none;
    border-radius: var(--radius);
    background: #53fc18;
    color: #000;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: filter var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.kick-btn:hover { filter: brightness(1.08); }
.kick-btn:active { transform: scale(0.985); }

@media (max-width: 600px) {
    .auth-section { padding: var(--space-6) var(--space-4); }
    .kick-btn { width: 100%; min-width: 0; padding: var(--space-4) var(--space-5); }
}

/* --- Informational callout --- */

.info-box {
    padding: var(--space-4) var(--space-5);
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: var(--fs-base);
    line-height: var(--lh);
}

.info-box h3 {
    font-size: var(--fs-sm);
    font-weight: 700;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: var(--space-3);
}

.info-box strong { color: var(--text-primary); }

.info-box ul {
    margin: 0;
    padding-left: var(--space-5);
    line-height: 1.9;
}

/* --- Form fields --- */

.form-field { margin-bottom: var(--space-5); }

.form-field label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-muted);
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 12px var(--space-4);
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--fs-md);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--accent-border-strong);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-field select option { background: var(--bg-elevated); color: var(--text-primary); }

.form-field .field-hint {
    margin-top: var(--space-2);
    font-size: var(--fs-sm);
    color: var(--text-faint);
}

/* --- Primary submit --- */

.submit-btn {
    width: 100%;
    padding: 13px var(--space-5);
    border: 1px solid var(--accent-border-strong);
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-contrast);
    font-family: var(--font-sans);
    font-size: var(--fs-md);
    font-weight: 700;
    cursor: pointer;
    transition: background var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.submit-btn:hover:not(:disabled) { background: var(--accent-hover); }

.submit-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* --- Inline result messages --- */

.success-message,
.predict-error-message {
    display: none;
    margin-top: var(--space-4);
    padding: 12px var(--space-4);
    border-radius: var(--radius);
    text-align: center;
    font-size: var(--fs-base);
    font-weight: 500;
}

.success-message {
    background: rgba(52, 211, 153, 0.07);
    border: 1px solid rgba(52, 211, 153, 0.24);
    color: var(--success);
}

.predict-error-message {
    background: rgba(248, 113, 113, 0.07);
    border: 1px solid rgba(248, 113, 113, 0.26);
    color: var(--danger);
}

/* --- Neutral state cards (no game, round locked, submitted) --- */

.state-card {
    padding: var(--space-7) var(--space-6);
    text-align: center;
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
}

.state-card h2 {
    font-size: var(--fs-lg);
    margin-bottom: var(--space-2);
}

.state-card p {
    color: var(--text-muted);
    max-width: 52ch;
    margin: 0 auto;
}

.state-card.is-success { border-color: rgba(52, 211, 153, 0.22); }
.state-card.is-success h2 { color: var(--success); }

.locked-message,
.thank-you-box {
    padding: var(--space-7) var(--space-6);
    text-align: center;
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
}

.thank-you-box { border-color: rgba(52, 211, 153, 0.22); }

.locked-message h2,
.thank-you-box h2 {
    font-size: var(--fs-lg);
    margin-bottom: var(--space-2);
}

.locked-message p,
.thank-you-box p { color: var(--text-muted); }

/* --- Status badges --- */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-sm);
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
}

.status-badge.alive { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.26); color: var(--success); }
.status-badge.eliminated { background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.26); color: var(--danger); }
.status-badge.spectator { background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.26); color: var(--warning); }

/* --- Player chips --- */

.player-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 3px;
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
}

.player-chip.alive { background: rgba(52, 211, 153, 0.07); border-color: rgba(52, 211, 153, 0.22); color: var(--success); }

.player-chip.eliminated {
    background: var(--surface-sunken);
    border-color: var(--border-subtle);
    color: var(--text-faint);
    text-decoration: line-through;
}

.player-chip.you { border-color: var(--accent-border-strong); color: var(--accent); }

/* --- Recent winners log --- */

.recent-winners-log,
.lms-recent-winners { margin-top: var(--space-7); }

.recent-winners-list,
.lms-recent-winners-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-height: 320px;
    overflow-y: auto;
}

.recent-winner-row,
.lms-recent-winner-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    padding: 11px var(--space-4);
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    font-size: var(--fs-base);
}

.recent-winner-row .event-label,
.lms-recent-winner-row .event-label {
    color: var(--text-muted);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-winner-row .winner-name,
.lms-recent-winner-row .winner-name {
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

.recent-winner-row .winner-score,
.lms-recent-winner-row .winner-score {
    font-family: var(--font-mono);
    color: var(--text-faint);
    font-weight: 400;
}

/* --- Misc shared bits --- */

.user-name {
    color: var(--text-primary);
    font-weight: 600;
}

/* Legacy hook: admin links are rendered by the sidebar now. */
#adminNavSection { display: none; }
