/* Luxurious Minimalist Theme */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Space+Grotesk:wght@300;400;500;600;700&family=DM+Sans:wght@400;500;700&family=Playfair+Display:wght@700;800;900&family=Noto+Sans+Symbols+2&display=swap');

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

body {
    font-family: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #000;
    position: relative;
}

/* Luxury Background Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(217, 119, 6, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 0% 50%, rgba(217, 119, 6, 0.02) 0%, transparent 50%),
                radial-gradient(circle at 100% 50%, rgba(217, 119, 6, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 100px 100px;
    pointer-events: none;
    z-index: 0;
}

#landing-screen, #lobby-screen, #game-screen {
    position: relative;
    z-index: 1;
}

/* Smooth transitions */
.screen-transition {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Luxury button with shimmer effect */
.luxury-button {
    position: relative;
    overflow: hidden;
}

.luxury-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.luxury-button:hover::before {
    left: 100%;
}

/* Player list items */
.player-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(39, 39, 42, 0.5);
    border: 1px solid rgba(63, 63, 70, 0.3);
    transition: all 0.3s ease;
}

.player-item:hover {
    background: rgba(39, 39, 42, 0.8);
    border-color: rgba(217, 119, 6, 0.3);
}

.player-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid rgba(217, 119, 6, 0.3);
    color: #d97706;
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 2px;
}

/* Status indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: #d97706;
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.5);
}

.status-dot.offline {
    background: #52525b;
}

/* Chat messages */
.chat-message {
    padding: 12px 16px;
    background: rgba(39, 39, 42, 0.3);
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.chat-message:hover {
    background: rgba(39, 39, 42, 0.5);
    border-left-color: rgba(217, 119, 6, 0.5);
}

.chat-message.system {
    background: rgba(217, 119, 6, 0.05);
    border-left-color: #d97706;
    color: #d97706;
    font-style: normal;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.chat-message .timestamp {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.7rem;
    color: #71717a;
    font-weight: 400;
    margin-right: 8px;
    letter-spacing: 0.5px;
}

.chat-message .sender {
    font-weight: 400;
    color: #d97706;
    margin-right: 8px;
    letter-spacing: 0.5px;
}

.chat-message .text {
    color: #d4d4d8;
    font-weight: 300;
}

/* Game cards */
.game-card {
    background: linear-gradient(135deg, rgba(39, 39, 42, 0.8) 0%, rgba(24, 24, 27, 0.8) 100%);
    border: 1px solid rgba(63, 63, 70, 0.5);
    padding: 32px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d97706, transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.game-card:hover::before {
    transform: translateX(100%);
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: rgba(217, 119, 6, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.game-card h4 {
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.game-card p {
    font-weight: 300;
    color: #a1a1aa;
}

/* Tic-Tac-Toe Board */
#tictactoe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    max-width: 400px;
    margin: 0 auto;
    background: rgba(217, 119, 6, 0.1);
    padding: 2px;
}

.tictactoe-cell {
    aspect-ratio: 1;
    background: #000;
    border: 1px solid rgba(63, 63, 70, 0.3);
    font-size: 3rem;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.tictactoe-cell::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(217, 119, 6, 0.05);
    opacity: 0;
    transition: opacity 0.2s;
}

.tictactoe-cell:hover:not(.filled)::before {
    opacity: 1;
}

.tictactoe-cell.filled {
    cursor: not-allowed;
}

.tictactoe-cell.x {
    color: #d97706;
}

.tictactoe-cell.o {
    color: #71717a;
}

/* Drawing canvas */
#drawing-canvas {
    border: 1px solid rgba(63, 63, 70, 0.5);
    cursor: crosshair;
    background: white;
}

.color-picker {
    width: 40px;
    height: 40px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.color-picker:hover,
.color-picker.active {
    border-color: #d97706;
    transform: scale(1.1);
}

/* Trivia */
.trivia-answer {
    padding: 20px;
    background: rgba(39, 39, 42, 0.5);
    border: 1px solid rgba(63, 63, 70, 0.3);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.trivia-answer::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #d97706;
    transform: scaleY(0);
    transition: transform 0.3s;
}

.trivia-answer:hover::before {
    transform: scaleY(1);
}

.trivia-answer:hover {
    background: rgba(39, 39, 42, 0.8);
    border-color: rgba(217, 119, 6, 0.3);
    transform: translateX(4px);
}

.trivia-answer.selected {
    background: rgba(217, 119, 6, 0.1);
    border-color: #d97706;
}

.trivia-answer.correct {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
}

.trivia-answer.incorrect {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(217, 119, 6, 0.2);
    border-top: 3px solid #d97706;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

::-webkit-scrollbar-track {
    background: rgba(24, 24, 27, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(217, 119, 6, 0.3);
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(217, 119, 6, 0.5);
}

/* Error message */
#error-message {
    font-weight: 300;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #tictactoe-board {
        max-width: 300px;
    }

    .tictactoe-cell {
        font-size: 2rem;
    }

    .game-card {
        padding: 24px;
    }
}

/* Luxury divider */
.luxury-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(217, 119, 6, 0.3), transparent);
}

/* Room code display */
#room-code-display {
    font-family: 'Space Grotesk', monospace;
    letter-spacing: 6px;
    font-weight: 500;
}

/* Typography System - Luxurious & Playful Mix */

/* Main headings - Luxurious (Syne) */
h1, h2, .luxury-heading {
    font-family: 'Syne', sans-serif;
}

/* Subheadings and labels - Technical & Clean (Space Grotesk) */
h3, h4, h5, h6,
.game-card h4,
.luxury-button,
input::placeholder,
button {
    font-family: 'Space Grotesk', sans-serif;
}

/* Body text - Readable & Modern (DM Sans) */
p,
.chat-message,
.trivia-answer,
.player-item {
    font-family: 'DM Sans', sans-serif;
}

/* Game titles - Extra playful */
.game-card h4 {
    font-weight: 600;
    font-size: 1rem;
}

/* Input fields - Refined */
input {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
}

/* Buttons - Bold & Confident */
button {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
}

/* Chat sender names - Pop of personality */
.chat-message .sender {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
}

/* Player badges - Premium feel */
.player-badge {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
}

/* Main logo - Formal and elegant */
h1 {
    position: relative;
    display: inline-block;
    font-family: 'Playfair Display', serif;
}

/* Game screen title - Elegant */
#game-title {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Playful number and counter styling */
#player-count,
#question-number,
#timer-display,
#question-timer {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Status messages - Friendly yet refined */
#game-status,
#word-display,
#question-result {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
}

/* Input focus states - Premium interaction */
input:focus {
    font-weight: 500;
}

/* Button hover state enhancement */
button:hover {
    letter-spacing: 0.12em;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Tic-tac-toe X and O - Playful yet elegant */
.tictactoe-cell {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
}

/* Scores and points - Bold impact */
.trivia-answer,
#trivia-scores {
    font-family: 'DM Sans', sans-serif;
}

/* Small caps for labels - Luxury detail */
h3 {
    font-variant: small-caps;
    font-weight: 400;
}

/* Resizable chat messages box */
#chat-messages {
    resize: vertical;
    overflow-y: auto;
    min-height: 160px;
    max-height: 600px;
}

/* Chess pieces - consistent rendering across all devices */
.chess-piece {
    font-family: 'Noto Sans Symbols 2', 'Segoe UI Symbol', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    font-weight: 400;
    font-feature-settings: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
