* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

/* Prevent horizontal scrolling on all devices */
@media (max-width: 768px) {
    html {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #202124;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

/* Main Header Navigation */
.main-header {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid #e8eaed;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 100;
    padding: 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 15px;
    min-width: 0; /* Allow flex items to shrink */
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo img {
    max-height: 50px;
    width: auto;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-nav-container {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    min-width: 0; /* Allow flex items to shrink */
    overflow: hidden; /* Prevent overflow */
}

.header-nav li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-nav a {
    padding: 10px 16px;
    color: #5f6368;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header-nav a:hover {
    background-color: #f1f3f4;
    color: #202124;
}

.header-nav a.active {
    color: #1a73e8;
    background-color: #e8f0fe;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.mobile-menu-toggle:hover {
    background-color: #f1f3f4;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #5f6368;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e8eaed;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 0;
    margin: 0;
    list-style: none;
    z-index: 101;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu li {
    border-bottom: 1px solid #e8eaed;
}

.mobile-menu li:last-child {
    border-bottom: none;
}

.mobile-menu a {
    display: block;
    padding: 16px 20px;
    color: #5f6368;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.mobile-menu a:hover,
.mobile-menu a.active {
    background-color: #f1f3f4;
    color: #1a73e8;
}

/* Dark theme for header */
[data-theme="dark"] .main-header {
    background: #1f2937;
    border-bottom-color: #374151;
}

[data-theme="dark"] .header-nav a {
    color: #d1d5db;
}

[data-theme="dark"] .header-nav a:hover {
    background-color: #374151;
    color: #f9fafb;
}

[data-theme="dark"] .header-nav a.active {
    color: #60a5fa;
    background-color: #1e3a8a;
}

[data-theme="dark"] .mobile-menu-toggle:hover {
    background-color: #374151;
}

[data-theme="dark"] .mobile-menu-toggle span {
    background-color: #d1d5db;
}

[data-theme="dark"] .mobile-menu {
    background: #1f2937;
    border-top-color: #374151;
}

[data-theme="dark"] .mobile-menu li {
    border-bottom-color: #374151;
}

[data-theme="dark"] .mobile-menu a {
    color: #d1d5db;
}

[data-theme="dark"] .mobile-menu a:hover,
[data-theme="dark"] .mobile-menu a.active {
    background-color: #374151;
    color: #60a5fa;
}

/* Header Game Controls (shown during gameplay) */
.header-game-controls {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-width: 0; /* Allow flex items to shrink */
    overflow: hidden; /* Prevent overflow */
}

.header-timer-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0; /* Prevent timer from shrinking */
}

.header-game-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

/* Hide navigation when game is active */
.main-header.game-active .header-nav-container {
    display: none;
}

.main-header.game-active .header-game-controls {
    display: flex;
}

/* Hide game controls when navigation is active */
.main-header:not(.game-active) .header-game-controls {
    display: none;
}

/* Tablet header styles (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .header-container {
        padding: 0 12px;
        gap: 8px;
        height: 65px;
    }
    
    .header-logo {
        flex-shrink: 0;
    }
    
    .header-logo img {
        max-height: 40px;
    }
    
    .header-nav {
        gap: 3px;
    }
    
    .header-nav a {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    /* Game controls on tablet */
    .header-game-controls {
        gap: 10px;
        flex-wrap: nowrap;
        min-width: 0;
    }
    
    .header-timer-container {
        gap: 6px;
        flex-shrink: 0;
    }
    
    .header-timer-container .timer-label {
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .header-timer-container .timer {
        font-size: 1.1rem;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }
    
    .header-game-buttons {
        gap: 6px;
        flex-shrink: 0;
    }
    
    .header-game-buttons .btn-secondary {
        padding: 6px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .header-game-buttons .btn-theme {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }
    
    .header-game-buttons .btn-theme svg {
        width: 18px;
        height: 18px;
    }
    
    /* Hide hamburger menu when game is active on tablet */
    .main-header.game-active .mobile-menu-toggle {
        display: none;
    }
}

/* Mobile header styles */
@media (max-width: 768px) {
    .header-container {
        height: 56px;
        padding: 0 10px;
        gap: 6px;
    }
    
    .header-logo {
        flex-shrink: 0;
    }
    
    .header-logo img {
        max-height: 35px;
    }
    
    .header-nav-container {
        display: none;
    }
    
    /* Game controls on mobile - horizontal layout */
    .header-game-controls {
        flex-direction: row;
        gap: 6px;
        align-items: center;
        justify-content: flex-end;
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
    
    .header-timer-container {
        gap: 4px;
        flex-shrink: 0;
    }
    
    .header-timer-container .timer-label {
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .header-timer-container .timer {
        font-size: 0.95rem;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }
    
    .header-game-buttons {
        gap: 4px;
        flex-shrink: 0;
    }
    
    .header-game-buttons .btn-secondary {
        padding: 6px 10px;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .header-game-buttons .btn-theme {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }
    
    .header-game-buttons .btn-theme svg {
        width: 16px;
        height: 16px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Hide hamburger menu when game is active on mobile */
    .main-header.game-active .mobile-menu-toggle {
        display: none;
    }
    
    /* On mobile, show game controls in header when game is active */
    .main-header.game-active .header-game-controls {
        display: flex;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 8px;
        gap: 4px;
    }
    
    .header-logo img {
        max-height: 30px;
    }
    
    .header-timer-container .timer-label {
        font-size: 0.7rem;
    }
    
    .header-timer-container .timer {
        font-size: 0.85rem;
    }
    
    .header-game-buttons .btn-secondary {
        padding: 5px 8px;
        font-size: 0.7rem;
    }
    
    .header-game-buttons .btn-theme {
        width: 28px;
        height: 28px;
    }
    
    .header-game-buttons .btn-theme svg {
        width: 14px;
        height: 14px;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
    padding-top: 0; /* Header is sticky, no extra top padding needed */
}

/* Mobile container adjustments */
@media (max-width: 768px) {
    .container {
        max-width: 100vw;
        padding: 10px;
        margin: 0;
    }
    
    /* Prevent any element from causing horizontal overflow */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Ensure all containers respect viewport width */
    .welcome-layout,
    .game-content,
    .grid-container,
    .word-grid,
    .welcome-leaderboard,
    .start-section,
    .input-group {
        max-width: 100%;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

/* Screen Management */
.screen {
    display: none;
    min-height: 80vh;
}

.screen.active {
    display: block;
}

/* Welcome Screen */
.welcome-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 70vh;
    align-items: start;
    box-sizing: border-box;
    width: 100%;
}

/* Mobile welcome layout adjustments */
@media (max-width: 768px) {
    .welcome-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 10px;
        max-width: 100%;
        margin: 0;
    }
}

.welcome-left {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.welcome-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.welcome-content {
    text-align: left;
}

.logo {
    max-width: 400px;
    padding: 0px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    margin-top: -70px;
}

/* Mobile logo adjustments */
@media (max-width: 768px) {
    .logo {
        max-width: 100%;
        width: 100%;
        margin-top: -50px;
    }
}

/* Desktop logo positioning */
@media (min-width: 1024px) {
    .logo {
        margin-top: -100px;
    }
}

.start-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.welcome-content h1 {
    font-size: 2.5rem;
    color: #1a73e8;
    margin-bottom: 10px;
    font-weight: 400;
}

#game-title {
    font-size: 1.5rem;
    color: #5f6368;
    margin-bottom: 20px;
    font-weight: 400;
}

.welcome-content h2 {
    font-size: 1rem;
    color: #5f6368;
    margin-bottom: 30px;
    font-weight: 400;
}

.how-to-play {
    /* margin: 25px 0; */
    padding: 18px;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #1a73e8;
    font-size: 0.8rem;
}

.anti-cheat-notice {
    margin-top: 15px;
    padding: 16px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.anti-cheat-notice p {
    margin: 0;
    color: #1e40af;
    line-height: 1.5;
}

/* Dark theme for anti-cheat notice */
[data-theme="dark"] .anti-cheat-notice {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    border-left-color: #60a5fa;
}

[data-theme="dark"] .anti-cheat-notice p {
    color: #dbeafe;
}

.how-to-play h2 {
    font-size: 1.1rem;
    color: #1a73e8;
    margin-bottom: 12px;
    font-weight: 500;
}

.how-to-play ol {
    margin-left: 20px;
    color: #5f6368;
}

.how-to-play li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.how-to-play strong {
    color: #202124;
    font-weight: 500;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    margin: 0 auto;
}

.input-row {
    display: flex;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

#player-name, #player-email {
    padding: 12px 16px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 16px;
    flex: 1;
    min-width: 0;
    width: 0;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

/* Mobile input adjustments */
@media (max-width: 768px) {
    #player-name, #player-email {
        width: 100%;
        min-width: auto;
        flex: none;
    }
}

#player-name:focus, #player-email:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

/* Welcome screen specific button styling */
.start-section .btn-primary,
.start-section .btn-secondary {
    width: 100%;
}

.btn-primary {
    background-color: #1a73e8;
    color: white;
    animation: popAnimation 0.6s ease-out 0.5s both;
}

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

.btn-primary:hover {
    background-color: #1557b0;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.btn-secondary {
    background-color: #f1f3f4;
    color: #5f6368;
    border: 1px solid #dadce0;
}

.btn-secondary:hover {
    background-color: #e8eaed;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 20px;
    padding: 20px 0;
}

.load-more-btn {
    background-color: #f1f3f4;
    color: #5f6368;
    border: 1px solid #dadce0;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background-color: #e8eaed;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#resume-game-btn {
    background-color: #fce8e6;
    color: #d93025;
    border: 1px solid #fad2cf;
}

#resume-game-btn:hover {
    background-color: #fad2cf;
    box-shadow: 0 2px 8px rgba(217, 48, 37, 0.2);
}

.clear-defaults-link {
    color: #5f6368;
    font-size: 14px;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
    margin-top: 8px;
    display: none; /* Hidden by default */
}

.clear-defaults-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Scores Tabs Container */

.scores-tabs-header {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 0;
    margin-bottom: 0;
    padding: 0;
    border-bottom: 2px solid #e8eaed;
}

.scores-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    width: 100%;
    padding: 12px 8px;
    margin-bottom: -2px;
    background: transparent;
    color: #5f6368;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.15;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
}

.scores-tab-icon {
    font-size: 1.125rem;
    line-height: 1;
}

.scores-tab-label {
    font-size: 12px;
    font-weight: inherit;
    text-align: center;
    hyphens: none;
}

.scores-tab-btn:hover {
    color: #202124;
    background: rgba(26, 115, 232, 0.04);
}

.scores-tab-btn.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
    font-weight: 600;
    background: transparent;
}

.scores-tab-btn.active .scores-tab-label {
    font-weight: 600;
}

.scores-tab-content {
    display: none;
    background: white;
    border: 1px solid #e8eaed;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 20px;
    margin-top: -1px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.scores-tab-content.active {
    display: block;
}

html[data-theme="dark"] .scores-tabs-header {
    border-bottom-color: #3c4043;
}

html[data-theme="dark"] .scores-tab-btn {
    color: #9aa0a6;
}

html[data-theme="dark"] .scores-tab-btn:hover {
    color: #e8eaed;
    background: rgba(138, 180, 248, 0.08);
}

html[data-theme="dark"] .scores-tab-btn.active {
    color: #8ab4f8;
    border-bottom-color: #8ab4f8;
}

html[data-theme="dark"] .scores-tab-content {
    background: #292a2d;
    border-color: #3c4043;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Teams tab (welcome): company league snapshot */
.teams-standings-item .teams-standings-points {
    font-family: inherit;
    flex-shrink: 0;
}

.teams-standings-meta {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #80868b;
}

/* Welcome Screen Leaderboard */
.welcome-leaderboard-container {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e8eaed;
}

.welcome-leaderboard-container h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #202124;
    font-weight: 500;
    font-size: 1.1rem;
}

.welcome-leaderboard {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    max-width: 400px;
    margin: 0 auto;
}

/* Mobile welcome leaderboard adjustments */
@media (max-width: 768px) {
    .welcome-leaderboard {
        max-width: 100%;
        margin: 0;
    }
}

.welcome-leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e8eaed;
}

.welcome-leaderboard-item:last-child {
    border-bottom: none;
}

.welcome-leaderboard-item .rank {
    font-weight: 600;
    color: #1a73e8;
    min-width: 30px;
    font-size: 14px;
}

.welcome-leaderboard-item .name {
    flex: 1;
    margin: 0 15px;
    font-size: 14px;
    color: #202124;
    display: flex;
    align-items: center;
    gap: 8px;
}

.welcome-leaderboard-item .brand-icon {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
    object-fit: contain;
}

.welcome-leaderboard-item .player-name {
    vertical-align: middle;
}

.score-name-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.welcome-leaderboard-item .time {
    font-weight: 500;
    color: #5f6368;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.loading-scores {
    text-align: center;
    color: #5f6368;
    font-style: italic;
    padding: 20px;
}

.no-scores {
    text-align: center;
    color: #5f6368;
    padding: 20px;
    font-size: 14px;
}

/* Medal colors for top 3 */
.welcome-leaderboard-item .rank[data-rank="1"] {
    color: #ffd700; /* Gold */
}

.welcome-leaderboard-item .rank[data-rank="2"] {
    color: #c0c0c0; /* Silver */
}

.welcome-leaderboard-item .rank[data-rank="3"] {
    color: #cd7f32; /* Bronze */
}

/* Latest Scores Feed */
.latest-scores-feed {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.latest-scores-item {
    padding: 12px 0;
    border-bottom: 1px solid #e8eaed;
    transition: background-color 0.2s ease;
}

.latest-scores-item:last-child {
    border-bottom: none;
}

.latest-scores-group {
    position: relative;
}

.latest-scores-item.same-player-group {
    background-color: #f1f3f4;
    border-left: 3px solid #1a73e8;
    padding-left: 12px;
    margin-left: -12px;
}

.latest-score-main {
    position: relative;
}

.expand-group-btn {
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.expand-group-btn:hover {
    background: #1557b0;
    transform: scale(1.05);
}

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

.additional-scores {
    margin-top: 4px;
    padding-left: 12px;
    border-left: 2px solid #1a73e8;
    margin-left: 8px;
}

.additional-scores .latest-scores-item {
    padding-top: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8eaed;
}

.additional-scores .latest-scores-item:last-child {
    border-bottom: none;
}

.latest-scores-group.expanded .latest-scores-item:first-child {
    border-bottom: 1px solid #e8eaed;
    padding-bottom: 12px;
    margin-bottom: 4px;
}

.latest-score-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    position: relative;
}

.latest-score-name {
    flex: 1;
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #202124;
}

.latest-score-name .brand-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
    object-fit: contain;
}

.latest-score-name .player-name {
    vertical-align: middle;
}

.latest-score-time-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.latest-score-time {
    font-weight: 500;
    color: #5f6368;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.latest-score-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #5f6368;
    margin-top: 4px;
}

.latest-score-meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.latest-score-game {
    font-style: italic;
    opacity: 0.8;
}

.latest-score-timestamp {
    cursor: help;
    opacity: 0.7;
}

.latest-score-timestamp:hover {
    opacity: 1;
}

.score-badges {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid #d2e3fc;
    background: #e8f0fe;
    color: #1557b0;
}

.score-badge-first_challenge {
    border-color: #c8e6c9;
    background: #e6f4ea;
    color: #137333;
}

.score-badge-personal_best {
    border-color: #fdd663;
    background: #fef7e0;
    color: #8d5d00;
}

.load-more-scores-btn {
    width: 100%;
    margin-top: 15px;
    padding: 10px 20px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-scores-btn:hover {
    background: #1557b0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.load-more-scores-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(26, 115, 232, 0.2);
}

a.load-more-scores-btn.teams-rankings-more-link {
    display: block;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

/* Mobile latest scores feed adjustments */
@media (max-width: 768px) {
    .latest-scores-feed {
        max-width: 100%;
        margin: 0;
    }
    
    .scores-tabs-header {
        padding: 6px 4px 0;
    }
    
    .scores-tab-btn {
        padding: 10px 4px;
        gap: 4px;
    }

    .scores-tab-icon {
        font-size: 1rem;
    }

    .scores-tab-label {
        font-size: 11px;
    }
    
    .scores-tab-content {
        padding: 15px;
    }
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.game-header-logo {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-logo {
    max-width: 100px;
    height: auto;
}

.timer-container {
    flex: 0 0 auto;
}

.game-controls {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
    align-items: center;
}



/* Search Warning Modal */
.search-warning-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.search-warning-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.search-warning-content h2 {
    color: #dc2626;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.search-warning-content p {
    margin-bottom: 15px;
    color: #374151;
    line-height: 1.6;
}

.search-warning-content .btn-primary {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 1rem;
}

/* Dark theme for search warning modal */
[data-theme="dark"] .search-warning-content {
    background: #1f2937;
    color: #f9fafb;
}

[data-theme="dark"] .search-warning-content p {
    color: #d1d5db;
}

/* Penalty Notification */
.penalty-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    z-index: 10001;
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

.penalty-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.penalty-icon {
    font-size: 1.2rem;
}

.penalty-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Penalty Summary */
.penalty-summary {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-radius: 8px;
    border-left: 4px solid #dc2626;
}

.penalty-summary-content h3 {
    color: #dc2626;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.penalty-summary-content p {
    margin-bottom: 8px;
    color: #374151;
}

.penalty-note {
    font-style: italic;
    color: #6b7280;
    margin-top: 15px;
}

/* Dark theme for penalty elements */
[data-theme="dark"] .penalty-summary {
    background: linear-gradient(135deg, #450a0a, #7f1d1d);
    border-left-color: #dc2626;
}

[data-theme="dark"] .penalty-summary-content p {
    color: #d1d5db;
}

[data-theme="dark"] .penalty-note {
    color: #9ca3af;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Theme Toggle Button */
.theme-toggle-container {
    display: flex;
    align-items: center;
}

.btn-theme {
    background: #f8f9fa;
    border: 2px solid #e8eaed;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #5f6368;
}

.btn-theme:hover {
    background: #e8eaed;
    border-color: #dadce0;
    transform: scale(1.05);
}

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

/* Dark Theme Styles */
[data-theme="dark"] .game-header {
    background: #1f2937;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .timer-label {
    color: #d1d5db;
}

[data-theme="dark"] .timer {
    color: #60a5fa;
}

[data-theme="dark"] .btn-theme {
    background: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

[data-theme="dark"] .btn-theme:hover {
    background: #4b5563;
    border-color: #6b7280;
}

[data-theme="dark"] .btn-secondary {
    background: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #4b5563;
    border-color: #6b7280;
}

[data-theme="dark"] .btn-primary {
    background: #2563eb;
    border-color: #3b82f6;
    color: white;
}

[data-theme="dark"] .btn-primary:hover {
    background: #1d4ed8;
    border-color: #2563eb;
}

[data-theme="dark"] .word-list-container {
    background: #1f2937;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .word-list-container h3 {
    color: #f9fafb;
}

[data-theme="dark"] .word-count {
    color: #9ca3af;
}

[data-theme="dark"] .word-item {
    background: #374151;
    color: #d1d5db;
    border: 1px solid #4b5563;
}

[data-theme="dark"] .word-item.found {
    background: #065f46;
    color: #d1fae5;
    border-color: #10b981;
}

[data-theme="dark"] .grid-container {
    background: #1f2937;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .grid-cell {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

[data-theme="dark"] .grid-cell:hover {
    background: #4b5563;
    border-color: #6b7280;
}

[data-theme="dark"] .grid-cell.selected {
    background: #1d4ed8;
    border-color: #3b82f6;
    color: white;
}

[data-theme="dark"] .grid-cell.found {
    background: #065f46;
    border-color: #10b981;
    color: #d1fae5;
}

[data-theme="dark"] body {
    background-color: #111827;
    color: #f9fafb;
}

[data-theme="dark"] .container {
    background-color: #111827;
}

/* Dark theme for pause overlay */
[data-theme="dark"] .pause-overlay {
    background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .pause-content {
    background: #1f2937;
    color: #f9fafb;
}

[data-theme="dark"] .pause-content h2 {
    color: #f9fafb;
}

[data-theme="dark"] .pause-content p {
    color: #d1d5db;
}

/* Dark theme for complete screen */
[data-theme="dark"] .complete-content {
    background: #1f2937;
    color: #f9fafb;
}

[data-theme="dark"] .complete-content h1 {
    color: #f9fafb;
}

[data-theme="dark"] .complete-content p {
    color: #d1d5db;
}

[data-theme="dark"] .score-info p {
    color: #d1d5db;
}

[data-theme="dark"] .social-sharing h3 {
    color: #f9fafb;
}

[data-theme="dark"] .profile-share {
    background: #1e3a5f;
    border-color: #3b5998;
}

[data-theme="dark"] .profile-share h3 {
    color: #f9fafb;
}

[data-theme="dark"] .profile-share-hint {
    color: #9ca3af;
}

[data-theme="dark"] .profile-share-input {
    background: #111827;
    border-color: #4b5563;
    color: #f3f4f6;
}

[data-theme="dark"] .profile-stats-table th {
    background: #374151;
    color: #f9fafb;
}

[data-theme="dark"] .profile-stats-table td {
    border-bottom-color: #4b5563;
    color: #d1d5db;
}

[data-theme="dark"] .profile-summary-card {
    background: linear-gradient(180deg, #0f172a 0%, #16253f 100%);
    border-color: #304a70;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .profile-summary-item {
    background: rgba(15, 23, 42, 0.82);
    border-color: #335078;
}

[data-theme="dark"] .profile-summary-item:hover {
    border-color: #4f78ad;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .profile-summary-label {
    color: #bfdbfe;
}

[data-theme="dark"] .profile-summary-value {
    color: #f8fafc;
}

[data-theme="dark"] .profile-summary-team-icon {
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35);
}

[data-theme="dark"] .profile-summary-team-row-link {
    background: rgba(15, 23, 42, 0.82);
    border-color: #335078;
}

[data-theme="dark"] .profile-summary-team-row-link:hover {
    border-color: #4f78ad;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .profile-badge {
    background: rgba(30, 58, 95, 0.35);
    border-color: #3e5f8c;
    color: #dbeafe;
}

[data-theme="dark"] .profile-badge-value {
    color: #93c5fd;
}

[data-theme="dark"] .profile-insights h2 {
    color: #f3f4f6;
}

[data-theme="dark"] .profile-insight-card {
    background: #111827;
    border-color: #2d3f5d;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .profile-insight-card h3,
[data-theme="dark"] .profile-chart-value {
    color: #e5edff;
}

[data-theme="dark"] .profile-insight-subtitle,
[data-theme="dark"] .profile-chart-label,
[data-theme="dark"] .profile-chart-empty {
    color: #94a3b8;
}

[data-theme="dark"] .profile-chart-bar-wrap {
    background: #334155;
}

[data-theme="dark"] .profile-pb-area {
    fill: rgba(96, 165, 250, 0.12);
}

[data-theme="dark"] .profile-pb-line {
    stroke: #60a5fa;
}

[data-theme="dark"] .profile-pb-trend {
    stroke: #e2e8f0;
    opacity: 0.55;
}

[data-theme="dark"] .profile-pb-grid {
    stroke: #334155;
}

[data-theme="dark"] .profile-pb-axis-label {
    fill: #94a3b8;
}

[data-theme="dark"] .profile-pb-legend-item {
    color: #cbd5e1;
}

[data-theme="dark"] .profile-pb-legend-more {
    color: #94a3b8;
}

[data-theme="dark"] .profile-pb-dot-time {
    fill: #cbd5e1;
}

[data-theme="dark"] .profile-best-score-cell:hover {
    text-decoration-color: rgba(96, 165, 250, 0.45);
}

[data-theme="dark"] #profile-score-tooltip.profile-score-tooltip {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 2px 10px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .profile-score-tooltip-title {
    color: #f1f5f9;
}

[data-theme="dark"] .profile-score-tooltip-sponsor {
    color: #94a3b8;
    border-bottom-color: #334155;
}

[data-theme="dark"] .profile-game-title {
    color: #f1f5f9;
}

[data-theme="dark"] .profile-game-sponsor {
    color: #94a3b8;
}

[data-theme="dark"] .profile-pb-legend-title {
    color: #e2e8f0;
}

[data-theme="dark"] .profile-pb-legend-sponsor {
    color: #94a3b8;
}

[data-theme="dark"] .profile-chart-sublabel {
    color: #94a3b8;
}

[data-theme="dark"] .profile-score-tooltip-k {
    color: #94a3b8;
}

[data-theme="dark"] .profile-score-tooltip-v {
    color: #e2e8f0;
}

[data-theme="dark"] .profile-my-stats-banner-link {
    background: linear-gradient(135deg, #1e3a5f 0%, #172554 100%);
    border-color: #334155;
    color: #e5edff;
}

[data-theme="dark"] .profile-my-stats-banner-link:hover {
    background: linear-gradient(135deg, #254a7a 0%, #1e3a5f 100%);
    border-color: #475569;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .profile-browse-fallback {
    background: #111827;
    border-color: #2d3f5d;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .profile-browse-fallback h2,
[data-theme="dark"] .profile-browse-score {
    color: #e5edff;
}

[data-theme="dark"] .profile-browse-subtitle,
[data-theme="dark"] .profile-browse-meta,
[data-theme="dark"] .profile-browse-loading,
[data-theme="dark"] .profile-browse-empty {
    color: #94a3b8;
}

[data-theme="dark"] .profile-browse-item {
    background: rgba(30, 58, 95, 0.32);
    border-color: #36527a;
}

[data-theme="dark"] .profile-browse-item:hover {
    background: rgba(30, 64, 112, 0.5);
    border-color: #4a6a98;
}

[data-theme="dark"] .profile-browse-rank,
[data-theme="dark"] .profile-browse-name,
[data-theme="dark"] .profile-browse-icon-fallback {
    color: #dbeafe;
}

[data-theme="dark"] .profile-browse-streak-legend {
    color: #94a3b8;
}

[data-theme="dark"] .profile-streaks-at-risk-card h2,
[data-theme="dark"] .profile-streak-module h2 {
    color: #bfdbfe;
}

[data-theme="dark"] .profile-streak-module-value {
    color: #f1f5f9;
}

[data-theme="dark"] .profile-streak-module-note {
    color: #fbbf24;
}

[data-theme="dark"] .profile-personal-best {
    color: #e5e7eb;
}

[data-theme="dark"] .profile-status-message {
    color: #9ca3af;
}

[data-theme="dark"] .profile-page-header.rankings-header {
    color: #f9fafb;
}

[data-theme="dark"] .profile-page-header.rankings-header .profile-hero-title-row h1,
[data-theme="dark"] .profile-page-header.rankings-header .header-content h1 {
    color: #f9fafb;
}

[data-theme="dark"] .profile-page-header #profile-subtitle {
    color: #9ca3af;
}

[data-theme="dark"] .profile-page-actions {
    background: #1e3a5f;
    border-color: #3b5998;
}

[data-theme="dark"] .profile-hero-brand-icon {
    border-color: #4b5563;
    background: #111827;
}

[data-theme="dark"] .profile-personal-best-hero {
    border-bottom-color: #4b5563;
    background: transparent;
}

[data-theme="dark"] .profile-personal-best-hero-title {
    color: #d1d5db;
}

[data-theme="dark"] .profile-personal-best-hero-time {
    color: #60a5fa;
}

[data-theme="dark"] .profile-personal-best-hero-game {
    color: #9ca3af;
}

[data-theme="dark"] a.player-profile-link {
    color: inherit;
}

[data-theme="dark"] .leaderboard-container h3 {
    color: #f9fafb;
}

/* Dark theme for social buttons */
[data-theme="dark"] .social-btn {
    background: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

[data-theme="dark"] .social-btn:hover {
    background: #4b5563;
    border-color: #6b7280;
}

/* Dark theme for leaderboard */
[data-theme="dark"] .leaderboard-item {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

[data-theme="dark"] .leaderboard-item .rank {
    color: #d1d5db;
}

[data-theme="dark"] .leaderboard-item .name {
    color: #f9fafb;
}

[data-theme="dark"] .leaderboard-item .time {
    color: #60a5fa;
}

[data-theme="dark"] .score-badge {
    border-color: #3b4f75;
    background: #1f3557;
    color: #bfdbfe;
}

[data-theme="dark"] .score-badge-first_challenge {
    border-color: #355b44;
    background: #173827;
    color: #86efac;
}

[data-theme="dark"] .score-badge-personal_best {
    border-color: #7a5d1f;
    background: #3f3217;
    color: #fde68a;
}

/* Dark theme for sponsor content */
[data-theme="dark"] .sponsor-content {
    background: #374151;
    border-left-color: #60a5fa;
}

[data-theme="dark"] .sponsor-blurb {
    background: #374151;
    border-color: #4b5563;
}

[data-theme="dark"] .game-sponsor-content {
    background: #374151;
    border-left-color: #60a5fa;
}

[data-theme="dark"] .sponsor-ribbon {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
}

[data-theme="dark"] .sponsor-ribbon::before {
    border-left-color: #3b82f6;
}

[data-theme="dark"] .sponsor-ribbon::after {
    border-right-color: #60a5fa;
}

[data-theme="dark"] .sponsor-message {
    color: #f9fafb;
}

[data-theme="dark"] .sponsor-message p {
    color: #f9fafb;
}

[data-theme="dark"] .sponsor-message strong {
    color: #60a5fa;
}

[data-theme="dark"] .sponsor-message a {
    color: #60a5fa;
}

[data-theme="dark"] .sponsor-message a:hover {
    color: #93c5fd;
}

[data-theme="dark"] .welcome-text {
    color: #f9fafb;
}

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

.timer-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timer-label {
    font-weight: 500;
    color: #5f6368;
}

.timer {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a73e8;
    font-family: 'Courier New', monospace;
}

.game-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.game-left-column {
    flex: 0 0 250px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-right-column {
    flex: 1;
}

.word-list-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.word-list-container h3 {
    color: #202124;
    font-weight: 500;
    font-size: 1rem;
    text-align: center;
}

.word-count {
    text-align: center;
    color: #5f6368;
    font-size: 0.8rem;
    margin-bottom: 15px;
    font-weight: 400;
}

.word-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 3px;
    padding-right: 5px;
    justify-items: center;
}

.word-item {
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-weight: 500;
    font-size: 11px;
    transition: all 0.2s;
    cursor: default;
    text-align: center;
    white-space: nowrap;
    position: relative;
    width: 100%;
    max-width: 120px;
}

.word-item.found {
    background: #e6f4ea;
    color: #137333;
    opacity: 0.8;
    position: relative;
    animation: wordFound 0.3s ease-in-out;
}

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

.word-item.found::after {
    content: "✓";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    font-size: 16px;
}

.grid-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

/* Mobile grid container adjustments */
@media (max-width: 768px) {
    .grid-container {
        padding: 15px 10px;
        margin: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 2px;
    margin: 0 auto;
    max-width: 600px;
    min-width: 450px;
    /* Prevent native scrolling/zoom gestures during pointer drag */
    touch-action: none;
}


.grid-cell {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    border-radius: 4px;
    padding: 4px;
    box-sizing: border-box;
}

.grid-cell:hover {
    background: #e8eaed;
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* Touch-friendly adjustments */
@media (pointer: coarse) {
    .grid-cell {
        min-width: 0;
        min-height: 0;
        touch-action: manipulation;
    }
    
    .grid-cell:hover {
        transform: none; /* Disable transform on touch devices */
    }
    
    .grid-cell:active {
        background: #e8eaed;
        transform: scale(0.98);
    }
}

.grid-cell.selected {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
    box-shadow: 0 0 8px rgba(26, 115, 232, 0.4);
    transform: scale(1.05);
    transition: all 0.2s ease;
    z-index: 10;
    position: relative;
}

.grid-cell.preview {
    background: rgba(26, 115, 232, 0.3);
    border-color: rgba(26, 115, 232, 0.5);
    box-shadow: 0 0 4px rgba(26, 115, 232, 0.3);
}

.grid-cell.found {
    background: #e6f4ea;
    color: #137333;
    border-color: #137333;
}

/* Pause Overlay */
.pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.pause-overlay.active {
    display: flex;
}

.pause-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    margin: 20px;
}

.pause-content h2 {
    color: #202124;
    margin-bottom: 15px;
    font-size: 1.8rem;
    font-weight: 400;
}

.pause-content p {
    color: #5f6368;
    margin-bottom: 30px;
    font-size: 1rem;
}

.pause-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Complete Screen */
.complete-content {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 40px auto;
    max-width: 600px;
}

.complete-content h1 {
    font-size: 2.5rem;
    color: #137333;
    margin-bottom: 20px;
    font-weight: 400;
}

.highlight {
    color: #1a73e8;
    font-weight: 600;
}

.score-info {
    margin: 20px 0;
    padding: 15px;
    background: #e6f4ea;
    border-radius: 8px;
    color: #137333;
}

/* Social Sharing Section */
.social-sharing {
    margin: 30px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e8eaed;
}

.social-sharing h3 {
    margin-bottom: 20px;
    color: #202124;
    font-weight: 500;
    font-size: 1.1rem;
}

/* Player profile share (complete screen) */
.profile-share {
    margin: 24px 0;
    padding: 20px;
    background: #f0f7ff;
    border-radius: 12px;
    border: 1px solid #c3d9f0;
}

.profile-share h3 {
    margin: 0 0 8px 0;
    color: #202124;
    font-weight: 500;
    font-size: 1.05rem;
}

.profile-share-hint {
    margin: 0 0 14px 0;
    font-size: 0.9rem;
    color: #5f6368;
    line-height: 1.4;
}

.profile-share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.profile-share-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #202124;
}

.profile-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    max-width: 720px;
    padding: 20px;
    background: #f0f7ff;
    border-radius: 12px;
    border: 1px solid #c3d9f0;
    box-sizing: border-box;
}

.profile-status-message {
    padding: 24px;
    text-align: center;
    color: #5f6368;
}

.profile-page-header.rankings-header {
    background: transparent;
    background-image: none;
    color: #202124;
    padding: 28px 16px 12px;
    margin-bottom: 8px;
    border-radius: 0;
    box-shadow: none;
}

.profile-page-header .header-content {
    text-align: center;
}

.profile-page-header.rankings-header .header-content p,
.profile-page-header #profile-subtitle {
    color: #5f6368;
    opacity: 1;
    font-size: 1rem;
}

.profile-page-header.rankings-header .header-content h1,
.profile-page-header .profile-hero-title-row h1 {
    font-size: clamp(2.25rem, 7vw, 3.25rem);
    font-weight: 800;
    color: #202124;
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.profile-hero-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.profile-hero-brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: contain;
    flex-shrink: 0;
    border: 1px solid #e8eaed;
    background: #fff;
}

.profile-personal-best-hero {
    max-width: 560px;
    margin: 0 auto 28px;
    text-align: center;
    padding: 20px 16px 24px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #e8eaed;
    background: transparent;
    box-shadow: none;
}

.profile-personal-best-hero-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #374151;
}

.profile-personal-best-hero-time {
    margin: 0 0 8px;
    font-size: 2.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    color: #1a73e8;
    font-family: ui-monospace, 'Courier New', monospace;
}

.profile-personal-best-hero-game {
    margin: 0;
    font-size: 0.95rem;
    color: #6b7280;
}

.rankings-left .profile-personal-best-hero {
    max-width: none;
    width: 100%;
    margin: 0 0 24px;
    box-sizing: border-box;
}

.profile-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-summary-list li {
    margin-bottom: 10px;
    line-height: 1.45;
}

.profile-summary-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #d6e4f5;
    box-shadow: 0 8px 20px rgba(18, 74, 138, 0.12);
}

.profile-summary-card h2 {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 1.05rem;
    margin-bottom: 18px;
}

.profile-summary-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #dbe7f5;
    background: rgba(255, 255, 255, 0.92);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.profile-summary-item:hover {
    transform: translateY(-1px);
    border-color: #c5d8ef;
    box-shadow: 0 3px 10px rgba(15, 66, 124, 0.08);
}

.profile-summary-label {
    display: block;
    color: #334155;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.profile-summary-value {
    display: inline-block;
    color: #0f3f77;
    font-size: 1rem;
    font-weight: 800;
    white-space: nowrap;
    text-align: right;
}

.profile-summary-label.profile-summary-label--team-points {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    max-width: min(100%, 22rem);
}

.profile-summary-team-title {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.profile-summary-team-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    vertical-align: middle;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(15, 63, 119, 0.12);
}

.profile-summary-item.profile-summary-item--team-link {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.profile-summary-item.profile-summary-item--team-link:hover {
    transform: none;
    box-shadow: none;
}

.profile-summary-team-row-link {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #dbe7f5;
    background: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.profile-summary-team-row-link:hover {
    transform: translateY(-1px);
    border-color: #c5d8ef;
    box-shadow: 0 3px 10px rgba(15, 66, 124, 0.08);
}

.profile-summary-team-row-link:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

.profile-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 12px 0 14px;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #c8dcf1;
    background: #f7fbff;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 0.8rem;
    color: #1f3f63;
}

.profile-badge-label {
    font-weight: 600;
    letter-spacing: 0;
}

.profile-badge-value {
    font-weight: 800;
    color: #1557b0;
}

.profile-badges-compact .profile-badge {
    padding: 5px 9px;
    font-size: 0.76rem;
}

.profile-insights {
    max-width: 1400px;
    margin: 24px auto 20px;
    padding: 0 20px;
    box-sizing: border-box;
    width: 100%;
}

.profile-insights h2 {
    margin: 0 0 12px;
    font-size: 1.24rem;
    color: #1f2937;
}

.profile-insights-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 16px;
}

.profile-insight-card {
    background: #ffffff;
    border: 1px solid #d8e4f2;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.profile-insight-card h3 {
    margin: 0;
    font-size: 1rem;
    color: #0f3f77;
}

.profile-insight-subtitle {
    margin: 5px 0 11px;
    font-size: 0.82rem;
    color: #64748b;
}

.profile-chart-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.profile-chart-item {
    margin-bottom: 11px;
}

.profile-chart-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.84rem;
}

.profile-chart-label-col {
    flex: 1;
    min-width: 0;
    max-width: 72%;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.profile-chart-label {
    color: #334155;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-chart-sublabel {
    font-size: 0.74rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.32;
}

.profile-chart-value {
    color: #0f3f77;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.profile-chart-bar-wrap {
    height: 7px;
    background: #edf2f7;
    border-radius: 999px;
    overflow: hidden;
}

.profile-chart-bar {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #3b82f6;
}

.profile-chart-bar-consistency {
    background: #2563eb;
}

.profile-chart-bar-improvement {
    background: #059669;
}

.profile-chart-bar-depth {
    background: #7c3aed;
}

.profile-chart-empty {
    font-size: 0.8rem;
    color: #6b7280;
    padding: 6px 0;
}

.profile-pb-timeline-card {
    margin-top: 16px;
    width: 100%;
    box-sizing: border-box;
}

.profile-pb-timeline-chart {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.profile-pb-svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 200px;
}

.profile-pb-area {
    fill: rgba(37, 99, 235, 0.14);
    stroke: none;
}

.profile-pb-line {
    fill: none;
    stroke: #2563eb;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-pb-trend {
    fill: none;
    stroke: #0f172a;
    stroke-width: 1.75;
    stroke-dasharray: 7 5;
    stroke-linecap: round;
    opacity: 0.5;
    pointer-events: none;
}

.profile-pb-grid {
    stroke: #e2e8f0;
    stroke-width: 1;
}

.profile-pb-axis-label {
    fill: #64748b;
    font-size: 11px;
}

.profile-pb-axis-label.profile-pb-axis-x-flow {
    font-size: 10px;
    font-weight: 600;
}

.profile-pb-timeline-legend {
    margin-top: 12px;
}

.profile-pb-legend-rows {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px 14px;
    align-items: start;
}

.profile-pb-legend-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.78rem;
    color: #334155;
    min-width: 0;
    line-height: 1.35;
}

.profile-pb-legend-name {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.profile-pb-legend-title {
    font-weight: 600;
    color: #334155;
    line-height: 1.25;
}

.profile-pb-legend-sponsor {
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.25;
}

.profile-pb-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
    margin-top: 3px;
}

.profile-pb-legend-more {
    grid-column: 1 / -1;
    font-size: 0.74rem;
    color: #64748b;
    margin-top: 2px;
}

.profile-pb-dot-time {
    fill: #475569;
    font-size: 10px;
    font-weight: 600;
    font-family: system-ui, -apple-system, sans-serif;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.profile-best-score-cell {
    cursor: help;
    text-decoration: underline dotted transparent;
    transition: text-decoration-color 0.15s ease;
}

.profile-best-score-cell:hover {
    text-decoration-color: rgba(37, 99, 235, 0.35);
}

#profile-score-tooltip.profile-score-tooltip {
    position: fixed;
    z-index: 10050;
    max-width: min(320px, calc(100vw - 24px));
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06);
    font-size: 0.8rem;
    line-height: 1.45;
    pointer-events: none;
}

#profile-score-tooltip.profile-score-tooltip[hidden] {
    display: none !important;
}

.profile-score-tooltip-title {
    font-weight: 700;
    font-size: 0.84rem;
    color: #0f172a;
    margin-bottom: 4px;
}

.profile-score-tooltip-sponsor {
    font-size: 0.78rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.profile-score-tooltip-grid {
    display: grid;
    gap: 4px 10px;
}

.profile-score-tooltip-row {
    display: grid;
    grid-template-columns: minmax(5.5rem, auto) 1fr;
    gap: 8px;
    align-items: baseline;
}

.profile-score-tooltip-k {
    color: #64748b;
    font-size: 0.76rem;
}

.profile-score-tooltip-v {
    font-variant-numeric: tabular-nums;
    color: #334155;
    font-weight: 600;
    text-align: right;
}

.profile-my-stats-banner {
    margin: 0 0 16px;
}

.profile-my-stats-banner-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff 0%, #e0edff 100%);
    border: 1px solid #bfd4eb;
    color: #0f3f77;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.profile-my-stats-banner-link:hover {
    background: linear-gradient(135deg, #e0edff 0%, #d2e4fc 100%);
    border-color: #8eb4e8;
    box-shadow: 0 4px 14px rgba(21, 87, 176, 0.12);
}

.profile-my-stats-banner-link:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.profile-browse-fallback {
    background: white;
    border: 1px solid #d6e4f5;
    border-radius: 14px;
    padding: 18px;
    margin: 8px 0 20px;
    box-shadow: 0 8px 20px rgba(18, 74, 138, 0.08);
}

.profile-browse-fallback h2 {
    margin: 0 0 6px;
    color: #0f3f77;
    font-size: 1.2rem;
}

.profile-browse-subtitle {
    margin: 0 0 12px;
    color: #64748b;
    font-size: 0.92rem;
}

.profile-browse-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-browse-item {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #dbe7f5;
    background: #f8fbff;
    text-decoration: none;
}

.profile-browse-item:hover {
    border-color: #bfd4eb;
    background: #f0f7ff;
}

.profile-browse-rank {
    font-weight: 800;
    color: #1557b0;
    min-width: 28px;
}

.profile-browse-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    background: #fff;
}

.profile-browse-icon-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
}

.profile-browse-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.profile-browse-name {
    font-weight: 700;
    color: #0f172a;
}

.profile-browse-meta {
    font-size: 0.8rem;
    color: #64748b;
}

.profile-browse-score {
    font-weight: 800;
    color: #0f3f77;
    white-space: nowrap;
}

.profile-browse-loading,
.profile-browse-empty {
    color: #64748b;
    font-size: 0.9rem;
    padding: 10px 4px;
}

.profile-browse-streak-legend {
    margin: 0 0 10px;
    font-size: 0.78rem;
    color: #64748b;
}

.profile-streaks-at-risk-wrap {
    margin-top: 14px;
}

.profile-streaks-at-risk-card h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: #0f3f77;
}

.profile-streak-module h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: #0f3f77;
}

.profile-streak-module-value {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
}

.profile-streak-module-note {
    margin: 8px 0 0;
    font-size: 0.88rem;
    color: #b45309;
    line-height: 1.35;
}

.profile-personal-best {
    margin-top: 8px;
    font-size: 15px;
    color: #202124;
}

.profile-table-wrap {
    overflow-x: auto;
    margin-top: 8px;
}

.profile-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.profile-stats-table th,
.profile-stats-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #e8eaed;
}

.profile-stats-table td.profile-game-cell {
    vertical-align: top;
}

.profile-game-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.35;
}

.profile-game-title {
    font-weight: 600;
    color: #202124;
}

.profile-game-sponsor {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
}

.profile-stats-table th {
    font-weight: 600;
    color: #202124;
    background: #f8f9fa;
    padding: 0;
    vertical-align: bottom;
}

.profile-th-sort {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 8px;
    margin: 0;
    border: none;
    background: transparent;
    font: inherit;
    font-weight: 600;
    color: inherit;
    cursor: pointer;
    text-align: left;
    border-radius: 4px;
}

.profile-th-sort:hover {
    background: rgba(0, 0, 0, 0.045);
}

.profile-th-sort:focus {
    outline: none;
}

.profile-th-sort:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: -2px;
}

.profile-sort-indicator {
    flex-shrink: 0;
    font-size: 0.65rem;
    line-height: 1;
    opacity: 0.35;
    min-width: 0.85em;
}

.profile-stats-table th[aria-sort="ascending"] .profile-sort-indicator::before {
    content: '\25b2';
    opacity: 1;
}

.profile-stats-table th[aria-sort="descending"] .profile-sort-indicator::before {
    content: '\25bc';
    opacity: 1;
}

[data-theme="dark"] .profile-th-sort:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .profile-th-sort:focus-visible {
    outline-color: #60a5fa;
}

/* Linked player names → public profile (no email in URL) */
a.player-profile-link {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}

a.player-profile-link:hover {
    text-decoration: underline;
}

.latest-score-name a.player-profile-link,
.leaderboard-item .name a.player-profile-link,
.welcome-leaderboard-item .name a.player-profile-link {
    color: inherit;
}

.social-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: white;
    min-width: 120px;
    justify-content: center;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.social-btn:active {
    transform: translateY(0);
}

.social-btn svg {
    width: 18px;
    height: 18px;
}

/* Social Button Colors */
.linkedin-btn {
    background: #0077b5;
}

.linkedin-btn:hover {
    background: #005885;
}

.whatsapp-btn {
    background: #25d366;
}

.whatsapp-btn:hover {
    background: #1ea952;
}

.facebook-btn {
    background: #1877f2;
}

.facebook-btn:hover {
    background: #166fe5;
}

.twitter-btn {
    background: #000000;
}

.twitter-btn:hover {
    background: #333333;
}

.email-btn {
    background: #ea4335;
}

.email-btn:hover {
    background: #d33426;
}

.leaderboard-container {
    margin: 30px 0;
    text-align: left;
}

.leaderboard-container h3 {
    margin-bottom: 15px;
    color: #202124;
    font-weight: 500;
}

.leaderboard {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e8eaed;
}

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

.leaderboard-item .rank {
    font-weight: 600;
    color: #1a73e8;
    min-width: 30px;
}

.leaderboard-item .name {
    flex: 1;
    margin: 0 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.leaderboard-item .brand-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
    object-fit: contain;
}

.leaderboard-item .player-name {
    vertical-align: middle;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    min-height: 40px;
}

.pagination-btn {
    background: transparent;
    color: #4285f4;
    border: 1px solid #4285f4;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 80px;
    text-align: center;
}

.pagination-btn:hover {
    background: #4285f4;
    color: white;
}

.pagination-btn:active {
    background: #3367d6;
    color: white;
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Responsive pagination for smaller screens */
@media (max-width: 480px) {
    .pagination-controls {
        gap: 15px;
    }
    
    .pagination-btn {
        min-width: 70px;
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .pagination-info {
        min-width: 100px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .pagination-controls {
        gap: 10px;
    }
    
    .pagination-btn {
        min-width: 60px;
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .pagination-info {
        min-width: 80px;
        font-size: 12px;
    }
}

.pagination-info {
    font-size: 14px;
    color: #5f6368;
    font-weight: 500;
    min-width: 120px;
    text-align: center;
    flex-shrink: 0;
}

.leaderboard-item .time {
    font-weight: 500;
    color: #5f6368;
}

/* Responsive Design */
/* Tablet and Small Desktop (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 15px;
    }
    
    .welcome-layout {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
        padding: 30px 20px;
    }
    
    .welcome-left {
        padding: 25px 20px;
    }
    
    .welcome-content h1 {
        font-size: 2.2rem;
    }
    
    .welcome-content h2 {
        font-size: 1.4rem;
    }
    
    .how-to-play {
        margin: 25px 0;
        padding: 18px;
    }
    
    .how-to-play h2 {
        font-size: 1.2rem;
    }
    
    .start-section {
        padding: 30px 25px;
    }
    
    .input-group {
        gap: 15px;
    }
    
    .input-row {
        min-width: 0;
    }
    
    #player-name, #player-email {
        padding: 12px 15px;
        font-size: 16px;
        box-sizing: border-box;
    }
    
    /* Game layout: Move word list to bottom on tablet */
    .game-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .game-left-column {
        flex: none;
        width: 100%;
        order: 2;
    }
    
    .game-right-column {
        flex: none;
        width: 100%;
        order: 1;
    }
    
    .word-list-container {
        padding: 15px;
    }
    
    .word-list-container h3 {
        font-size: 0.95rem;
    }
    
    .word-count {
        font-size: 0.75rem;
    }
    
    .word-list {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 4px;
        justify-items: center;
    }
    
    .word-item {
        padding: 6px 8px;
        font-size: 10px;
        width: 100%;
        max-width: 100px;
    }
    
    .grid-container {
        padding: 15px;
    }
    
    .word-grid {
        gap: 2px;
        min-width: auto;
        width: 100%;
        max-width: 100%;
    }
    
    .grid-cell {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
    
    .timer {
        font-size: 1.3rem;
    }
    
    .welcome-leaderboard-container {
        margin-top: 25px;
    }
    
    .welcome-leaderboard {
        padding: 15px;
    }
    
    .welcome-leaderboard-item {
        padding: 10px 0;
        font-size: 14px;
    }
    
    /* Sponsor content optimizations for tablet */
    .sponsor-blurb {
        gap: 20px;
        padding: 18px;
    }
    
    .sponsor-logo {
        max-width: 150px;
        max-height: 60px;
    }
    
    .game-sponsor-content {
        padding: 18px;
        gap: 18px;
    }
    
    /* Button optimizations for tablet */
    .btn-primary, .btn-secondary {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    /* Pause overlay optimizations */
    .pause-content {
        padding: 40px 30px;
        margin: 20px;
    }
    
    .pause-content h2 {
        font-size: 1.8rem;
    }
}

/* Mobile and Small Tablet (768px and below) */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        max-width: 100vw;
        overflow-x: hidden;
        margin: 0;
    }
    
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    .welcome-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 10px;
        min-height: auto;
        max-width: 100%;
        margin: 0;
    }
    
    .word-grid {
        min-width: auto;
        max-width: 100%;
        width: 100%;
        gap: 0.5px;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .grid-container {
        padding: 15px 8px;
        overflow: hidden;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0;
    }
    
    .welcome-left {
        padding: 30px 20px;
    }
    
    .welcome-content {
        text-align: center;
    }
    
    .welcome-content h1 {
        font-size: 2rem;
    }
    
    .how-to-play {
        margin: 20px 0;
        padding: 15px;
    }
    
    .how-to-play h2 {
        font-size: 1.1rem;
    }
    
    .start-section {
        padding: 25px 20px;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
    }
    
    .input-row {
        flex-direction: column;
        gap: 8px;
        min-width: 0;
    }
    
    #player-name, #player-email {
        min-width: auto;
        flex: none;
        width: 100%;
        box-sizing: border-box;
    }
    
    .game-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .game-left-column {
        flex: none;
        width: 100%;
        order: 2;
    }
    
    .game-right-column {
        flex: none;
        width: 100%;
        order: 1;
    }
    
    .word-grid {
        grid-template-columns: repeat(15, 1fr);
        gap: 0.5px;
        min-width: auto;
        width: 100%;
    }
    
    .grid-cell {
        width: auto !important;
        height: auto !important;
        min-width: 0;
        min-height: 0;
        aspect-ratio: 1;
        font-size: clamp(10px, 2.5vw, 14px);
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .game-controls {
        justify-content: center;
    }
    
    .pause-content {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .pause-content h2 {
        font-size: 1.5rem;
    }
    
    .pause-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .complete-content {
        margin: 20px auto;
        padding: 40px 20px;
    }
    
    .complete-content h1 {
        font-size: 2rem;
    }
    
    /* Social Sharing Responsive */
    .social-sharing {
        margin: 20px 0;
        padding: 20px 15px;
    }
    
    .social-sharing h3 {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .social-buttons {
        gap: 8px;
    }
    
    .social-btn {
        padding: 10px 16px;
        font-size: 13px;
        min-width: 100px;
    }
    
    .social-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .welcome-leaderboard-container {
        margin-top: 30px;
        padding-top: 20px;
    }
    
    .welcome-leaderboard {
        padding: 12px;
        max-width: 100%;
    }
    
    .welcome-leaderboard-item {
        padding: 8px 0;
    }
    
    .welcome-leaderboard-item .name {
        margin: 0 10px;
        font-size: 13px;
    }
    
    .welcome-leaderboard-item .rank,
    .welcome-leaderboard-item .time {
        font-size: 13px;
    }
    
    .sponsor-blurb {
        flex-direction: column;
        gap: 15px;
        overflow: visible;
        align-items: stretch;
        padding: 20px 15px;
    }
    
    .sponsor-logo-section {
        flex: none;
        width: 100%;
        min-width: 0;
        max-width: none;
        justify-content: center;
        order: 1;
    }
    
    .sponsor-message {
        flex: none;
        width: 100%;
        min-width: 0;
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
        padding-right: 0;
        order: 2;
    }
    
    .game-sponsor-content {
        flex-direction: column;
        gap: 15px;
        overflow: visible;
        align-items: stretch;
        margin-top: 8px;
        margin-left: 8px;
        position: relative;
    }
    
    .game-sponsor-content .sponsor-logo-section {
        flex: none;
        width: 100%;
        min-width: 0;
        max-width: none;
        justify-content: center;
        order: 1;
    }
    
    .game-sponsor-content .sponsor-message {
        flex: none;
        width: 100%;
        min-width: 0;
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
        order: 2;
    }
    
    /* Mobile-specific optimizations */
    .btn-primary, .btn-secondary {
        padding: 14px 20px;
        font-size: 16px;
        min-height: 48px;
    }
    
    .word-list {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 3px;
        justify-items: center;
    }
    
    .word-item {
        padding: 6px 8px;
        font-size: 11px;
        width: 100%;
        max-width: 100px;
    }
    
    .word-list-container h3 {
        font-size: 0.9rem;
    }
    
    .word-count {
        font-size: 0.7rem;
    }

    /* Footer */
    .footer {
        margin-top: 40px;
        padding: 20px 0;
        border-top: 1px solid #e8eaed;
        background-color: #f8f9fa;
    }

    .footer-content {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
        text-align: center;
    }

    .footer-content p {
        margin: 0;
        font-size: 0.85rem;
        color: #5f6368;
        line-height: 1.4;
    }

    .footer-content a {
        color: #1a73e8;
        text-decoration: none;
        transition: color 0.2s;
    }

    .footer-content a:hover {
        color: #1557b0;
        text-decoration: underline;
    }
}

@media (max-width: 480px) {
    .word-grid {
        min-width: auto;
        max-width: 100%;
        width: 100%;
        gap: 0.5px;
    }
    
    .grid-container {
        padding: 10px 5px;
        overflow: hidden;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0;
    }
    
    .grid-cell {
        width: auto !important;
        height: auto !important;
        min-width: 0;
        min-height: 0;
        aspect-ratio: 1;
        font-size: clamp(9px, 2.3vw, 13px);
    }
    
    /* Social Sharing for very small screens */
    .social-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .social-btn {
        min-width: 100%;
        justify-content: center;
    }
}

/* Sponsor Content */
.sponsor-logo-container {
    text-align: center;
    margin: 20px 0;
}

.sponsor-logo {
    max-width: 200px;
    max-height: 80px;
    height: auto;
}

/* Mobile sponsor logo adjustments */
@media (max-width: 768px) {
    .sponsor-logo {
        max-width: 100%;
        max-height: 60px;
    }
}

.sponsor-content {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #1a73e8;
}

.welcome-text {
    margin-bottom: 15px;
}

.sponsor-blurb {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e8eaed;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    overflow: visible;
    font-size: smaller;
    position: relative;
    min-height: 0;
    flex-wrap: wrap;
    margin-top: 8px;
    margin-left: 8px;
}

/* Sponsor Ribbon */
.sponsor-ribbon {
    position: absolute;
    top: -6px;
    left: -6px;
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: white;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.3px;
    border-radius: 3px 0 3px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    z-index: 10;
    transform: rotate(-1deg);
    white-space: nowrap;
    pointer-events: none;
}

.sponsor-ribbon::before {
    content: '';
    position: absolute;
    top: 0;
    right: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid #4285f4;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.sponsor-ribbon::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 0;
    border-right: 6px solid #1a73e8;
    border-left: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

/* Responsive adjustments for sponsor ribbon */
@media (max-width: 768px) {
    .sponsor-ribbon {
        font-size: 9px;
        padding: 2px 6px;
        top: -5px;
        left: -5px;
    }
    
    .sponsor-ribbon::before {
        right: -5px;
        border-left-width: 5px;
        border-top-width: 5px;
        border-bottom-width: 5px;
    }
    
    .sponsor-ribbon::after {
        bottom: -5px;
        border-right-width: 5px;
        border-left-width: 5px;
        border-bottom-width: 5px;
    }
}

.sponsor-logo-section {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    min-width: 0;
    max-width: 200px;
    order: 1;
}

.sponsor-message {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    order: 2;
}

.sponsor-content h1 {
    color: #1a73e8;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.sponsor-content h2 {
    color: #1a73e8;
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.sponsor-content h3 {
    color: #1a73e8;
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.sponsor-content p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.sponsor-content ul {
    margin-bottom: 10px;
    padding-left: 20px;
}

.sponsor-content li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.sponsor-content a {
    color: #1a73e8;
    text-decoration: none;
}

.sponsor-content a:hover {
    text-decoration: underline;
}

/* Game Screen Sponsor Content */
.game-sponsor-content {
    margin-top: 8px;
    margin-left: 8px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #1a73e8;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    overflow: visible;
    font-size: 0.9rem;
    flex-wrap: wrap;
    position: relative;
}

.game-sponsor-content .sponsor-logo-section {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    min-width: 0;
    max-width: 200px;
    order: 1;
}

.game-sponsor-content .sponsor-message {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    order: 2;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-content {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e8eaed;
    border-top: 4px solid #1a73e8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.loading-content p {
    color: #5f6368;
    font-size: 1rem;
    margin: 0;
}

/* Error States */
.error-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.error-content {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #ea4335;
    max-width: 400px;
    margin: 20px;
}

.error-content h3 {
    color: #ea4335;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.error-content p {
    color: #5f6368;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Footer */
.footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #e8eaed;
    background-color: #f8f9fa;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-content p {
    margin: 0;
    font-size: 0.85rem;
    color: #5f6368;
    line-height: 1.4;
}

.profile-load-indicator {
    color: #9aa0a6;
    font-size: 0.8em;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.footer-content a {
    color: #1a73e8;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-content a:hover {
    color: #1557b0;
    text-decoration: underline;
}

/* Footer responsive styles */
@media (max-width: 768px) {
    .footer-content {
        padding: 0 15px;
    }
    
    .footer-content p {
        font-size: 0.8rem;
    }
}

/* Domain rankings widget: styles ship in widgets/domain-rankings-widget.js */

/* Domain Rankings Page Styles */
.rankings-header {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 40px;
    border-radius: 12px;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 20px 0 10px 0;
}

.header-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

.rankings-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    width: 100%;
}

.rankings-left {
    order: 1;
}

.rankings-right {
    order: 2;
}

.instructions-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    position: sticky;
    top: 20px;
}

.instructions-card h2 {
    color: #111827;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
}

.instructions-card h3 {
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 25px 0 15px 0;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

.instructions-card p {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 15px;
}

.instructions-card ul {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 20px;
    padding-left: 20px;
}

.instructions-card li {
    margin-bottom: 8px;
}

.instructions-card strong {
    color: #374151;
}

.scoring-section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.scoring-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.scoring-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.scoring-row.participation {
    background: #f0f9ff;
    border-color: #0ea5e9;
}

.scoring-row .position {
    font-weight: 500;
    color: #374151;
}

.scoring-row .points {
    font-weight: 700;
    color: #059669;
    font-size: 1.1rem;
}

.scoring-row.participation .points {
    color: #0ea5e9;
}

.rules-section,
.strategy-section,
.updates-section {
    margin: 25px 0;
}

.rankings-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.rankings-header-section {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
}

.rankings-header-section h2 {
    color: #111827;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.rankings-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
}

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

.stat-label {
    display: block;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    display: block;
    color: #111827;
    font-size: 1.25rem;
    font-weight: 700;
}

.q2-league-banner {
    margin-top: 18px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 12px;
    font-size: 1.05rem;
    line-height: 1.5;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.q2-league-banner strong {
    color: #fff;
}

.q2-countdown-line {
    margin: 18px 0 0 0;
    font-size: 1.05rem;
    color: #4b5563;
    font-weight: 500;
}

.q2-countdown-label {
    font-weight: 700;
    color: #111827;
}

#q2-countdown-value {
    font-variant-numeric: tabular-nums;
    color: #1557b0;
    font-weight: 700;
}

.teams-share-row {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.teams-share-btn {
    padding: 10px 22px;
    font-size: 0.95rem;
}

.teams-share-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    padding: 12px 20px;
    background: #111827;
    color: #fff;
    border-radius: 10px;
    font-size: 0.95rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    max-width: min(420px, 92vw);
    text-align: center;
}

.rankings-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.rankings-footer p {
    color: #6b7280;
    margin: 0;
}

.rankings-footer a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 600;
}

.rankings-footer a:hover {
    text-decoration: underline;
}

/* teams rankings page only: light header, flat points column, stats under table */
body.teams-rankings-page .rankings-header {
    background: transparent;
    color: #111827;
    padding: 28px 20px 32px;
    margin-bottom: 28px;
    border-radius: 0;
    border-bottom: 1px solid #e5e7eb;
}

body.teams-rankings-page .rankings-header .header-content h1 {
    color: #111827;
    font-weight: 800;
}

body.teams-rankings-page .rankings-header .header-content p {
    color: #4b5563;
    opacity: 1;
}

body.teams-rankings-page .rankings-header .q2-league-banner {
    margin-top: 22px;
    margin-left: auto;
    margin-right: auto;
    max-width: 760px;
    padding: 22px 24px 24px;
    text-align: center;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 48%, #0ea5e9 100%);
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.12),
        0 14px 28px -6px rgba(29, 78, 216, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

body.teams-rankings-page .rankings-header .q2-league-banner__copy {
    font-size: 1.05rem;
    line-height: 1.55;
    color: rgba(248, 250, 252, 0.96);
    text-align: center;
    max-width: 52ch;
}

body.teams-rankings-page .rankings-header .q2-league-banner strong {
    color: #fff;
}

body.teams-rankings-page .rankings-header .q2-league-banner .q2-countdown-line {
    margin: 14px 0 0;
    font-size: 1.08rem;
    color: rgba(248, 250, 252, 0.92);
    font-weight: 500;
}

body.teams-rankings-page .rankings-header .q2-league-banner .q2-countdown-label {
    color: #fff;
    font-weight: 700;
}

body.teams-rankings-page .rankings-header .q2-league-banner #q2-countdown-value {
    color: #fef08a;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
}

body.teams-rankings-page .rankings-header .q2-league-banner .teams-share-row {
    margin-top: 16px;
    margin-bottom: 2px;
    gap: 12px;
}

body.teams-rankings-page .rankings-header .q2-league-banner .teams-play-now-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 999px;
    background: #fff;
    color: #1d4ed8;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.95);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

body.teams-rankings-page .rankings-header .q2-league-banner .teams-play-now-btn:hover {
    background: #f8fafc;
    color: #1e40af;
    transform: translateY(-1px);
}

body.teams-rankings-page .rankings-header .q2-league-banner .teams-play-now-btn:focus-visible {
    outline: 2px solid #fef08a;
    outline-offset: 3px;
}

body.teams-rankings-page .rankings-header .q2-league-banner .teams-share-btn {
    background: rgba(255, 255, 255, 0.14);
    border: 2px solid rgba(255, 255, 255, 0.88);
    color: #fff;
    font-weight: 600;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

body.teams-rankings-page .rankings-header .q2-league-banner .teams-share-btn:hover {
    background: rgba(255, 255, 255, 0.26);
    border-color: #fff;
    color: #fff;
}

body.teams-rankings-page .rankings-main-panel {
    min-width: 0;
}

body.teams-rankings-page .rankings-header-section {
    padding-bottom: 16px;
    margin-bottom: 20px;
}

body.teams-rankings-page .rankings-stats.rankings-stats--below {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    justify-content: center;
    flex-wrap: wrap;
}

body.teams-rankings-page .rankings-stats--below .stat-item--inline {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
    text-align: left;
}

body.teams-rankings-page .rankings-stats--below .stat-item--inline .stat-label {
    display: inline;
    margin-bottom: 0;
    text-transform: none;
    letter-spacing: normal;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

body.teams-rankings-page .rankings-stats--below .stat-item--inline .stat-value {
    display: inline;
    font-size: 1.35rem;
    font-weight: 800;
}

body.teams-rankings-page .rankings-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: none;
}

body.teams-rankings-page .rankings-right .instructions-card.teams-points-guide {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0 0 24px 8px;
    position: sticky;
    top: 20px;
}

body.teams-rankings-page .rankings-right .instructions-card.teams-points-guide h2 {
    text-align: center;
}

[data-theme="dark"] body.teams-rankings-page .rankings-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] body.teams-rankings-page .rankings-header .header-content h1 {
    color: #f8fafc;
}

[data-theme="dark"] body.teams-rankings-page .rankings-header .header-content p {
    color: #cbd5e1;
}

[data-theme="dark"] body.teams-rankings-page .rankings-header .q2-league-banner {
    background: linear-gradient(135deg, #1e3a8a 0%, #5b21b6 52%, #0369a1 100%);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.35),
        0 16px 32px -8px rgba(30, 58, 138, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

[data-theme="dark"] body.teams-rankings-page .rankings-header .q2-league-banner__copy {
    color: rgba(248, 250, 252, 0.95);
}

[data-theme="dark"] body.teams-rankings-page .rankings-header .q2-league-banner strong {
    color: #fff;
}

[data-theme="dark"] body.teams-rankings-page .rankings-header .q2-league-banner #q2-countdown-value {
    color: #fde047;
}

[data-theme="dark"] body.teams-rankings-page .rankings-stats--below .stat-item--inline .stat-label {
    color: #cbd5e1;
}

[data-theme="dark"] body.teams-rankings-page .rankings-stats.rankings-stats--below {
    border-top-color: #334155;
}

[data-theme="dark"] body.teams-rankings-page .rankings-right .instructions-card.teams-points-guide {
    background: transparent;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .rankings-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* teams rankings page: rankings first, then points guide */
    body.teams-rankings-page .rankings-left {
        order: 1;
    }

    body.teams-rankings-page .rankings-right {
        order: 2;
    }

    body.teams-rankings-page .rankings-right .instructions-card.teams-points-guide {
        position: static;
        padding-left: 0;
    }

    .rankings-left {
        order: 2;
    }

    .rankings-right {
        order: 1;
    }

    .instructions-card {
        position: static;
    }
}

@media (max-width: 768px) {
    .rankings-header {
        padding: 30px 15px;
        margin-bottom: 30px;
    }

    .profile-page-header.rankings-header {
        padding: 22px 12px 10px;
        margin-bottom: 8px;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }

    .profile-page-header.rankings-header .header-content h1,
    .profile-page-header .profile-hero-title-row h1 {
        font-size: clamp(1.85rem, 9vw, 2.75rem);
    }
    
    .header-content p {
        font-size: 1rem;
    }

    .profile-summary-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .profile-summary-value {
        text-align: left;
    }

    .profile-insights-grid {
        grid-template-columns: 1fr;
    }

    .profile-insights {
        padding: 0 15px;
    }

    .profile-insight-card {
        padding: 14px 12px;
    }

    .profile-browse-item {
        grid-template-columns: auto auto 1fr;
        row-gap: 4px;
    }

    .profile-browse-score {
        grid-column: 3;
        justify-self: start;
        font-size: 0.85rem;
    }
    
    .rankings-layout {
        padding: 0 15px;
        gap: 25px;
    }
    
    .instructions-card,
    .rankings-container {
        padding: 20px;
    }
    
    .rankings-stats {
        flex-direction: column;
        gap: 20px;
    }

    body.teams-rankings-page .rankings-stats.rankings-stats--below {
        flex-direction: row;
        gap: 0;
    }
    
    .scoring-table {
        gap: 6px;
    }
    
    .scoring-row {
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .container {
        max-width: 100vw;
        overflow-x: hidden;
        padding: 5px;
        margin: 0;
    }
    
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    .rankings-header {
        padding: 25px 10px;
        margin-bottom: 25px;
    }
    
    .header-content h1 {
        font-size: 1.75rem;
    }
    
    .rankings-layout {
        padding: 0 10px;
        gap: 20px;
    }
    
    .instructions-card,
    .rankings-container {
        padding: 15px;
    }
    
    .instructions-card h2 {
        font-size: 1.25rem;
    }
    
    .rankings-header-section h2 {
        font-size: 1.5rem;
    }
}

/* Hint System Styles */
@keyframes hintPulse1 {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
        background-color: rgba(59, 130, 246, 0.15);
    }
    50% {
        box-shadow: 0 0 15px 5px rgba(59, 130, 246, 0.4);
        background-color: rgba(59, 130, 246, 0.25);
    }
}

@keyframes hintPulse2 {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(147, 51, 234, 0.7);
        background-color: rgba(147, 51, 234, 0.15);
    }
    50% {
        box-shadow: 0 0 18px 6px rgba(147, 51, 234, 0.5);
        background-color: rgba(147, 51, 234, 0.3);
    }
}

@keyframes hintPulse3 {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.8);
        background-color: rgba(234, 88, 12, 0.2);
    }
    50% {
        box-shadow: 0 0 20px 8px rgba(234, 88, 12, 0.6);
        background-color: rgba(234, 88, 12, 0.35);
    }
}

.grid-cell.hint-pulse-1 {
    animation: hintPulse1 2s ease-in-out infinite;
    z-index: 10;
    position: relative;
}

.grid-cell.hint-pulse-2 {
    animation: hintPulse2 2s ease-in-out infinite;
    z-index: 10;
    position: relative;
}

.grid-cell.hint-pulse-3 {
    animation: hintPulse3 1.5s ease-in-out infinite;
    z-index: 10;
    position: relative;
}

/* Hint toggle button */
#hint-toggle .hint-icon {
    font-size: 20px;
    transition: opacity 0.3s ease;
}

/* Dark theme adjustments for hints */
[data-theme="dark"] .grid-cell.hint-pulse-1 {
    background-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .grid-cell.hint-pulse-2 {
    background-color: rgba(147, 51, 234, 0.2);
}

[data-theme="dark"] .grid-cell.hint-pulse-3 {
    background-color: rgba(234, 88, 12, 0.25);
}