/* Main CSS - Dots and Boxes Classroom Edition */

/* Theme and Sound row styling for home */
.theme-sound-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
}

.theme-sound-divider {
    color: #bbb;
    font-size: 1.3em;
    margin: 0 0.5em;
    user-select: none;
}

#soundToggle.theme-btn {
    margin-left: 0;
}

/* Sound toggle button styles */
#soundToggle.theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    margin-left: 10px;
}

#soundToggle .sound-icon {
    font-size: 1.2em;
}

#soundToggle .sound-label {
    font-size: 1em;
    margin-left: 0.4em;
    font-family: inherit;
}

.footer-privacy {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: transparent;
    text-align: center;
    padding: 20px 0;
    z-index: 1050;
    pointer-events: none;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.footer-privacy .privacy-btn {
    pointer-events: auto;
}

/* Show footer ONLY on home screen */
#homeScreen.active~.footer-privacy {
    display: flex !important;
}

/* Base styles for the footer buttons */
.footer-privacy .privacy-btn {
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 8px;
    background: #eee;
    color: #333;
    text-decoration: none;
    display: inline-block;
    margin: 0 8px;
}

.footer-privacy .privacy-btn:hover {
    background: #e0e0e0;
}

/* Standardize footer across all screens */

.google-signin-btn {
    font-size: 1.1rem;
    padding: 10px 24px;
    border-radius: 8px;
    background: #fff;
    color: #333;
    box-shadow: 0 2px 8px #0001;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: 1px solid #ccc;
    font-family: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.google-signin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px #0002;
}

.signout-btn {
    margin-left: 12px;
    font-size: 0.95rem;
    padding: 4px 12px;
    border-radius: 6px;
    background: #eee;
    color: #333;
    border: 1px solid #ccc;
    cursor: pointer;
    transition: background 0.2s ease;
}

.signout-btn:hover {
    background: #e0e0e0;
}

/* Notification red dot for mobile chat button */
.red-dot {
    position: absolute;
    top: 4px;
    right: 8px;
    width: 10px;
    height: 10px;
    background: red;
    border-radius: 50%;
    z-index: 10;
    pointer-events: none;
}

/* Mobile Global Chat Button (Menu Integrated) */
.mobile-only-btn {
    display: none;
}

@media (max-width: 1249px) {
    .mobile-only-btn {
        display: flex;
    }
}

.mode-btn {
    position: relative; /* For red-dot positioning */
}

.mode-btn .red-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background: #e74c3c;
    border: 2px solid white;
    border-radius: 50%;
    z-index: 5;
}

/* Main CSS - Dots and Boxes Classroom Edition */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: 'Patrick Hand', cursive;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

body {
    background: #ffffff;
    color: #333;
    position: relative;
}

/* Screen Management */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    overflow-y: auto;
}

.screen.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out forwards;
}

.screen.transition-out {
    animation: fadeOut 0.2s ease-in forwards;
}

.hidden {
    display: none !important;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    touch-action: manipulation;
    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Home Screen */
.home-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 1vh;
    padding-bottom: 80px;
    /* Space for fixed footer */
    min-height: 100vh;
    height: auto;
    min-width: 0;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    padding: 10px 0;
    gap: 0;
    background: none;
    overflow-y: auto;
    overflow-x: hidden;
}

.game-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-top: 4rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-family: 'Schoolbell', cursive;
}

/* Sub-screen centering overrides */
.sub-screen-center .game-title {
    margin-top: 0;
}

.sub-screen-center {
    justify-content: center !important;
    padding-top: 5vh;
}

.name-input-container {
    margin-bottom: 0.8rem;
}

.name-input-container label {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #34495e;
}

.name-input-container input {
    padding: 12px 20px;
    font-size: 1.1rem;
    border: 3px solid #34495e;
    border-radius: 10px;
    background: white;
    font-family: inherit;
    width: 100%;
    max-width: 300px;
    text-align: center;
}

.name-input-container input:focus {
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

/* Home Screen Game Modes Layout */
.game-modes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 600px;
    margin-bottom: 1rem;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 480px) {
    .game-modes {
        grid-template-columns: 1fr;
        max-width: 280px;
    }
}

/* Home Screen Mode Button */
.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    max-width: 100%;
    height: 110px;
    background: #f5f5f5;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(60, 60, 60, 0.07);
    font-size: 1rem;
    padding: 0.7em 0.5em 0.5em 0.5em;
    margin: 0;
    gap: 0.2em;
    border: 2px solid #e0e0e0;
    transition: box-shadow 0.2s, border 0.2s;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.mode-btn .btn-icon {
    font-size: 2rem;
}

.mode-btn .btn-text {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2c3e50;
}

.mode-btn .btn-desc {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-align: center;
}

.theme-toggle-home {
    margin-top: 0;
    margin-bottom: 0;
}

.theme-btn {
    background: #34495e;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-btn:hover {
    background: #2c3e50;
}

/* Main setup/room/join/quickmatch containers */
.setup-container,
.room-container,
.join-container,
.quickmatch-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 100vh;
    width: 100vw;
    box-sizing: border-box;
    padding: 15px;
    padding-bottom: 80px;
    /* Reduced space for fixed action bar */
    margin: 0;
    overflow-y: auto;
    background: none;
    gap: 0.75rem;
    /* Reduced gap */
}

.quickmatch-container {
    padding-left: 5vw;
    padding-right: 5vw;
    padding-bottom: 120px !important;
    min-width: 0;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Setup Screens */
.home-btn {
    background: #e74c3c;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
}

.top-bar .home-btn {
    margin-bottom: 0 !important;
    align-self: center;
}

.home-btn:hover {
    background: #c0392b;
}

.setup-container h2,
.room-container h2,
.join-container h2,
.quickmatch-container h2 {
    text-align: center;
    font-size: 1.5rem;
    /* Reduced from 1.8rem */
    margin-bottom: 0.75rem;
    /* Reduced margin */
    color: #2c3e50;
}

.player-count,
.grid-size {
    margin-bottom: 0.75rem;
    /* Reduced margin */
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    text-align: center;
}

.player-count label,
.grid-size label {
    display: block;
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: #34495e;
    font-weight: 600;
}

.count-buttons,
.size-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.count-btn,
.size-btn {
    background: white;
    border: 3px solid #34495e;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 1.2rem;
    min-width: 80px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.count-btn.active,
.size-btn.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.count-btn:hover,
.size-btn:hover {
    background: #ecf0f1;
    transform: translateY(-1px);
}

.count-btn.active:hover,
.size-btn.active:hover {
    background: #2980b9;
}

.player-names {
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100vw;
}

.player-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    max-width: 800px;
    margin-inline: auto;
}

.player-input {
    margin-bottom: 0;
}

.player-input.hidden {
    display: none;
}

.player-input label {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #34495e;
    font-weight: 600;
}

.player-input input {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 3px solid #bdc3c7;
    border-radius: 8px;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.player-input input:focus {
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
    transform: translateY(-1px);
}

.start-btn:hover,
.create-btn:hover,
.join-btn:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(39, 174, 96, 0.3);
}

/* Room Info */
.room-info {
    background: white;
    border: 3px solid #34495e;
    border-radius: 15px;
    padding: 1.5rem;
    /* Reduced padding */
    margin-top: 1.5rem;
    /* Reduced margin */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.room-info.hidden {
    display: none;
}

.room-info h3 {
    text-align: center;
    font-size: 1.3rem;
    /* Reduced font size */
    margin-bottom: 1.2rem;
    /* Reduced margin */
    color: #27ae60;
}

.room-code,
.invite-link {
    margin-bottom: 1.2rem;
    /* Reduced margin */
}

.room-code label,
.invite-link label {
    display: block;
    font-size: 1rem;
    /* Reduced font size */
    margin-bottom: 0.4rem;
    /* Reduced margin */
    color: #34495e;
}

.code-display,
.link-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ecf0f1;
    padding: 10px;
    border-radius: 8px;
    font-family: monospace;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.code-display:hover,
.link-display:hover {
    background: #e0e6e8;
}

.copy-feedback {
    position: absolute;
    top: -35px;
    right: 10px;
    background: #27ae60;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    pointer-events: none;
    animation: feedbackFade 1.5s ease-out forwards;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@keyframes feedbackFade {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    15% {
        opacity: 1;
        transform: translateY(0);
    }

    80% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-15px);
    }
}

.code-display span,
.link-display span {
    flex: 1;
    font-size: 1.2rem;
    font-weight: bold;
}



.waiting-message {
    text-align: center;
    margin: 1.5rem 0;
    font-size: 1.1rem;
    color: #7f8c8d;
}

.lobby-players h4 {
    margin-bottom: 1rem;
    color: #34495e;
}

.lobby-players ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lobby-players li {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #333;
}

/* Join Room */
.join-form {
    text-align: center;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #34495e;
}

.input-group input {
    padding: 12px 20px;
    font-size: 1.1rem;
    border: 3px solid #34495e;
    border-radius: 10px;
    background: white;
    font-family: inherit;
    width: 100%;
    max-width: 200px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}


.error-message {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #e74c3c;
    color: white;
    padding: 16px 24px;
    border-radius: 10px;
    text-align: center;
    z-index: 9999;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    font-size: 1.1rem;
    max-width: 90vw;
    width: 400px;
    pointer-events: auto;
}

@media (max-width: 600px) {
    .error-message {
        width: 90vw;
        font-size: 1rem;
        padding: 12px 10px;
    }
}

.error-message.hidden {
    display: none;
}

/* Quick Match */
.quickmatch-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Center align via sub-screen-center applied in index.html */
    text-align: center;
}

.matching-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #ecf0f1;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.matching-status p {
    font-size: 1.2rem;
    color: #34495e;
}

.sub-text {
    font-size: 1rem !important;
    color: #7f8c8d !important;
}

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

.cancel-btn {
    background: #e74c3c;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: #c0392b;
}

/* Game Screen */
#gameScreen {
    background: var(--board-bg, #2d5016);
}

.desktop-ui {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mobile-ui {
    display: none;
}

/* Desktop Game Layout */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 2px solid #34495e;
}

.top-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    background: #34495e;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1.2rem;
    min-width: 40px;
}

.control-btn:hover {
    background: #2c3e50;
}

.game-layout {
    display: flex;
    height: calc(100% - 60px);
    position: relative;
    overflow: hidden;
}

/* Classroom Decorations */
.game-layout::before {
    content: '📏';
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 3rem;
    transform: rotate(45deg);
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

.game-layout::after {
    content: '✏️';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 3rem;
    transform: rotate(-15deg);
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

.left-panel,
.right-panel {
    width: 260px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    z-index: 5;
}

.right-panel {
    padding-left: 0;
}

.left-panel {
    padding-right: 0;
}

.center-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.game-board-container {
    position: relative;
    max-width: 100%;
    max-height: 100%;
}

#gameBoard,
#mobileGameBoard {
    border: 3px solid #34495e;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background: var(--board-bg, #2d5016);
    /* Remove touch-action and pointer-events here to avoid conflict with mobile-specific rules */
}

/* Game board sizing moved to mobile.css */

/* Chat */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff8dc;
    border: 2px solid #8b4513;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chat-header {
    background: #8b4513;
    color: white;
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.chat-messages {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
    background: #fff8dc;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

/* Chat Bubble System */
.chat-bubble {
    margin-bottom: 12px;
    max-width: 85%;
    display: flex;
    flex-direction: column;
    animation: bubbleIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-bubble.own {
    align-self: flex-end;
}

.chat-bubble.other {
    align-self: flex-start;
}

.bubble-info {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 0.75rem;
    padding: 0 4px;
}

.own .bubble-info {
    flex-direction: row-reverse;
}

.bubble-name {
    font-weight: 700;
    color: #34495e;
}

.bubble-time {
    color: #7f8c8d;
}

.bubble-content {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.92rem;
    line-height: 1.4;
    word-break: break-word;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.own .bubble-content {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-bottom-right-radius: 4px;
}

.other .bubble-content {
    background: rgba(255, 255, 255, 0.95);
    color: #2c3e50;
    border-bottom-left-radius: 4px;
    border-left: 3px solid #34495e;
}

.system-message {
    align-self: center;
    font-size: 0.75rem;
    padding: 4px 12px;
    background: rgba(52, 73, 94, 0.1);
    color: #34495e;
    border-radius: 12px;
    margin: 8px 0;
    font-style: italic;
    text-align: center;
    width: fit-content;
}

.chat-input {
    display: flex;
    padding: var(--spacing-md);
    background: #8b4513;
    gap: 8px;
    align-items: center;
    position: relative;
}

.emoji-btn {
    background: transparent;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 6px;
    font-size: 1.2rem;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.emoji-btn:hover {
    background: rgba(255, 140, 0, 0.1);
}

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

.chat-input input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #8b6914;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    min-width: 0;
    background: #fffacd;
    transition: all 0.2s ease;
}

.chat-input input:focus {
    border-color: #ff8c00;
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.3);
    background: white;
}

.send-btn,
#desktopSendBtn,
#mobileSendBtn {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: 2px solid #1e8449;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 48px;
    min-height: 44px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.send-btn:hover,
#desktopSendBtn:hover,
#mobileSendBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

.send-btn:active,
#desktopSendBtn:active,
#mobileSendBtn:active {
    transform: translateY(0);
}

.emoji-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 10px;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    width: 226px;
    overflow: hidden;
    animation: pickerSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-color);
}

@keyframes pickerSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.emoji-picker.hidden {
    display: none;
}

.emoji-picker-container {
    display: flex;
    flex-direction: column;
}

.emoji-picker-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 6px;
    gap: 4px;
}

.emoji-picker-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    filter: none;
    opacity: 0.6;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-picker-tab:hover {
    background: rgba(0, 0, 0, 0.05);
    opacity: 0.8;
    filter: grayscale(0.5);
}

.emoji-picker-tab.active {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 1;
    transform: translateY(-1px);
}

.emoji-picker-tab.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 25%;
    right: 25%;
    height: 3px;
    background: var(--accent-color, #ff8c00);
    border-radius: 10px;
}

.emoji-picker-content {
    padding: 10px;
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
}

.emoji-category-list {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 8px 4px;
    overflow-x: hidden;
}

.emoji-category-list.active {
    display: grid;
}

.emoji-item {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    padding: 6px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-item:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.15);
}

.emoji-item:active {
    transform: scale(0.9);
}

/* Notification Badge */
.pulse-notif {
    position: relative;
}

.pulse-notif::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid white;
    animation: dotPulse 1.5s infinite;
}

@keyframes dotPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }

    70% {
        transform: scale(1.2);
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

/* Scoreboard */
.scoreboard-container {
    background: #f8f9fa;
    border: 3px solid #34495e;
    border-radius: 12px;
    padding: 20px;
    height: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scoreboard-container h3 {
    text-align: center;
    margin-bottom: 1.2rem;
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 800;
}

.score-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 8px;
    background: white;
    border-radius: 8px;
    border: 2px solid transparent;
}

/* Lobby Seating Grid */
.seating-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding: 10px;
}

.student-seat {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #34495e;
    border-radius: 16px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.student-seat.empty {
    opacity: 0.75;
    border-style: dashed;
    background: rgba(255, 255, 255, 0.15);
}

.student-seat.occupied {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background: white;
}

.student-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
}

.student-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-name {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.1rem;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
    word-break: break-all;
}

/* Green theme: make seat name and empty slot text readable */
.theme-greenboard .student-seat .student-name {
    color: #1a2a1a;
}

.theme-greenboard .student-seat.empty .student-name {
    color: rgba(255, 255, 255, 0.7);
}

.theme-greenboard .student-seat.empty .student-avatar {
    color: rgba(255, 255, 255, 0.8);
}

/* Lobby label/heading contrast on green theme */
.theme-greenboard #waitingText,
.theme-greenboard .lobby-label,
.theme-greenboard .room-info-text,
.theme-greenboard .room-info label,
.theme-greenboard .room-status-label {
    color: rgba(255, 255, 255, 0.92) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.host-badge,
.away-badge {
    position: absolute;
    top: -10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.host-badge {
    background: #f1c40f;
    right: -5px;
}

.away-badge {
    background: #e74c3c;
    left: -5px;
    animation: pulseRed 2s infinite;
}

@keyframes pulseRed {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

.score-item.current-player {
    border-color: #f39c12;
    background: #fef9e7;
}

/* Join Room Form Styling */
.join-form-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.join-input-group {
    text-align: center;
}

.join-input-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.join-input-field {
    width: 100%;
    padding: 1rem;
    font-size: 1.8rem;
    text-align: center;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-bg);
    color: var(--text-primary);
    text-transform: uppercase;
    font-family: inherit;
    letter-spacing: 6px;
    transition: all 0.2s ease;
}

.join-input-field:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.2);
}

.join-room-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--surface-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.score-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #333;
}

.score-name {
    font-weight: bold;
    font-size: 1rem;
}

.score-points {
    font-size: 1.1rem;
    font-weight: bold;
    color: #27ae60;
}

.current-turn {
    margin-top: 1rem;
    padding: 12px;
    background: #e8f4f8;
    border-radius: 12px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: turnPulse 2s infinite ease-in-out;
    transition: all 0.3s ease;
}

@keyframes turnPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }

    50% {
        transform: scale(1.03);
        box-shadow: 0 0 15px var(--player-turn-color, #f39c12);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }
}

/* Mobile UI */
.mobile-header {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.mobile-rule-btn {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    min-width: 32px !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease-in-out !important;
    border-radius: 50% !important;
}

.mobile-rule-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    transform: scale(1.1);
}

.mobile-rule-btn:active {
    transform: scale(0.95);
}

.mobile-rule-btn svg {
    width: 24px !important;
    height: 24px !important;
    stroke: currentColor !important;
    stroke-width: 2.2 !important;
}

.mobile-game-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    padding-bottom: 80px;
    margin-top: -2.5rem;
}

.current-turn-mobile {
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #34495e;
    font-weight: bold;
    font-size: 0.9rem;
    margin: 4.5rem auto 0.5rem auto;
    display: block;
    width: fit-content;
    max-width: 96vw;
}

.mobile-nav {
    display: none;
}

.nav-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    padding: 8px;
    border-radius: 8px;
    min-width: 45px;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover,
.nav-btn.active {
    background: #ecf0f1;
}

/* Mobile Drawers */
.mobile-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 3px solid #34495e;
    border-radius: 20px 20px 0 0;
    max-height: 70vh;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1100;
    display: flex;
    flex-direction: column;
}

.mobile-drawer.show {
    transform: translateY(0);
}

.mobile-drawer.hidden {
    display: none;
}

.drawer-header {
    background: #34495e;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.drawer-header:hover {
    background: #2c3e50;
}

.drawer-header h3 {
    margin: 0;
}

/* Down arrow icon for drawer close (right side) */
.drawer-header .drawer-arrow {
    font-size: 2rem;
    margin-left: 16px;
    user-select: none;
    pointer-events: none;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    padding: 2px 16px 2px 10px;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.08);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.drawer-header:hover .drawer-arrow {
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.13);
    transform: translateY(2px) scale(1.08);
}

.drawer-close {
    background: transparent;
    color: white;
    border: none;
    font-size: 1.2rem;
    padding: 5px;
}

.drawer-content {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(70vh - 60px);
    background: none;
}

/* Make mobile chat-messages always fill space above input */
.chat-messages#mobileChatMessages {
    flex: 1 1 auto;
    min-height: 0;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    backdrop-filter: blur(4px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Confirmation modal must always sit above all other modals */
#confirmModal {
    z-index: 1300;
}

.modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: #34495e;
    color: white;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-close {
    background: transparent;
    color: white;
    border: none;
    font-size: 1.2rem;
    padding: 5px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-body ul {
    list-style: none;
    padding-left: 0;
}

.modal-body li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
}

.modal-body li:before {
    content: "✏️";
    position: absolute;
    left: 0;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: stretch;
    margin-top: 20px;
    width: 100%;
}

.modal-buttons button,
.modal-buttons .confirm-btn,
.modal-buttons .cancel-btn {
    flex: 1;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 16px !important;
    font-size: 1rem !important;
    height: 48px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
    margin: 0 !important;
    min-width: 0;
    text-align: center;
}

.confirm-btn {
    background: #27ae60;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.confirm-btn:hover {
    background: #229954;
}

.final-scores {
    background: #f8f9fa;
    border: 2px solid #34495e;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.final-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
}

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

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

.final-score-points {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Support Button */
.support-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

.support-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #ff813f;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.support-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
/* Overrides handled in mobile.css */

/* Mobile home screen handling moved to mobile.css */

/* Animations */
@keyframes chalk-dust {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(2);
    }
}

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

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

.chalk-dust {
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    animation: chalk-dust 0.5s ease-out forwards;
    pointer-events: none;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti 3s ease-out forwards;
    pointer-events: none;
}

/* Custom Scrollbars */
.chat-messages::-webkit-scrollbar,
.drawer-content::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.drawer-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb,
.drawer-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.drawer-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

@media (max-width: 700px) {
    .home-container {
        padding: 15px;
        justify-content: flex-start;
        padding-top: 5vh;
        min-height: 100vh;
        box-sizing: border-box;
        /* Removed margin-top so container stretches to top */
    }
}

.setup-container {
    padding-bottom: 0 !important;
}

.setup-container .home-btn,
.room-container .home-btn,
.join-container .home-btn,
.quickmatch-container .home-btn {
    align-self: flex-start !important;
    margin-top: 0.7rem !important;
    margin-bottom: 0.5rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 9px !important;
    font-size: 0.95rem !important;
    padding: 7px 14px !important;
}

/* Standardized modal buttons handled above via .modal-buttons */





/* Desktop global chat left panel */
.desktop-global-chat-panel {
    position: fixed;
    right: 20px;
    top: 80px;
    bottom: 20px;
    width: 300px;
    background: transparent;
    z-index: 100;
    pointer-events: none;
    /* Let clicks pass through to background if not on container */
    display: flex;
    flex-direction: column;
}

.desktop-global-chat-panel>* {
    pointer-events: auto;
    /* Re-enable for children */
}

@media (max-width: 1250px) {
    .desktop-global-chat-panel {
        width: 260px;
        right: 10px;
    }
}

.global-chat-container {
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.global-chat-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.global-chat-messages {
    padding: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.global-chat-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 16px;
    background: var(--message-bg, #ffffff);
    border: 1px solid var(--border-color);
    font-family: var(--theme-font);
    animation: messageSlideIn 0.3s ease-out;
    position: relative;
}

.global-chat-message.own-message {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover, #0056b3));
    color: white;
    margin-left: 20%;
    flex-direction: row-reverse;
}

.global-chat-message.own-message .global-chat-message-name,
.global-chat-message.own-message .global-chat-message-time {
    color: rgba(255, 255, 255, 0.9);
}

.global-chat-message-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    object-fit: cover;
}

.global-chat-message-content {
    flex: 1;
    min-width: 0;
}

.global-chat-message-name {
    font-weight: bold;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.global-chat-message-text {
    font-size: 0.9rem;
    word-wrap: break-word;
    line-height: 1.4;
    margin-bottom: 4px;
}

.global-chat-message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.global-chat-input-row {
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
    background: var(--input-bg, #f8f9fa);
}

.global-chat-input-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--surface-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
}

.global-chat-input-row button {
    padding: 8px 16px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
}

.online-users-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: var(--surface-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.online-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

/* Animations */
@keyframes chalk-dust {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(2);
    }
}

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

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

.chalk-dust {
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    animation: chalk-dust 0.5s ease-out forwards;
    pointer-events: none;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti 3s ease-out forwards;
    pointer-events: none;
}

/* Custom Scrollbars */
.chat-messages::-webkit-scrollbar,
.drawer-content::-webkit-scrollbar,
.global-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.drawer-content::-webkit-scrollbar-track,
.global-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb,
.drawer-content::-webkit-scrollbar-thumb,
.global-chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

/* Rematch Roster Badge Styles */
.rematch-player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.rematch-player-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    font-family: inherit;
}

.theme-whiteboard .rematch-player-name {
    color: #333 !important;
}

.rematch-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1.5px dashed;
    font-family: inherit;
}

/* Ready Badges (Green chalk-style) */
.rematch-badge.badge-ready {
    background: rgba(46, 204, 113, 0.2) !important;
    color: #2ecc71 !important;
    border-color: #2ecc71 !important;
}
.theme-whiteboard .rematch-badge.badge-ready {
    background: rgba(39, 174, 96, 0.1) !important;
    color: #27ae60 !important;
    border-color: #27ae60 !important;
}

/* Thinking Badges (Grey chalk-style) */
.rematch-badge.badge-thinking {
    background: rgba(220, 220, 220, 0.15) !important;
    color: #bdc3c7 !important;
    border-color: #95a5a6 !important;
}
.theme-whiteboard .rematch-badge.badge-thinking {
    background: rgba(127, 135, 143, 0.1) !important;
    color: #7f8c8d !important;
    border-color: #7f8c8d !important;
}

/* Left Badges (Red chalk-style) */
.rematch-badge.badge-left {
    background: rgba(231, 76, 60, 0.2) !important;
    color: #e74c3c !important;
    border-color: #e74c3c !important;
}
.theme-whiteboard .rematch-badge.badge-left {
    background: rgba(192, 41, 43, 0.1) !important;
    color: #c0392b !important;
    border-color: #c0392b !important;
}