/**
 * NoChips - Apple-inspired Dark Mode Mobile-First Design
 * Clean, minimal, elegant
 */

/* ===== FONTS ===== */
@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/Inter/Inter-VariableFont_opsz,wght.ttf') format('truetype-variations'),
        url('/assets/fonts/Inter/Inter-VariableFont_opsz,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/Inter/Inter-Italic-VariableFont_opsz,wght.ttf') format('truetype-variations'),
        url('/assets/fonts/Inter/Inter-Italic-VariableFont_opsz,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

/* ===== CSS VARIABLES ===== */
:root {
    /* Apple-inspired dark colors */
    --bg-primary: #151515;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --bg-elevated: #3a3a3c;
    --bg-grouped: #1c1c1e;

    /* System colors */
    --accent-green: #3fba60;
    --accent-blue: #0a84ff;
    --accent-red: #ff453a;
    --accent-orange: #ff9f0a;
    --accent-yellow: #ffd60a;
    --accent-purple: #bf5af2;
    --accent-teal: #64d2ff;

    /* Text colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(235, 235, 245, 0.6);
    --text-tertiary: rgba(235, 235, 245, 0.3);

    /* Separators */
    --separator: rgba(84, 84, 88, 0.65);
    --separator-opaque: #38383a;

    /* Fill colors */
    --fill-primary: rgba(120, 120, 128, 0.36);
    --fill-secondary: rgba(120, 120, 128, 0.32);
    --fill-tertiary: rgba(118, 118, 128, 0.24);

    /* Spacing - Apple HIG */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 20px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 44px;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-full: 50%;

    /* Typography - SF Pro inspired */
    --font-system: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    --font-rounded: -apple-system, BlinkMacSystemFont, 'SF Pro Rounded', 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-spring: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Safe areas */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-system);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.47;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

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

ul {
    list-style: none;
}

/* ===== LAYOUT ===== */
.app {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    overflow-y: auto;
    overflow-x: hidden;
}

main {
    flex: 1;
}

/* ===== NAVIGATION ===== */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: rgba(28, 28, 30, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 0.5px solid var(--separator);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    font-size: 17px;
    color: var(--text-primary);
}

.brand-icon {
    font-size: 24px;
    color: var(--accent-green);
    content: url("/assets/logo/logo.svg");
    width: 20px;
    height: 20px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-links {
    display: flex;
    gap: var(--space-md);
}

.nav-link {
    font-size: 15px;
    color: var(--accent-blue);
}

.nav-info-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fill-tertiary);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.nav-info-btn:hover {
    background: var(--fill-secondary);
    color: var(--text-primary);
}

.nav-info-btn:active {
    transform: scale(0.95);
}

/* ===== FOOTER ===== */
.footer {
    padding: var(--space-lg) var(--space-md);
    background: var(--bg-secondary);
    border-top: 0.5px solid var(--separator);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-tertiary);
}

.lang-switch {
    display: flex;
    gap: var(--space-xs);
}

.lang-switch a {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--fill-tertiary);
}

.lang-switch a.active {
    color: var(--text-primary);
    background: var(--fill-primary);
}

/* ===== HOME PAGE ===== */
.home-container {
    text-align: center;
}

.home-header {
    margin-bottom: var(--space-2xl);
}

.home-header h1 {
    font-size: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.home-header h1::before {
    content: url("/assets/logo/logo.svg");
    color: var(--accent-green);
    width: 30px;
    height: 30px;
}

.home-tagline {
    font-size: 17px;
    color: var(--accent-yellow);
    font-weight: 500;
    margin-top: var(--space-sm);
}

.home-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.home-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: var(--text-tertiary);
    font-size: 13px;
}

.home-divider::before,
.home-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--separator);
}

.home-desc {
    margin-top: var(--space-2xl);
    color: var(--text-tertiary);
    font-size: 15px;
    line-height: 1.5;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
}

/* ===== FORMS ===== */
.form-page {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--space-lg);
    padding-top: var(--space-xl);
}

.form-container {
    width: 100%;
    max-width: 400px;
}

.form-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.form-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.game-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding-left: var(--space-md);
}

.form-group input,
.form-group select {
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 17px;
    font-family: inherit;
    transition: background var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    background: var(--bg-elevated);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

.input-code {
    font-family: var(--font-mono);
    font-size: 24px !important;
    text-align: center;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.form-row {
    display: grid;
    gap: var(--space-md);
}

.form-row-2 {
    grid-template-columns: 1fr 1fr;
}

/* Emoji Picker */
.emoji-picker {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.emoji-btn {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.emoji-btn:hover {
    background: var(--fill-tertiary);
}

.emoji-btn.selected {
    background: var(--fill-secondary);
    border-color: var(--accent-green);
}

/* Checkbox */
.form-checkbox {
    flex-direction: row;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 17px;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid var(--text-tertiary);
    border-radius: var(--radius-sm);
    background: transparent;
    position: relative;
    transition: all var(--transition-fast);
}

.checkbox-label input:checked+.checkmark {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.checkbox-label input:checked+.checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--bg-primary);
    font-size: 14px;
    font-weight: 700;
}

.levels-options {
    display: none;
    padding: var(--space-md);
    background: var(--bg-grouped);
    border-radius: var(--radius-md);
}

.form-footer {
    margin-top: var(--space-lg);
    text-align: center;
}

.link-back {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--fill-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-appearance: none;
}

.btn:active {
    transform: scale(0.98);
    opacity: 0.8;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    color: var(--bg-primary);
    background: var(--accent-green);
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 17px;
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: 15px;
    border-radius: var(--radius-sm);
}

/* Loading state */
.game-form.loading .btn-text {
    display: none;
}

.game-form:not(.loading) .btn-loading {
    display: none;
}

.game-form.loading button {
    opacity: 0.6;
    pointer-events: none;
}

/* ===== FLASH MESSAGES ===== */
.flash {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-size: 15px;
}

.flash-error {
    background: rgba(255, 69, 58, 0.2);
    color: var(--accent-red);
}

.flash-success {
    background: rgba(48, 209, 88, 0.2);
    color: var(--accent-green);
}

/* ===== SESSION HEADER ===== */
.session-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: rgba(28, 28, 30, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 0.5px solid var(--separator);
    position: sticky;
    top: 0;
    z-index: 100;
}

.session-brand .brand-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
    font-weight: 600;
}

.session-code-display {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.code-value {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

.btn-copy {
    padding: var(--space-xs);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
}

.session-controls {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.inline-form {
    display: inline;
}

/* Header buttons - unified style */
.btn-logs,
.btn-pause,
.btn-end,
.btn-leave {
    padding: var(--space-xs) var(--space-sm);
    background: var(--fill-tertiary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-logs {
    color: var(--accent-blue);
}

.btn-pause {
    color: var(--accent-yellow);
}

.btn-end {
    color: var(--accent-red);
}

.btn-leave {
    color: var(--accent-orange);
}

.btn-logs:hover,
.btn-pause:hover,
.btn-end:hover,
.btn-leave:hover {
    opacity: 0.8;
}

.btn-logs:active,
.btn-pause:active,
.btn-end:active,
.btn-leave:active {
    transform: scale(0.95);
}

/* ===== WAITING ROOM ===== */
.waiting-room {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.waiting-header {
    padding: var(--space-xl) 0;
}

.waiting-header h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.share-hint {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: var(--space-md);
}

.share-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.share-code-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-yellow);
    letter-spacing: 0.05em;
    animation: blink-gold 1.5s ease-in-out infinite;
}

.waiting-actions {
    padding: var(--space-lg);
}

.waiting-actions .hint {
    margin-top: var(--space-md);
    font-size: 13px;
    color: var(--text-tertiary);
}

.waiting-hint {
    padding: var(--space-lg);
    color: var(--text-secondary);
    font-size: 15px;
}

/* Players List (Waiting Room) */
.players-list {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    text-align: left;
}

.players-list h3 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: var(--space-md);
    padding: 0 var(--space-sm);
}

.player-count {
    color: var(--text-tertiary);
}

.player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-radius: var(--radius-md);
}

.player-item.is-you {
    background: rgba(48, 209, 88, 0.1);
}

.player-name {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 500;
}

.badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.badge-you {
    background: var(--accent-green);
    color: var(--bg-primary);
}

.badge-host {
    background: var(--accent-yellow);
    color: var(--bg-primary);
}

.player-stack {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-green);
}

/* ===== GAME VIEW - NEW LAYOUT ===== */
.game-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px);
    min-height: calc(100dvh - 60px);
    padding: 0;
}

.game-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: opacity 0.15s ease;
}

/* Smooth state transitions - reduce iOS flash */
#gameState,
#waitingContent,
#historyBody,
#actionPanel {
    transition: opacity 0.12s ease-out;
    will-change: opacity;
}

/* Fade class for DOM updates */
.state-updating {
    opacity: 0.7;
}

/* Prevent layout shift during updates */
.game-container,
.waiting-room {
    contain: layout style;
}

/* Stable height containers to prevent jank */
.players-grid {
    min-height: 120px;
}

.game-center {
    min-height: 150px;
}

.action-panel {
    min-height: 50px;
}

/* Players Grid - Top of Screen */
.players-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.player-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm);
    position: relative;
    transition: all var(--transition-fast);
}

.player-avatar.is-turn {
    background: rgba(255, 214, 10, 0.15);
    border-radius: var(--radius-md);
}

.player-avatar.is-folded {
    opacity: 0.35;
}

.player-avatar.is-me .avatar-emoji {
    box-shadow: 0 0 0 2px var(--accent-green);
}

.host-badge {
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 6px;
    font-weight: 600;
    color: var(--accent-yellow);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: #1e1e20;
    padding: 2px 4px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
}

.avatar-emoji {
    font-size: 36px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    position: relative;
}

.position-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    border-radius: var(--radius-full);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.position-badge.dealer {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.position-badge.sb {
    background: var(--accent-blue);
    color: var(--text-primary);
}

.position-badge.bb {
    background: var(--accent-yellow);
    color: var(--bg-primary);
}

.avatar-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.avatar-stack {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-green);
}

.avatar-bet {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-orange);
}

/* Center Area - Pot Display */
.game-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.blinds-round {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.blinds-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.blinds-info .value {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.round-info {
    font-size: 13px;
    color: var(--text-tertiary);
}

.round-info .betting-round {
    color: var(--accent-blue);
    font-weight: 500;
}

.countdown {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-orange);
}

.pot-display {
    text-align: center;
}

.pot-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pot-value {
    font-family: var(--font-mono);
    font-size: 48px;
    font-weight: 700;
    color: var(--accent-green);
    letter-spacing: -0.02em;
    gap: var(--space-xs);
}

/* ===== ACTION PANEL - Fixed Bottom ===== */
.action-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(28, 28, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid var(--separator);
    padding: var(--space-md);
    padding-bottom: calc(var(--space-md) + var(--safe-bottom));
    z-index: 50;
}

.action-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.your-turn-badge {
    padding: 0;
    background: transparent;
    color: var(--accent-yellow);
    border-radius: 0;
    font-weight: 700;
    font-size: 15px;
    animation: blink-gold 1.5s ease-in-out infinite;
}

@keyframes blink-gold {

    0%,
    100% {
        color: var(--accent-yellow);
        opacity: 1;
    }

    50% {
        color: #ffd700;
        opacity: 0.7;
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(255, 214, 10, 0.3);
    }

    50% {
        box-shadow: 0 0 25px rgba(255, 214, 10, 0.6);
    }
}

.action-stats {
    display: flex;
    gap: var(--space-lg);
    font-size: 15px;
    color: var(--text-secondary);
}

.action-stats strong {
    color: var(--accent-green);
    font-family: var(--font-mono);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.action-buttons.is-allin {
    grid-template-columns: 1fr 2fr;
}

.action-form {
    display: contents;
}

.action-form.call-full {
    grid-column: span 2;
}

.btn-action {
    padding: var(--space-md);
    padding-right: 3px;
    padding-left: 3px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
}

.btn-fold {
    color: var(--accent-red);
}

.btn-fold:active {
    background: var(--accent-red);
    color: var(--text-primary);
}

.btn-check {
    color: var(--accent-blue);
}

.btn-check:active {
    background: var(--accent-blue);
    color: var(--text-primary);
}

.btn-call {
    color: var(--accent-blue);
}

.btn-raise {
    color: var(--accent-green);
}

/* Raise Modal */
.raise-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

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

.raise-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.raise-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-xl);
    padding-bottom: calc(var(--space-xl) + var(--safe-bottom));
}

.raise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.raise-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.raise-close {
    background: var(--fill-tertiary);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
}

.raise-controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.raise-controls input[type="range"] {
    width: 100%;
    height: 36px;
    background: transparent;
    -webkit-appearance: none;
}

.raise-controls input[type="range"]::-webkit-slider-track {
    height: 8px;
    background: var(--fill-tertiary);
    border-radius: 4px;
}

.raise-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    background: var(--accent-green);
    border-radius: var(--radius-full);
    cursor: pointer;
    margin-top: -10px;
}

.raise-amount-display {
    text-align: center;
}

.raise-amount-value {
    font-family: var(--font-mono);
    font-size: 36px;
    font-weight: 700;
    color: var(--accent-green);
}

.raise-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.raise-presets .btn {
    padding: var(--space-md);
    background: var(--fill-tertiary);
    font-size: 15px;
}

.raise-presets .btn-allin {
    background: var(--accent-red);
    color: var(--text-primary);
}

.raise-submit {
    margin-top: var(--space-md);
}

/* Waiting/Folded Notice */
.waiting-notice,
.folded-notice {
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
}

.folded-notice {
    color: var(--accent-red);
    font-weight: 500;
}

/* ===== HISTORY MODAL ===== */
.history-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

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

.history-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.history-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 70vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 0.5px solid var(--separator);
}

.history-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.history-close {
    background: var(--fill-tertiary);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
}

.history-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    padding-bottom: calc(var(--space-md) + var(--safe-bottom));
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.history-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-sm);
    font-size: 14px;
    border-radius: var(--radius-sm);
}

.history-time {
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    font-size: 12px;
    flex-shrink: 0;
}

.history-text {
    color: var(--text-secondary);
}

.history-item.action-fold .history-text {
    color: var(--accent-red);
}

.history-item.action-bet .history-text,
.history-item.action-raise .history-text {
    color: var(--accent-green);
}

.history-item.action-call .history-text {
    color: var(--accent-blue);
}

.history-item.action-win_pot .history-text {
    color: var(--accent-yellow);
    font-weight: 600;
}

.history-empty {
    text-align: center;
    color: var(--text-tertiary);
    padding: var(--space-xl);
}

/* Hidden game history for non-modal display */
.game-history {
    display: none;
}

/* ===== SHOWDOWN AWARD ===== */
.showdown-award {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(28, 28, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid var(--separator);
    padding: var(--space-md);
    padding-bottom: calc(var(--space-md) + var(--safe-bottom));
    z-index: 50;
    text-align: center;
    margin: 0;
    border-radius: 0;
}

.showdown-award h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--accent-yellow);
}

.award-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.award-form select {
    padding: var(--space-md);
    background: var(--bg-elevated);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 17px;
}

/* Side Pots Display */
.side-pots-info {
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    max-height: 120px;
    overflow-y: auto;
}

.pot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--separator);
}

.pot-item:last-child {
    border-bottom: none;
}

.pot-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.pot-amount {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 17px;
    color: var(--accent-green);
}

.pot-eligible {
    display: flex;
    gap: var(--space-xs);
}

.eligible-player {
    font-size: 20px;
}

/* Winner Selection Checkboxes */
.winner-selection {
    text-align: left;
}

.winner-selection>label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
}

.winner-checkboxes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.winner-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-xs);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
    text-align: center;
    position: relative;
    min-height: 70px;
    width: 100%;
}

.winner-option:has(input:checked) {
    border-color: var(--accent-green);
    background: rgba(48, 209, 88, 0.15);
}

.winner-option input[type="checkbox"] {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent-green);
    cursor: pointer;
}

.winner-emoji {
    font-size: 24px;
    margin-top: 4px;
}

.winner-name {
    font-size: 11px;
    font-weight: 500;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.award-actions {
    margin-top: var(--space-md);
}

.award-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: var(--space-sm);
}

/* ===== GAME OVER ===== */
.game-over {
    text-align: center;
    padding: var(--space-3xl);
}

.game-over h1 {
    font-size: 28px;
    margin-bottom: var(--space-lg);
}

.winner-announce {
    font-size: 22px;
    color: var(--accent-yellow);
    margin-bottom: var(--space-xl);
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 320px;
    width: 90%;
    text-align: center;
}

.modal-content p {
    font-size: 17px;
    margin-bottom: var(--space-xl);
}

.modal-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.modal-actions .btn {
    flex: 1;
}

/* ===== INFO MODAL ===== */
.info-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
}

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

.info-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.info-modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    max-width: 400px;
    width: 90%;
    overflow: hidden;
}

.info-modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fill-tertiary);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
    margin-bottom: 13px;
}

.info-modal-close:hover {
    background: var(--fill-secondary);
    color: var(--text-primary);
}

.info-modal-body {
    padding: var(--space-xl);
    padding-top: calc(var(--space-xl) + 10px);
}

.info-modal-body p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.info-modal-body p:last-of-type:not(.info-modal-footer) {
    margin-bottom: 0;
}

.info-modal-footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 0.5px solid var(--separator);
    font-size: 13px;
    color: var(--text-tertiary);
}

.info-modal-footer a {
    color: var(--accent-blue);
    text-decoration: underline;
}

/* ===== PAUSED STATE ===== */
.paused-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--accent-orange);
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 15px;
}

.game-container.is-paused {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 480px) {
    .brand-name {
        display: inline;
    }

    .players-grid {
        gap: var(--space-md);
        padding: var(--space-lg);
    }

    .avatar-emoji {
        font-size: 44px;
        width: 68px;
        height: 68px;
    }

    .pot-value {
        font-size: 64px;
    }
}

@media (min-width: 768px) {
    .players-grid {
        max-width: 600px;
        margin: 0 auto;
    }

    .game-center {
        padding: var(--space-3xl);
    }

    .action-panel,
    .showdown-award {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }
}

/* ===== RESPONSIVE SESSION HEADER ===== */
@media (max-width: 480px) {
    .session-header {
        gap: var(--space-xs);
        padding: var(--space-xs) var(--space-sm);
    }

    .session-brand .brand-icon {
        font-size: 18px;
    }

    .session-code-display {
        gap: var(--space-xs);
    }

    .code-value {
        font-size: 12px;
    }

    .session-controls {
        gap: 2px;
    }

    .session-controls .btn {
        font-size: 11px;
        padding: var(--space-xs) var(--space-sm);
        white-space: nowrap;
    }
}

/* ===== UTILITIES ===== */
.error {
    color: var(--accent-red);
    text-align: center;
    padding: var(--space-lg);
}

/* Hide number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--fill-tertiary);
    border-radius: 3px;
}

/* Hidden indicator for JS */
#showdownIndicator {
    display: none;
}

/* Card float animations (hero) */
.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.card-float {
    position: absolute;
    font-size: 80px;
    opacity: 0.05;
}

.card-1 {
    top: 10%;
    left: 10%;
}

.card-2 {
    top: 20%;
    right: 15%;
}

.card-3 {
    bottom: 20%;
    left: 20%;
}

.card-4 {
    bottom: 10%;
    right: 10%;
}