/* ===== CSS Variables ===== */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --success-color: #22c55e;
    --success-hover: #16a34a;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #475569;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* ===== Header ===== */
.header {
    text-align: center;
    padding: 30px 0;
    margin-bottom: 20px;
}

/* Hide header when game is active */
#gameContainer.active ~ .header,
body:has(#gameContainer.active) .header {
    display: none;
}

.header h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary-color), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* ===== Sections ===== */
.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ===== Cards ===== */
.menu-card, .lobby-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    margin: 0 auto 30px;
}

/* ===== Input Groups ===== */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-light);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

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

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-hover);
}

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

.btn-success:hover:not(:disabled) {
    background: var(--success-hover);
    transform: translateY(-2px);
}

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

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

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-large {
    padding: 18px 36px;
    font-size: 1.2rem;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

.button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ===== Games Section ===== */
.games-section {
    max-width: 800px;
    margin: 0 auto;
}

.games-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.game-card {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.game-card:not(.disabled):hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.game-card.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.game-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.game-card .game-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.game-card h4 {
    margin-bottom: 8px;
}

.game-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.player-count {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.coming-soon {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 30px;
    max-width: 400px;
    width: 100%;
    position: relative;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content h2 {
    margin-bottom: 20px;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-primary);
}

/* ===== Lobby ===== */
.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.room-code-display {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--surface-light);
    border-radius: var(--radius-sm);
}

.room-code-display > span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.code-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
}

.code-box span {
    font-size: 2.5rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    letter-spacing: 8px;
    color: var(--primary-color);
}

.share-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.players-list {
    margin-bottom: 20px;
}

.players-list h3 {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--surface-light);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.player-avatar.p1 { background: #4CAF50; }
.player-avatar.p2 { background: #2196F3; }

.player-name {
    font-weight: 600;
}

.player-badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    margin-left: 8px;
}

.player-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.player-status.ready {
    color: var(--success-color);
}

/* ===== Lobby Game Selection ===== */
.lobby-game-select {
    margin-bottom: 20px;
}

.lobby-game-select h3 {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.lobby-games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.lobby-game-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--surface-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.lobby-game-card:hover {
    border-color: var(--primary-color);
    background: var(--surface);
}

.lobby-game-card.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.lobby-game-card .game-icon {
    font-size: 1.3rem;
}

.lobby-game-card span:last-child {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== Speed Setting ===== */
.speed-setting {
    margin-bottom: 20px;
}

.speed-setting h3 {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.speed-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--surface-light);
    border-radius: var(--radius-sm);
}

.speed-label {
    font-size: 1.5rem;
}

.speed-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    outline: none;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.speed-slider::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.speed-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.speed-display {
    text-align: center;
    margin-top: 10px;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== Lobby Chat ===== */
.lobby-chat {
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.lobby-chat h3 {
    padding: 12px 15px;
    margin: 0;
    background: var(--surface-light);
    color: var(--text-secondary);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
}

.chat-messages {
    height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: var(--background);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chat-message {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    max-width: 85%;
    word-wrap: break-word;
}

.chat-message.me {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
}

.chat-message.other {
    background: var(--surface-light);
    color: var(--text-primary);
    align-self: flex-start;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 0.75rem;
    opacity: 0.8;
}

.chat-sender {
    font-weight: 600;
}

.chat-time {
    color: inherit;
    opacity: 0.7;
}

.chat-message-text {
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-input-container {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
}

.chat-input-container input {
    flex: 1;
    padding: 10px 12px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.chat-input-container input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-input-container .btn {
    padding: 10px 16px;
    white-space: nowrap;
}

.lobby-actions {
    text-align: center;
}

.hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* ===== Game Container ===== */
#gameContainer {
    text-align: center;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 5px 10px;
    background: var(--surface);
    gap: 10px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-sizing: border-box;
}

.game-header #leaveGameBtn {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 0.8rem;
}

.game-info {
    font-size: 0.9rem;
    font-weight: bold;
}

/* Offset for fixed header */
#gameContainer.active {
    padding-top: 40px;
}

.game-scores {
    display: flex;
    gap: 20px;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.score-color.p1 { background: #4CAF50; }
.score-color.p2 { background: #2196F3; }

#gameArea {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#gameArea canvas {
    border: 3px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.game-controls-info {
    color: var(--text-secondary);
}

.game-controls-info kbd {
    display: inline-block;
    padding: 4px 8px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: monospace;
    margin: 0 2px;
}

/* ===== Game Over ===== */
.game-over {
    text-align: center;
}

.game-over h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

#gameOverMessage {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

#finalScores {
    margin-bottom: 25px;
}

.final-score-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 10px;
    margin-bottom: 10px;
}

.final-score-item.winner {
    background: rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-sm);
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 15px 20px;
    margin-top: 10px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 4px solid var(--success-color); }
.toast.error { border-left: 4px solid var(--danger-color); }
.toast.info { border-left: 4px solid var(--primary-color); }

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .menu-card, .lobby-card {
        padding: 20px;
    }
    
    .code-box span {
        font-size: 1.8rem;
        letter-spacing: 5px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-header {
        flex-direction: row;
        gap: 10px;
        padding: 6px 10px;
    }
    
    .game-header .game-info {
        font-size: 0.9rem;
    }
    
    .desktop-hint {
        display: none;
    }
    
    #gameArea canvas {
        max-width: 100%;
        height: auto;
    }
}

/* ===== Mobile Controls ===== */
.mobile-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
    padding: 15px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* ===== In-Game Chat ===== */
.game-chat {
    max-width: 600px;
    margin: 20px auto 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
}

.game-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--surface-light);
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border-color);
}

.game-chat-header:hover {
    background: var(--surface);
}

.chat-toggle-icon {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.game-chat-body {
    transition: max-height 0.3s ease, padding 0.3s ease;
    max-height: 300px;
    overflow: hidden;
}

.game-chat-body.collapsed {
    max-height: 0;
}

.game-chat-body.collapsed + .game-chat-header .chat-toggle-icon {
    transform: rotate(180deg);
}

.game-chat-body .chat-messages {
    height: 150px;
    padding: 8px;
    background: var(--background);
}

.game-chat-body .chat-input-container {
    padding: 8px;
}

.game-chat-body .chat-input-container input {
    font-size: 0.85rem;
    padding: 8px 10px;
}

.game-chat-body .chat-input-container .btn {
    padding: 8px 12px;
    font-size: 1rem;
}

.control-row {
    display: flex;
    gap: 5px;
}

.control-btn {
    width: 70px;
    height: 70px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
}

.control-btn:active,
.control-btn.active {
    background: var(--primary-color);
    transform: scale(0.95);
    border-color: var(--primary-hover);
}

.control-btn:disabled {
    cursor: default;
}

.center-spacer {
    width: 70px;
    height: 70px;
    visibility: hidden;
}

/* Show mobile controls only on touch devices */
@media (hover: none) and (pointer: coarse) {
    .mobile-controls {
        display: flex !important;
    }
    
    .desktop-hint {
        display: none;
    }
}

@media (max-width: 400px) {
    .control-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* ===== Tic Tac Toe Styles ===== */
.ttt-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.ttt-status {
    margin-bottom: 20px;
    text-align: center;
}

.turn-indicator {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    padding: 10px 25px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.turn-indicator.your-turn {
    background: var(--primary-color);
    animation: pulse 1.5s ease-in-out infinite;
}

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

.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background: var(--surface-light);
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.ttt-cell {
    width: 100px;
    height: 100px;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.ttt-cell:hover:not(.taken) {
    background: var(--surface-light);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.ttt-cell.taken {
    cursor: not-allowed;
}

.ttt-cell.x {
    color: #ef4444;
}

.ttt-cell.o {
    color: #3b82f6;
}

.ttt-cell.winning {
    background: var(--success-color);
    animation: winPulse 0.5s ease-in-out;
}

@keyframes winPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.ttt-info {
    margin-top: 20px;
    text-align: center;
}

/* TicTacToe Players Display */
.ttt-players {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.ttt-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.ttt-player.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.ttt-player.x .ttt-symbol {
    color: #ef4444;
}

.ttt-player.o .ttt-symbol {
    color: #3b82f6;
}

.ttt-symbol {
    font-size: 1.5rem;
    font-weight: bold;
}

.ttt-name {
    font-size: 1rem;
}

.vs {
    color: var(--text-secondary);
    font-weight: bold;
}

.turn-indicator.my-turn {
    background: var(--primary-color);
}

.turn-indicator.waiting {
    background: var(--surface);
}

.ttt-cell.clickable:hover {
    cursor: pointer;
}

.ttt-cell.filled {
    cursor: default;
}

.ttt-cell.winner {
    background: linear-gradient(135deg, var(--success-color), #16a34a);
    animation: winPulse 0.5s ease-in-out;
}

.ttt-symbols {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 10px;
}

.ttt-symbol-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: var(--surface);
    border-radius: var(--radius-sm);
}

.ttt-symbol-info.me {
    border: 2px solid var(--primary-color);
}

.symbol-x {
    color: #ef4444;
    font-weight: bold;
    font-size: 1.5rem;
}

.symbol-o {
    color: #3b82f6;
    font-weight: bold;
    font-size: 1.5rem;
}

@media (max-width: 480px) {
    .ttt-cell {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }
    
    .ttt-board {
        gap: 8px;
        padding: 10px;
    }
}

@media (max-width: 350px) {
    .ttt-cell {
        width: 65px;
        height: 65px;
        font-size: 2rem;
    }
}

/* ===== Blinds Setting ===== */
.blinds-setting {
    margin-bottom: 20px;
}

.blinds-setting h3 {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.blinds-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.blind-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--surface-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.blind-option:hover {
    border-color: var(--primary-color);
}

.blind-option input[type="radio"] {
    accent-color: var(--primary-color);
    width: 18px;
    height: 18px;
}

.blind-option input[type="radio"]:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== Chips Setting ===== */
.chips-setting {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.chips-setting label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.chips-input-container {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--surface-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    width: fit-content;
}

.chips-input-container:focus-within {
    border-color: var(--primary-color);
}

.currency-symbol {
    color: var(--success-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.chips-input-container input[type="number"] {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    width: 80px;
    font-weight: 600;
}

.chips-input-container input[type="number"]:focus {
    outline: none;
}

.chips-input-container input[type="number"]::-webkit-outer-spin-button,
.chips-input-container input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ===== Checkers (Dame) Styles ===== */
.checkers-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.checkers-status {
    text-align: center;
}

.checkers-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0;
    background: #654321;
    padding: 10px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg), inset 0 0 20px rgba(0, 0, 0, 0.3);
    border: 4px solid #8B4513;
}

.checkers-board.rotated {
    transform: rotate(180deg);
}

.checkers-board.rotated .checkers-piece {
    transform: rotate(180deg);
}

.checkers-cell {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.checkers-cell.light {
    background: #f0d9b5;
}

.checkers-cell.dark {
    background: #b58863;
}

.checkers-cell.selected {
    box-shadow: inset 0 0 0 3px var(--primary-color);
}

.checkers-cell.valid-move::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(99, 102, 241, 0.5);
    border-radius: 50%;
}

.checkers-cell.capture-move::after {
    background: rgba(239, 68, 68, 0.6);
    width: 30px;
    height: 30px;
}

.checkers-piece {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    transition: transform 0.2s;
}

.checkers-piece.red {
    background: linear-gradient(145deg, #ef4444, #b91c1c);
    border: 2px solid #991b1b;
}

.checkers-piece.black {
    background: linear-gradient(145deg, #374151, #1f2937);
    border: 2px solid #111827;
}

.checkers-piece.king {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), 0 0 10px rgba(255, 215, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.checkers-cell:hover .checkers-piece {
    transform: scale(1.1);
}

.checkers-captured {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 10px;
}

.captured-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: var(--surface);
    border-radius: var(--radius-sm);
}

.captured-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.captured-count {
    font-weight: bold;
    font-size: 1.2rem;
}

.checkers-piece-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-block;
}

.checkers-piece-icon.red {
    background: linear-gradient(145deg, #ef4444, #b91c1c);
    border: 2px solid #991b1b;
}

.checkers-piece-icon.black {
    background: linear-gradient(145deg, #374151, #1f2937);
    border: 2px solid #111827;
}

.checkers-piece-icon.small {
    width: 18px;
    height: 18px;
}

.checkers-players {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.checkers-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.checkers-player.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.checkers-name {
    font-size: 1rem;
}

@media (max-width: 480px) {
    .checkers-cell {
        width: 38px;
        height: 38px;
    }
    
    .checkers-piece {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .checkers-board {
        padding: 6px;
    }
    
    .checkers-captured {
        flex-direction: column;
        gap: 10px;
    }
    
    .checkers-players {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 350px) {
    .checkers-cell {
        width: 32px;
        height: 32px;
    }
    
    .checkers-piece {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }
}

/* ===== Poker Styles ===== */
.poker-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-height: 400px;
}

.poker-table {
    background: linear-gradient(145deg, #1a472a, #2d5a3f);
    border: 8px solid #8b4513;
    border-radius: 150px;
    padding: 30px;
    width: 100%;
    max-width: 700px;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.4), 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
}

.poker-table.multiplayer {
    min-height: 450px;
    position: relative;
}

/* Seat positions around the table */
.poker-seat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    min-width: 100px;
    position: absolute;
    z-index: 10;
    transition: all 0.3s;
}

/* Position classes for seats around the table */
.poker-seat.seat-top {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.poker-seat.seat-top-left {
    top: 30px;
    left: 15%;
}

.poker-seat.seat-top-left-2 {
    top: 15px;
    left: 30%;
}

.poker-seat.seat-top-right {
    top: 30px;
    right: 15%;
}

.poker-seat.seat-top-right-2 {
    top: 15px;
    right: 30%;
}

.poker-seat.seat-left {
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
}

.poker-seat.seat-right {
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
}

.poker-seat.seat-bottom {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.poker-seat.seat-bottom-left {
    bottom: 30px;
    left: 15%;
}

.poker-seat.seat-bottom-right {
    bottom: 30px;
    right: 15%;
}

.poker-seat.seat-bottom-right-2 {
    bottom: 60px;
    right: 10%;
}

/* My seat styling */
.poker-seat.my-seat {
    background: rgba(99, 102, 241, 0.2);
    border: 2px solid rgba(99, 102, 241, 0.5);
}

.poker-seat.active-turn {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    background: rgba(255, 215, 0, 0.1);
}

.seat-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.seat-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seat-chips {
    color: #ffd700;
    font-weight: bold;
    font-size: 0.8rem;
}

.seat-cards {
    display: flex;
    gap: 3px;
}

.seat-bet {
    color: #ffd700;
    font-weight: bold;
    font-size: 0.85rem;
    min-height: 18px;
}

.seat-status {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    min-height: 16px;
}

.seat-status.thinking {
    animation: blink 1s infinite;
}

.seat-status.folded {
    color: #ef4444;
}

.seat-status.allin {
    color: #ffd700;
    font-weight: bold;
}

.dealer-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: linear-gradient(145deg, #ffd700, #ffb700);
    color: #000;
    font-weight: bold;
    font-size: 0.7rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Small cards for opponent seats */
.card.small {
    width: 35px;
    height: 50px;
    font-size: 0.7rem;
}

.card.small .rank {
    font-size: 0.8rem;
}

.card.small .suit {
    font-size: 0.75rem;
}

.card.small.folded,
.card.small.out {
    background: rgba(100,100,100,0.5);
    color: rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* My player area */
.poker-player.my-seat {
    position: relative;
}

.poker-player.my-seat .dealer-btn {
    top: -10px;
    right: calc(50% - 60px);
}

/* Original opponent styles (can be removed if not used) */
.poker-opponent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.opponent-info, .player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0,0,0,0.3);
    padding: 8px 20px;
    border-radius: 20px;
}

.opponent-name, .player-name {
    font-weight: 600;
    color: white;
}

.opponent-chips, .player-chips {
    color: #ffd700;
    font-weight: bold;
}

.opponent-cards, .player-cards {
    display: flex;
    gap: 8px;
}

.opponent-bet, .player-bet {
    color: #ffd700;
    font-weight: bold;
    min-height: 24px;
    font-size: 1.1rem;
}

.opponent-status {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    min-height: 20px;
}

.opponent-status.thinking {
    animation: blink 1s infinite;
}

.opponent-status.folded {
    color: #ef4444;
}

.opponent-status.allin {
    color: #ffd700;
    font-weight: bold;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Community area - centered on table */
.community-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
    z-index: 5;
}

.pot-display {
    background: rgba(0,0,0,0.5);
    padding: 10px 25px;
    border-radius: 25px;
    display: flex;
    gap: 10px;
    color: white;
}

#potAmount {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.2rem;
}

.community-cards {
    display: flex;
    gap: 8px;
}

.phase-display {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Player area */
.poker-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Cards */
.card {
    width: 50px;
    height: 70px;
    background: white;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    position: relative;
}

.card.back {
    background: linear-gradient(135deg, #1e3a5f, #2c5282);
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        rgba(255,255,255,0.05) 5px,
        rgba(255,255,255,0.05) 10px
    );
}

.card.placeholder {
    background: rgba(255,255,255,0.1);
    border: 2px dashed rgba(255,255,255,0.2);
}

.card.folded {
    background: #666;
    color: #999;
    font-size: 0.7rem;
}

.card.red {
    color: #dc2626;
}

.card.black {
    color: #1f2937;
}

.card .rank {
    font-size: 1rem;
    line-height: 1;
}

.card .suit {
    font-size: 1.2rem;
}

/* Poker actions */
.poker-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.poker-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.poker-btn.fold {
    background: #ef4444;
    color: white;
}

.poker-btn.check {
    background: #64748b;
    color: white;
}

.poker-btn.call {
    background: #22c55e;
    color: white;
}

.poker-btn.raise {
    background: #f59e0b;
    color: white;
}

.poker-btn.allin {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #1f2937;
}

.poker-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Raise controls */
.raise-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 20px;
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
}

.raise-controls input[type="range"] {
    width: 100%;
}

.raise-amount {
    display: flex;
    align-items: center;
    gap: 10px;
}

.raise-amount input {
    width: 100px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--background);
    color: var(--text-primary);
    font-size: 1.1rem;
    text-align: center;
}

.raise-buttons {
    display: flex;
    gap: 10px;
}

.raise-preset {
    padding: 8px 16px;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.raise-preset:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.confirm-raise {
    background: var(--success-color) !important;
}

.cancel-raise {
    background: var(--secondary-color) !important;
}

/* Poker message */
.poker-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 20px 40px;
    border-radius: var(--radius);
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.poker-message.visible {
    opacity: 1;
}

/* ===== Poker Chat ===== */
.poker-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.poker-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    order: 1;
    flex-shrink: 0;
}

.poker-chat {
    width: 280px;
    min-width: 250px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    height: 450px;
    order: 2;
    flex-shrink: 0;
}

.poker-chat-header {
    padding: 10px 15px;
    background: var(--surface-light);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.poker-chat .chat-messages {
    flex: 1;
    min-height: 200px;
    height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: var(--background);
}

.poker-chat .chat-input-container {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--border-color);
}

.poker-chat .chat-input-container input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.poker-chat .chat-input-container input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Responsive poker */
@media (max-width: 900px) {
    .poker-container {
        flex-direction: column;
        align-items: center;
    }
    
    .poker-main {
        order: 1;
    }
    
    .poker-chat {
        width: 100%;
        max-width: 600px;
        order: 10;
        height: auto;
        max-height: none;
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    .poker-chat .chat-messages {
        height: 150px;
        min-height: 150px;
    }
    
    .poker-chat .chat-input-container {
        padding: 12px;
    }
    
    .poker-chat .chat-input-container input {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 600px) {
    .poker-table {
        border-radius: 60px;
        padding: 15px;
    }
    
    .card {
        width: 40px;
        height: 56px;
    }
    
    .card .rank {
        font-size: 0.85rem;
    }
    
    .card .suit {
        font-size: 1rem;
    }
    
    .poker-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .opponent-info, .player-info {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .poker-chat {
        width: calc(100% - 20px);
        margin: 15px 10px;
    }
    
    .poker-chat .chat-messages {
        height: 120px;
        min-height: 120px;
    }
    
    .poker-chat .chat-input-container {
        padding: 10px;
        position: relative;
        z-index: 10;
    }
    
    .poker-chat .chat-input-container input {
        padding: 14px 12px;
        font-size: 16px;
        -webkit-appearance: none;
        border-radius: 8px;
    }
    
    .poker-chat .chat-input-container button {
        padding: 14px 16px;
        min-width: 50px;
    }
}
