/* Improve placement and alignment of mobileScoresList.score on mobile */
#mobileScoresList.score {
    margin: 0.7rem auto 0.7rem auto;
    width: 96%;
    max-width: 420px;
    display: block;
}

/* Move mobile current turn display up from the bottom edge */
#mobileCurrentTurnDisplay {
    margin-bottom: 0.7rem;
}

/* Add margin to current-player score item to separate from scoreboard header */
.score-item.current-player {
    margin-top: 0.5rem;
}

/* ===================== THEME-SPECIFIC DRAWER HEADER CLOSE BUTTONS ===================== */
/* Whiteboard theme: red close header for drawers */
body.theme-whiteboard .drawer-header.drawer-close {
    background: #e74c3c;
    color: #fff;
}

body.theme-whiteboard .drawer-header.drawer-close:hover {
    background: #c0392b;
}

/* Greenboard theme: white close header for drawers (if needed, add here) */
/* Example:
body.theme-greenboard .drawer-header.drawer-close {
    background: #fff;
    color: #1a3009;
}
body.theme-greenboard .drawer-header.drawer-close:hover {
    background: #cccccc;
}
*/
/* ===================== END THEME-SPECIFIC DRAWER HEADER CLOSE BUTTONS ===================== */
/* Make global chat sign-in message with proper contrast in greenboard theme */
.theme-greenboard .global-chat-signin-message,
.theme-greenboard .mobile-global-chat-signin-message {
    color: #2c3e50 !important;
    cursor: pointer;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.95) !important;
    font-weight: bold;
}

.theme-greenboard #onlineUsersCount,
.theme-greenboard #mobileOnlineUsersCount {
    color: #ffffff !important;
}

body.theme-whiteboard #onlineUsersCount {
    color: #000;
}

body.theme-whiteboard #mobileOnlineUsersCount {
    color: #000;
}

/* Theme CSS - Greenboard and Whiteboard Themes */
/* Default Theme Variables (Greenboard) */
:root {
    --board-bg: #0d3818;
    --dot-color: #ffffff;
    --line-color: #ffffff;
    --board-texture: none;
    --cursor-url: url('../assets/cursors/chalk.png');
    --font-family: 'Schoolbell', cursive;
    --border-color: rgba(255, 255, 255, 0.2);
    --input-bg: rgba(255, 255, 255, 0.05);
    --message-bg: rgba(255, 255, 255, 0.9);
    --accent-color: #c8860d;
    --accent-hover: #b8790b;
    --accent-rgb: 200, 134, 13;
    --theme-font: 'Schoolbell', cursive;
    --semi-transparent-white: rgba(255, 255, 255, 0.1);
    /* Spacing variables */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 10px;
    --spacing-lg: 12px;
    --spacing-xl: 16px;
    --spacing-xxl: 20px;
}

/* Standardized Breakpoints */
/* Mobile small: up to 400px */
/* Mobile medium: up to 600px */
/* Mobile large: up to 768px */
/* Tablet: up to 900px */
/* Desktop small: 769px and up */

/* Greenboard Theme */
body.theme-greenboard {
    --board-bg: #0d3818;
    --dot-color: #ffffff;
    --line-color: #ffffff;
    --board-texture: none;
    --cursor-url: url('../assets/cursors/chalk.png');
    --font-family: 'Schoolbell', cursive;
    --draw-sound: 'chalk';

    /* Global Chat Theme Variables for Greenboard */
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --surface-bg: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.2);
    --input-bg: rgba(255, 255, 255, 0.05);
    --message-bg: rgba(255, 255, 255, 0.9);
    --accent-color: #c8860d;
    --accent-hover: #b8790b;
    --accent-rgb: 200, 134, 13;
    --theme-font: 'Schoolbell', cursive;
    background: #f5f5dc;
}

body.theme-greenboard .mobile-nav {
    background: rgba(13, 56, 24, 0.95) !important;
    border-top-color: rgba(255, 255, 255, 0.2) !important;
}

body.theme-greenboard .mobile-drawer {
    background: #0d3818 !important;
    color: #ffffff !important;
    border-top-color: #ffffff !important;
    border-left-color: #ffffff !important;
}

body.theme-greenboard .nav-btn {
    color: #ffffff !important;
}

body.theme-greenboard .nav-btn:hover,
body.theme-greenboard .nav-btn.active {
    background: rgba(255, 255, 255, 0.1) !important;
}

body.theme-greenboard .drawer-header {
    background: #1a3c20 !important;
    color: #ffffff !important;
}

/* Whiteboard Theme */
body.theme-whiteboard {
    --board-bg: #ffffff;
    --dot-color: #333333;
    --line-color: var(--player-color, #333333);
    --board-texture: linear-gradient(45deg, #fafafa 25%, transparent 25%, transparent 75%, #fafafa 75%, #fafafa), linear-gradient(45deg, #fafafa 25%, transparent 25%, transparent 75%, #fafafa 75%, #fafafa);
    --cursor-url: url('../assets/cursors/red-marker.png');
    --font-family: 'Patrick Hand', cursive;
    --draw-sound: 'marker';
    background: #f5f5f5;

    /* Global Chat Theme Variables for Whiteboard */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --surface-bg: #ffffff;
    --border-color: #e0e0e0;
    --input-bg: #f8f9fa;
    --message-bg: #ffffff;
    --accent-color: #2d5a87;
    --accent-hover: #245373;
    --accent-rgb: 45, 90, 135;
    --theme-font: 'Patrick Hand', cursive;
}

body.theme-whiteboard .mobile-nav {
    background: #ffffff !important;
    border-top-color: #34495e !important;
}

body.theme-whiteboard .mobile-drawer {
    background: #ffffff !important;
    color: #333333 !important;
    border-top-color: #34495e !important;
    border-left-color: #34495e !important;
}

body.theme-whiteboard .nav-btn {
    color: #333333 !important;
}

body.theme-whiteboard .nav-btn:hover,
body.theme-whiteboard .nav-btn.active {
    background: #ecf0f1 !important;
}

body.theme-whiteboard .drawer-header {
    background: #f8f9fa !important;
    color: #333333 !important;
}

/* Game Board Styling */
#gameScreen {
    background: var(--board-bg);
}

#gameBoard,
#mobileGameBoard {
    background: var(--board-bg);
    cursor: var(--cursor-url), crosshair;
}

/* Greenboard specific styling */
body.theme-greenboard #gameScreen {
    background: #0d3818;
    /* Simple, clean analogous green gradient */
    background: linear-gradient(135deg,
            #0d3818 0%,
            /* Deep forest green */
            #154220 25%,
            /* Forest green */
            #0f3a1a 50%,
            /* Pine green */
            #134021 75%,
            /* Moss green */
            #0d3818 100%
            /* Back to deep forest */
        );
}

body.theme-greenboard #gameBoard,
body.theme-greenboard #mobileGameBoard {
    background: #0d3818;
    /* Subtle chalk texture without complex patterns */
    background: linear-gradient(135deg,
            #0d3818 0%,
            #154220 50%,
            #0d3818 100%);
    /* Simple chalk dust effect */
    box-shadow:
        inset 0 0 100px rgba(255, 255, 255, 0.02),
        inset 0 0 50px rgba(255, 255, 255, 0.01);
}

/* Whiteboard specific styling */
body.theme-whiteboard #gameScreen {
    background: #ffffff;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
}

body.theme-whiteboard #gameBoard,
body.theme-whiteboard #mobileGameBoard {
    background: #ffffff;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    border-color: #ddd;
    box-shadow:
        inset 0 0 10px rgba(0, 0, 0, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Font styling based on theme */
body.theme-greenboard {
    font-family: 'Schoolbell', cursive;
}

body.theme-whiteboard {
    font-family: 'Patrick Hand', cursive;
}

/* Player Colors for Whiteboard Theme */
body.theme-whiteboard .player-1-color {
    color: #e74c3c;
}

body.theme-whiteboard .player-2-color {
    color: #3498db;
}

body.theme-whiteboard .player-3-color {
    color: #27ae60;
}

body.theme-whiteboard .player-4-color {
    color: #2c3e50;
}

/* Player Colors for Greenboard Theme (all white - no colors allowed) */
body.theme-greenboard .player-1-color,
body.theme-greenboard .player-2-color,
body.theme-greenboard .player-3-color,
body.theme-greenboard .player-4-color {
    color: #ffffff !important;
}

/* Score item colors - Whiteboard only */
body.theme-whiteboard .score-color.player-1 {
    background-color: #e74c3c;
}

body.theme-whiteboard .score-color.player-2 {
    background-color: #3498db;
}

body.theme-whiteboard .score-color.player-3 {
    background-color: #27ae60;
}

body.theme-whiteboard .score-color.player-4 {
    background-color: #2c3e50;
}

/* Greenboard theme - all indicators white, no colored elements */
body.theme-greenboard .score-color.player-1,
body.theme-greenboard .score-color.player-2,
body.theme-greenboard .score-color.player-3,
body.theme-greenboard .score-color.player-4 {
    background-color: #ffffff !important;
    border: 2px solid #ffffff !important;
}

/* Ensure no soft colors leak through in greenboard */
body.theme-greenboard .score-item,
body.theme-greenboard .chat-message,
body.theme-greenboard .modal-content,
body.theme-greenboard .drawer-content {
    color: #ffffff !important;
}

body.theme-greenboard .current-turn,
body.theme-greenboard .current-turn-mobile {
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    background: #0d2b14 !important;
}

body.theme-greenboard .chat-container {
    background: #0d2b14;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body.theme-greenboard .chat-header {
    background: #ffffff;
    color: #0d2b14;
    font-weight: bold;
    border-bottom: 1px solid #ffffff;
}

body.theme-greenboard .chat-messages {
    background: #0d2b14;
    background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
}

body.theme-greenboard .chat-message {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

body.theme-greenboard .chat-input {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px;
}

body.theme-greenboard .chat-input input {
    background: #0d2b14;
    color: #ffffff;
    border: 1px solid #000;
    font-family: 'Schoolbell', cursive;
}

body.theme-greenboard .scoreboard-container {
    background: #0d2b14;
    border: 2px solid #ffffff;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body.theme-greenboard .scoreboard-container h3 {
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

body.theme-greenboard .score-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.theme-greenboard .score-item.current-player {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid #ffffff;
}

body.theme-greenboard .current-turn {
    background: #ffffff;
    color: #0d2b14;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Unused mobile styles removed */

/* Drawer styling for themes */
body.theme-greenboard .mobile-drawer {
    background: #1a3009;
    border-top-color: #ffffff;
}

body.theme-greenboard .drawer-header {
    background: #ffffff;
    color: #1a3009;
}

body.theme-greenboard .drawer-content {
    background: #1a3009;
    color: #ffffff;
}

/* Top bar theme adjustments */
body.theme-greenboard .top-bar {
    background: rgba(26, 48, 9, 0.9);
    border-bottom-color: #ffffff;
}

body.theme-greenboard .control-btn {
    background: #ffffff;
    color: #1a3009;
}

body.theme-greenboard .control-btn:hover {
    background: #cccccc;
}

body.theme-greenboard .home-btn {
    background: #ffffff;
    color: #1a3009;
}

body.theme-greenboard .home-btn:hover {
    background: #cccccc;
}

/* Modal theme adjustments */
body.theme-greenboard .modal-content {
    background: #1a3009;
    border-color: #ffffff;
    color: #ffffff;
}

body.theme-greenboard .modal-header {
    background: #ffffff;
    color: #1a3009;
}

body.theme-greenboard .modal-close {
    color: #1a3009;
}

body.theme-greenboard .final-scores {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
}

body.theme-greenboard .final-score-item {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

/* Emoji picker theme adjustments */
body.theme-greenboard .emoji-picker {
    background: #0d2b14;
    border-color: #ffffff;
}

body.theme-greenboard .emoji-picker-tabs {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-greenboard .emoji-picker-tab {
    color: #ffffff;
    opacity: 0.6;
}

body.theme-greenboard .emoji-picker-tab.active {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

body.theme-greenboard .emoji-picker-tab svg {
    stroke: #ffffff;
}

body.theme-greenboard .emoji-picker button:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.theme-greenboard .chat-input {
    background: #0d2b14;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

body.theme-whiteboard .chat-input {
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
}

/* Support button theme adjustments */
body.theme-greenboard .support-btn {
    background: #ffffff;
    color: #1a3009;
}

body.theme-greenboard .support-btn:hover {
    background: #cccccc;
}

/* Responsive main action buttons for setup/room/join/quickmatch screens */
.start-btn,
.create-btn,
.join-btn,
.cancel-btn {
    width: 100%;
    max-width: 340px;
    min-width: 0;
    margin: 1.2rem auto 0 auto;
    display: block;
    font-size: 1.05rem;
    padding: 12px 0;
    box-sizing: border-box;
    border-radius: 12px;
}

@media (max-width: 480px) {

    .start-btn,
    .create-btn,
    .join-btn,
    .cancel-btn {
        font-size: 0.98rem;
        padding: 10px 0;
        max-width: 96vw;
        margin-top: 0.8rem;
    }

    .setup-container,
    .room-container,
    .join-container,
    .quickmatch-container {
        padding-left: 2vw;
        padding-right: 2vw;
    }
}

/* Extra responsive fixes for action buttons and containers */
.setup-container,
.room-container,
.join-container,
.quickmatch-container {
    padding-left: 4vw;
    padding-right: 4vw;
    padding-bottom: 120px !important;
    /* Increased from 40px to 110px */
    box-sizing: border-box;
    min-width: 0;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Cursor styles based on player and theme */
.cursor-player-1.theme-whiteboard {
    cursor: url('../assets/cursors/red-marker.png'), crosshair;
}

.cursor-player-2.theme-whiteboard {
    cursor: url('../assets/cursors/blue-marker.png'), crosshair;
}

.cursor-player-3.theme-whiteboard {
    cursor: url('../assets/cursors/green-marker.png'), crosshair;
}

.cursor-player-4.theme-whiteboard {
    cursor: url('../assets/cursors/black-marker.png'), crosshair;
}

.cursor-player-1.theme-greenboard,
.cursor-player-2.theme-greenboard,
.cursor-player-3.theme-greenboard,
.cursor-player-4.theme-greenboard {
    cursor: url('../assets/cursors/chalk.png'), crosshair;
}

/* Dynamic cursor styling based on current player and theme */
body.theme-greenboard #gameBoard,
body.theme-greenboard #mobileGameBoard {
    cursor: url('../assets/cursors/chalk.png'), crosshair;
}

body.theme-whiteboard #gameBoard,
body.theme-whiteboard #mobileGameBoard {
    cursor: url('../assets/cursors/red-marker.png'), crosshair;
}

/* Player-specific cursors for whiteboard theme */
body.theme-whiteboard .player-1-turn #gameBoard,
body.theme-whiteboard .player-1-turn #mobileGameBoard {
    cursor: url('../assets/cursors/red-marker.png'), crosshair;
}

body.theme-whiteboard .player-2-turn #gameBoard,
body.theme-whiteboard .player-2-turn #mobileGameBoard {
    cursor: url('../assets/cursors/blue-marker.png'), crosshair;
}

body.theme-whiteboard .player-3-turn #gameBoard,
body.theme-whiteboard .player-3-turn #mobileGameBoard {
    cursor: url('../assets/cursors/green-marker.png'), crosshair;
}

body.theme-whiteboard .player-4-turn #gameBoard,
body.theme-whiteboard .player-4-turn #mobileGameBoard {
    cursor: url('../assets/cursors/black-marker.png'), crosshair;
}


/* Confetti animation for wins */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    animation: confetti-fall 3s linear forwards;
    pointer-events: none;
    z-index: 10000;
}

/* Home screen theme adjustments */
body.theme-greenboard .home-container {
    background: radial-gradient(circle at center, rgba(45, 80, 22, 0.1) 0%, rgba(45, 80, 22, 0.3) 100%);
}

body.theme-greenboard .game-title {
    color: #2d5016;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.3);
}

body.theme-greenboard .mode-btn {
    background: rgba(26, 48, 9, 0.9);
    color: #ffffff;
    border-color: #ffffff;
}

body.theme-greenboard .mode-btn .btn-text {
    color: #ffffff;
}

body.theme-greenboard .mode-btn .btn-desc {
    color: #cccccc;
}

body.theme-greenboard .mode-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
}

/* Setup screens theme adjustments */
body.theme-greenboard .setup-container,
body.theme-greenboard .room-container,
body.theme-greenboard .join-container,
body.theme-greenboard .quickmatch-container {
    background: radial-gradient(circle at center, rgba(45, 80, 22, 0.1) 0%, rgba(45, 80, 22, 0.3) 100%);
    color: #ffffff;
}

body.theme-greenboard .setup-container h2,
body.theme-greenboard .room-container h2,
body.theme-greenboard .join-container h2,
body.theme-greenboard .quickmatch-container h2 {
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

body.theme-greenboard .count-btn,
body.theme-greenboard .size-btn {
    background: rgba(26, 48, 9, 0.8);
    color: #ffffff;
    border-color: #ffffff;
}

body.theme-greenboard .count-btn.active,
body.theme-greenboard .size-btn.active {
    background: #ffffff;
    color: #1a3009;
}

body.theme-greenboard .player-input input,
body.theme-greenboard .input-group input,
body.theme-greenboard .name-input-container input {
    background: rgba(26, 48, 9, 0.8);
    color: #ffffff;
    border-color: #ffffff;
}

body.theme-greenboard .player-input input::placeholder,
body.theme-greenboard .input-group input::placeholder,
body.theme-greenboard .name-input-container input::placeholder {
    color: #cccccc;
}

body.theme-greenboard .start-btn,
body.theme-greenboard .create-btn,
body.theme-greenboard .join-btn {
    background: #ffffff;
    color: #1a3009;
}

body.theme-greenboard .start-btn:hover,
body.theme-greenboard .create-btn:hover,
body.theme-greenboard .join-btn:hover {
    background: #cccccc;
}

body.theme-greenboard .room-info {
    background: rgba(26, 48, 9, 0.9);
    border-color: #ffffff;
    color: #ffffff;
}

body.theme-greenboard .room-info h3 {
    color: #ffffff;
}

body.theme-greenboard .room-info label {
    color: #cccccc;
}

body.theme-greenboard .code-display,
body.theme-greenboard .link-display {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.theme-greenboard .code-display span,
body.theme-greenboard .link-display span {
    color: #ffffff;
}



/* Fix waiting message contrast on green theme */
body.theme-greenboard .waiting-message,
body.theme-greenboard .lobby-players h4 {
    color: #ffffff !important;
}

/* Fix system messages contrast on green theme */
body.theme-greenboard .system-message {
    background: rgba(255, 255, 255, 0.85);
    color: #1a3009;
    font-weight: 600;
}

/* Fix emoji button visibility on green theme */
body.theme-greenboard .emoji-btn {
    color: #ffffff;
}

body.theme-greenboard .emoji-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Fix chat input text visibility on green theme */
body.theme-greenboard .chat-input input,
body.theme-greenboard .chat-input textarea {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

body.theme-greenboard .chat-input input::placeholder,
body.theme-greenboard .chat-input textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Consistent top-left alignment for Back to Home button on setup/join/room/quickmatch screens */
.setup-container .home-btn,
.room-container .home-btn,
.join-container .home-btn,
.quickmatch-container .home-btn {
    align-self: flex-start !important;
    margin-top: 1.2rem !important;
    margin-bottom: 0.8rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 10px !important;
    font-size: 1rem !important;
    padding: 8px 16px !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
}

/* Responsive theme adjustments */
@media (max-width: 767px) {
    body.theme-greenboard .mobile-drawer {
        background: rgba(26, 48, 9, 0.95);
        backdrop-filter: blur(10px);
    }

    body.theme-greenboard .mobile-nav {
        background: rgba(26, 48, 9, 0.95);
        backdrop-filter: blur(10px);
    }
}

/* High contrast mode for accessibility */
@media (prefers-contrast: high) {
    body.theme-greenboard {
        --board-bg: #000000;
        --dot-color: #ffffff;
        --line-color: #ffffff;
    }

    body.theme-whiteboard {
        --board-bg: #ffffff;
        --dot-color: #000000;
        --line-color: #000000;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    .chalk-dust,
    .marker-effect,
    .confetti {
        animation: none;
    }

    .theme-btn::after,
    .theme-btn::before {
        transition: none;
    }
}

/* Place this at the end of your .setup-container/.room-container/.join-container/.quickmatch-container */
.fixed-action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0 !important;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 2vw !important;
    /* Increased padding for better centering */
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.07);
    display: flex;
    justify-content: center;
    gap: 12px;
}

body.theme-greenboard .fixed-action-bar {
    background: rgba(26, 48, 9, 0.97);
}

.fixed-action-bar .start-btn,
.fixed-action-bar .create-btn,
.fixed-action-bar .join-btn,
.fixed-action-bar .cancel-btn {
    max-width: 180px !important;
    font-size: 0.92rem !important;
    padding: 8px 0 !important;
    border-radius: 10px !important;
}

#gameScreen .fixed-action-bar {
    display: none !important;
}

.setup-container h2 {
    margin-bottom: 1.2rem !important;
    margin-top: 0.5rem !important;
    font-size: 1.8rem !important;
}

.player-count,
.grid-size,
.player-names {
    margin-bottom: 1.2rem !important;
    margin-top: 0 !important;
}

.player-input-grid {
    gap: 8px !important;
    margin-bottom: 8px !important;
}

.player-input label {
    margin-bottom: 0.4rem !important;
    font-size: 1.1rem !important;
}

.count-btn,
.size-btn {
    font-size: 1.1rem !important;
    padding: 10px 16px !important;
    min-width: 60px !important;
    border-radius: 10px !important;
}

/* --- WHITEBOARD THEME OVERRIDE FOR ROOM-INFO HEADINGS --- */
body.theme-whiteboard .room-info h3 {
    color: #3498db !important;
}

/* Error message popup for both themes */
body.theme-greenboard .error-message,
body.theme-whiteboard .error-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fffbe6;
    color: #222;
    border: 2px solid #e74c3c;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    padding: 1.2rem 2rem;
    border-radius: 12px;
    font-size: 1.25rem;
    font-family: var(--font-family, 'Arial', sans-serif);
    z-index: 9999;
    max-width: 90vw;
    width: fit-content;
    text-align: center;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.2s;
}

body.theme-greenboard .error-message {
    background: #fffbe6;
    color: #0d3818;
    border-color: #e74c3c;
}

body.theme-whiteboard .error-message {
    background: #fffbe6;
    color: #3498db;
    border-color: #e74c3c;
}



/* Additional theme-specific overrides */
.theme-greenboard .global-chat-message {
    font-family: 'Schoolbell', cursive;
    background: rgba(255, 255, 255, 0.9);
}

.theme-greenboard .global-chat-message.own-message {
    background: linear-gradient(135deg, #c8860d, #b8790b);
}



/* Greenboard theme: improve contrast for quick tips */
.theme-greenboard .quick-tips-container {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: #ffffff !important;
}

.theme-greenboard .quick-tips-container h4 {
    color: #2c3e50 !important;
}

.theme-greenboard .quick-tips-container li,
.theme-greenboard .quick-tips-container li strong {
    color: #34495e !important;
}

/* Whiteboard theme overrides */
body.theme-whiteboard .scoreboard-container,
body.theme-whiteboard .scoreboard-container *,
body.theme-whiteboard .drawer-content,
body.theme-whiteboard .drawer-content *,
body.theme-whiteboard .chat-messages,
body.theme-whiteboard .chat-messages * {
    color: #2c3e50;
}

body.theme-whiteboard .chat-container {
    background: #ffffff;
    border: 2px solid #2c3e50;
}

body.theme-whiteboard .chat-header {
    background: #2c3e50;
    color: #ffffff;
}

body.theme-whiteboard .chat-messages {
    background: #fdfdfd;
}

body.theme-whiteboard .chat-input {
    background: #f1f1f1;
    border-top: 1px solid #ccc;
}

/* Better handling for orientation changes */
@media screen and (orientation: portrait) {
    body {
        width: 100%;
        min-height: 100%;
    }
}

@media screen and (orientation: landscape) {
    body {
        width: 100%;
        min-height: 100%;
    }
}
