/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Raleway', sans-serif;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

.game-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

/* Optimized floating particles background */
.particle {
    position: absolute;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
    z-index: 1;
    will-change: transform, opacity;
}

.particle:nth-child(1) { width: 30px; height: 30px; top: 15%; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { width: 20px; height: 20px; top: 70%; left: 85%; animation-delay: 3s; }
.particle:nth-child(3) { width: 25px; height: 25px; top: 40%; left: 5%; animation-delay: 6s; }
.particle:nth-child(4) { width: 15px; height: 15px; top: 85%; left: 75%; animation-delay: 2s; }

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) rotate(0deg);
        opacity: 0.3;
    }
    25% { 
        transform: translateY(-20px) translateX(10px) rotate(90deg);
        opacity: 0.6;
    }
    50% { 
        transform: translateY(-10px) translateX(-15px) rotate(180deg);
        opacity: 0.8;
    }
    75% { 
        transform: translateY(-30px) translateX(5px) rotate(270deg);
        opacity: 0.4;
    }
}

/* Header */
.header {
    text-align: center;
    position: relative;
    flex-shrink: 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.header-controls {
    min-width: 60px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.title-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 5;
    text-align: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(45deg, #00d4ff, #0099cc, #33ddff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
    animation: oceanPulse 3s ease-in-out infinite;
    letter-spacing: 1.5px;
    margin: 0;
    will-change: transform, filter;
    flex: 1;
    text-align: center;
}

@keyframes oceanPulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.02); filter: brightness(1.1); }
}

.score-time {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.stat-card {
    flex: 1;
    background: rgba(0, 212, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 15px;
    padding: 12px 8px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    animation: wave 4s linear infinite;
    will-change: left;
}

@keyframes wave {
    0% { left: -100%; }
    100% { left: 100%; }
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.4);
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.65rem;
    font-weight: 500;
    margin-bottom: 4px;
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: #00d4ff;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
    position: relative;
    z-index: 2;
}

/* Game Status Area */
.game-status-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
    padding: 16px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(20px);
}

.game-status-message {
    color: #00d4ff;
    font-weight: 600;
    font-size: 1.1rem;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
    text-align: center;
}

.game-status-message span {
    display: inline-block;
}

.game-status-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Music Toggle */
.music-toggle-container {
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.music-toggle-button {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 15px;
    padding: 8px 16px;
    color: #00d4ff;
    font-family: 'Raleway', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    outline: none;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    min-width: 80px;
}

.music-toggle-button:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.music-toggle-button:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

.music-toggle-button.muted {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
}

.music-toggle-button.muted:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.music-toggle-button.compact {
    padding: 8px;
    min-width: auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 0;
}

.music-toggle-button.compact .music-icon {
    width: 20px;
    height: 20px;
}

.game-button.compact {
    padding: 8px 12px;
    font-size: 0;
    border-radius: 20px;
    min-width: auto;
}

.game-button.compact svg {
    width: 20px;
    height: 20px;
}

.music-icon {
    transition: all 0.3s ease;
}

.music-status {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Game Board */
.game-board {
    background: rgba(0, 212, 255, 0.05);
    backdrop-filter: blur(30px);
    border: 2px solid rgba(0, 212, 255, 0.15);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.game-board::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(0, 212, 255, 0.05), transparent);
    animation: shimmer 6s linear infinite;
    will-change: transform;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.letter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    position: relative;
    z-index: 2;
    max-width: 320px;
    margin: 0 auto;
}

.letter-tile {
    aspect-ratio: 1;
    background: rgba(0, 212, 255, 0.1);
    border: 2px solid rgba(0, 212, 255, 0.2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    will-change: transform, background-color, border-color;
}

.letter-tile:hover, .letter-tile:focus {
    outline: none;
    transform: scale(1.1);
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
    text-shadow: 0 2px 10px rgba(0, 212, 255, 0.5);
}

.letter-tile.selected {
    background: #00d4ff;
    color: #003d4d;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
    border-color: #33ddff;
    text-shadow: none;
}

.letter-tile.drag-selected {
    background: rgba(0, 212, 255, 0.6);
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.6);
    border-color: #00d4ff;
    border-width: 3px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 5;
    position: relative;
}

/* Drag path visual styling */
#drag-path-svg {
    pointer-events: none;
    z-index: 8;
}

.drag-path-line {
    stroke: #00d4ff;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.7));
}

.letter-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.letter-tile:hover::before {
    left: 100%;
}

/* Keyboard navigation for letter tiles */
.letter-tile:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

/* Current Word Display */
.current-word {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 15px;
    padding: 18px;
    text-align: center;
    min-height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.current-word::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
    animation: currentWordGlow 2s ease-in-out infinite;
    will-change: opacity;
}

@keyframes currentWordGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.word-display {
    font-size: 1.5rem;
    font-weight: 600;
    color: #00d4ff;
    letter-spacing: 2px;
    text-transform: uppercase;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 15px rgba(0, 212, 255, 0.4);
}

.word-placeholder {
    color: rgba(0, 212, 255, 0.4);
    font-style: italic;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    will-change: transform, box-shadow;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-submit {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: white;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.3);
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.4);
    background: linear-gradient(135deg, #33ddff, #00b8e6);
}

.btn-clear {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.btn-clear:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-summary {
    background: linear-gradient(135deg, #00a8cc, #0077aa);
    color: white;
    border: 1px solid rgba(0, 168, 204, 0.3);
    box-shadow: 0 6px 20px rgba(0, 168, 204, 0.3);
}

.btn-summary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 168, 204, 0.4);
    background: linear-gradient(135deg, #00b8e6, #008fcc);
}

/* Compact button styles for game status area */
.btn.compact {
    padding: 8px 12px;
    font-size: 0.8rem;
    border-radius: 12px;
    min-width: auto;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: 'Raleway', sans-serif;
}

.btn-summary.compact {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.4);
}

.btn-summary.compact:hover {
    background: rgba(0, 212, 255, 0.3);
    border-color: rgba(0, 212, 255, 0.6);
    color: white;
    transform: translateY(-1px);
}

.btn-stats.compact {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-stats.compact:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
    transform: translateY(-1px);
}

.btn.compact svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Found Words */
.found-words {
    background: rgba(0, 212, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 20px;
    padding: 20px;
    max-height: 200px;
    overflow-y: auto;
    min-height: 100px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.found-words h3 {
    color: #00d4ff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

.words-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.word-tag {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 212, 255, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 15px;
    padding: 8px 12px;
    color: #00d4ff;
    font-size: 0.9rem;
    font-weight: 500;
    animation: fadeInUp 0.5s ease;
    backdrop-filter: blur(5px);
    transition: all 0.2s ease;
    will-change: transform;
}

.word-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.5);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Message Display */
.message-display {
    background: rgba(0, 0, 0, 0.7);
    color: #00d4ff;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    font-weight: 600;
    border: 1px solid rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 5;
    animation: fadeIn 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.message-display span {
    flex: 1;
    min-width: max-content;
}

.message-display .btn {
    flex: 0 0 auto;
    margin: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Start Game Overlay */
.start-game-overlay {
    position: fixed;
    top: 56px; /* Bootstrap navbar height */
    left: 0;
    width: 100%;
    height: calc(100vh - 56px); /* Account for navbar */
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1010; /* Below Bootstrap navbar (1030) and dropdown (1000+) */
    animation: fadeIn 0.5s ease-in-out;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto; /* Allow scrolling if content is tall */
}

/* Ensure Bootstrap navbar dropdowns appear above the start modal */
.navbar .dropdown-menu {
    z-index: 1050 !important; /* Above modal overlay */
}

.start-game-content {
    background: rgba(15, 25, 35, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 20px;
    padding: 20px 25px;
    max-width: 480px;
    width: 92%;
    text-align: center;
    position: relative;
    z-index: 10001;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 75vh;
    overflow-y: auto;
    color: white;
}

.start-game-logo {
    margin-bottom: 0;
}

.start-game-logo h1 {
    font-family: 'Raleway', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #00d4ff;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 212, 255, 0.4);
    letter-spacing: 2px;
    line-height: 1;
}

/* Game Description */
.game-description {
    color: rgba(255, 255, 255, 0.9);
}

.game-tagline {
    font-size: 1.1rem;
    font-weight: 300;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.game-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    color: rgba(0, 212, 255, 0.9);
    font-weight: 500;
}

/* Player Status Section */
.player-status-section {
    margin: 20px 0;
}

.player-info {
    text-align: center;
    margin-bottom: 16px;
}

.player-label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.player-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* User Section */
.user-section {
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin: 2px 0;
    color: white;
}

.user-greeting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.user-avatar {
    font-size: 1.2rem;
}

.username {
    font-size: 1.1rem;
    font-weight: 600;
    color: #00d4ff;
}

.user-stats-preview {
    color: rgba(255, 255, 255, 0.8);
    max-height: 350px;
    overflow-y: auto;
}

/* Guest Section */
.guest-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin: 2px 0;
    color: white;
}

.auth-prompt {
    text-align: center;
}

.auth-prompt p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin: 0 0 12px 0;
}

.auth-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-auth {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: 'Raleway', sans-serif;
}

.btn-login {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: white;
}

.btn-login:hover {
    background: linear-gradient(135deg, #33ddff, #00b8e6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

.btn-guest {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-guest:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Shared Game Card */
.shared-game-card {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 2px 0;
    color: white;
}

.share-badge {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.share-content {
    flex: 1;
    text-align: left;
}

.share-content h3 {
    color: #00d4ff;
    font-size: 1.1rem;
    margin: 0 0 4px 0;
    font-weight: 600;
}

.share-author {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin: 0 0 6px 0;
}

.share-desc {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin: 0;
    font-style: italic;
}

/* Primary Action */
.primary-action {
    margin: 8px 0 4px 0;
}

.btn-play {
    all: unset;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: white;
    font-family: 'Raleway', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 14px 24px;
    border-radius: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-play:hover {
    background: linear-gradient(135deg, #33ddff, #00b8e6);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.5);
}

.btn-play:active {
    transform: translateY(0);
}

.btn-play-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Secondary Actions */
.secondary-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-secondary {
    all: unset;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: 10px;
    color: rgba(0, 212, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Raleway', sans-serif;
}

.btn-secondary:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.4);
    color: #00d4ff;
    transform: translateY(-1px);
}

.sound-label {
    font-size: 0.85rem;
}

.start-game-description {
    margin-bottom: 20px;
}

.start-game-description p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.5;
    margin: 8px 0;
}

.start-game-description .game-timer-info {
    color: rgba(0, 212, 255, 0.9);
    font-size: 0.95rem;
    margin-top: 5px;
}

.start-game-description strong {
    color: #00d4ff;
    font-weight: 600;
}

/* Instructions Container */
.instructions-container {
    margin-bottom: 25px;
}

.instructions-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    padding: 10px 15px;
    color: rgba(0, 212, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    width: 100%;
    justify-content: center;
    font-family: 'Raleway', sans-serif;
}

.instructions-toggle:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.4);
    color: #00d4ff;
}

.instructions-toggle .chevron-icon {
    transition: transform 0.3s ease;
}

.instructions-toggle.expanded .chevron-icon {
    transform: rotate(180deg);
}

.instructions-toggle .info-icon {
    flex-shrink: 0;
}

.instructions-text {
    font-weight: 500;
}

.start-game-rules {
    margin-top: 15px;
    margin-bottom: 0;
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(0, 212, 255, 0.1);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
    }
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.rule-item:last-child {
    margin-bottom: 0;
}

.rule-item svg {
    color: rgba(0, 212, 255, 0.7);
    flex-shrink: 0;
}

button.btn-start-game,
#startGameButton {
    all: unset !important;
    background: linear-gradient(135deg, #00d4ff, #0099cc) !important;
    color: white !important;
    font-family: 'Raleway', Arial, sans-serif !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    padding: 16px 32px !important;
    border-radius: 25px !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    margin: 18px auto 12px auto !important;
    width: 220px !important;
    height: 58px !important;
    position: relative !important;
    z-index: 1001 !important;
    box-shadow: 
        0 8px 25px rgba(0, 212, 255, 0.6) !important,
        inset 0 2px 0 rgba(255, 255, 255, 0.4) !important,
        0 0 30px rgba(0, 212, 255, 0.5) !important;
    border: 3px solid #00d4ff !important;
    animation: buttonGlow 2s ease-in-out infinite !important;
    opacity: 1 !important;
    visibility: visible !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3) !important;
    box-sizing: border-box !important;
}

button.btn-start-game:hover,
#startGameButton:hover {
    background: linear-gradient(135deg, #33ddff, #00b8e6) !important;
    transform: translateY(-2px) !important;
    box-shadow: 
        0 12px 35px rgba(0, 212, 255, 0.8) !important,
        inset 0 2px 0 rgba(255, 255, 255, 0.5) !important,
        0 0 40px rgba(0, 212, 255, 0.7) !important;
}

@keyframes buttonGlow {
    0%, 100% { 
        box-shadow: 
            0 8px 25px rgba(0, 212, 255, 0.6) !important,
            inset 0 2px 0 rgba(255, 255, 255, 0.4) !important,
            0 0 30px rgba(0, 212, 255, 0.5) !important;
    }
    50% { 
        box-shadow: 
            0 10px 30px rgba(0, 212, 255, 0.8) !important,
            inset 0 2px 0 rgba(255, 255, 255, 0.5) !important,
            0 0 40px rgba(0, 212, 255, 0.7) !important;
    }
}

@keyframes startButtonPulse {
    0%, 100% { 
        box-shadow: 
            0 12px 35px rgba(0, 212, 255, 0.6),
            inset 0 2px 0 rgba(255, 255, 255, 0.4),
            0 0 40px rgba(0, 212, 255, 0.4);
        transform: scale(1);
    }
    50% { 
        box-shadow: 
            0 15px 45px rgba(0, 212, 255, 0.8),
            inset 0 2px 0 rgba(255, 255, 255, 0.5),
            0 0 60px rgba(0, 212, 255, 0.6);
        transform: scale(1.02);
    }
}

.btn-start-game:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(0, 212, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg, #33ddff, #00b8e6);
    border-color: rgba(0, 212, 255, 0.8);
}

.btn-start-game:active {
    transform: translateY(-1px);
    box-shadow: 
        0 6px 20px rgba(0, 212, 255, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.start-game-controls {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Secondary Actions Styling */
.start-game-secondary-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 10px 0 5px;
}

.btn-secondary-action {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: #00d4ff;
    padding: 10px 18px;
    border-radius: 18px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Raleway', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.btn-secondary-action:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.5);
    transform: translateY(-1px);
}

.btn-secondary-action svg {
    flex-shrink: 0;
}

.start-game-controls .music-toggle-button {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: #00d4ff;
    padding: 10px 18px;
    border-radius: 18px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Raleway', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 auto;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.start-game-controls .music-toggle-button:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.5);
}

/* Responsive adjustments for start screen */
@media (max-width: 480px) {
    .start-game-overlay {
        top: 56px; /* Maintain navbar space on mobile */
        height: calc(100vh - 56px);
    }
    
    .start-game-content {
        padding: 15px 16px;
        margin: 0;
        width: 95%;
        gap: 10px;
        max-height: calc(100vh - 112px); /* Account for navbar + padding */
    }
    
    .start-game-logo h1 {
        font-size: 2.2rem;
        letter-spacing: 2px;
    }
    
    .game-tagline {
        font-size: 1rem;
    }
    
    .game-timer {
        font-size: 0.9rem;
        gap: 6px;
    }
    
    .user-section,
    .guest-section,
    .shared-game-card {
        padding: 12px;
    }
    
    .auth-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-auth {
        width: 100%;
        justify-content: center;
    }
    
    .btn-play {
        font-size: 1rem;
        padding: 12px 20px;
        max-width: none;
        width: 100%;
    }
    
    .secondary-actions {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .game-status-area {
        margin-top: 12px;
        padding: 12px;
        gap: 10px;
    }
    
    .game-status-message {
        font-size: 1rem;
    }
    
    .game-status-actions {
        gap: 8px;
    }
    
    .btn.compact {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}

/* Larger screen optimizations for start modal */
@media (min-width: 768px) {
    .start-game-content {
        max-width: 580px;
        padding: 30px 35px;
        gap: 18px;
    }
}

@media (min-width: 1024px) {
    .start-game-content {
        max-width: 650px;
        padding: 35px 40px;
        gap: 20px;
    }
}

@media (min-width: 1200px) {
    .start-game-content {
        max-width: 720px;
        padding: 40px 45px;
    }
}

/* Game Button Styling */
.game-button {
    font-family: 'Raleway', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6em 1.2em;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
    overflow: hidden;
    will-change: transform, box-shadow;
}

.game-button:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

.game-button svg {
    width: 1em;
    height: 1em;
}

.game-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.game-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.game-button.primary {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: white;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.game-button.primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #33ddff, #00b8e6);
}

/* Custom Scrollbar - Global Styles for Letter Quest */
.letter-quest-game ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.letter-quest-game ::-webkit-scrollbar-track {
    background: rgba(0, 212, 255, 0.05);
    border-radius: 10px;
    margin: 4px;
}

.letter-quest-game ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, 
        rgba(0, 212, 255, 0.4) 0%, 
        rgba(0, 212, 255, 0.2) 100%);
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 255, 0.1);
}

.letter-quest-game ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, 
        rgba(0, 212, 255, 0.6) 0%, 
        rgba(0, 212, 255, 0.4) 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.letter-quest-game ::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox Scrollbar Support */
.letter-quest-game * {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 212, 255, 0.3) rgba(0, 212, 255, 0.05);
}

/* Specific scrollbar styles for word lists */
.found-words::-webkit-scrollbar,
.solvable-words::-webkit-scrollbar {
    width: 6px;
}

.found-words::-webkit-scrollbar-track,
.solvable-words::-webkit-scrollbar-track {
    background: rgba(0, 212, 255, 0.1);
    border-radius: 10px;
}

.found-words::-webkit-scrollbar-thumb,
.solvable-words::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 10px;
}

.found-words::-webkit-scrollbar-thumb:hover,
.solvable-words::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}

/* Game Summary Overlay */
#gameSummaryOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

#gameSummaryContent {
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    padding: 2em;
    border-radius: 1em;
    max-width: 85%;
    max-height: 85vh;
    overflow-y: auto;
    color: white;
    box-shadow: 0 0 2em rgba(0, 0, 0, 0.5);
    min-width: 20em;
    border: 2px solid rgba(0, 212, 255, 0.2);
    position: relative;
}

#gameSummaryContent h2 {
    margin-top: 0;
    color: #00d4ff;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

#gameSummaryContent .stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1em;
    margin: 1em 0;
}

#gameSummaryContent .stat-item {
    background: rgba(0, 212, 255, 0.1);
    padding: 0.5em;
    border-radius: 0.5em;
    text-align: center;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

#gameSummaryContent .solvable-words {
    margin-top: 0.5em;
    max-height: 40vh;
    overflow-y: auto;
    background: rgba(0, 212, 255, 0.1);
    padding: 1em;
    border-radius: 0.5em;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

#gameSummaryContent .solvable-words h3 {
    margin-top: 0;
    color: #00d4ff;
    text-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

#gameSummaryContent .word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}

#gameSummaryContent .word-item {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 0.25em 0.5em;
    border-radius: 0.25em;
    font-size: 0.9em;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#gameSummaryContent .word-item.found {
    background: #00d4ff;
    color: #003d4d;
    border-color: #33ddff;
}

.game-button.primary#summaryNewGameButton {
    display: block;
    margin: 0 auto 1em auto;
    width: fit-content;
}

/* Close button for modal */
.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #00d4ff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: scale(1.1);
}

.modal-close:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

/* Mini Board in Game Summary */
#summaryMiniBoard {
    margin: 1em auto;
    width: fit-content;
}

#summaryMiniBoard table {
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5em;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

#summaryMiniBoard td {
    width: 2em;
    height: 2em;
    text-align: center;
    font-weight: bold;
    color: white;
    border: 1px solid rgba(0, 212, 255, 0.3);
    font-size: 0.8em;
    transition: background-color 0.3s ease;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

/* Letter frequency visualization */
.letter-frequency-chart {
  margin-top: 10px;
  width: 100%;
}

.frequency-bar {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.frequency-bar span {
  width: 60px;
  text-align: left;
  font-size: 0.9em;
}

.bar {
  height: 15px;
  background-color: #00d4ff;
  border-radius: 3px;
  margin-left: 10px;
  transition: width 0.5s ease-out;
}

.common-letters-container {
  margin: 1em 0;
  padding: 1em;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 0.5em;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.common-letters-container h3 {
  margin-top: 0;
  color: #00d4ff;
  font-size: 1.1em;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

.common-letters-container p {
  text-align: center;
  margin-bottom: 1em;
  font-size: 0.9em;
}

/* Optimize ripple effects */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
    z-index: 1;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .particle {
        animation: none;
    }
    
    .logo {
        animation: none;
    }
    
    .stat-card::before {
        animation: none;
    }
    
    .game-board::before {
        animation: none;
    }
    
    .current-word::after {
        animation: none;
    }
    
    .letter-tile {
        transition: none;
    }
    
    .word-tag {
        animation: none;
    }
}

/* Mobile responsive improvements */
@media (max-width: 480px) {
    .game-container {
        padding: 12px;
        max-width: 100%;
        gap: 15px;
    }
    
    .header {
        margin-bottom: 0;
    }
    
    .header-top {
        margin-bottom: 10px;
    }
    
    .header-controls {
        min-width: 45px;
        gap: 6px;
    }
    
    .logo {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    
    .music-toggle-button.compact {
        width: 35px;
        height: 35px;
        padding: 6px;
    }
    
    .game-button.compact {
        padding: 6px 10px;
    }
    
    .game-button.compact svg {
        width: 18px;
        height: 18px;
    }
    
    .letter-tile {
        font-size: 1.3rem;
    }
    
    .word-display {
        font-size: 1.3rem;
        letter-spacing: 1.5px;
    }
    
    .title-section {
        flex-direction: column;
        gap: 12px;
        align-items: center;
        text-align: center;
        width: 100%;
        margin-bottom: 12px;
    }
    
    .game-button {
        font-size: 0.75rem;
        padding: 0.4em 0.8em;
        white-space: nowrap;
    }
    
    .score-time {
        flex-direction: row;
        gap: 6px;
        width: 100%;
        justify-content: space-between;
        margin-bottom: 8px;
    }
    
    .stat-card {
        min-width: 0;
        flex: 1;
        padding: 8px 6px;
    }
    
    .stat-label {
        font-size: 0.55rem;
    }
    
    .stat-value {
        font-size: 0.95rem;
    }
    
    .music-toggle-container {
        margin-top: 12px;
        margin-bottom: 12px;
    }
    
    .music-toggle-button {
        font-size: 0.65rem;
        padding: 5px 10px;
        min-width: 65px;
    }
    
    .music-icon {
        width: 14px;
        height: 14px;
    }
    
    .music-status {
        font-size: 0.6rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .btn {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .game-board {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .letter-grid {
        gap: 6px;
        max-width: 280px;
    }
    
    .current-word {
        padding: 12px;
        min-height: 55px;
        margin-bottom: 15px;
    }
    
    .found-words {
        padding: 12px;
        max-height: 130px;
    }
    
    .found-words h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .word-tag {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    #gameSummaryContent {
        max-width: 95%;
        padding: 1.2em;
        min-width: auto;
        margin: 8px;
    }
    
    #gameSummaryContent .stats {
        grid-template-columns: 1fr;
        gap: 0.4em;
    }
    
    #gameSummaryContent .stat-item {
        padding: 0.6em;
    }
}

@media (max-width: 375px) {
    .game-container {
        padding: 8px;
    }
    
    .header {
        margin-bottom: 12px;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .letter-tile {
        font-size: 1.1rem;
    }
    
    .word-display {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }
    
    .stat-label {
        font-size: 0.5rem;
    }
    
    .stat-value {
        font-size: 0.85rem;
    }
    
    .game-board {
        padding: 12px;
    }
    
    .letter-grid {
        gap: 5px;
        max-width: 260px;
    }
    
    .current-word {
        padding: 10px;
        min-height: 50px;
    }
    
    .found-words {
        padding: 10px;
        max-height: 120px;
    }
    
    .music-toggle-button {
        font-size: 0.6rem;
        padding: 4px 8px;
        min-width: 60px;
    }
    
    .music-icon {
        width: 12px;
        height: 12px;
    }
    
    .music-status {
        font-size: 0.55rem;
    }
    
    .btn {
        padding: 8px;
        font-size: 0.8rem;
    }
    
    .word-tag {
        font-size: 0.75rem;
        padding: 5px 8px;
    }
}

/* User Stats Display Styles */
.user-welcome-section {
    margin: 20px 0;
}

.welcome-message {
    font-size: 1.5rem;
    color: #00d4ff;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.user-stats-container {
    margin: 20px 0;
}

.stats-loading {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card-mini {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card-mini:hover {
    background: rgba(0, 212, 255, 0.2);
    transform: translateY(-2px);
}

.stat-card-mini.highlight {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.4);
}

.stat-value-large {
    font-size: 1.8rem;
    font-weight: 700;
    color: #00d4ff;
    margin-bottom: 5px;
}

.stat-label-mini {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-detail {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

/* Word Achievements */
.word-achievements {
    margin: 25px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.achievements-title {
    font-size: 1.2rem;
    color: #00d4ff;
    margin-bottom: 15px;
    text-align: center;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.achievement-item {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.achievement-item:hover {
    background: rgba(0, 212, 255, 0.15);
    transform: scale(1.02);
}

.achievement-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.achievement-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.achievement-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #00d4ff;
    margin-bottom: 3px;
}

.achievement-detail {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Recent Games Chart */
.recent-games-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.recent-title {
    font-size: 1rem;
    color: #00d4ff;
    margin-bottom: 15px;
    text-align: center;
}

.recent-games-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 100px;
    padding: 10px;
}

.chart-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 5px;
}

.chart-bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(to top, #00d4ff, #00a8cc);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 10px;
    transition: all 0.5s ease;
}

.bar-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #00d4ff;
    font-weight: 600;
    white-space: nowrap;
}

.bar-label {
    margin-top: 5px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Quick Stats for Startup Modal */
.quick-stats {
    padding: 12px 0;
}

.quick-overview {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 12px;
}

.last-game-preview {
    background: rgba(0, 212, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    flex: 1;
    min-width: 0;
}

.last-game-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.last-game-score {
    font-size: 1.4rem;
    font-weight: 700;
    color: #00d4ff;
    line-height: 1;
}

.last-game-details {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
}

.total-games {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    flex: 1;
    min-width: 0;
}

.total-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.total-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.welcome-message {
    text-align: center;
    padding: 20px 12px;
}

.welcome-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.welcome-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #00d4ff;
    margin-bottom: 4px;
}

.welcome-subtext {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* View Full Stats Links */
.view-full-stats {
    margin-top: 12px;
    text-align: center;
}

.stats-link-subtle {
    color: rgba(0, 212, 255, 0.6);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stats-link-subtle:hover {
    color: #00d4ff;
    text-decoration: none;
    transform: translateY(-1px);
}

.stats-link {
    color: rgba(0, 212, 255, 0.8);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.stats-link:hover {
    color: #00d4ff;
    text-decoration: none;
    transform: translateX(3px);
}

/* Responsive adjustments for quick stats */
@media (max-width: 480px) {
    .quick-overview {
        flex-direction: column;
        gap: 8px;
    }
    
    .last-game-preview,
    .total-games {
        padding: 10px;
    }
    
    .last-game-score,
    .total-number {
        font-size: 1.2rem;
    }
}

/* Game History List */
.game-history-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.history-title {
    font-size: 1rem;
    color: #00d4ff;
    margin-bottom: 15px;
    text-align: center;
}

.game-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 212, 255, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.15);
    transition: background 0.3s ease;
}

.history-item:hover {
    background: rgba(0, 212, 255, 0.12);
}

.history-game-id {
    font-size: 0.85rem;
    color: #00d4ff;
    font-weight: 600;
}

.history-details {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 0.8rem;
}

.history-percent {
    color: #00d4ff;
    font-weight: 600;
}

.history-words {
    color: rgba(255, 255, 255, 0.8);
}

.history-date {
    color: rgba(255, 255, 255, 0.6);
}

.history-board {
    color: rgba(255, 255, 255, 0.5);
    font-family: monospace;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

/* No Games Message */
.no-games-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.no-games-message {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    margin: 10px 0;
}

/* Guest Options Styles */
.guest-welcome-section {
    margin: 20px 0;
}

.guest-options {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.guest-prompt {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    font-size: 1rem;
}

.guest-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-login, .btn-guest {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    color: white;
}

.btn-login {
    background: linear-gradient(135deg, #00d4ff, #00a8cc);
}

.btn-login:hover {
    background: linear-gradient(135deg, #00a8cc, #0085a3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

.btn-guest {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-guest:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.stats-error {
    text-align: center;
    color: rgba(255, 100, 100, 0.9);
    padding: 20px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .letter-tile {
        border-width: 3px;
    }
    
    .btn {
        border-width: 2px;
    }
    
    .game-button {
        border: 2px solid currentColor;
    }
}
