/* OutWorded Styles */

/* Game Screen Header Styles */
.game-screen-header {
    text-align: center;
    padding: 1rem 0 2rem 0;
    margin-bottom: 1rem;
}

.dont-get-title {
    font-family: 'Georgia', serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: #000000;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.outworded-tiles {
    display: flex;
    gap: 0.3rem;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 600px;
    margin: 0 auto;
}

.header-tile {
    width: 50px;
    height: 50px;
    background: linear-gradient(145deg, #e8d5b7 0%, #d4c5a4 50%, #c4b593 100%);
    color: #000000;
    border: 3px solid #000000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Georgia', serif;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.3);
    transform: perspective(100px) rotateX(5deg);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .dont-get-title {
        font-size: 2rem;
    }
    
    .header-tile {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .outworded-tiles {
        gap: 0.2rem;
    }
}

/* Mobile-First Responsive Design */
* {
    box-sizing: border-box;
}

/* Safe area support for notched devices */
:root {
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-right: env(safe-area-inset-right);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
    --safe-area-inset-left: env(safe-area-inset-left);
}

body {
    touch-action: manipulation; /* Improve touch responsiveness */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    overflow-x: hidden; /* Prevent horizontal scroll */
    background: #f4e8d0;
    color: #000000;
    font-family: 'Georgia', serif;
    padding-top: var(--safe-area-inset-top);
    padding-right: var(--safe-area-inset-right);
    padding-bottom: var(--safe-area-inset-bottom);
    padding-left: var(--safe-area-inset-left);
}

/* Title Screen Styles */
.title-screen-wrapper {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

/* Scroll Background - Removed */



/* Title Above Scroll */
.title-above-scroll {
    position: relative;
    z-index: 3;
    text-align: center;
    margin-bottom: 20px;
}

.title-wizard-container {
    margin-bottom: 20px;
}

.title-wizard-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: gentleFloat 3s ease-in-out infinite;
}

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Scroll Container */
.scroll-container {
    position: relative;
    z-index: 2;
    max-width: 500px;
    width: 90%;
    margin: 0 auto;
}

/* Parchment Scroll */
.parchment-scroll {
    background-color: #f4e4bc;
    border: 3px solid #8b6914;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3), inset 0 0 20px rgba(139, 105, 20, 0.1);
    position: relative;
    padding: 40px 30px 30px 30px;
    margin: 10px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #3c2415;
    text-align: center;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* Title Section */
.title-section {
    text-align: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.letter-tiles-title {
    margin-bottom: 15px;
}

.tiles-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.letter-tile {
    width: 100px;
    height: 100px;
    background: linear-gradient(145deg, #e8d5b7 0%, #d4c5a4 50%, #c4b593 100%);
    border: 3px solid #000000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: bold;
    color: #000000;
    font-family: 'Georgia', serif;
    box-shadow: 
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.letter-tile:hover {
    transform: translateY(-2px);
}

.subtitle {
    font-family: 'Georgia', serif;
    font-size: 1.4rem;
    color: #2c1810;
    font-weight: normal;
    line-height: 1.3;
    margin-top: 15px;
}

/* Name Input Section */
.name-input-section {
    margin-bottom: 20px;
    flex-shrink: 0;
}

.wizard-input-container {
    display: flex;
    align-items: center;
    background: rgba(244, 228, 193, 0.6);
    border: 2px solid #8b6914;
    border-radius: 15px;
    padding: 12px;
    gap: 12px;
    box-sizing: border-box;
    width: 100%;
}

.wizard-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    object-fit: contain;
}

.input-group {
    flex: 1;
}

.input-label {
    display: block;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    color: #2c1810;
    margin-bottom: 8px;
    font-weight: bold;
}

.wizard-name-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #2c1810;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-family: 'Georgia', serif;
    font-size: 1rem;
    color: #2c1810;
    box-sizing: border-box;
}

.wizard-name-input:focus {
    outline: none;
    border-color: #8b6914;
    box-shadow: 0 0 0 3px rgba(139, 105, 20, 0.2);
}

/* Game Modes Section */
.game-modes-section {
    margin-bottom: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.scroll-button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 10px;
    background: linear-gradient(145deg, #c69960 0%, #b8864d 50%, #a67c42 100%);
    border: 3px solid #2c1810;
    border-radius: 12px;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    font-weight: bold;
    color: #2c1810;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.scroll-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        0 6px 12px rgba(0, 0, 0, 0.3);
}

.scroll-button:active {
    transform: translateY(0);
}

/* Specific colors for different button types */
.scroll-button.join-friend {
    background: linear-gradient(145deg, #4a90e2 0%, #357abd 50%, #2868a3 100%);
    color: white;
    border-color: #1a4a6b;
}

.scroll-button.join-friend:hover {
    background: linear-gradient(145deg, #5ba3f5 0%, #4a90e2 50%, #357abd 100%);
}

.button-icon {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    object-fit: contain;
}

/* Music Section */
.music-section {
    text-align: center;
    flex-shrink: 0;
    margin-top: 10px;
}

.music-toggle {
    background: linear-gradient(145deg, #f4e4c1 0%, #e8d5b7 50%, #d4c5a4 100%);
    border: 2px solid #2c1810;
    border-radius: 8px;
    padding: 6px 12px;
    font-family: 'Georgia', serif;
    font-size: 0.8rem;
    color: #2c1810;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.music-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.title-screen-content {
    text-align: center;
    max-width: 800px;
    width: 100%;
}

.title-container {
    margin-bottom: 2rem;
}

.game-title {
    margin-bottom: 2rem;
    perspective: 1000px;
}

.title-tiles-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    width: 100%;
}

.title-tiles-row {
    display: flex;
    gap: 0.3rem;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.title-tile {
    width: clamp(45px, 10vw, 80px);
    height: clamp(45px, 10vw, 80px);
    background: linear-gradient(145deg, #e8d5b7 0%, #d4c5a4 50%, #c4b593 100%);
    border: 2px solid #000000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(2rem, 7vw, 3.5rem);
    font-weight: bold;
    color: #000000;
    font-family: 'Georgia', serif;
    text-transform: uppercase;
    box-shadow: 
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.title-tile:hover {
    transform: translateY(-2px);
}

.game-subtitle {
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: #000000;
    font-family: 'Georgia', serif;
    text-align: center;
    margin: 1rem 0 2rem 0;
    font-style: italic;
}

.game-menu-card {
    background: rgba(244, 232, 208, 0.95);
    border: 3px solid #000000;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    max-width: 500px;
    width: 100%;
    backdrop-filter: blur(5px);
    margin: 0 auto;
    margin: 0 auto;
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.menu-header i {
    font-size: 1.2rem;
    color: #000000;
}

.menu-title {
    font-size: clamp(1rem, 4vw, 1.5rem);
    font-weight: bold;
    color: #000000;
    font-family: 'Georgia', serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
}

.vintage-button {
    background: linear-gradient(145deg, #d4a574 0%, #b8935a 50%, #a67c52 100%);
    border: 2px solid #000000;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: bold;
    color: #000000;
    font-family: 'Georgia', serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.3);
    margin: 0.5rem 0;
    width: 100%;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.vintage-button:hover {
    transform: translateY(-2px);
    background: linear-gradient(145deg, #ddb080 0%, #c19d66 50%, #b08758 100%);
    box-shadow: 
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2),
        0 6px 12px rgba(0, 0, 0, 0.4);
    color: #000000;
}

.vintage-button:active {
    transform: translateY(1px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

.vintage-button.primary {
    background: linear-gradient(145deg, #8fbc8f 0%, #6b8e6b 50%, #5a7a5a 100%);
    border-color: #4a5c4a;
}

.vintage-button.primary:hover {
    background: linear-gradient(145deg, #9cc69c 0%, #7a9e7a 50%, #668866 100%);
}

.vintage-button.secondary {
    background: linear-gradient(145deg, #b8935a 0%, #a67c52 50%, #8b6442 100%);
    border-color: #7a5a3f;
}

.vintage-button.secondary:hover {
    background: linear-gradient(145deg, #c29f66 0%, #b08758 50%, #956f4a 100%);
}

/* Action buttons styling - maintain current size */
.vintage-button[onclick="clearWord()"],
.vintage-button[onclick="shuffleTiles()"],
.vintage-button[onclick="showTileSwapModal()"] {
    width: auto;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    margin: 0.25rem;
    display: inline-block;
}

/* Vintage form elements */
.vintage-input {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #000000;
    border-radius: 8px;
    padding: 0.75rem;
    width: 100%;
    font-family: 'Georgia', serif;
    color: #000000;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Apply vintage theme to all cards and modals */
.card {
    background: rgba(244, 232, 208, 0.95) !important;
    border: 3px solid #000000 !important;
    border-radius: 15px !important;
    color: #000000 !important;
    font-family: 'Georgia', serif !important;
    text-align: center !important;
}

.card-body {
    background: transparent !important;
    color: #000000 !important;
    font-family: 'Georgia', serif !important;
    text-align: center !important;
}

.card-title, .card h3, .card h4, .card h5 {
    color: #000000 !important;
    font-family: 'Georgia', serif !important;
    font-weight: bold !important;
    text-align: center !important;
}

/* Form elements in modals */
.form-label {
    color: #000000 !important;
    font-family: 'Georgia', serif !important;
    font-weight: bold !important;
    text-align: center !important;
}

.form-control {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 2px solid #000000 !important;
    border-radius: 8px !important;
    color: #000000 !important;
    font-family: 'Georgia', serif !important;
    text-align: center !important;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: #6b4e3d !important;
    color: #000000 !important;
    box-shadow: 0 0 0 3px rgba(107, 78, 61, 0.2) !important;
    text-align: center !important;
}

.form-check-label {
    color: #000000 !important;
    font-family: 'Georgia', serif !important;
    text-align: center !important;
}

.form-check-input:checked {
    background-color: #000000 !important;
    border-color: #000000 !important;
}

.vintage-input:focus {
    outline: none;
    border-color: #6b4e3d;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 0 3px rgba(107, 78, 61, 0.2);
}

.vintage-input::placeholder {
    color: #000000;
    opacity: 0.8;
}

.vintage-label {
    color: #000000;
    font-family: 'Georgia', serif;
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: block;
    font-size: 1rem;
    text-align: center;
}

.vintage-radio-group {
    margin: 1rem 0;
    text-align: center;
}

.vintage-radio-option {
    margin: 0.75rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid #000000;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.vintage-radio-option:hover {
    background: rgba(255, 255, 255, 0.5);
    border-color: #6b4e3d;
}

.vintage-radio-option.selected {
    background: rgba(212, 165, 116, 0.3);
    border-color: #6b4e3d;
}

.vintage-radio {
    margin-right: 0.75rem;
    accent-color: #000000;
}

.vintage-radio-label {
    color: #000000 !important;
    font-family: 'Georgia', serif;
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    width: 100%;
    text-align: center;
}

/* Force all text elements to be dark */
* {
    color: #000000 !important;
}

/* Override any white text specifically */
.text-white,
.text-light,
.text-muted {
    color: #000000 !important;
}

/* Ensure form labels and inputs have dark text */
label,
input,
select,
textarea,
.form-label,
.form-control {
    color: #000000 !important;
}

/* Ensure all card text is dark */
.card,
.card *,
.card-body,
.card-title,
.card-text {
    color: #000000 !important;
}

/* Make specific text white - add the class name you want to be white */
.white-text,
.text-white-override {
    color: #ffffff !important;
}

.decorative-tiles {
    display: flex;
    justify-content: center;
}

.tile-decoration {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.tile-decoration {
    width: clamp(40px, 8vw, 60px);
    height: clamp(40px, 8vw, 60px);
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border: 2px solid #67e8f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 4px 15px rgba(6, 182, 212, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    animation: float 3s ease-in-out infinite;
    font-family: 'Orbitron', 'Arial Black', sans-serif;
}

.tile-decoration:nth-child(1) { animation-delay: 0s; }
.tile-decoration:nth-child(2) { animation-delay: 0.5s; }
.tile-decoration:nth-child(3) { animation-delay: 1s; }
.tile-decoration:nth-child(4) { animation-delay: 1.5s; }

.title-footer {
    position: relative;
    text-align: center;
    color: #000000;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 10;
    margin-top: 15px;
    margin-bottom: 10px;
    clear: both;
}

.title-footer a {
    color: #000000;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: bold;
}

.title-footer a:hover {
    color: #333333;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.title-footer p {
    margin: 0;
    margin-bottom: 4px;
}

.title-footer p:last-child {
    margin-bottom: 0;
}

.feedback-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #4a90e2 !important;
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.feedback-link:hover {
    color: #357abd !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Title Screen Animations */
@keyframes glow-cyan {
    0% { text-shadow: 0 0 20px rgba(6, 182, 212, 0.5), 0 0 40px rgba(6, 182, 212, 0.3), 0 0 60px rgba(6, 182, 212, 0.2); }
    100% { text-shadow: 0 0 30px rgba(6, 182, 212, 0.8), 0 0 60px rgba(6, 182, 212, 0.5), 0 0 90px rgba(6, 182, 212, 0.3); }
}

@keyframes glow-orange {
    0% { text-shadow: 0 0 20px rgba(249, 115, 22, 0.5), 0 0 40px rgba(249, 115, 22, 0.3), 0 0 60px rgba(249, 115, 22, 0.2); }
    100% { text-shadow: 0 0 30px rgba(249, 115, 22, 0.8), 0 0 60px rgba(249, 115, 22, 0.5), 0 0 90px rgba(249, 115, 22, 0.3); }
}

@keyframes glow-orange-intense {
    0% { text-shadow: 0 0 30px rgba(249, 115, 22, 0.6), 0 0 60px rgba(249, 115, 22, 0.4), 0 0 90px rgba(249, 115, 22, 0.3); }
    100% { text-shadow: 0 0 40px rgba(249, 115, 22, 0.9), 0 0 80px rgba(249, 115, 22, 0.6), 0 0 120px rgba(249, 115, 22, 0.4); }
}

@keyframes pulse-icon {
    0% { filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.7)) scale(1); }
    50% { filter: drop-shadow(0 0 20px rgba(6, 182, 212, 1)) scale(1.1); }
    100% { filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.7)) scale(1); }
}

/* Player Statistics Display */
.stats-display-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #8B4513;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.stats-header {
    font-family: Georgia, serif;
    font-size: 1.2rem;
    font-weight: bold;
    color: #000000;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stats-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    background: rgba(139, 69, 19, 0.1);
    border-radius: 8px;
    border: 1px solid #8B4513;
}

.stats-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.2rem;
    font-family: Georgia, serif;
}

.stats-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #000000;
    font-family: Georgia, serif;
}

.stats-value.win-count {
    color: #388e3c;
}

.stats-value.loss-count {
    color: #d32f2f;
}

.reset-stats-btn {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-color: #8B4513;
    color: #8B4513;
    background: transparent;
    transition: all 0.3s ease;
}

.reset-stats-btn:hover {
    background: #8B4513;
    color: white;
    transform: translateY(-2px);
}

/* Mobile responsive stats */
@media (max-width: 576px) {
    .stats-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.3rem;
    }
    
    .stats-display-container {
        margin: 1rem 0;
        padding: 1rem;
    }
    
    .stats-header {
        font-size: 1rem;
    }
    
    .stats-value {
        font-size: 1rem;
    }
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(2deg); }
    66% { transform: translateY(5px) rotate(-1deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

/* Mobile-First Responsive Design Enhancements */

/* Mobile Modal Optimization */
.mobile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-modal-content {
    width: 100%;
    max-width: min(95vw, 500px);
    margin: 10px auto;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.mobile-modal-body {
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
}

.mobile-modal-actions {
    position: sticky;
    bottom: 0;
    background: inherit;
    padding: 1rem;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    margin-top: auto;
}

/* Game Menu Cards - Mobile Optimized */
.game-menu-card {
    background: linear-gradient(135deg, #f4e8d0 0%, #e8dcc0 100%);
    border: 3px solid #000000;
    border-radius: 15px;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
    margin: 10px auto;
    max-height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
}

/* Menu Header - Fixed Height */
.menu-header {
    background: linear-gradient(135deg, #d4a574 0%, #b8956b 100%);
    border-bottom: 2px solid #000000;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #000000;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Scrollable Content Area */
.menu-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1.5rem;
    min-height: 0;
}

/* Fixed Action Area */
.menu-actions {
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 1.5rem;
    background: inherit;
    flex-shrink: 0;
}

/* Mobile-Specific Enhancements */
@media (max-width: 768px) {
    /* Modal improvements for mobile */
    .mobile-modal-overlay {
        padding: 5px;
    }
    
    .mobile-modal-content {
        max-width: calc(100vw - 10px);
        margin: 5px auto;
    }
    
    .menu-header {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .menu-content {
        padding: 1rem;
        max-height: calc(100vh - 200px);
    }
    
    .menu-actions {
        padding: 1rem;
    }
    
    /* Button improvements for mobile */
    .vintage-button {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        touch-action: manipulation;
    }
    
    /* Game interface improvements */
    .game-interface {
        padding: 0.5rem;
    }
    
    .game-board {
        margin: 0.5rem 0;
    }
    
    /* Tiles and interactive elements */
    .tile {
        min-width: 44px;
        min-height: 44px;
        font-size: 1.2rem;
    }
    
    /* Input improvements */
    input, textarea, select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
}

/* Small phones (320px - 480px) */
@media (max-width: 480px) {
    .title-screen-wrapper {
        padding: 10px;
        min-height: 100vh;
    }

    .title-tile {
        width: clamp(35px, 12vw, 50px);
        height: clamp(35px, 12vw, 50px);
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .game-menu-card {
        padding: 1rem;
        margin: 0 auto;
    }

    .menu-title {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
    }

    .vintage-button {
        padding: 0.8rem 1.5rem;
        font-size: clamp(0.9rem, 4vw, 1.2rem);
        margin: 0.3rem 0;
    }

    .vintage-input {
        padding: 0.6rem;
        font-size: 1rem;
    }

    .title-footer {
        bottom: 5px;
        font-size: 0.7rem;
        padding: 0 10px;
    }

    /* Game interface mobile optimizations */
    .container {
        padding: 5px;
    }

    .vintage-card {
        padding: 0.5rem;
        margin: 0.25rem 0;
    }

    .menu-header {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .menu-header i {
        font-size: 1.5rem;
    }

    .tile {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }

    .tile-small {
        width: 20px;
        height: 20px;
        font-size: 0.9rem;
    }

    .tiles-grid {
        gap: 3px;
        padding: 6px;
        min-height: 40px;
    }

    .word-drop-zone {
        min-height: 40px;
        padding: 6px;
        gap: 3px;
    }

    /* Action buttons for mobile */
    .vintage-button[onclick="clearWord()"],
    .vintage-button[onclick="shuffleTiles()"],
    .vintage-button[onclick="showTileSwapModal()"] {
        width: 100%;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        margin: 0.2rem 0;
        display: block;
    }

    /* Stack action buttons vertically on mobile */
    .mt-3 {
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
    }

    /* Game board responsive layout */
    .col-md-4,
    .col-md-6,
    .col-md-8 {
        width: 100%;
        margin-bottom: 1rem;
    }

    .row {
        margin: 0;
    }

    /* Clue and guess displays */
    .clue-used,
    .guess-item {
        padding: 4px 8px;
        font-size: 0.8rem;
        margin: 2px;
    }

    /* Game info adjustments */
    .game-info {
        margin: 10px 0;
        text-align: center;
    }

    .game-info span {
        display: inline-block;
        margin: 0.2rem;
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Medium phones (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .title-screen-wrapper {
        padding: 15px;
    }

    .title-tile {
        width: clamp(50px, 10vw, 70px);
        height: clamp(50px, 10vw, 70px);
        font-size: clamp(2rem, 6vw, 3rem);
    }

    .game-menu-card {
        padding: 1.5rem;
        max-width: 600px;
    }

    .vintage-button {
        padding: 0.9rem 1.8rem;
        font-size: clamp(1rem, 3.5vw, 1.3rem);
    }

    .tile {
        width: 45px;
        height: 45px;
        font-size: 1.8rem;
    }

    .tile-small {
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
    }

    .tiles-grid {
        gap: 7px;
        padding: 12px;
    }

    /* Action buttons in tablet view */
    .vintage-button[onclick="clearWord()"],
    .vintage-button[onclick="shuffleTiles()"],
    .vintage-button[onclick="showTileSwapModal()"] {
        width: auto;
        padding: 0.7rem 1.2rem;
        font-size: 0.95rem;
        margin: 0.2rem;
        display: inline-block;
    }

    .title-footer {
        bottom: 10px;
        font-size: 0.8rem;
    }
}

/* Large tablets and small desktops (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .title-tile {
        width: clamp(60px, 8vw, 75px);
        height: clamp(60px, 8vw, 75px);
    }

    .container {
        padding: 15px;
    }
}

/* Touch-friendly enhancements for all mobile devices */
@media (max-width: 768px) {
    /* Increase touch targets */
    .tile,
    .vintage-button,
    .form-control,
    .vintage-input {
        min-height: 44px; /* Apple's recommended minimum touch target */
        touch-action: manipulation;
    }

    /* Prevent zoom on input focus */
    .vintage-input,
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Better spacing for touch */
    .tiles-grid {
        touch-action: manipulation;
    }

    /* Stack columns on mobile */
    .row > div {
        margin-bottom: 0.5rem;
    }

    /* Full width buttons on mobile */
    .d-grid .vintage-button {
        width: 100%;
    }

    /* Better modal sizing */
    .game-menu-card,
    .vintage-card {
        max-width: calc(100vw - 20px);
        margin: 0.5rem auto;
    }

    /* Responsive text sizing */
    h1, .display-4 {
        font-size: clamp(1.2rem, 5vw, 2rem);
        margin: 0.5rem 0;
    }

    h2, h3, h4, h5 {
        font-size: clamp(1rem, 3.5vw, 1.4rem);
        margin: 0.3rem 0;
    }

    p, .lead {
        font-size: clamp(0.8rem, 2.5vw, 1rem);
        margin: 0.2rem 0;
    }

    /* Better game board layout on mobile */
    #game-board .col-md-4,
    #game-board .col-md-8 {
        order: 2;
    }
}

/* Discovered Letter Styles */
.discovered-letter {
    background-color: #4CAF50 !important;
    color: #ffffff !important;
    border: 3px solid #388E3C !important;
    position: relative;
    animation: discoveredPulse 1s ease-in-out;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
}

.discovered-letter::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    background: #2E7D32;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

@keyframes discoveredPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.8);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
    }
}

/* Opponent Tiles Drag and Drop */
.opponent-tiles-container {
    min-height: 60px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid #000000;
    border-radius: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.opponent-tile {
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}

.opponent-tile:hover {
    transform: translateY(-2px);
    box-shadow: 
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2),
        0 6px 12px rgba(0, 0, 0, 0.4);
}

.opponent-tile.dragging {
    opacity: 0.7;
    transform: rotate(5deg) scale(1.1);
    z-index: 1000;
    cursor: grabbing;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.opponent-tiles-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.opponent-tiles-header small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-style: italic;
}

/* Mobile touch improvements for opponent tiles */
@media (max-width: 768px) {
    .opponent-tile {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .opponent-tiles-container {
        padding: 10px;
        min-height: 70px;
    }
    
    .opponent-tiles-header small {
        font-size: 0.75rem;
    }
}

#game-board .col-md-4:first-child {
    order: 1;
}

/* Mobile responsive adjustments for scroll design */
@media (max-width: 768px) {
    .title-screen-wrapper {
        padding: 5px 3px;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .scroll-container {
        max-width: 100%;
        width: 100%;
        padding: 0 5px;
    }

    .parchment-scroll {
        padding: 30px 20px 25px 20px;
        margin: 0;
        min-height: auto;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    .letter-tile {
        width: 60px;
        height: 60px;
        font-size: 2.2rem;
        border-width: 2px;
    }

    .tiles-row {
        gap: 8px;
        margin-bottom: 8px;
    }

    .scroll-button {
        padding: 10px 15px !important;
        font-size: 0.9rem;
        margin-bottom: 8px;
        border-width: 2px;
        width: 90% !important;
        max-width: 90% !important;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .button-icon {
        width: 18px;
        height: 18px;
        margin-right: 8px;
    }

    .wizard-input-container {
        padding: 10px !important;
        gap: 8px;
        flex-direction: row;
        text-align: left;
        align-items: center;
        max-width: 90% !important;
        width: 90% !important;
        margin: 0 auto;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .input-group {
        flex: 1;
        min-width: 0;
        max-width: 100% !important;
        width: 100% !important;
    }

    .wizard-icon {
        width: 22px;
        height: 22px;
    }

    .wizard-name-input {
        padding: 10px 12px !important;
        font-size: 0.9rem;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .subtitle {
        font-size: 0.85rem;
        line-height: 1.1;
        margin-top: 8px;
    }

    .music-toggle {
        padding: 3px 6px;
        font-size: 0.65rem;
        gap: 3px;
    }

    .title-footer {
        bottom: 3px;
        font-size: 0.65rem;
    }

    .title-section {
        margin-bottom: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .name-input-section {
        margin-bottom: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .game-modes-section {
        margin-bottom: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .input-label {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }

    .letter-tiles-title {
        margin-bottom: 10px;
    }

    .title-above-scroll {
        margin-bottom: 15px;
    }
}

/* Very small mobile screens */
@media (max-width: 480px) {
    .scroll-container {
        padding: 0 3px;
    }

    .parchment-scroll {
        padding: 20px 12px 15px 12px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .letter-tile {
        width: 46px;
        height: 46px;
        font-size: 1.6rem;
    }

    .tiles-row {
        gap: 4px;
    }

    .scroll-button {
        padding: 8px 12px;
        font-size: 0.8rem;
        width: 85% !important;
        max-width: 85% !important;
        margin-left: auto;
        margin-right: auto;
        border-width: 2px;
    }

    .button-icon {
        width: 24px;
        height: 24px;
        margin-right: 6px;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .wizard-name-input {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    .input-label {
        font-size: 0.7rem;
    }

    .wizard-icon {
        width: 18px;
        height: 18px;
    }

    .wizard-input-container {
        padding: 8px;
        gap: 6px;
        max-width: 85%;
        width: 85%;
        margin: 0 auto;
        box-sizing: border-box;
    }

    .music-toggle {
        padding: 2px 4px;
        font-size: 0.6rem;
        gap: 2px;
    }

    .title-footer {
        font-size: 0.6rem;
    }

    .title-above-scroll {
        margin-bottom: 10px;
    }

    .title-wizard-image {
        width: 80px;
        height: 80px;
    }

    .title-wizard-container {
        margin-bottom: 10px;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .title-screen-wrapper {
        padding: 3px 10px;
    }

    .parchment-scroll {
        min-height: 300px;
        padding: 15px 10px 10px 10px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .title-container {
        margin-bottom: 0.5rem;
    }

    .game-subtitle {
        margin: 0.25rem 0 0.5rem 0;
    }

    .title-footer {
        position: relative;
        margin-top: 0.5rem;
    }

    .letter-tile {
        width: 45px;
        height: 45px;
        font-size: 1.8rem;
        border-width: 2px;
    }

    .scroll-button {
        padding: 8px 12px;
        font-size: 1rem;
        margin-bottom: 6px;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .wizard-input-container {
        padding: 3px;
        gap: 3px;
    }

    .wizard-icon {
        width: 16px;
        height: 16px;
    }

    .wizard-name-input {
        padding: 8px 12px;
        font-size: 1rem;
    }

    .input-label {
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .button-icon {
        width: 20px;
        height: 20px;
        margin-right: 4px;
    }

    .music-toggle {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .tiles-row {
        gap: 6px;
        margin-bottom: 6px;
    }

    .letter-tile {
        width: 85px;
        height: 85px;
        font-size: 3rem;
    }

    .title-wizard-image {
        width: 60px;
        height: 60px;
    }

    .title-wizard-container {
        margin-bottom: 8px;
    }

    .title-footer {
        font-size: 0.9rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .tile,
    .title-tile {
        border-width: 1px; /* Thinner borders on high DPI */
    }
}

/* Game Interface Styling */
.vintage-card {
    background: rgba(244, 232, 208, 0.95);
    border: 3px solid #000000;
    border-radius: 15px;
    padding: 0.75rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    margin: 0.5rem 0;
    backdrop-filter: blur(5px);
}

/* Desktop Layout Centering */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    #game-board .container {
        max-width: 1200px;
    }
    
    #word-selection .container {
        max-width: 800px;
    }
    
    #game-over .container {
        max-width: 1000px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 1100px;
        margin: 0 auto;
    }
    
    #game-board .container {
        max-width: 1000px;
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    .container {
        max-width: 900px;
        margin: 0 auto;
    }
}

.tiles-container {
    margin: 8px 0;
}

.tiles-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin: 8px 0;
    min-height: 60px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid #000000;
    border-radius: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}This CSS file is modified to make the clue buttons smaller and more compact in the "Your Turn" section.
.tiles-grid-small {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

/* Ensure opponent tiles display uses same spacing */
#opponent-tiles-display .d-flex {
    gap: 4px !important;
}

.tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: linear-gradient(145deg, #e8d5b7 0%, #d4c5a4 50%, #c4b593 100%);
    border: 2px solid #000000;
    border-radius: 6px;
    font-size: 1.4rem;
    font-weight: bold;
    color: #000000;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    box-shadow: 
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.3);
    font-family: 'Georgia', serif;
}

.tile:hover {
    transform: translateY(-2px);
    background: linear-gradient(145deg, #f0e2c9 0%, #ddc9a8 50%, #ccb89a 100%);
    box-shadow: 
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2),
        0 6px 12px rgba(0, 0, 0, 0.4);
}

.tile.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    z-index: 1000;
    cursor: grabbing;
}

.tile.used {
    background: var(--bs-secondary);
    opacity: 0.6;
    pointer-events: none;
}

.tile-small {
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
    padding: 0.4rem 0.8rem;
}

/* Compact clue buttons */
.vintage-button.small.clue-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    min-height: 35px;
    line-height: 1.2;
}

.game-info {
    margin: 8px 0;
}

.word-input {
    max-width: 400px;
    margin: 0 auto;
}

.clue-option {
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clue-option:hover {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-primary);
}

/* Disabled button styles */
.vintage-button.disabled,
.vintage-button:disabled,
button.disabled,
button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: #cccccc !important;
    border-color: #999999 !important;
    color: #666666 !important;
}

.vintage-input:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background-color: #f5f5f5 !important;
    color: #666666 !important;
}

.clue-used {
    background: var(--bs-primary);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 5px;
    display: inline-block;
    font-size: 0.9rem;
    line-height: 1.4;
    min-height: auto;
    width: auto;
    box-sizing: border-box;
}

/* Opponent clue styling with orange background - force override everything */
#opponent-clues-display .clue-used,
#opponent-clues-display .clue-used.bg-light,
#opponent-clues-display .clue-used.small,
#opponent-clues-display div.clue-used,
#opponent-clues-display div[class*="clue"] {
    background: #ff8c00 !important;
    background-color: #ff8c00 !important;
    color: white !important;
    border: 1px solid rgba(255, 140, 0, 0.3) !important;
}

/* Fix opponent clues container completely */
#opponent-clues-display,
#opponent-clues-display *,
#opponent-clues-display .text-muted,
#opponent-clues-display p,
#opponent-clues-display div {
    color: #000000 !important;
    background: transparent !important;
    background-color: transparent !important;
}

/* Override any Bootstrap light classes in opponent clues */
#opponent-clues-display .bg-light,
#opponent-clues-display .bg-light *,
#opponent-clues-display [class*="bg-light"],
#opponent-clues-display .small.bg-light {
    background: transparent !important;
    background-color: transparent !important;
    color: #000000 !important;
}

/* Force the card containing opponent clues to be dark */
.card:has(#opponent-clues-display),
.card:has(#opponent-clues-display) .card-body,
.card:has(#opponent-clues-display) * {
    background: var(--bs-light) !important;
    background-color: var(--bs-light) !important;
    color: #000000 !important;
}

/* Opponent guesses styling with purple background - force override everything */
#opponent-guesses-display .guess-item,
#opponent-guesses-display .guess-item.bg-light,
#opponent-guesses-display div.guess-item,
#opponent-guesses-display div[class*="guess"] {
    background: #8e44ad !important;
    background-color: #8e44ad !important;
    color: white !important;
    border: 1px solid rgba(142, 68, 173, 0.3) !important;
}

/* Fix opponent guesses container completely */
#opponent-guesses-display,
#opponent-guesses-display *,
#opponent-guesses-display .text-muted,
#opponent-guesses-display p,
#opponent-guesses-display div {
    color: #000000 !important;
    background: transparent !important;
    background-color: transparent !important;
}

/* Override any Bootstrap light classes in opponent guesses */
#opponent-guesses-display .bg-light,
#opponent-guesses-display .bg-light *,
#opponent-guesses-display [class*="bg-light"] {
    background: transparent !important;
    background-color: transparent !important;
    color: #000000 !important;
}

/* Force the card containing opponent guesses to be dark */
.card:has(#opponent-guesses-display),
.card:has(#opponent-guesses-display) .card-body,
.card:has(#opponent-guesses-display) * {
    background: var(--bs-light) !important;
    background-color: var(--bs-light) !important;
    color: #000000 !important;
}

.guess-item {
    background: var(--bs-danger);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    margin: 3px;
    display: inline-block;
    font-weight: bold;
}

.turn-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.not-your-turn {
    text-align: center;
    padding: 20px;
    color: var(--bs-text-muted);
}

.ai-thinking {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: var(--bs-info);
}

.game-winner {
    color: var(--bs-success);
    font-weight: bold;
}

.game-loser {
    color: var(--bs-danger);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tile {
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }

    .tile-small {
        width: 25px;
        height: 25px;
        font-size: 1rem;
    }

    .tiles-grid {
        gap: 6px;
    }

    .turn-action-buttons {
        flex-direction: column;
    }
}

/* Animation for game state changes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Custom alert styles */
.alert-custom {
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Loading states */
.btn-loading {
    position: relative;
}

.btn-loading:disabled {
    opacity: 0.7;
}

.btn-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Game Over Screen Enhancements */
.game-over-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #f4e8d0 0%, #e8d5b7 50%, #d4c5a4 100%);
    border: 4px solid #000000;
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.4);
    padding: 2rem;
}

.game-over-header {
    margin-bottom: 2rem;
}

.game-over-bird {
    width: 150px;
    height: 150px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: celebrateBounce 2s ease-in-out infinite;
}

@keyframes celebrateBounce {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(3deg); }
    50% { transform: translateY(-10px) rotate(0deg); }
    75% { transform: translateY(-5px) rotate(-3deg); }
}

.final-words-display {
    margin: 2rem 0;
}

.word-reveal-card {
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid #000000;
    border-radius: 15px;
    padding: 1.5rem;
    margin: 0.5rem 0;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease;
}

.word-reveal-card:hover {
    transform: translateY(-3px);
}

.word-reveal-card.your-word {
    border-color: #4CAF50;
    background: linear-gradient(145deg, rgba(76, 175, 80, 0.1) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.word-reveal-card.opponent-word {
    border-color: #FF5722;
    background: linear-gradient(145deg, rgba(255, 87, 34, 0.1) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.word-label {
    font-family: Georgia, serif;
    font-weight: bold;
    font-size: 1.1rem;
    color: #000000;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.word-display {
    font-family: Georgia, serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: #000000;
    margin: 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    line-height: 1.2;
}

.word-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.strokes-count, .record-display {
    font-family: Georgia, serif;
    font-weight: bold;
    color: #000000;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stroke-number {
    color: #d32f2f;
    font-size: 1.2rem;
}

.win-count {
    color: #388e3c;
}

.loss-count {
    color: #d32f2f;
}

.game-over-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.game-over-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    min-width: 180px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.game-over-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Confetti Animation */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0.8;
    animation: confetti-fall 3s linear infinite;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(calc(100vh + 100px)) rotate(360deg);
        opacity: 0;
    }
}

/* Winner/Loser specific styling */
.game-winner {
    color: #4CAF50 !important;
    text-shadow: 2px 2px 4px rgba(76, 175, 80, 0.3);
    animation: winnerGlow 2s ease-in-out infinite alternate;
}

.game-loser {
    color: #f44336 !important;
    text-shadow: 2px 2px 4px rgba(244, 67, 54, 0.3);
}

@keyframes winnerGlow {
    0% { 
        text-shadow: 2px 2px 4px rgba(76, 175, 80, 0.3);
    }
    100% { 
        text-shadow: 2px 2px 8px rgba(76, 175, 80, 0.6), 0 0 20px rgba(76, 175, 80, 0.4);
    }
}

/* Mobile responsive adjustments for game over screen */
@media (max-width: 768px) {
    .game-over-card {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .game-over-bird {
        width: 120px;
        height: 120px;
    }
    
    .word-display {
        font-size: 2rem;
    }
    
    .word-reveal-card {
        padding: 1rem;
        margin: 0.25rem 0;
    }
    
    .game-over-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .game-over-btn {
        width: 100%;
        max-width: 300px;
        margin: 0.25rem 0;
    }
}

/* Game board layout improvements */
.card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid var(--bs-border-color);
}

.card-header {
    background: var(--bs-secondary-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

/* Spacing improvements */
.container {
    padding: 8px;
    margin-left: auto;
    margin-right: auto;
}

.container-fluid {
    min-height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Center all main content areas */
#title-screen,
#word-selection,
#game-board,
#game-over,
#join-game-modal,
#ai-game-modal,
#loading-spinner {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* Music toggle button */
#music-toggle-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(0, 0, 0, 0.3) !important;
    color: #000000 !important;
    font-size: 0.875rem !important;
    transition: all 0.3s ease !important;
}

#music-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-1px) !important;
}

/* Button improvements */
.btn-lg {
    padding: 12px 24px;
    font-size: 1.1rem;
}

/* Word building area */
.word-drop-zone {
    min-height: 50px;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid #000000;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.word-drop-zone.drag-over {
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
    border-style: solid;
}

.word-drop-zone .drop-hint {
    color: var(--bs-text-muted);
    font-style: italic;
    position: absolute;
    pointer-events: none;
}

.word-drop-zone.has-tiles .drop-hint {
    display: none;
}

.word-tile {
    background: var(--bs-success);
    color: white;
    position: relative;
}

.word-tile .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: var(--bs-danger);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.word-tile .remove-btn:hover {
    opacity: 1;
}

/* Input improvements */
.form-control-lg {
    font-size: 1.2rem;
    padding: 12px 16px;
}

/* Badge improvements */
.badge {
    font-size: 0.9rem;
    padding: 6px 12px;
}

/* === SUPPORT SYSTEM STYLES === */
.support-button {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.support-button:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.support-mini-button {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.support-mini-button:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.support-content {
    color: #000;
}

.support-message {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 15px;
}

.support-text {
    font-size: 14px;
    line-height: 1.5;
}

.support-benefit {
    background: rgba(108, 117, 125, 0.1);
    border-radius: 8px;
    padding: 15px;
}

.support-benefit i {
    font-size: 24px;
    display: block;
}

.support-donate-btn {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    border: none !important;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.support-donate-btn:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.support-footer {
    border-top: 1px solid rgba(108, 117, 125, 0.2);
    padding-top: 10px;
}

/* Support container in title screen */
.support-container {
    text-align: center;
    margin: 15px 0;
}