:root {
    /* Apple Design Tokens - Dark Mode */
    --system-bg: #0a0a0f;
    --card-bg: rgba(30, 30, 35, 0.8);
    --accent-blue: #0A84FF;
    --accent-blue-rgb: 10, 132, 255;
    --accent-green: #30D158;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --glass-blur: blur(20px) saturate(180%);
    --radius-xl: 28px;
    --radius-lg: 16px;
    --radius-md: 10px;
    --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--system-bg);
    color: var(--text-primary);
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.screen {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}

/* Card */
.card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    padding: 48px 36px;
    width: 100%;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.title {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

.timer {
    font-size: 4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
    margin: 16px 0;
    color: var(--accent-blue);
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn.primary {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(var(--accent-blue-rgb), 0.35);
}

.btn.primary:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn:active {
    transform: scale(0.97);
}

/* User Info Bar */
.user-info-bar {
    position: fixed;
    top: 24px;
    right: 32px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(40, 40, 45, 0.85);
    padding: 8px 16px;
    border-radius: 30px;
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 500;
    font-size: 0.85rem;
    z-index: 100;
}

/* Input Styles */
input[type="text"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 16px;
    color: white;
    font-size: 1rem;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus {
    border-color: var(--accent-blue);
}

/* Game Canvas */
#game-screen .card {
    max-width: 720px;
    padding: 32px;
}

#game-canvas {
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 600px;
    height: 280px;
}

/* Seat Screen */
#seat-screen {
    justify-content: flex-start;
    padding-top: 100px;
}

.seat-map-wrapper {
    width: 100%;
    max-width: 1100px;
    padding: 32px;
    position: relative;
}

.seat-map {
    display: flex;
    justify-content: center;
    gap: 40px;
    overflow-x: auto;
    padding: 24px 0;
}

.group {
    display: grid;
    gap: 12px;
}

.seat {
    width: 58px;
    height: 58px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.seat:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.seat.taken {
    background: var(--accent-blue);
    color: white;
    cursor: not-allowed;
    border: none;
    box-shadow: 0 0 8px rgba(var(--accent-blue-rgb), 0.4);
}

.seat.my-seat {
    background: var(--accent-green);
    box-shadow: 0 0 12px rgba(48, 209, 88, 0.5);
    transform: scale(1.1);
}

.seat.deleted {
    opacity: 0.15;
    pointer-events: none;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

/* Locked State */
.locked-overlay {
    filter: blur(12px) grayscale(0.7);
    opacity: 0.5;
    pointer-events: none;
}

.lock-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px 40px;
    border-radius: var(--radius-lg);
}

/* Orientation Warning */
#orientation-warning {
    position: fixed;
    inset: 0;
    background: black;
    z-index: 10000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
}

@media (orientation: portrait) {
    #orientation-warning {
        display: flex;
    }
}

/* Seat Layout Split (좌석 + 사이드바) */
.seat-layout-split {
    display: flex;
    gap: 24px;
    width: 100%;
    max-width: 1300px;
    align-items: flex-start;
}

.seat-layout-split .seat-map-wrapper {
    flex: 1;
}

/* Online Users Sidebar */
.online-sidebar {
    width: 200px;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.online-sidebar h3 {
    font-size: 0.9rem;
    color: var(--accent-green);
    margin-bottom: 16px;
    font-weight: 600;
}

.online-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.online-user {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.online-user::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
}

/* Chat Section */
.chat-section {
    margin-top: 24px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 16px;
    max-height: 180px;
    overflow-y: auto;
}

.chat-section h4 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-msg {
    font-size: 0.8rem;
    line-height: 1.4;
}

.chat-msg .author {
    color: var(--accent-blue);
    font-weight: 600;
    margin-right: 6px;
}

.chat-input-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.chat-input-row input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 12px;
    color: white;
    font-size: 0.85rem;
    outline: none;
}

.chat-input-row button {
    padding: 10px 16px;
    background: var(--accent-blue);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
}