:root {
            --navbar-height-desktop: 80px;
            --navbar-height-tablet: 70px;
            --navbar-height-mobile: 60px;
            --navbar-spacing: 20px;
        }
        
        body {
            background: #ffffff;
            font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            min-height: 100vh;
        }

        .container {
            margin-top: calc(var(--navbar-height-desktop, 80px) + var(--navbar-spacing, 20px));
            background: #ffffff;
            padding: 40px 30px 30px 30px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        
        

        .simple-score {
            color: #eebbc3;
            font-size: 24px;
            font-weight: 600;
            margin-left: 5px;
            display: inline-block;
            white-space: nowrap;
        }

        .score-badge {
            background: linear-gradient(135deg, #eebbc3 0%, #f7b7a3 100%);
            color: #232946;
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 20px;
            font-weight: 700;
            display: inline-block;
            box-shadow: 0 4px 12px rgba(238,187,195,0.3);
            border: 2px solid rgba(255,255,255,0.2);
            transition: all 0.3s ease;
            white-space: nowrap;
        }

        .score-badge:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(238,187,195,0.4);
        }

        /* Game Popup Styles */
        .game-popup {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(35, 41, 70, 0.8);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 10000;
            animation: fadeIn 0.3s ease;
        }

        .popup-content {
            background: linear-gradient(135deg, #f7faff 0%, #e0eafc 100%);
            border-radius: 20px;
            padding: 30px;
            max-width: 400px;
            width: 90%;
            box-shadow: 0 20px 40px rgba(35, 41, 70, 0.3);
            border: 2px solid rgba(238, 187, 195, 0.3);
            animation: slideIn 0.4s ease;
        }

        .popup-header {
            text-align: center;
            margin-bottom: 25px;
        }

        .popup-header h2 {
            color: #4a5c6e;
            font-size: 28px;
            font-weight: 700;
            margin: 0 0 10px 0;
        }

        .popup-icon {
            font-size: 48px;
            margin: 10px 0;
        }

        .popup-body {
            margin-bottom: 25px;
        }

        .final-score {
            text-align: center;
            margin-bottom: 20px;
        }

        .final-score-badge {
            background: linear-gradient(135deg, #eebbc3 0%, #f7b7a3 100%);
            color: #232946;
            padding: 12px 24px;
            border-radius: 25px;
            font-size: 24px;
            font-weight: 700;
            display: inline-block;
            box-shadow: 0 6px 20px rgba(238,187,195,0.3);
            border: 2px solid rgba(255,255,255,0.2);
            margin-left: 10px;
        }

        .game-stats {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .stat-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 15px;
            background: rgba(238, 187, 195, 0.1);
            border-radius: 10px;
            border: 1px solid rgba(238, 187, 195, 0.2);
        }

        .stat-label {
            color: #4a5c6e;
            font-weight: 600;
            font-size: 14px;
        }

        .stat-value {
            color: #232946;
            font-weight: 700;
            font-size: 16px;
        }

        .popup-actions {
            display: flex;
            gap: 12px;
            justify-content: center;
        }

        /* Contest Ended Popup Styles */
        .final-stats {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            margin: 20px 0;
        }

        .stat-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            background: rgba(238,187,195,0.1);
            border-radius: 8px;
            border-left: 3px solid #eebbc3;
        }

        .stat-label {
            font-size: 14px;
            color: #6b7c8e;
            font-weight: 600;
        }

        .stat-value {
            font-size: 16px;
            color: #4a5c6e;
            font-weight: bold;
        }

        .popup-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 20px;
            border: none;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            outline: none;
        }

        .popup-btn.primary {
            background: linear-gradient(135deg, #eebbc3 0%, #f7b7a3 100%);
            color: #232946;
            box-shadow: 0 4px 12px rgba(238,187,195,0.3);
        }

        .popup-btn.primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(238,187,195,0.4);
        }

        .popup-btn.secondary {
            background: linear-gradient(135deg, #f7faff 0%, #e0eafc 100%);
            color: #4a5c6e;
            border: 2px solid #eebbc3;
        }

        .popup-btn.secondary:hover {
            background: linear-gradient(135deg, #eebbc3 0%, #f7b7a3 100%);
            color: #232946;
            transform: translateY(-2px);
        }
        
        .popup-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            background: #ccc !important;
            color: #666 !important;
            border-color: #999 !important;
        }
        
        .popup-btn:disabled:hover {
            transform: none !important;
            box-shadow: 0 4px 12px rgba(238,187,195,0.3) !important;
            background: #ccc !important;
            color: #666 !important;
        }

        .btn-icon {
            font-size: 16px;
        }

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

        @keyframes slideIn {
            from { 
                opacity: 0;
                transform: translateY(-30px) scale(0.9);
            }
            to { 
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .score-label {
            color: #4a5c6e;
            font-size: 20px;
            font-weight: 600;
            margin-right: 5px;
            white-space: nowrap;
        }

        


        @-webkit-keyframes move-up {
            0% {
                top: 25px;
                opacity: 1;
            }
            100% {
                top: -50px;
                opacity: 0;
            }
        }

        @-moz-keyframes move-up {
            0% {
                top: 25px;
                opacity: 1;
            }
            100% {
                top: -50px;
                opacity: 0;
            }
        }

        @keyframes move-up {
            0% {
                top: 25px;
                opacity: 1;
            }
            100% {
                top: -50px;
                opacity: 0;
            }
        }
        
        .mode-indicator {
            color: #eebbc3;
            font-size: 18px;
            font-weight: 600;
            margin-left: 10px;
            white-space: nowrap;
        }
        

        .game-container {
            margin-top: 0;
            position: relative;
            padding: 12px;
            cursor: default;
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            user-select: none;
            background: #bbada0;
            border-radius: 4px;
            border: none;
            width: 100%;
            max-width: 400px;
            aspect-ratio: 1 / 1;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            outline: none;
        }

        .game-container:focus {
            outline: none;
        }

        .grid-container {
            position: absolute;
            z-index: 1;
            width: calc(100% - 24px);
            height: calc(100% - 24px);
            top: 12px;
            left: 12px;
            padding: 0;
            margin: 0;
            box-sizing: border-box;
        }

        .grid-row {
            margin-bottom: 12px;
            width: 100%;
            display: block;
            height: calc((100% - 36px) / 4);
            box-sizing: border-box;
        }
        .grid-row:last-child {
            margin-bottom: 0;
        }
        .grid-row:after {
            content: "";
            display: block;
            clear: both;
        }

        .grid-cell {
            width: calc((100% - 36px) / 4);
            height: 100%;
            margin-right: 12px;
            float: left;
            border-radius: 4px;
            background: rgba(238, 228, 218, 0.35);
            box-sizing: border-box;
        }
        .grid-row .grid-cell:last-child {
            margin-right: 0;
        }

        .tile-container {
            position: absolute;
            z-index: 2;
            width: calc(100% - 24px);
            height: calc(100% - 24px);
            top: 12px;
            left: 12px;
            padding: 0;
            margin: 0;
            box-sizing: border-box;
        }

        .game-container .game-message {
            display: none;
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            background: rgba(238, 228, 218, 0.5);
            z-index: 100;
            text-align: center;
            -webkit-animation: fade-in 800ms ease 1200ms;
            -moz-animation: fade-in 800ms ease 1200ms;
            animation: fade-in 800ms ease 1200ms;
            -webkit-animation-fill-mode: both;
            -moz-animation-fill-mode: both;
            animation-fill-mode: both;
        }
        .game-container .game-message p {
            font-size: 48px;
            font-weight: bold;
            height: 48px;
            line-height: 48px;
            margin-top: 176px;
        }
        .game-container .game-message .lower {
            display: block;
            margin-top: 59px;
        }
        .game-container .game-message a {
            display: inline-block;
            background: #8f7a66;
            border-radius: 4px;
            padding: 0 20px;
            text-decoration: none;
            color: #f9f6f2;
            height: 40px;
            line-height: 42px;
            margin-left: 9px;
        }
        .game-container .game-message.game-won {
            background: rgba(237, 194, 46, 0.5);
            color: #f9f6f2;
        }
        .game-container .game-message.game-won, .game-container .game-message.game-over {
            display: block;
        }

        @-webkit-keyframes fade-in {
            0% {
                opacity: 0;
            }
            100% {
                opacity: 1;
            }
        }

        @-moz-keyframes fade-in {
            0% {
                opacity: 0;
            }
            100% {
                opacity: 1;
            }
        }

        @keyframes fade-in {
            0% {
                opacity: 0;
            }
            100% {
                opacity: 1;
            }
        }
        

        .tile {
            width: calc((100% - 36px) / 4);
            height: calc((100% - 36px) / 4);
            border-radius: 4px;
            background: #eee4da;
            color: #776e65;
            font-weight: bold;
            z-index: 10;
            font-size: clamp(24px, 5vw, 45px);
            -webkit-transition: 100ms ease-in-out;
            -moz-transition: 100ms ease-in-out;
            transition: 100ms ease-in-out;
            -webkit-transition-property: top, left;
            -moz-transition-property: top, left;
            transition-property: top, left;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            margin: 0;
            position: absolute;
            text-align: center;
            line-height: 1;
            border: none;
            outline: none;
            overflow: hidden;
            transition: all 0.3s ease, top 100ms ease-in-out, left 100ms ease-in-out;
        }
        
        /* Shimmer effect for tiles */
        .tile::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(
                90deg,
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0) 30%,
                rgba(255, 255, 255, 0.6) 50%,
                rgba(255, 255, 255, 0) 70%,
                rgba(255, 255, 255, 0) 100%
            );
            z-index: 1;
            transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1);
            pointer-events: none;
            animation: tile-shimmer 3s infinite;
        }
        
        @keyframes tile-shimmer {
            0% {
                left: -100%;
            }
            50% {
                left: 100%;
            }
            100% {
                left: 100%;
            }
        }
        
        /* Ensure text is above shimmer */
        .tile > * {
            position: relative;
            z-index: 2;
        }

        /* Tile position classes */
        .tile.tile-position-1-1 {
            position: absolute;
            left: 0;
            top: 0;
        }
        .tile.tile-position-1-2 {
            position: absolute;
            left: 0;
            top: calc(((100% - 36px) / 4) + 12px);
        }
        .tile.tile-position-1-3 {
            position: absolute;
            left: 0;
            top: calc(((100% - 36px) / 4) * 2 + 12px * 2);
        }
        .tile.tile-position-1-4 {
            position: absolute;
            left: 0;
            top: calc(((100% - 36px) / 4) * 3 + 12px * 3);
        }
        .tile.tile-position-2-1 {
            position: absolute;
            left: calc(((100% - 36px) / 4) + 12px);
            top: 0;
        }
        .tile.tile-position-2-2 {
            position: absolute;
            left: calc(((100% - 36px) / 4) + 12px);
            top: calc(((100% - 36px) / 4) + 12px);
        }
        .tile.tile-position-2-3 {
            position: absolute;
            left: calc(((100% - 36px) / 4) + 12px);
            top: calc(((100% - 36px) / 4) * 2 + 12px * 2);
        }
        .tile.tile-position-2-4 {
            position: absolute;
            left: calc(((100% - 36px) / 4) + 12px);
            top: calc(((100% - 36px) / 4) * 3 + 12px * 3);
        }
        .tile.tile-position-3-1 {
            position: absolute;
            left: calc(((100% - 36px) / 4) * 2 + 12px * 2);
            top: 0;
        }
        .tile.tile-position-3-2 {
            position: absolute;
            left: calc(((100% - 36px) / 4) * 2 + 12px * 2);
            top: calc(((100% - 36px) / 4) + 12px);
        }
        .tile.tile-position-3-3 {
            position: absolute;
            left: calc(((100% - 36px) / 4) * 2 + 12px * 2);
            top: calc(((100% - 36px) / 4) * 2 + 12px * 2);
        }
        .tile.tile-position-3-4 {
            position: absolute;
            left: calc(((100% - 36px) / 4) * 2 + 12px * 2);
            top: calc(((100% - 36px) / 4) * 3 + 12px * 3);
        }
        .tile.tile-position-4-1 {
            position: absolute;
            left: calc(((100% - 36px) / 4) * 3 + 12px * 3);
            top: 0;
        }
        .tile.tile-position-4-2 {
            position: absolute;
            left: calc(((100% - 36px) / 4) * 3 + 12px * 3);
            top: calc(((100% - 36px) / 4) + 12px);
        }
        .tile.tile-position-4-3 {
            position: absolute;
            left: calc(((100% - 36px) / 4) * 3 + 12px * 3);
            top: calc(((100% - 36px) / 4) * 2 + 12px * 2);
        }
        .tile.tile-position-4-4 {
            position: absolute;
            left: calc(((100% - 36px) / 4) * 3 + 12px * 3);
            top: calc(((100% - 36px) / 4) * 3 + 12px * 3);
        }

        /* Tile value styling - Different colors for each tile value, relative to amber theme */
        /* Low values - Light beige/cream tones */
        .tile.tile-2 {
            background: #eee4da;
            color: #776e65;
            box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0), inset 0 0 0 1px rgba(255, 255, 255, 0);
        }
        
        .tile.tile-4 {
            background: #ede0c8;
            color: #776e65;
            box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0), inset 0 0 0 1px rgba(255, 255, 255, 0);
        }
        
        /* Medium values - Orange tones progressing */
        .tile.tile-8 {
            color: #f9f6f2;
            background: #f2b179;
        }
        
        .tile.tile-16 {
            color: #f9f6f2;
            background: #f59563;
        }
        
        .tile.tile-32 {
            color: #f9f6f2;
            background: #f67c5f;
        }
        
        .tile.tile-64 {
            color: #f9f6f2;
            background: #f65e3b;
        }
        
        /* Higher values - Amber/gold tones with glow effects */
        .tile.tile-128 {
            color: #f9f6f2;
            background: #edcf72;
            box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.238095), inset 0 0 0 1px rgba(255, 255, 255, 0.142857);
            font-size: 45px;
        }
        
        .tile.tile-256 {
            color: #f9f6f2;
            background: #edcc61;
            box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.31746), inset 0 0 0 1px rgba(255, 255, 255, 0.190476);
            font-size: 45px;
        }
        
        .tile.tile-512 {
            color: #f9f6f2;
            background: #edc850;
            box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.396825), inset 0 0 0 1px rgba(255, 255, 255, 0.238095);
            font-size: 45px;
        }
        
        .tile.tile-1024 {
            color: #f9f6f2;
            background: #edc53f;
            box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.47619), inset 0 0 0 1px rgba(255, 255, 255, 0.285714);
            font-size: 35px;
        }
        
        .tile.tile-2048 {
            color: #f9f6f2;
            background: #edc22e;
            box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.555556), inset 0 0 0 1px rgba(255, 255, 255, 0.333333);
            font-size: 35px;
        }
        
        /* Mobile font-size adjustments for larger tiles */
        @media screen and (max-width: 520px) {
            .tile.tile-128,
            .tile.tile-256,
            .tile.tile-512 {
                font-size: 25px;
            }
            
            .tile.tile-1024,
            .tile.tile-2048 {
                font-size: 15px;
            }
        }
        
        /* New tile animation */
        @-webkit-keyframes appear {
            0% {
                opacity: 0;
                -webkit-transform: scale(0);
                -moz-transform: scale(0);
            }
            100% {
                opacity: 1;
                -webkit-transform: scale(1);
                -moz-transform: scale(1);
            }
        }

        @-moz-keyframes appear {
            0% {
                opacity: 0;
                -webkit-transform: scale(0);
                -moz-transform: scale(0);
            }
            100% {
                opacity: 1;
                -webkit-transform: scale(1);
                -moz-transform: scale(1);
            }
        }
        
        @keyframes appear {
            0% {
                opacity: 0;
                -webkit-transform: scale(0);
                -moz-transform: scale(0);
            }
            100% {
                opacity: 1;
                -webkit-transform: scale(1);
                -moz-transform: scale(1);
            }
        }

        .tile-new {
            -webkit-animation: appear 200ms ease 100ms;
            -moz-animation: appear 200ms ease 100ms;
            animation: appear 200ms ease 100ms;
            -webkit-animation-fill-mode: both;
            -moz-animation-fill-mode: both;
            animation-fill-mode: both;
        }

        /* Merge animation */
        @-webkit-keyframes pop {
            0% {
                -webkit-transform: scale(0);
                -moz-transform: scale(0);
            }
            50% {
                -webkit-transform: scale(1.2);
                -moz-transform: scale(1.2);
            }
            100% {
                -webkit-transform: scale(1);
                -moz-transform: scale(1);
            }
        }

        @-moz-keyframes pop {
            0% {
                -webkit-transform: scale(0);
                -moz-transform: scale(0);
            }
            50% {
                -webkit-transform: scale(1.2);
                -moz-transform: scale(1.2);
            }
            100% {
                -webkit-transform: scale(1);
                -moz-transform: scale(1);
            }
        }

        @keyframes pop {
            0% {
                -webkit-transform: scale(0);
                -moz-transform: scale(0);
            }
            50% {
                -webkit-transform: scale(1.2);
                -moz-transform: scale(1.2);
            }
            100% {
                -webkit-transform: scale(1);
                -moz-transform: scale(1);
            }
        }

        .tile-merged {
            z-index: 20;
            -webkit-animation: pop 200ms ease 100ms;
            -moz-animation: pop 200ms ease 100ms;
            animation: pop 200ms ease 100ms;
            -webkit-animation-fill-mode: both;
            -moz-animation-fill-mode: both;
            animation-fill-mode: both;
        }
        
        /* Tile hover effect */
        .tile:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(120,180,255,0.2);
        }
        
        /* Swipe direction indicators - Enhanced Visibility */
        .tile.swipe-up {
            animation: swipe-up 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        
        .tile.swipe-down {
            animation: swipe-down 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        
        .tile.swipe-left {
            animation: swipe-left 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        
        .tile.swipe-right {
            animation: swipe-right 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        
        /* Enhanced swipe animations with multiple effects - Very Visible */
        .tile.swipe-up-enhanced {
            animation: swipe-up-enhanced 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        
        .tile.swipe-down-enhanced {
            animation: swipe-down-enhanced 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        
        .tile.swipe-left-enhanced {
            animation: swipe-left-enhanced 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        
        .tile.swipe-right-enhanced {
            animation: swipe-right-enhanced 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        
        /* Tile bounce effect - Enhanced */
        .tile.bounce {
            animation: tile-bounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        
        /* Tile shake effect - Enhanced */
        .tile.shake {
            animation: tile-shake 0.8s cubic-bezier(0.36, 0, 0.66, 1);
        }
        
        /* Tile glow effect - Enhanced */
        .tile.glow {
            animation: tile-glow 1.2s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        /* Tile float effect - New */
        .tile.float {
            animation: tile-float 1.5s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        /* Tile pulse effect - New */
        .tile.pulse {
            animation: tile-pulse 1.0s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        /* Tile wave effect - New */
        .tile.wave {
            animation: tile-wave 1.2s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        /* Tile spiral effect - New */
        .tile.spiral {
            animation: tile-spiral 1.8s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        /* Moving tile effect - Shows tiles actually moving */
        .tile.moving-tile {
            animation: moving-tile 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        
        @keyframes moving-tile {
            0% {
                transform: scale(1);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
            25% {
                transform: scale(1.15);
                box-shadow: 0 8px 25px rgba(120,180,255,0.5);
            }
            50% {
                transform: scale(1.25);
                box-shadow: 0 15px 40px rgba(120,180,255,0.7);
            }
            75% {
                transform: scale(1.15);
                box-shadow: 0 8px 25px rgba(120,180,255,0.5);
            }
            100% {
                transform: scale(1);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
        }
        
        @keyframes swipe-up {
            0% { 
                transform: translateY(0) scale(1);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
            50% { 
                transform: translateY(-25px) scale(1.15);
                box-shadow: 0 12px 35px rgba(120,180,255,0.6);
            }
            100% { 
                transform: translateY(0) scale(1);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
        }
        
        @keyframes swipe-down {
            0% { 
                transform: translateY(0) scale(1);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
            50% { 
                transform: translateY(25px) scale(1.15);
                box-shadow: 0 12px 35px rgba(120,180,255,0.6);
            }
            100% { 
                transform: translateY(0) scale(1);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
        }
        
        @keyframes swipe-left {
            0% { 
                transform: translateX(0) scale(1);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
            50% { 
                transform: translateX(-25px) scale(1.15);
                box-shadow: 0 12px 35px rgba(120,180,255,0.6);
            }
            100% { 
                transform: translateX(0) scale(1);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
        }
        
        @keyframes swipe-right {
            0% { 
                transform: translateX(0) scale(1);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
            50% { 
                transform: translateX(25px) scale(1.15);
                box-shadow: 0 12px 35px rgba(120,180,255,0.6);
            }
            100% { 
                transform: translateX(0) scale(1);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
        }
        
        /* Enhanced swipe animations - Very Visible and Dramatic */
        @keyframes swipe-up-enhanced {
            0% { 
                transform: translateY(0) scale(1) rotate(0deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
                opacity: 1;
            }
            10% { 
                transform: translateY(-35px) scale(1.2) rotate(-8deg);
                box-shadow: 0 20px 50px rgba(120,180,255,0.8);
                opacity: 0.9;
            }
            25% { 
                transform: translateY(-60px) scale(1.35) rotate(-5deg);
                box-shadow: 0 35px 80px rgba(120,180,255,0.9);
                opacity: 0.8;
            }
            40% { 
                transform: translateY(-45px) scale(1.25) rotate(-2deg);
                box-shadow: 0 25px 60px rgba(120,180,255,0.7);
                opacity: 0.85;
            }
            60% { 
                transform: translateY(-20px) scale(1.15) rotate(3deg);
                box-shadow: 0 15px 35px rgba(120,180,255,0.5);
                opacity: 0.9;
            }
            80% { 
                transform: translateY(-8px) scale(1.08) rotate(1deg);
                box-shadow: 0 8px 20px rgba(120,180,255,0.3);
                opacity: 0.95;
            }
            100% { 
                transform: translateY(0) scale(1) rotate(0deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
                opacity: 1;
            }
        }
        
        @keyframes swipe-down-enhanced {
            0% { 
                transform: translateY(0) scale(1) rotate(0deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
                opacity: 1;
            }
            10% { 
                transform: translateY(35px) scale(1.2) rotate(8deg);
                box-shadow: 0 20px 50px rgba(120,180,255,0.8);
                opacity: 0.9;
            }
            25% { 
                transform: translateY(60px) scale(1.35) rotate(5deg);
                box-shadow: 0 35px 80px rgba(120,180,255,0.9);
                opacity: 0.8;
            }
            40% { 
                transform: translateY(45px) scale(1.25) rotate(2deg);
                box-shadow: 0 25px 60px rgba(120,180,255,0.7);
                opacity: 0.85;
            }
            60% { 
                transform: translateY(20px) scale(1.15) rotate(-3deg);
                box-shadow: 0 15px 35px rgba(120,180,255,0.5);
                opacity: 0.9;
            }
            80% { 
                transform: translateY(8px) scale(1.08) rotate(-1deg);
                box-shadow: 0 8px 20px rgba(120,180,255,0.3);
                opacity: 0.95;
            }
            100% { 
                transform: translateY(0) scale(1) rotate(0deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
                opacity: 1;
            }
        }
        
        @keyframes swipe-left-enhanced {
            0% { 
                transform: translateX(0) scale(1) rotate(0deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
                opacity: 1;
            }
            10% { 
                transform: translateX(-35px) scale(1.2) rotate(-8deg);
                box-shadow: 0 20px 50px rgba(120,180,255,0.8);
                opacity: 0.9;
            }
            25% { 
                transform: translateX(-60px) scale(1.35) rotate(-5deg);
                box-shadow: 0 35px 80px rgba(120,180,255,0.9);
                opacity: 0.8;
            }
            40% { 
                transform: translateX(-45px) scale(1.25) rotate(-2deg);
                box-shadow: 0 25px 60px rgba(120,180,255,0.7);
                opacity: 0.85;
            }
            60% { 
                transform: translateX(-20px) scale(1.15) rotate(3deg);
                box-shadow: 0 15px 35px rgba(120,180,255,0.5);
                opacity: 0.9;
            }
            80% { 
                transform: translateX(-8px) scale(1.08) rotate(1deg);
                box-shadow: 0 8px 20px rgba(120,180,255,0.3);
                opacity: 0.95;
            }
            100% { 
                transform: translateX(0) scale(1) rotate(0deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
                opacity: 1;
            }
        }
        
        @keyframes swipe-right-enhanced {
            0% { 
                transform: translateX(0) scale(1) rotate(0deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
                opacity: 1;
            }
            10% { 
                transform: translateX(35px) scale(1.2) rotate(8deg);
                box-shadow: 0 20px 50px rgba(120,180,255,0.8);
                opacity: 0.9;
            }
            25% { 
                transform: translateX(60px) scale(1.35) rotate(5deg);
                box-shadow: 0 35px 80px rgba(120,180,255,0.9);
                opacity: 0.8;
            }
            40% { 
                transform: translateX(45px) scale(1.25) rotate(2deg);
                box-shadow: 0 25px 60px rgba(120,180,255,0.7);
                opacity: 0.85;
            }
            60% { 
                transform: translateX(20px) scale(1.15) rotate(-3deg);
                box-shadow: 0 15px 35px rgba(120,180,255,0.5);
                opacity: 0.9;
            }
            80% { 
                transform: translateX(8px) scale(1.08) rotate(-1deg);
                box-shadow: 0 8px 20px rgba(120,180,255,0.3);
                opacity: 0.95;
            }
            100% { 
                transform: translateX(0) scale(1) rotate(0deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
                opacity: 1;
            }
        }
        
        /* Enhanced Bounce animation - Slow and Amazing */
        @keyframes tile-bounce {
            0% { 
                transform: scale(1) rotate(0deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
            15% { 
                transform: scale(1.2) rotate(-3deg);
                box-shadow: 0 8px 25px rgba(120,180,255,0.3);
            }
            30% { 
                transform: scale(0.9) rotate(2deg);
                box-shadow: 0 4px 15px rgba(120,180,255,0.2);
            }
            50% { 
                transform: scale(1.15) rotate(-1deg);
                box-shadow: 0 6px 20px rgba(120,180,255,0.25);
            }
            70% { 
                transform: scale(0.95) rotate(1deg);
                box-shadow: 0 3px 12px rgba(120,180,255,0.15);
            }
            85% { 
                transform: scale(1.05) rotate(-0.5deg);
                box-shadow: 0 2px 8px rgba(120,180,255,0.1);
            }
            100% { 
                transform: scale(1) rotate(0deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
        }
        
        /* Enhanced Shake animation - Slow and Amazing */
        @keyframes tile-shake {
            0% { 
                transform: translateX(0) rotate(0deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
            10% { 
                transform: translateX(-8px) rotate(-2deg);
                box-shadow: 0 4px 15px rgba(120,180,255,0.2);
            }
            20% { 
                transform: translateX(6px) rotate(1deg);
                box-shadow: 0 3px 12px rgba(120,180,255,0.15);
            }
            30% { 
                transform: translateX(-4px) rotate(-1deg);
                box-shadow: 0 2px 10px rgba(120,180,255,0.12);
            }
            40% { 
                transform: translateX(3px) rotate(0.5deg);
                box-shadow: 0 1px 8px rgba(120,180,255,0.1);
            }
            50% { 
                transform: translateX(-2px) rotate(-0.5deg);
                box-shadow: 0 1px 6px rgba(120,180,255,0.08);
            }
            60% { 
                transform: translateX(1px) rotate(0.2deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
            70% { 
                transform: translateX(-1px) rotate(-0.1deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
            80% { 
                transform: translateX(0.5px) rotate(0deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
            90% { 
                transform: translateX(-0.2px) rotate(0deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
            100% { 
                transform: translateX(0) rotate(0deg);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
        }
        
        /* Enhanced Glow animation - Slow and Amazing */
        @keyframes tile-glow {
            0% { 
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
                transform: scale(1);
            }
            25% { 
                box-shadow: 0 0 15px rgba(120,180,255,0.3), 0 0 30px rgba(120,180,255,0.15);
                transform: scale(1.02);
            }
            50% { 
                box-shadow: 0 0 25px rgba(120,180,255,0.5), 0 0 50px rgba(120,180,255,0.25), 0 0 75px rgba(120,180,255,0.1);
                transform: scale(1.05);
            }
            75% { 
                box-shadow: 0 0 20px rgba(120,180,255,0.4), 0 0 40px rgba(120,180,255,0.2);
                transform: scale(1.03);
            }
            100% { 
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
                transform: scale(1);
            }
        }
        
        /* New Floating animation */
        @keyframes tile-float {
            0% { 
                transform: translateY(0) scale(1);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
            25% { 
                transform: translateY(-8px) scale(1.03);
                box-shadow: 0 4px 15px rgba(120,180,255,0.2);
            }
            50% { 
                transform: translateY(-12px) scale(1.05);
                box-shadow: 0 6px 20px rgba(120,180,255,0.25);
            }
            75% { 
                transform: translateY(-6px) scale(1.02);
                box-shadow: 0 3px 12px rgba(120,180,255,0.15);
            }
            100% { 
                transform: translateY(0) scale(1);
                box-shadow: 0 1px 4px rgba(120,180,255,0.06);
            }
        }
        
        /* New Pulse animation */
        @keyframes tile-pulse {
            0% { 
                transform: scale(1);
                opacity: 1;
            }
            25% { 
                transform: scale(1.1);
                opacity: 0.9;
            }
            50% { 
                transform: scale(0.95);
                opacity: 0.8;
            }
            75% { 
                transform: scale(1.05);
                opacity: 0.9;
            }
            100% { 
                transform: scale(1);
                opacity: 1;
            }
        }
        
        /* New Wave animation */
        @keyframes tile-wave {
            0% { 
                transform: translateX(0) rotate(0deg);
            }
            25% { 
                transform: translateX(5px) rotate(2deg);
            }
            50% { 
                transform: translateX(-3px) rotate(-1deg);
            }
            75% { 
                transform: translateX(2px) rotate(1deg);
            }
            100% { 
                transform: translateX(0) rotate(0deg);
            }
        }
        
        /* New Spiral animation */
        @keyframes tile-spiral {
            0% { 
                transform: scale(1) rotate(0deg);
            }
            25% { 
                transform: scale(1.1) rotate(90deg);
            }
            50% { 
                transform: scale(0.9) rotate(180deg);
            }
            75% { 
                transform: scale(1.05) rotate(270deg);
            }
            100% { 
                transform: scale(1) rotate(360deg);
            }
        }
        /* Tile color definitions removed - all tiles now use amber color scheme defined above */
        
        .instructions {
            margin-top: 30px;
            color: #4a5c6e;
            font-size: 18px;
            text-align: center;
        }
        
        /* How to Play Page Styles */
        .howtoplay-container {
            display: flex;
            justify-content: center;
            align-items: flex-start;
            padding: 120px 20px 40px;
            min-height: 100vh;
        }
        
        .howtoplay-card {
            background: #ffffff;
            border-radius: 4px;
            max-width: 800px;
            width: 100%;
            position: relative;
            border: 2px solid #cbd5e1;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            overflow: hidden;
            transition: all 0.3s ease;
        }
        
        .howtoplay-card:hover {
            border-color: #fbbf24;
            box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        }
        
        .howtoplay-header {
            text-align: center;
            padding: 32px 32px 24px;
        }
        
        .howtoplay-icon {
            font-size: 48px;
            margin-bottom: 12px;
            display: block;
        }
        
        .howtoplay-title {
            color: #1f2937;
            font-size: 32px;
            font-weight: 700;
            margin: 0 0 6px 0;
            line-height: 1.2;
        }
        
        .howtoplay-subtitle {
            color: #6b7280;
            font-size: 16px;
            margin: 0;
            line-height: 1.5;
        }
        
        .howtoplay-list {
            list-style: none !important;
            padding: 0 32px 0 32px !important;
            margin: 0 0 32px 0 !important;
            padding-left: 32px !important;
        }
        
        .howtoplay-list li,
        .howtoplay-list > li {
            list-style: none !important;
            list-style-type: none !important;
            padding-left: 0 !important;
            margin-left: 0 !important;
        }
        
        .howtoplay-item {
            display: flex !important;
            align-items: flex-start;
            margin-bottom: 18px;
            padding: 0 !important;
            padding-left: 0 !important;
            margin-left: 0 !important;
            text-align: left;
            list-style: none !important;
            list-style-type: none !important;
        }
        
        .howtoplay-item::before,
        .howtoplay-item::after,
        .howtoplay-list > li::before,
        .howtoplay-list > li::after {
            display: none !important;
            content: none !important;
        }
        
        .howtoplay-item:last-child {
            margin-bottom: 0;
        }
        
        .howtoplay-arrow {
            color: #fbbf24;
            font-size: 20px;
            font-weight: 700;
            margin-right: 16px;
            flex-shrink: 0;
            margin-top: 2px;
        }
        
        .howtoplay-text {
            color: #374151;
            font-size: 16px;
            line-height: 1.8;
            text-align: left;
            flex: 1;
            position: relative;
            z-index: 1;
        }
        
        .howtoplay-text strong {
            color: #1f2937;
            font-weight: 600;
        }
        
        .howtoplay-footer {
            text-align: center;
            padding: 0 32px 32px;
        }
        
        .howtoplay-back-button {
            display: inline-block;
            padding: 16px 32px;
            background: #fbbf24;
            color: #ffffff;
            font-size: 16px;
            font-weight: 700;
            text-decoration: none;
            border-radius: 4px;
            border: none;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }
        
        .howtoplay-back-button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(
                90deg,
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0) 30%,
                rgba(255, 255, 255, 0.6) 50%,
                rgba(255, 255, 255, 0) 70%,
                rgba(255, 255, 255, 0) 100%
            );
            z-index: 1;
            transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1);
            pointer-events: none;
        }
        
        .howtoplay-back-button:hover {
            background: #f59e0b;
            box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
            transform: translateY(-1px);
        }
        
        .howtoplay-back-button:hover::before {
            left: 100%;
        }
        
        .howtoplay-back-button:active {
            opacity: 0.9;
        }
        
        .howtoplay-back-button * {
            position: relative;
            z-index: 2;
        }
        
        @media (max-width: 768px) {
            .howtoplay-container {
                padding: 100px 16px 32px;
            }
            
            .howtoplay-header {
                padding: 32px 24px 24px;
            }
            
            .howtoplay-icon {
                font-size: 40px;
                margin-bottom: 12px;
            }
            
            .howtoplay-title {
                font-size: 24px;
            }
            
            .howtoplay-subtitle {
                font-size: 14px;
            }
            
            .howtoplay-list {
                padding: 0 24px;
                margin-bottom: 32px;
            }
            
            .howtoplay-item {
                margin-bottom: 20px;
            }
            
            .howtoplay-arrow {
                font-size: 18px;
                margin-right: 12px;
            }
            
            .howtoplay-text {
                font-size: 15px;
                line-height: 1.7;
            }
            
            .howtoplay-footer {
                padding: 0 24px 32px;
            }
            
            .howtoplay-back-button {
                padding: 14px 28px;
                font-size: 15px;
                width: 100%;
                max-width: 300px;
            }
        }
        
        /* Game Area Layout */
        .game-area {
            display: flex;
            gap: 30px;
            align-items: flex-start;
            justify-content: center;
            margin: 20px auto;
            max-width: 1000px;
            width: 100%;
        }
        
        .game-board-section {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 424px;
            height: auto;
            min-height: 424px;
            padding: 12px;
            background: #ffffff;
            border: 2px solid #cbd5e1;
            border-radius: 4px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            box-sizing: border-box;
            transition: all 0.3s ease;
            touch-action: none;
            overflow: hidden;
            position: relative;
            -webkit-overflow-scrolling: touch;
        }
        
        .game-board-section:hover {
            box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
            border-color: #fbbf24;
        }
        
        .game-controls-section {
            display: flex;
            flex-direction: column;
            gap: 12px;
            width: 424px;
            height: 424px;
            padding: 12px;
            background: #ffffff;
            border: 2px solid #cbd5e1;
            border-radius: 4px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            box-sizing: border-box;
            position: relative;
            z-index: 1;
            overflow-y: auto;
            transition: all 0.3s ease;
        }
        
        /* Desktop: Hide mobile-specific layout classes */
        .mobile-controls-top-row {
            display: none !important;
        }
        
        .mobile-time-module,
        .mobile-score-display,
        .mobile-action-buttons,
        .mobile-restart-btn,
        .mobile-play-again-btn,
        .mobile-how-to-play-wrapper {
            display: none !important;
        }
        
        /* Desktop: Show desktop layout classes */
        .desktop-time-module {
            display: block;
        }
        
        .desktop-score-display {
            display: flex;
        }
        
        .desktop-action-buttons {
            display: flex;
        }
        
        .game-controls-section:hover {
            box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
            border-color: #fbbf24;
        }
        
        .game-controls-section.disabled {
            background: #ffffff;
            /* Don't dim the entire section - only dim specific controls */
        }
        
        /* Dim only the time module when controls are disabled */
        .game-controls-section.disabled .time-module {
            opacity: 0.5;
            pointer-events: none;
        }
        
        .game-controls-section.disabled .custom-game-mode-dropdown,
        .game-controls-section.disabled .custom-time-dropdown {
            opacity: 0.5;
            cursor: not-allowed;
            pointer-events: none;
        }
        
        .game-controls-section.disabled .game-mode-dropdown-header,
        .game-controls-section.disabled .time-dropdown-header {
            cursor: not-allowed;
            color: #6c757d;
            pointer-events: none;
        }
        
        /* On mobile, allow time dropdown to be clickable even when controls are disabled */
        /* User should be able to change time limit before game starts */
        @media (max-width: 768px) {
            .game-controls-section.disabled .mobile-time-module .custom-time-dropdown {
                opacity: 1 !important;
                pointer-events: auto !important;
                cursor: pointer !important;
            }
            
            .game-controls-section.disabled .mobile-time-module .time-dropdown-header {
                opacity: 1 !important;
                pointer-events: auto !important;
                cursor: pointer !important;
                color: #1f2937 !important;
            }
        }
        
        /* Keep score display fully visible even when controls are disabled */
        .game-controls-section.disabled .score-display {
            opacity: 1 !important;
            pointer-events: auto !important;
        }
        
        /* Keep restart button fully functional even when controls are disabled (but not when button itself is disabled) */
        .game-controls-section.disabled .restart-btn:not(:disabled) {
            opacity: 1 !important;
            pointer-events: auto !important;
            cursor: pointer !important;
        }
        
        /* Disable Play Again button when controls are disabled */
        .game-controls-section.disabled .play-again-btn {
            opacity: 0.5 !important;
            pointer-events: none !important;
            cursor: not-allowed !important;
        }
        
        /* Keep Play Again button disabled when button itself is disabled */
        .play-again-btn:disabled {
            opacity: 0.5 !important;
            cursor: not-allowed !important;
            pointer-events: none !important;
        }
        
        /* Keep contest banner visible */
        .game-controls-section.disabled .contest-banner-display {
            opacity: 1 !important;
        }
        
        /* Contest mode - hide restart button with highest priority */
        .restart-btn.contest-hidden {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
            pointer-events: none !important;
        }
        
        /* Contest mode - hide restart button */
        .restart-btn.contest-hidden {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
            pointer-events: none !important;
        }
        
        /* Contest mode - hide retry button (Try Again!) */
        .retry-button.contest-hidden {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
            pointer-events: none !important;
        }
        
        .restart-btn.contest-hidden:hover {
            opacity: 0 !important;
            transform: none !important;
        }
        
        /* Disabled restart button styling - highest priority */
        .restart-btn:disabled,
        .game-controls-section.disabled .restart-btn:disabled {
            opacity: 0.6 !important;
            cursor: not-allowed !important;
            pointer-events: none !important;
        }
        
        .restart-btn:disabled:hover,
        .game-controls-section.disabled .restart-btn:disabled:hover {
            transform: none !important;
            box-shadow: none !important;
        }
        
        /* Contest Info Styling */
        .contest-info {
            margin-bottom: 15px;
        }
        
        .contest-info > div {
            background: linear-gradient(135deg, #f7faff 0%, #e0eafc 100%) !important;
            padding: 15px !important;
            border-radius: 12px !important;
            border: 1px solid rgba(0, 0, 0, 0.05) !important;
            box-shadow: 0 2px 8px rgba(120,180,255,0.1) !important;
            margin-bottom: 10px !important;
        }
        
        .contest-info strong {
            color: #4a5c6e !important;
            font-size: 16px !important;
        }
        
        .contest-info small {
            color: #6b7c8e !important;
            font-size: 13px !important;
        }
        
        #contest-countdown {
            margin-top: 10px !important;
            font-size: 13px !important;
            color: #6b7c8e !important;
            font-weight: 500 !important;
        }
        
        #contest-time-left {
            color: #4a5c6e !important;
            font-weight: 600 !important;
        }
        
        /* Score Display */
        .score-display {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            background: #10b981; /* Success green - different from other displays */
            border-radius: 4px;
            border: 2px solid #059669;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            cursor: default;
            width: 100%;
            box-sizing: border-box;
            margin: 0;
        }
        
        .score-display::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(
                90deg,
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0) 30%,
                rgba(255, 255, 255, 0.6) 50%,
                rgba(255, 255, 255, 0) 70%,
                rgba(255, 255, 255, 0) 100%
            );
            z-index: 1;
            transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1);
            pointer-events: none;
        }
        
        .score-display:hover::before {
            left: 100%;
        }
        
        .score-label {
            color: #ffffff;
            font-size: 14px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            position: relative;
            z-index: 2;
        }
        
        .score-value {
            color: #ffffff;
            font-size: 18px;
            font-weight: 700;
            position: relative;
            z-index: 2;
        }
        
        /* Restart Button */
        .restart-button-container {
            display: flex;
            justify-content: center;
            width: 100%;
        }

        /* Game Action Buttons Container */
        .game-action-buttons {
            display: flex;
            gap: 12px;
            width: 100%;
        }
        
        .restart-btn,
        .play-again-btn {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            padding: 16px 20px;
            color: #ffffff;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            outline: none;
            flex: 1;
            font-family: inherit;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }
        
        .restart-btn {
            background: #fbbf24;
        }
        
        .play-again-btn {
            background: #10b981;
        }
        
        .restart-btn::before,
        .play-again-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(
                90deg,
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0) 30%,
                rgba(255, 255, 255, 0.6) 50%,
                rgba(255, 255, 255, 0) 70%,
                rgba(255, 255, 255, 0) 100%
            );
            z-index: 1;
            transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1);
            pointer-events: none;
        }
        
        .restart-btn:hover {
            background: #f59e0b;
            box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
            transform: translateY(-1px);
        }
        
        .play-again-btn:hover:not(:disabled) {
            background: #059669;
            box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
            transform: translateY(-1px);
        }
        
        .restart-btn:hover::before,
        .play-again-btn:hover:not(:disabled)::before {
            left: 100%;
        }
        
        .restart-btn:active,
        .play-again-btn:active:not(:disabled) {
            opacity: 0.9;
        }
        
        .restart-btn .shimmer-text,
        .play-again-btn .shimmer-text {
            position: relative;
            z-index: 2;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        
        .restart-icon,
        .play-again-icon {
            color: #ffffff;
            font-size: 16px;
            position: relative;
            z-index: 2;
        }
        
        .play-again-btn:disabled:hover {
            transform: none !important;
            box-shadow: none !important;
        }
        
        /* Contest Banner Display */
        .contest-banner-display {
            width: 100%;
            display: block;
        }
        
        .contest-banner-display img {
            width: 100%;
            height: auto;
            max-height: 50px;
            border-radius: 4px;
            border: 1px solid #cbd5e1;
            object-fit: cover;
            display: block;
        }
        
        .restart-text {
            color: #ffffff;
            font-size: 16px;
            font-weight: 700;
            text-align: center;
            position: relative;
            z-index: 2;
        }
        
        /* Controls Row */
        .controls-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 20px;
            width: 100%;
        }

        /* Game Mode Module */
        .game-mode-module {
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding: 0;
            border-radius: 0;
            position: relative;
            background: transparent;
            border: none;
        }
        
        .game-mode-label {
            color: #1f2937;
            font-size: 14px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            position: relative;
            z-index: 1;
            margin-bottom: 0;
        }
        
        .game-mode-label::after {
            content: '🎮';
            margin-left: 8px;
            font-size: 14px;
        }

        /* Custom Game Mode Dropdown */
        .custom-game-mode-dropdown {
            position: relative;
            min-width: 140px;
            flex: 1;
            z-index: 10000;
        }

        .game-mode-dropdown-header {
            padding: 16px 20px;
            font-size: 16px;
            font-weight: 600;
            border: 2px solid #cbd5e1;
            border-radius: 4px;
            background: #f8f9fa;
            color: #1f2937;
            cursor: pointer;
            transition: all 0.3s ease;
            outline: none;
            position: relative;
            display: flex;
            justify-content: space-between;
            align-items: center;
            overflow: hidden;
        }
        
        .game-mode-dropdown-header:focus {
            border-color: #fbbf24;
            background: #ffffff;
            box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.1);
        }

        .game-mode-dropdown-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        }

        .game-mode-dropdown-header:hover {
            border-color: #fbbf24;
            background: #ffffff;
        }

        .game-mode-dropdown-arrow {
            font-size: 14px;
            color: #6b7280;
            transition: color 0.3s ease, transform 0.3s ease;
        }

        .game-mode-dropdown-header:hover .game-mode-dropdown-arrow {
            color: #fbbf24;
            transform: scale(1.1);
        }

        .game-mode-dropdown-arrow.rotated {
            transform: rotate(180deg);
        }

        .game-mode-dropdown-header:hover .game-mode-dropdown-arrow.rotated {
            transform: rotate(180deg) scale(1.1);
        }

        .game-mode-dropdown-options {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: #ffffff;
            border-radius: 4px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            border: 2px solid #cbd5e1;
            margin-top: 5px;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: hidden;
            z-index: 10000;
            min-width: 140px;
        }

        .game-mode-dropdown-options.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .game-mode-dropdown-option {
            padding: 12px 16px;
            font-size: 14px;
            font-weight: 600;
            color: #1f2937;
            cursor: pointer;
            transition: all 0.3s ease;
            background: #ffffff;
            border-bottom: 1px solid #e5e7eb;
            position: relative;
            overflow: hidden;
            width: 100%;
            box-sizing: border-box;
            border-radius: 0;
        }

        .game-mode-dropdown-option:first-child {
            border-top-left-radius: 4px;
            border-top-right-radius: 4px;
        }

        .game-mode-dropdown-option:last-child {
            border-bottom: none;
            border-bottom-left-radius: 4px;
            border-bottom-right-radius: 4px;
        }

        .game-mode-dropdown-option:hover {
            background: #fbbf24;
            color: #ffffff;
        }

        .game-mode-dropdown-option.active {
            background: #fbbf24;
            color: #ffffff;
            font-weight: 700;
        }

        
        /* Duplicate restart-btn definition removed - using main definition above */
        
        .custom-dropdown .dropdown-header {
            padding: 12px 20px;
            font-size: 16px;
            font-weight: 700;
            border: 3px solid transparent;
            border-radius: 15px;
            background: linear-gradient(135deg, #f7faff 0%, #e0eafc 100%);
            color: #4a5c6e;
            cursor: pointer;
            transition: border-color 0.3s ease, box-shadow 0.3s ease;
            outline: none;
            position: relative;
            box-shadow: 0 4px 15px rgba(120,180,255,0.1);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            display: flex;
            justify-content: space-between;
            align-items: center;
            overflow: hidden;
        }
        
        .custom-dropdown .dropdown-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        }
        
        .custom-dropdown .dropdown-header:hover {
            border-color: #eebbc3;
            box-shadow: 0 6px 20px rgba(238,187,195,0.2);
        }
        
        .custom-dropdown .dropdown-arrow {
            font-size: 14px;
            color: #eebbc3;
            transition: color 0.3s ease, transform 0.3s ease;
            text-shadow: 0 1px 2px rgba(0,0,0,0.3);
        }

        .custom-dropdown .dropdown-header:hover .dropdown-arrow {
            color: #ff6b6b;
            transform: scale(1.1);
        }

        .custom-dropdown .dropdown-arrow.rotated {
            transform: rotate(180deg);
        }

        .custom-dropdown .dropdown-header:hover .dropdown-arrow.rotated {
            transform: rotate(180deg) scale(1.1);
        }
        

        
        .custom-dropdown .dropdown-options {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: linear-gradient(135deg, #f7faff 0%, #e0eafc 100%);
            border-radius: 12px;
            box-shadow: 0 8px 25px rgba(120,180,255,0.2);
            border: 2px solid #eebbc3;
            margin-top: 5px;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: hidden;
            z-index: 10000;
            min-width: 140px;
        }
        
        .custom-dropdown .dropdown-options.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }
        
        .custom-dropdown .dropdown-option {
            padding: 12px 20px;
            font-size: 16px;
            font-weight: 700;
            color: #4a5c6e;
            cursor: pointer;
            transition: background-color 0.3s ease, transform 0.3s ease;
            background: linear-gradient(135deg, #f7faff 0%, #e0eafc 100%);
            border-bottom: 1px solid rgba(238,187,195,0.2);
            position: relative;
            overflow: hidden;
            width: 100%;
            box-sizing: border-box;
        }
        
        .custom-dropdown .dropdown-option:last-child {
            border-bottom: none;
        }
        
        .custom-dropdown .dropdown-option::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
            transition: left 0.5s ease;
        }
        
        .custom-dropdown .dropdown-option:hover {
            background: linear-gradient(135deg, #eebbc3 0%, #f7b7a3 100%);
            color: #232946;
            transform: translateX(5px);
        }
        
        .custom-dropdown .dropdown-option:hover::before {
            left: 100%;
        }
        
        .custom-dropdown .dropdown-option.active {
            background: linear-gradient(135deg, #eebbc3 0%, #f7b7a3 100%);
            color: #232946;
            font-weight: 800;
        }
        
        .custom-dropdown .dropdown-option.active::before {
            left: 100%;
        }
        
        /* Custom Time Dropdown Styles */
        .custom-time-dropdown {
            position: relative;
            width: 100%;
            z-index: 1000;
        }
        
        .time-dropdown-header {
            padding: 16px 20px;
            font-size: 16px;
            font-weight: 600;
            border: 2px solid #cbd5e1;
            border-radius: 4px;
            background: #f8f9fa;
            color: #1f2937;
            cursor: pointer;
            transition: all 0.3s ease;
            outline: none;
            position: relative;
            display: flex;
            justify-content: space-between;
            align-items: center;
            overflow: hidden;
            z-index: 1;
            width: 100%;
            box-sizing: border-box;
            margin: 0;
        }
        
        .time-dropdown-header:focus {
            border-color: #fbbf24;
            background: #ffffff;
            box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.1);
        }
        
        .time-dropdown-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        }
        
        .time-dropdown-header:hover {
            border-color: #fbbf24;
            background: #ffffff;
        }
        
        .time-dropdown-arrow {
            font-size: 14px;
            color: #6b7280;
            transition: color 0.3s ease, transform 0.3s ease;
            position: relative;
            z-index: 1;
        }
        
        .time-dropdown-header:hover .time-dropdown-arrow {
            color: #fbbf24;
            transform: scale(1.1);
        }
        
        .time-dropdown-arrow.rotated {
            transform: rotate(180deg);
        }
        
        .time-dropdown-header:hover .time-dropdown-arrow.rotated {
            transform: rotate(180deg) scale(1.1);
        }
        
        .time-dropdown-options {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: #ffffff;
            border-radius: 4px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            border: 2px solid #cbd5e1;
            margin-top: 5px;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: hidden;
            z-index: 1001;
            min-width: 140px;
        }
        
        .time-dropdown-options.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }
        
        .time-dropdown-options.hidden {
            display: none !important;
            opacity: 0 !important;
            visibility: hidden !important;
            transform: translateY(-10px) !important;
            pointer-events: none !important;
        }
        
        .custom-time-dropdown.hidden {
            display: none !important;
        }
        
        .custom-time-dropdown.contest-hidden {
            display: none !important;
        }
        
        .time-dropdown-option {
            padding: 12px 16px;
            font-size: 14px;
            font-weight: 600;
            color: #1f2937;
            cursor: pointer;
            transition: all 0.3s ease;
            background: #ffffff;
            border-bottom: 1px solid #e5e7eb;
            position: relative;
            overflow: hidden;
            border-radius: 0;
            z-index: 1002;
        }
        
        .time-dropdown-option:first-child {
            border-top-left-radius: 4px;
            border-top-right-radius: 4px;
        }
        
        .time-dropdown-option:last-child {
            border-bottom: none;
            border-bottom-left-radius: 4px;
            border-bottom-right-radius: 4px;
        }
        
        .time-dropdown-option:hover {
            background: #fbbf24;
            color: #ffffff;
        }
        
        .time-dropdown-option.active {
            background: #fbbf24;
            color: #ffffff;
            font-weight: 700;
        }
        

        

        

        

        

        

        

        

        

        

        

        

        

        

        
        /* Dropdown container enhancements */
        .mode-dropdown-container {
            position: relative;
            overflow: visible;
        }
        
        .mode-dropdown-container::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
            pointer-events: none;
            border-radius: 15px;
        }
        

        

        
        /* Mode indicator styling that works */
        .mode-indicator {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-left: 8px;
        }
        
        .mode-indicator.easy {
            background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
            color: #ffffff;
            box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
        }
        
        .mode-indicator.medium {
            background: linear-gradient(135deg, #FF9800 0%, #FFC107 100%);
            color: #ffffff;
            box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
        }
        
        .mode-indicator.hard {
            background: linear-gradient(135deg, #F44336 0%, #FF5722 100%);
            color: #ffffff;
            box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
        }
        

        
        /* Time indicator styling */
        .time-indicator {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-left: 8px;
        }
        
        .time-indicator.none {
            background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
            color: #ffffff;
            box-shadow: 0 2px 8px rgba(158, 158, 158, 0.3);
        }
        
        .time-indicator.limited {
            background: linear-gradient(135deg, #FF9800 0%, #FFC107 100%);
            color: #ffffff;
            box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
        }
        
        .time-indicator.urgent {
            background: linear-gradient(135deg, #F44336 0%, #FF5722 100%);
            color: #ffffff;
            box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
        }
        

        
        /* Dropdown animation effects */
        .mode-dropdown-container {
            animation: dropdown-appear 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        
        @keyframes dropdown-appear {
            0% {
                opacity: 0;
                transform: translateY(-10px) scale(0.95);
            }
            100% {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }
        
        /* Hover effect for the entire container */
        .mode-dropdown-container:hover .mode-label {
            transform: scale(1.05);
            transition: transform 0.3s ease;
        }
        
        /* Amazing Mobile Responsive Dropdown */
        @media (max-width: 768px) {
            .mode-dropdown-container {
                flex-direction: column;
                gap: 12px;
                align-items: center;
                padding: 12px 16px;
            }
            
            .mode-label {
                font-size: 14px;
                text-align: center;
            }
            
            .mode-label::after {
                font-size: 14px;
            }
            
            .custom-dropdown {
                min-width: 160px;
            }
            
            .custom-dropdown .dropdown-header {
                padding: 12px 20px;
                font-size: 14px;
            }
            
            .custom-dropdown .dropdown-option {
                padding: 12px 20px;
                font-size: 14px;
                width: 100%;
                box-sizing: border-box;
            }
            
            .custom-time-dropdown {
                width: 100%;
            }
            
            .time-dropdown-header {
                padding: 16px 20px;
                font-size: 16px;
                width: 100%;
            }
            
            .time-dropdown-option {
                padding: 12px 20px;
                font-size: 14px;
            }
            

        }
        

        

        

        
        /* Time Module Styles */
        .time-module {
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding: 0;
            border-radius: 0;
            position: relative;
            background: transparent;
            border: none;
            width: 100%;
        }
        
        .time-label {
            color: #1f2937;
            font-size: 14px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            position: relative;
            z-index: 1;
            margin-bottom: 0;
        }
        
        .time-label::after {
            content: '⏰';
            margin-left: 8px;
            font-size: 14px;
        }
        
        .time-dropdown {
            padding: 12px 20px;
            font-size: 16px;
            font-weight: 700;
            border: 3px solid transparent;
            border-radius: 15px;
            background-image: linear-gradient(135deg, #f7faff 0%, #e0eafc 100%);
            background-size: 200% 200%;
            color: #4a5c6e;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            outline: none;
            min-width: 140px;
            position: relative;
            box-shadow: 0 4px 15px rgba(120,180,255,0.1);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            overflow: hidden;
        }
        
        .time-dropdown::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        }
        
        
        
        .time-dropdown::before {
            content: '⏱️';
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 14px;
            opacity: 0.7;
        }
        
        .time-dropdown::after {
            content: '▼';
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 12px;
            color: #eebbc3;
            transition: all 0.3s ease;
        }
        
        .time-dropdown:hover {
            border-color: #eebbc3;
            box-shadow: 0 8px 25px rgba(238,187,195,0.3);
            transform: translateY(-2px);
            background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
            animation: time-hover-pulse 0.6s ease;
        }
        
        @keyframes time-hover-pulse {
            0% { transform: translateY(-2px) scale(1); }
            50% { transform: translateY(-2px) scale(1.02); }
            100% { transform: translateY(-2px) scale(1); }
        }
        
        .time-dropdown:hover::after {
            transform: translateY(-50%) rotate(180deg);
            color: #ff6b6b;
            transition: all 0.3s ease;
        }
        
        .time-dropdown:focus {
            border-color: #eebbc3;
            box-shadow: 0 0 0 4px rgba(238,187,195,0.3), 0 8px 25px rgba(238,187,195,0.4);
            transform: translateY(-1px);
        }
        
        /* Enhanced Timer Display with Exact Time Module */
        .timer-display {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            padding: 16px 20px;
            background: #3b82f6; /* Info blue - different from other displays */
            border-radius: 4px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            border: 2px solid #2563eb;
            position: relative;
            overflow: hidden;
            width: 100%;
            box-sizing: border-box;
            margin: 0;
        }
        
        .timer-label {
            font-size: 10px;
            color: #ffffff;
            font-weight: 500;
            margin-bottom: 2px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .timer-display::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(
                90deg,
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0) 30%,
                rgba(255, 255, 255, 0.6) 50%,
                rgba(255, 255, 255, 0) 70%,
                rgba(255, 255, 255, 0) 100%
            );
            z-index: 1;
            transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1);
            pointer-events: none;
        }
        
        .timer-display:hover::before {
            left: 100%;
        }
        
        .timer-display::after {
            display: none;
        }
        
        .timer-main {
            display: flex;
            align-items: center;
            gap: 2px;
            color: #ffffff;
            font-size: 16px;
            font-weight: 700;
            letter-spacing: 0.5px;
            position: relative;
            z-index: 2;
        }
        
        .timer-milliseconds {
            font-size: 12px;
            font-weight: 600;
            color: #ffffff;
            opacity: 0.9;
            position: relative;
            z-index: 2;
        }
        

        
        .timer-display.warning {
            background: #f59e0b;
            border-color: #f59e0b;
            box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
            animation: timer-pulse 1.2s infinite;
        }
        
        @keyframes timer-pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.03); }
        }
        
        .timer-display.critical {
            background: #f97316;
            border-color: #f97316;
            box-shadow: 0 4px 15px rgba(249, 115, 22, 0.5);
            animation: timer-critical 0.8s infinite;
        }
        
        .timer-display.critical .timer-main {
            color: #ffffff !important;
            animation: timer-blink 0.5s infinite;
        }
        
        .timer-display.critical .timer-milliseconds {
            color: #ffffff !important;
            animation: timer-blink 0.5s infinite;
        }
        
        .timer-display.urgent {
            background: #dc2626;
            border-color: #dc2626;
            box-shadow: 0 4px 15px rgba(220, 38, 38, 0.6);
            animation: timer-critical 0.4s infinite;
        }
        
        .timer-display.urgent .timer-main {
            color: #ffffff !important;
            animation: timer-blink-fast 0.3s infinite;
        }
        
        .timer-display.urgent .timer-milliseconds {
            color: #ffffff !important;
            animation: timer-blink-fast 0.3s infinite;
        }
        
        @keyframes timer-critical {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }
        
        @keyframes timer-blink {
            0%, 50% { opacity: 1; }
            51%, 100% { opacity: 0.3; }
        }
        
        @keyframes timer-blink-fast {
            0%, 25% { opacity: 1; }
            26%, 50% { opacity: 0.2; }
            51%, 75% { opacity: 1; }
            76%, 100% { opacity: 0.2; }
        }
        
        
        /* Enhanced Timer Module Hover Effects */
        .timer-display:hover {
            background: #f59e0b;
            border-color: #f59e0b;
            box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
        }
        
        /* Timer Module Responsive Design */
        @media (max-width: 768px) {
            .timer-display {
                width: 100%;
                padding: 16px 20px;
            }
            
            .timer-main {
                font-size: 14px;
            }
            
            .timer-milliseconds {
                font-size: 10px;
            }
            
        }
        
        /* Timer Module Loading Animation */
        .timer-display.loading {
            animation: timer-loading 2s infinite;
        }
        
        
        
        
        
        
        
        
        
        
        /* Contest Time Limit Display Styles */
        .contest-time-limit-display {
            display: flex;
            flex-direction: column;
            align-items: center;
            background: #f59e0b; /* Warning orange - different from other displays */
            color: #ffffff;
            padding: 16px 20px;
            border-radius: 4px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            position: relative;
            overflow: hidden;
            margin: 0 !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
            width: 100%;
            box-sizing: border-box;
            border: 2px solid #d97706;
            transition: all 0.3s ease;
        }
        
        .contest-time-limit-display::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(
                90deg,
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0) 30%,
                rgba(255, 255, 255, 0.6) 50%,
                rgba(255, 255, 255, 0) 70%,
                rgba(255, 255, 255, 0) 100%
            );
            z-index: 1;
            transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1);
            pointer-events: none;
        }
        
        .contest-time-limit-display:hover::before {
            left: 100%;
        }
        
        .contest-time-limit-display::after {
            display: none;
        }
        
        .contest-time-limit-label {
            font-size: 10px;
            color: #ffffff;
            font-weight: 500;
            margin-bottom: 2px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            position: relative;
            z-index: 2;
        }
        
        .contest-time-limit-main {
            font-size: 16px;
            font-weight: 700;
            color: #ffffff;
            letter-spacing: 0.5px;
            position: relative;
            z-index: 2;
        }
        
        
        /* Contest Time Limit Display Hover Effects */
        .contest-time-limit-display:hover {
            background: #d97706; /* Darker orange on hover */
            border-color: #d97706;
            box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
        }
        
        /* Contest Time Limit Display Warning States */
        .contest-time-limit-display.warning {
            background: #f59e0b; /* Orange warning */
            border-color: #f59e0b;
            box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
        }
        
        .contest-time-limit-display.critical {
            background: #dc2626; /* Red - below 10 seconds */
            border-color: #dc2626;
            box-shadow: 0 4px 15px rgba(220, 38, 38, 0.6);
            animation: contest-timer-blink 0.8s infinite; /* Blinking effect */
        }
        
        .contest-time-limit-display.critical .contest-time-limit-main {
            color: #ffffff !important;
        }
        
        .contest-time-limit-display.urgent {
            background: #dc2626; /* Red - below 5 seconds */
            border-color: #dc2626;
            box-shadow: 0 4px 15px rgba(220, 38, 38, 0.6);
            animation: contest-timer-blink-fast 0.4s infinite; /* Faster blinking */
        }
        
        .contest-time-limit-display.urgent .contest-time-limit-main {
            color: #ffffff !important;
        }
        
        /* Blinking animation for contest time limit */
        @keyframes contest-timer-blink {
            0%, 100% { 
                opacity: 1;
                transform: scale(1);
            }
            50% { 
                opacity: 0.7;
                transform: scale(1.02);
            }
        }
        
        @keyframes contest-timer-blink-fast {
            0%, 100% { 
                opacity: 1;
                transform: scale(1);
            }
            50% { 
                opacity: 0.6;
                transform: scale(1.03);
            }
        }
        
        /* Contest Time Limit Display Responsive Design */
        @media (max-width: 768px) {
            .contest-time-limit-display {
                width: 100%;
                padding: 16px 20px;
            }
            
            .contest-time-limit-main {
                font-size: 14px;
            }
            
            .contest-time-limit-label {
                font-size: 9px;
            }
        }
        
        @keyframes timer-loading {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }
        
        
        /* Restart Button at Top Styles */
        .restart-button-top {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            margin-left: auto;
        }
        
        
        
        

        
        
        /* Mobile responsive timer */
        @media (max-width: 768px) {
            .game-area {
                flex-direction: column;
                gap: 8px !important;
                align-items: stretch;
                width: calc(100% - 32px) !important;
                max-width: calc(100% - 32px) !important;
                margin: 12px auto !important;
                padding: 0 !important;
                box-sizing: border-box !important;
                overflow-x: hidden;
                background: transparent !important;
                border: none !important;
                border-radius: 0 !important;
            }
            
            .game-controls-section {
                order: -1;
                width: 100% !important;
                max-width: 100% !important;
                height: auto;
                min-height: auto;
                margin-top: 0 !important;
                margin-bottom: 0 !important;
                padding: 12px 16px !important;
                box-sizing: border-box !important;
                display: flex;
                flex-direction: column;
                gap: 8px;
                position: relative;
                overflow: visible !important;
                z-index: auto;
                background: #ffffff !important; /* Same as web version */
                border: 2px solid #cbd5e1 !important; /* Border around controls section */
                border-radius: 4px !important;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
            }
            
            /* Mobile Top Row: Time Limit dropdown and Score side by side */
            .mobile-controls-top-row {
                display: flex !important;
                gap: 10px;
                width: 100%;
                align-items: stretch;
                position: relative;
                z-index: 1;
            }
            
            .mobile-time-module {
                flex: 1 1 50% !important; /* Equal width with score */
                margin: 0 !important;
                padding: 0 !important;
                display: block !important;
                min-width: 0;
                position: relative;
                z-index: 1000;
            }
            
            /* Hide Time Limit label on mobile */
            .mobile-time-module .time-label {
                display: none !important;
            }
            
            /* Standardize dropdown size - compact */
            .mobile-time-module .custom-time-dropdown {
                width: 100% !important;
                height: 100% !important;
                position: relative !important;
                z-index: 1001 !important;
                display: block !important; /* Ensure dropdown is visible by default */
            }
            
            /* Mobile select element styling */
            .mobile-time-module .time-select-mobile {
                width: 100% !important;
                height: 38px !important;
                min-height: 38px !important;
                max-height: 38px !important;
                padding: 8px 12px !important;
                font-size: 13px !important;
                font-weight: 500 !important;
                background: #f8f9fa !important;
                border: 2px solid #cbd5e1 !important;
                border-radius: 4px !important;
                color: #1f2937 !important;
                cursor: pointer !important;
                appearance: none !important;
                -webkit-appearance: none !important;
                -moz-appearance: none !important;
                background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231f2937' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
                background-repeat: no-repeat !important;
                background-position: right 12px center !important;
                background-size: 12px 12px !important;
                padding-right: 36px !important;
                outline: none !important;
                transition: border-color 0.2s ease, background-color 0.2s ease !important;
                touch-action: manipulation !important;
                -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
            }
            
            .mobile-time-module .time-select-mobile:focus,
            .mobile-time-module .time-select-mobile:active {
                border-color: #fbbf24 !important;
                background-color: #ffffff !important;
                scroll-margin: 0 !important;
                scroll-padding: 0 !important;
            }
            
            /* Prevent scrolling when select is focused */
            .mobile-time-module .time-select-mobile:focus {
                scroll-behavior: auto !important;
            }
            
            .mobile-time-module .time-select-mobile:disabled {
                opacity: 0.6 !important;
                cursor: not-allowed !important;
                background-color: #f3f4f6 !important;
                border-color: #d1d5db !important;
            }
            
            .mobile-time-module .time-select-mobile option {
                padding: 8px 12px !important;
                background: #ffffff !important;
                color: #1f2937 !important;
            }
            
            .mobile-time-module .time-dropdown-header {
                height: 38px !important;
                min-height: 38px !important;
                max-height: 38px !important;
                display: flex !important;
                align-items: center !important;
                justify-content: space-between !important;
                padding: 8px 12px !important;
                font-size: 13px !important;
                cursor: pointer !important;
                position: relative !important;
                z-index: 1 !important;
                pointer-events: auto !important;
                touch-action: manipulation !important;
                -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
                overflow: visible !important;
                gap: 8px !important;
                /* Same colors as web version */
                background: #f8f9fa !important;
                border: 2px solid #cbd5e1 !important;
                border-radius: 4px !important;
                color: #1f2937 !important;
                box-shadow: none !important;
            }
            
            .mobile-time-module .time-dropdown-header:hover {
                border-color: #fbbf24 !important;
                background: #ffffff !important;
            }
            
            .mobile-time-module .time-dropdown-header .shimmer-text {
                flex: 1 1 auto !important;
                min-width: 0 !important;
                overflow: visible !important;
                white-space: nowrap !important;
                pointer-events: none !important;
                display: flex !important;
                align-items: center !important;
                text-overflow: clip !important;
                color: #1f2937 !important;
            }
            
            .mobile-time-module .time-dropdown-header #selected-time-mobile {
                overflow: visible !important;
                text-overflow: clip !important;
                white-space: nowrap !important;
                display: inline-block !important;
                max-width: 100% !important;
                color: #1f2937 !important;
                font-weight: 600 !important;
            }
            
            .mobile-time-module .time-dropdown-arrow {
                font-size: 12px !important;
                flex-shrink: 0 !important;
                margin-left: auto !important;
                color: #6b7280 !important;
                font-weight: normal !important;
                pointer-events: none !important;
                display: inline-block !important;
            }
            
            .mobile-time-module .time-dropdown-header:hover .time-dropdown-arrow {
                color: #fbbf24 !important;
            }
            
            .mobile-time-module .time-dropdown-header * {
                pointer-events: none !important;
            }
            
            .mobile-time-module .time-dropdown-options {
                font-size: 13px !important;
                position: fixed !important;
                z-index: 999999 !important;
                margin-top: 5px !important;
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
                background: #ffffff !important;
                border-radius: 4px !important;
                border: 2px solid #cbd5e1 !important;
                max-width: calc(100vw - 20px) !important;
                box-sizing: border-box !important;
            }
            
            /* Override show class for mobile */
            .mobile-time-module .time-dropdown-options.show {
                position: fixed !important;
                z-index: 999999 !important;
                opacity: 1 !important;
                visibility: visible !important;
                transform: none !important;
            }
            
            /* Position is already set above - no need to duplicate */
            
            .mobile-time-module .time-dropdown-option {
                padding: 10px 12px !important;
                font-size: 13px !important;
                min-height: 36px !important;
                cursor: pointer !important;
                pointer-events: auto !important;
                touch-action: manipulation !important;
                -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
            }
            
            /* Mobile timer display - positioned over dropdown area */
            /* Use vibrant orange/red to clearly differentiate from cyan dropdown */
            .mobile-time-module #timer-display-mobile {
                position: absolute !important;
                top: 0 !important;
                left: 0 !important;
                width: 100% !important;
                height: 38px !important;
                min-height: 38px !important;
                max-height: 38px !important;
                padding: 0 !important;
                margin: 0 !important;
                display: none !important; /* Hidden by default - only show when time limit is selected */
                flex-direction: row !important;
                align-items: center !important;
                justify-content: center !important;
                gap: 0 !important;
                border-radius: 4px !important;
                border: 2px solid #ea580c !important;
                background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
                box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4) !important;
                z-index: 1002 !important;
                /* No animation by default - animations will be applied via warning/critical/urgent classes */
            }
            
            /* Show timer only when explicitly displayed via JavaScript */
            .mobile-time-module #timer-display-mobile[style*="display: flex"],
            .mobile-time-module #timer-display-mobile[style*="display:block"] {
                display: flex !important;
            }
            
            .mobile-time-module #timer-display-mobile .timer-label {
                display: none !important;
            }
            
            .mobile-time-module #timer-display-mobile .timer-main {
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                padding: 0 !important;
                margin: 0 !important;
                height: 100% !important;
            }
            
            .mobile-time-module #timer-display-mobile .timer-main span {
                font-size: 14px !important;
                font-weight: 700 !important;
                color: #ffffff !important;
                line-height: 1 !important;
            }
            
            /* Mobile timer warning state (30-10 seconds) - orange */
            .mobile-time-module #timer-display-mobile.warning {
                background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
                border-color: #f59e0b !important;
                box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4) !important;
                animation: timer-pulse-mobile 1.2s infinite !important;
            }
            
            @keyframes timer-pulse-mobile {
                0%, 100% { transform: scale(1); }
                50% { transform: scale(1.03); }
            }
            
            /* Mobile timer critical state (10-5 seconds) - orange-red */
            .mobile-time-module #timer-display-mobile.critical {
                background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
                border-color: #f97316 !important;
                box-shadow: 0 4px 15px rgba(249, 115, 22, 0.5) !important;
                animation: timer-critical-mobile 0.8s infinite !important;
            }
            
            .mobile-time-module #timer-display-mobile.critical .timer-main {
                animation: timer-blink-mobile 0.5s infinite !important;
            }
            
            .mobile-time-module #timer-display-mobile.critical .timer-main span {
                animation: timer-blink-mobile 0.5s infinite !important;
            }
            
            @keyframes timer-critical-mobile {
                0%, 100% { transform: scale(1); }
                50% { transform: scale(1.05); }
            }
            
            @keyframes timer-blink-mobile {
                0%, 50% { opacity: 1; }
                51%, 100% { opacity: 0.3; }
            }
            
            /* Mobile timer urgent state (5-0 seconds) - red */
            .mobile-time-module #timer-display-mobile.urgent {
                background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
                border-color: #dc2626 !important;
                box-shadow: 0 4px 15px rgba(220, 38, 38, 0.6) !important;
                animation: timer-critical-mobile 0.4s infinite !important;
            }
            
            .mobile-time-module #timer-display-mobile.urgent .timer-main {
                animation: timer-blink-fast-mobile 0.3s infinite !important;
            }
            
            .mobile-time-module #timer-display-mobile.urgent .timer-main span {
                animation: timer-blink-fast-mobile 0.3s infinite !important;
            }
            
            @keyframes timer-blink-fast-mobile {
                0%, 25% { opacity: 1; }
                26%, 50% { opacity: 0.2; }
                51%, 75% { opacity: 1; }
                76%, 100% { opacity: 0.2; }
            }
            
            /* Hide dropdown when timer is shown - handled by JavaScript */
            .mobile-time-module .custom-time-dropdown.hidden-by-timer {
                display: none !important;
            }
            
            /* Ensure dropdown is visible by default on mobile */
            .mobile-time-module .custom-time-dropdown {
                display: block !important;
            }
            
            /* Hide dropdown only when explicitly hidden */
            .mobile-time-module .custom-time-dropdown.hidden-by-timer,
            .mobile-time-module .custom-time-dropdown[style*="display: none"] {
                display: none !important;
            }
            
            .mobile-score-display {
                flex: 1 1 50% !important; /* Equal width with time module */
                padding: 8px 12px !important;
                margin: 0 !important;
                box-sizing: border-box !important;
                min-width: 0;
                display: flex !important;
                height: 38px !important;
                min-height: 38px !important;
                max-height: 38px !important;
                align-items: center !important;
                /* Same colors as web version */
                background: #10b981 !important;
                border: 2px solid #059669 !important;
                border-radius: 4px !important;
            }
            
            /* Hide desktop layout elements on mobile */
            .desktop-time-module,
            .desktop-score-display,
            .desktop-action-buttons {
                display: none !important;
            }
            
            .mobile-score-display .score-label {
                font-size: 11px !important;
                font-weight: 600 !important;
                color: #ffffff !important; /* Same as web version */
            }
            
            .mobile-score-display .score-value {
                font-size: 16px !important;
                font-weight: 700 !important;
                color: #ffffff !important; /* Same as web version */
            }
            
            /* Mobile Bottom Row: Reset and Play Again side by side - compact */
            .mobile-action-buttons {
                flex-direction: row !important;
                gap: 10px;
                width: 100%;
                display: flex !important;
                margin: 0 !important;
                position: relative;
                z-index: 1;
            }
            
            .mobile-restart-btn,
            .mobile-play-again-btn {
                padding: 8px 12px !important;
                font-size: 13px !important;
                flex: 1 1 50% !important; /* Equal width for both buttons */
                margin: 0 !important;
                box-sizing: border-box !important;
                display: flex !important;
                height: 38px !important;
                min-height: 38px !important;
                max-height: 38px !important;
                align-items: center !important;
                justify-content: center !important;
                position: relative;
                z-index: 1 !important;
                border: none !important;
                border-radius: 4px !important;
                color: #ffffff !important;
                font-weight: 700 !important;
            }
            
            .mobile-restart-btn {
                background: #fbbf24 !important; /* Same as web version */
            }
            
            .mobile-restart-btn:hover {
                background: #f59e0b !important; /* Same as web version */
            }
            
            .mobile-play-again-btn {
                background: #10b981 !important; /* Same as web version */
            }
            
            .mobile-play-again-btn:hover:not(:disabled) {
                background: #059669 !important; /* Same as web version */
            }
            
            .mobile-restart-btn .restart-icon,
            .mobile-play-again-btn .play-again-icon {
                font-size: 14px !important;
                z-index: 1 !important;
                position: relative !important;
            }
            
            .mobile-restart-btn .shimmer-text,
            .mobile-play-again-btn .shimmer-text {
                z-index: 1 !important;
                position: relative !important;
            }
            
            .mobile-restart-btn .restart-text,
            .mobile-play-again-btn .play-again-text {
                font-size: 13px !important;
            }
            
            /* Contest Banner - positioned between buttons and game grid */
            .contest-banner-display {
                width: 100% !important;
                max-width: 100% !important;
                margin: 0 !important;
                box-sizing: border-box !important;
                height: 50px;
                overflow: hidden;
                display: flex;
                align-items: center;
                justify-content: center;
            }
            
            .contest-banner-display img {
                width: 100% !important;
                max-width: 100% !important;
                height: 50px !important;
                object-fit: cover !important;
            }
            
            .game-board-section {
                width: calc(100vw - 64px) !important;
                max-width: 400px !important;
                height: auto !important;
                min-height: auto !important;
                margin: 0 auto !important;
                padding: 12px !important;
                box-sizing: border-box !important;
                position: relative !important;
            }
            
            .game-container {
                width: 100% !important;
                max-width: 400px !important;
                aspect-ratio: 1 / 1 !important;
                padding: 12px !important;
                box-sizing: border-box !important;
                background: #bbada0 !important; /* Same beige background as web version */
                border: none !important; /* Remove border to match web version */
                border-radius: 4px !important;
                box-shadow: none !important; /* Remove shadow to match web version */
            }
            
            /* Hide How to Play link on mobile or make it smaller */
            .how-to-play-link {
                color: #f59e0b !important;
                text-decoration: none !important;
                font-size: 12px !important;
                font-weight: 500 !important;
                display: inline-flex !important;
                align-items: center !important;
                gap: 4px !important;
                transition: color 0.2s ease !important;
            }
            
            .how-to-play-link:hover {
                color: #fbbf24 !important;
            }
            
            
            /* Game Mode Module Mobile Improvements */
            .game-mode-module {
                flex-direction: column;
                gap: 12px;
                align-items: stretch !important;
                padding: 12px 0 !important;
                justify-content: center;
                width: 100% !important;
            }
            
            .game-mode-label {
                font-size: 16px;
                text-align: left !important;
                margin-bottom: 8px;
                width: 100% !important;
            }
            
            .custom-game-mode-dropdown {
                width: 100% !important;
                max-width: 100% !important;
            }
            
            .game-mode-dropdown-header {
                padding: 15px 20px !important;
                font-size: 16px;
                min-height: 50px;
                display: flex;
                align-items: center;
                justify-content: space-between;
                width: 100% !important;
                box-sizing: border-box !important;
            }
            
            .game-mode-dropdown-options {
                width: 100% !important;
                top: 100%;
                left: 0;
                right: 0;
                box-sizing: border-box !important;
            }
            
            .game-mode-dropdown-option {
                padding: 15px 20px !important;
                font-size: 16px;
                min-height: 50px;
                display: flex;
                align-items: center;
                width: 100% !important;
                box-sizing: border-box !important;
            }
            
            /* Time Module Mobile Improvements */
            .time-module {
                flex-direction: column;
                gap: 12px;
                align-items: stretch !important;
                padding: 12px 0 !important;
                justify-content: center;
                width: 100% !important;
            }
            
            /* Remove padding from mobile time module */
            .mobile-time-module {
                padding: 0 !important;
            }
            
            .time-label {
                font-size: 16px;
                text-align: left !important;
                margin-bottom: 8px;
                width: 100% !important;
            }
            
            .custom-time-dropdown {
                width: 100% !important;
                max-width: 100% !important;
            }
            
            .time-dropdown-header {
                padding: 16px 20px !important;
                font-size: 16px;
                width: 100% !important;
                display: flex;
                align-items: center;
                justify-content: space-between;
                box-sizing: border-box !important;
            }
            
            .time-dropdown-options {
                width: 100% !important;
                box-sizing: border-box !important;
            }
            
            .time-dropdown-option {
                width: 100% !important;
                box-sizing: border-box !important;
            }
            
            .timer-display {
                width: 100%;
            }
            
            .contest-time-limit-display {
                width: 100%;
            }
            
            .score-display {
                width: 100%;
            }
            
            .time-dropdown-options {
                width: 100%;
                top: 100%;
                left: 0;
                right: 0;
            }
            
            .time-dropdown-option {
                padding: 15px 20px;
                font-size: 16px;
                min-height: 50px;
                display: flex;
                align-items: center;
            }
            
            .timer-display {
                font-size: 14px;
                min-width: 80px;
            }
            
            .restart-button-top {
                justify-content: center;
                width: 100%;
                margin-left: 0;
            }
            
            
        }
        
        .swipe-hint {
            margin-top: 2px;
            margin-bottom: 2px;
            color: #666;
            font-size: 12px;
            text-align: center;
            font-style: italic;
            background: rgba(238, 187, 195, 0.1);
            padding: 4px 12px;
            border-radius: 20px;
            border: 1px solid rgba(238, 187, 195, 0.3);
        }
        
        /* How to Play button for mobile - between grid and instruction */
        .how-to-play-button-mobile {
            display: none !important;
        }
        
        @media (max-width: 768px) {
            .how-to-play-button-mobile {
                display: block !important;
            }
        }
        
        @media (min-width: 769px) {
            .how-to-play-button-mobile {
                display: none !important;
            }
        }
        
        @media (max-width: 480px) {
            .swipe-hint {
                margin-top: 2px;
                margin-bottom: 2px;
                font-size: 11px;
                padding: 4px 10px;
            }
        }
        
        /* Desktop: Show desktop hint, hide mobile hint */
        .desktop-hint {
            display: block;
        }
        
        .mobile-hint {
            display: none;
        }
        
        /* Mobile optimizations - navbar styles are handled in navigation.php */
        @media (max-width: 768px) {
            .container {
                margin-top: calc(var(--navbar-height-tablet, 70px) + var(--navbar-spacing, 20px));
            }
        }
        
        @media (max-width: 480px) {
            .container {
                margin-top: calc(var(--navbar-height-mobile, 60px) + var(--navbar-spacing, 20px));
            }
            
            .top-controls {
                flex-direction: column;
                gap: 15px;
                padding: 12px 15px;
            }
            
            .mode-dropdown-container {
                width: 100%;
                justify-content: center;
            }
            

            
            .game-action-buttons {
                flex-direction: row;
                gap: 10px;
            }
            
            .restart-btn,
            .play-again-btn {
                width: 100%;
                max-width: 200px;
                flex: 1;
            }
            
            .contest-banner-display {
                width: 100% !important;
                max-width: 100% !important;
            }
            
            .contest-banner-display img {
                width: 100% !important;
                max-width: 100% !important;
            }
            
            .game-footer {
                margin-top: 30px;
                padding: 20px 0;
            }
            
            .footer-links {
                gap: 15px;
                margin-bottom: 15px;
            }
            
            .footer-link {
                font-size: 14px;
                padding: 8px 16px;
            }
            
            .footer-info {
                font-size: 12px;
            }
            
            .game-board {
                grid-template-columns: repeat(4, 70px);
                grid-template-rows: repeat(4, 70px);
                gap: 12px;
                padding: 12px;
            }
            
            .tile {
                width: 85px;
                height: 85px;
                line-height: 85px;
                font-size: 35px;
                box-sizing: border-box;
            }
            
            
            .mode-indicator {
                font-size: 16px;
            }
            
            .instructions {
                font-size: 16px;
            }
            
            .swipe-hint {
                font-size: 13px;
                margin-top: 8px;
                margin-bottom: 0;
            }
            
            /* Mobile: Show mobile hint, hide desktop hint */
            .mobile-hint {
                display: block !important;
            }
            
            .desktop-hint {
                display: none !important;
            }
            
            /* Enhanced mobile touch experience */
            .game-board-wrapper {
                margin: 20px auto;
            }
            
            .swipe-indicator {
                font-size: 12px;
                padding: 6px 12px;
            }
            
            /* Swipe indicator styles */
            .swipe-indicator {
                position: fixed;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                background: rgba(0, 0, 0, 0.8);
                color: white;
                padding: 12px 20px;
                border-radius: 8px;
                font-size: 16px;
                font-weight: bold;
                z-index: 1000;
                opacity: 0;
                transition: opacity 0.3s ease;
                pointer-events: none;
            }
            
            .swipe-indicator.show {
                opacity: 1;
            }
            
            /* Make game board more touch-friendly */
            /* Prevent scrolling on game board section */
            .game-board-section {
                touch-action: none !important;
                overflow: hidden !important;
                position: relative !important;
                -webkit-overflow-scrolling: touch;
            }
            
            #game-board {
                touch-action: none !important; /* Prevent default touch behaviors */
                user-select: none !important; /* Prevent text selection */
                -webkit-user-select: none !important;
                -moz-user-select: none !important;
                -ms-user-select: none !important;
                pointer-events: auto;
            }
            
            /* Prevent scrolling during game interaction */
            .game-container {
                touch-action: none !important;
                overflow: hidden !important;
                position: relative !important;
                -webkit-overflow-scrolling: touch;
            }
            
            /* Prevent scrolling on tile container */
            #tile-container {
                touch-action: none !important;
                pointer-events: none;
            }
            
            /* Prevent body and html scroll on mobile during game */
            body.game-active,
            html.game-active {
                overflow: hidden;
                position: fixed;
                width: 100%;
                height: 100%;
                touch-action: none;
            }
            
            body.game-active {
                left: 0;
                right: 0;
                top: 0;
            }
            
            /* Navbar styles are handled in navigation.php */
            
            /* Extra small mobile controls */
            .game-mode-module,
            .time-module {
                padding: 12px 8px;
            }
            
            .game-mode-label,
            .time-label {
                font-size: 14px;
            }
            
            .custom-game-mode-dropdown,
            .custom-time-dropdown {
                width: 100%;
            }
            
            .game-mode-dropdown-header,
            .time-dropdown-header {
                padding: 16px 20px;
                font-size: 16px;
                width: 100%;
            }
            
            .timer-display {
                width: 100%;
            }
            
            .contest-time-limit-display {
                width: 100%;
            }
            
            .score-display {
                width: 100%;
            }
            
            .game-mode-dropdown-option,
            .time-dropdown-option {
                padding: 12px 15px;
                font-size: 14px;
                min-height: 45px;
            }
            
            .navbar .nav-link {
                font-size: 16px;
                padding: 12px 25px;
            }
        }
        
        /* Additional mobile styles are handled in navigation.php */
        

        
        /* Swipe direction indicators (optional visual feedback) */
        .swipe-indicator {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(238, 187, 195, 0.9);
            color: #232946;
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 14px;
            font-weight: bold;
            opacity: 0;
            transition: opacity 0.2s ease;
            pointer-events: none;
            z-index: 10;
        }
        
        .swipe-indicator.show {
            opacity: 1;
        }
        .game-over {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(224, 234, 252, 0.95);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 36px;
            color: #4a5c6e;
            font-weight: bold;
            border-radius: 12px;
            z-index: 2;
            text-align: center;
            padding: 20px;
            backdrop-filter: blur(5px);
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        }
        .game-board-wrapper {
            position: relative;
            width: max-content;
        }

        /* Footer Styles */
        .game-footer {
            margin-top: 40px;
            padding: 30px 0;
            background: linear-gradient(135deg, #232946 0%, #2a3655 100%);
            border-top: 3px solid #eebbc3;
            box-shadow: 0 -8px 32px rgba(35,41,70,0.25);
        }
        
        .footer-content {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
            text-align: center;
        }
        
        .footer-links {
            display: flex;
            justify-content: center;
            gap: 30px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }
        
        .footer-link {
            color: #eebbc3;
            text-decoration: none;
            font-weight: 600;
            font-size: 16px;
            padding: 10px 20px;
            border-radius: 25px;
            transition: all 0.3s ease;
            background: rgba(238,187,195,0.1);
            border: 2px solid transparent;
        }
        
        .footer-link:hover {
            background: rgba(238,187,195,0.2);
            border-color: #eebbc3;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(238,187,195,0.3);
        }
        
        .footer-info {
            color: #b8c5d6;
            font-size: 14px;
            opacity: 0.8;
        }
        
        .footer-info p {
            margin: 0;
        }

        @media screen and (max-width: 768px) {
            html {
                background: #ffffff !important; /* Same as web version */
            }
            
            body {
                background: #ffffff !important; /* Same as web version */
            }
            
            .container {
                background: #ffffff !important; /* Same as web version */
            }
            
            .game-board-section {
                width: 100% !important;
                max-width: 400px !important;
                height: auto !important;
                min-height: auto !important;
                margin: 0 auto !important;
                padding: 12px !important;
                box-sizing: border-box !important;
                background: #ffffff !important; /* Same as web version */
                border: 2px solid #cbd5e1 !important; /* Border around grid section */
                border-radius: 4px !important;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
                position: relative !important;
            }
            
            .game-container {
                width: 100% !important;
                max-width: 400px !important;
                aspect-ratio: 1 / 1 !important;
                padding: 12px !important;
                box-sizing: border-box !important;
                background: #bbada0 !important; /* Same beige background as web version */
                border: none !important; /* Remove border to match web version */
                border-radius: 4px !important;
                box-shadow: none !important; /* Remove shadow to match web version */
            }
            
            .grid-container {
                width: 100% !important;
                height: 100% !important;
                top: 0 !important;
                left: 0 !important;
                padding: 8px !important;
                box-sizing: border-box !important;
            }
            
            .grid-row {
                height: calc((100% - 24px) / 4);
                margin-bottom: 8px;
            }
            
            .grid-cell {
                width: calc((100% - 24px) / 4);
                margin-right: 8px;
            }
            
            .tile-container {
                width: 100% !important;
                height: 100% !important;
                top: 0 !important;
                left: 0 !important;
                padding: 8px !important;
                box-sizing: border-box !important;
            }
            
            .tile {
                width: calc((100% - 24px) / 4);
                height: calc((100% - 24px) / 4);
                font-size: clamp(18px, 5vw, 28px);
                display: flex;
                align-items: center;
                justify-content: center;
                line-height: 1;
            }
            
            /* Tablet tile positions - gap is 8px, padding is 8px */
            .tile.tile-position-1-1 {
                left: 8px !important;
                top: 8px !important;
            }
            .tile.tile-position-1-2 {
                left: 8px !important;
                top: calc(8px + ((100% - 24px) / 4) + 8px) !important;
            }
            .tile.tile-position-1-3 {
                left: 8px !important;
                top: calc(8px + ((100% - 24px) / 4) * 2 + 8px * 2) !important;
            }
            .tile.tile-position-1-4 {
                left: 8px !important;
                top: calc(8px + ((100% - 24px) / 4) * 3 + 8px * 3) !important;
            }
            .tile.tile-position-2-1 {
                left: calc(8px + ((100% - 24px) / 4) + 8px) !important;
                top: 8px !important;
            }
            .tile.tile-position-2-2 {
                left: calc(8px + ((100% - 24px) / 4) + 8px) !important;
                top: calc(8px + ((100% - 24px) / 4) + 8px) !important;
            }
            .tile.tile-position-2-3 {
                left: calc(8px + ((100% - 24px) / 4) + 8px) !important;
                top: calc(8px + ((100% - 24px) / 4) * 2 + 8px * 2) !important;
            }
            .tile.tile-position-2-4 {
                left: calc(8px + ((100% - 24px) / 4) + 8px) !important;
                top: calc(8px + ((100% - 24px) / 4) * 3 + 8px * 3) !important;
            }
            .tile.tile-position-3-1 {
                left: calc(8px + ((100% - 24px) / 4) * 2 + 8px * 2) !important;
                top: 8px !important;
            }
            .tile.tile-position-3-2 {
                left: calc(8px + ((100% - 24px) / 4) * 2 + 8px * 2) !important;
                top: calc(8px + ((100% - 24px) / 4) + 8px) !important;
            }
            .tile.tile-position-3-3 {
                left: calc(8px + ((100% - 24px) / 4) * 2 + 8px * 2) !important;
                top: calc(8px + ((100% - 24px) / 4) * 2 + 8px * 2) !important;
            }
            .tile.tile-position-3-4 {
                left: calc(8px + ((100% - 24px) / 4) * 2 + 8px * 2) !important;
                top: calc(8px + ((100% - 24px) / 4) * 3 + 8px * 3) !important;
            }
            .tile.tile-position-4-1 {
                left: calc(8px + ((100% - 24px) / 4) * 3 + 8px * 3) !important;
                top: 8px !important;
            }
            .tile.tile-position-4-2 {
                left: calc(8px + ((100% - 24px) / 4) * 3 + 8px * 3) !important;
                top: calc(8px + ((100% - 24px) / 4) + 8px) !important;
            }
            .tile.tile-position-4-3 {
                left: calc(8px + ((100% - 24px) / 4) * 3 + 8px * 3) !important;
                top: calc(8px + ((100% - 24px) / 4) * 2 + 8px * 2) !important;
            }
            .tile.tile-position-4-4 {
                left: calc(8px + ((100% - 24px) / 4) * 3 + 8px * 3) !important;
                top: calc(8px + ((100% - 24px) / 4) * 3 + 8px * 3) !important;
            }
        }

        @media screen and (max-width: 480px) {
            html, body {
                font-size: 15px;
            }
            
            html {
                background: #ffffff !important; /* Same as web version */
            }

            body {
                margin: 0;
                padding: 0;
                background: #ffffff !important; /* Same as web version */
            }

            .container {
                width: 100%;
                max-width: 100%;
                margin: 0 auto;
                padding: 0 !important;
                background: #ffffff !important; /* Same as web version */
            }
            
            .game-board-section {
                width: 100% !important;
                max-width: 400px !important;
                height: auto !important;
                min-height: auto !important;
                margin: 0 auto !important;
                padding: 12px !important;
                box-sizing: border-box !important;
                background: #ffffff !important; /* Same as web version */
                border: 2px solid #cbd5e1 !important; /* Border around grid section */
                border-radius: 4px !important;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
                position: relative !important;
            }
            
            .game-container {
                width: 100% !important;
                max-width: 400px !important;
                aspect-ratio: 1 / 1 !important;
                padding: 12px !important;
                box-sizing: border-box !important;
                background: #bbada0 !important; /* Same beige background as web version */
                border: none !important; /* Remove border to match web version */
                border-radius: 4px !important;
                box-shadow: none !important; /* Remove shadow to match web version */
            }
            
            .game-controls-section {
                width: 100% !important;
                max-width: 100% !important;
                height: auto;
                min-height: auto;
                margin-top: 0 !important;
                margin-bottom: 0 !important;
                padding: 12px 16px !important;
                box-sizing: border-box !important;
                overflow: hidden;
                background: #ffffff !important; /* Same as web version */
                border: 2px solid #cbd5e1 !important; /* Border around controls section */
                border-radius: 4px !important;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
            }
            
            .score-display {
                padding: 12px 16px !important;
                width: 100% !important;
                max-width: 100% !important;
                margin: 0 0 10px 0 !important;
                box-sizing: border-box !important;
            }
            
            .game-action-buttons {
                flex-direction: column;
                gap: 10px;
            }
            
            .restart-btn,
            .play-again-btn {
                padding: 14px 20px !important;
                font-size: 15px !important;
                width: 100% !important;
                max-width: 100% !important;
                margin: 0 !important;
                box-sizing: border-box !important;
            }
            
            .contest-banner-display {
                width: 100% !important;
                max-width: 100% !important;
                margin: 0 !important;
                box-sizing: border-box !important;
            }
            
            .contest-banner-display img {
                width: 100% !important;
                max-width: 100% !important;
                max-height: 50px !important;
                object-fit: cover !important;
            }
            
            .game-mode-module,
            .time-module {
                align-items: stretch !important;
                width: 100% !important;
            }
            
            .custom-game-mode-dropdown,
            .custom-time-dropdown {
                width: 100% !important;
                max-width: 100% !important;
            }
            
            .game-mode-label,
            .time-label {
                text-align: left !important;
                width: 100% !important;
            }
            
            .game-mode-dropdown-header,
            .time-dropdown-header {
                width: 100% !important;
                box-sizing: border-box !important;
            }
            
            .game-mode-dropdown-options,
            .time-dropdown-options {
                width: 100% !important;
                box-sizing: border-box !important;
            }
            
            .game-mode-dropdown-option,
            .time-dropdown-option {
                width: 100% !important;
                box-sizing: border-box !important;
            }

            .heading {
                margin-bottom: 10px;
            }

            .game-container {
                width: 100% !important;
                max-width: 400px !important;
                aspect-ratio: 1 / 1 !important;
                padding: 12px !important; /* Same padding as web version */
                background: #bbada0 !important; /* Same beige background as web version */
                border: none !important; /* Remove border to match web version */
                border-radius: 4px !important;
                box-shadow: none !important; /* Remove shadow to match web version */
            }

            .grid-container {
                position: absolute !important;
                z-index: 1 !important;
                width: calc(100% - 24px) !important;
                height: calc(100% - 24px) !important;
                top: 12px !important;
                left: 12px !important;
                padding: 0 !important;
                margin: 0 !important;
                box-sizing: border-box !important;
            }

            .grid-row {
                margin-bottom: 6px !important;
                width: 100% !important;
                display: block !important;
                height: calc((100% - 18px) / 4) !important;
                box-sizing: border-box !important;
            }
            .grid-row:last-child {
                margin-bottom: 0 !important;
            }
            .grid-row:after {
                content: "";
                display: block;
                clear: both;
            }

            .grid-cell {
                width: calc((100% - 18px) / 4) !important;
                height: 100% !important;
                margin-right: 6px !important;
                float: left !important;
                border-radius: 4px !important;
                background: rgba(238, 228, 218, 0.35) !important;
                box-sizing: border-box !important;
                margin-left: 0 !important;
                margin-top: 0 !important;
                margin-bottom: 0 !important;
                padding: 0 !important;
            }
            .grid-row .grid-cell:last-child {
                margin-right: 0 !important;
            }

            .tile-container {
                position: absolute !important;
                z-index: 2 !important;
                width: calc(100% - 24px) !important;
                height: calc(100% - 24px) !important;
                top: 12px !important;
                left: 12px !important;
                padding: 0 !important;
                margin: 0 !important;
                box-sizing: border-box !important;
            }

            .tile {
                width: calc((100% - 18px) / 4) !important;
                height: calc((100% - 18px) / 4) !important;
                font-size: clamp(16px, 4.5vw, 24px) !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                line-height: 1 !important;
                box-sizing: border-box !important;
                margin: 0 !important;
                padding: 0 !important;
                border: none !important;
                border-radius: 4px !important;
            }
            
            /* Mobile tile positions - gap is 6px, adjusted to remove extra padding */
            .tile.tile-position-1-1 {
                position: absolute !important;
                left: 0 !important;
                top: 0 !important;
            }
            .tile.tile-position-1-2 {
                position: absolute !important;
                left: 0 !important;
                top: calc(((100% - 18px) / 4) + 6px) !important;
            }
            .tile.tile-position-1-3 {
                position: absolute !important;
                left: 0 !important;
                top: calc(((100% - 18px) / 4) * 2 + 6px * 2) !important;
            }
            .tile.tile-position-1-4 {
                position: absolute !important;
                left: 0 !important;
                top: calc(((100% - 18px) / 4) * 3 + 6px * 3) !important;
            }
            .tile.tile-position-2-1 {
                position: absolute !important;
                left: calc(((100% - 18px) / 4) + 6px) !important;
                top: 0 !important;
            }
            .tile.tile-position-2-2 {
                position: absolute !important;
                left: calc(((100% - 18px) / 4) + 6px) !important;
                top: calc(((100% - 18px) / 4) + 6px) !important;
            }
            .tile.tile-position-2-3 {
                position: absolute !important;
                left: calc(((100% - 18px) / 4) + 6px) !important;
                top: calc(((100% - 18px) / 4) * 2 + 6px * 2) !important;
            }
            .tile.tile-position-2-4 {
                position: absolute !important;
                left: calc(((100% - 18px) / 4) + 6px) !important;
                top: calc(((100% - 18px) / 4) * 3 + 6px * 3) !important;
            }
            .tile.tile-position-3-1 {
                position: absolute !important;
                left: calc(((100% - 18px) / 4) * 2 + 6px * 2) !important;
                top: 0 !important;
            }
            .tile.tile-position-3-2 {
                position: absolute !important;
                left: calc(((100% - 18px) / 4) * 2 + 6px * 2) !important;
                top: calc(((100% - 18px) / 4) + 6px) !important;
            }
            .tile.tile-position-3-3 {
                position: absolute !important;
                left: calc(((100% - 18px) / 4) * 2 + 6px * 2) !important;
                top: calc(((100% - 18px) / 4) * 2 + 6px * 2) !important;
            }
            .tile.tile-position-3-4 {
                position: absolute !important;
                left: calc(((100% - 18px) / 4) * 2 + 6px * 2) !important;
                top: calc(((100% - 18px) / 4) * 3 + 6px * 3) !important;
            }
            .tile.tile-position-4-1 {
                position: absolute !important;
                left: calc(((100% - 18px) / 4) * 3 + 6px * 3) !important;
                top: 0 !important;
            }
            .tile.tile-position-4-2 {
                position: absolute !important;
                left: calc(((100% - 18px) / 4) * 3 + 6px * 3) !important;
                top: calc(((100% - 18px) / 4) + 6px) !important;
            }
            .tile.tile-position-4-3 {
                position: absolute !important;
                left: calc(((100% - 18px) / 4) * 3 + 6px * 3) !important;
                top: calc(((100% - 18px) / 4) * 2 + 6px * 2) !important;
            }
            .tile.tile-position-4-4 {
                position: absolute !important;
                left: calc(((100% - 18px) / 4) * 3 + 6px * 3) !important;
                top: calc(((100% - 18px) / 4) * 3 + 6px * 3) !important;
            }

            .game-message p {
                font-size: clamp(24px, 6vw, 30px) !important;
                height: clamp(24px, 6vw, 30px) !important;
                line-height: clamp(24px, 6vw, 30px) !important;
                margin-top: 30% !important;
            }
            .game-message .lower {
                margin-top: 30px !important;
            }
        }
        
        @keyframes pulse {
            0%, 100% { 
                transform: scale(1);
                opacity: 1;
            }
            50% { 
                transform: scale(1.05);
                opacity: 0.8;
            }
        }
        
        @keyframes navigation-restriction-pulse {
            0%, 100% { 
                transform: scale(1);
                opacity: 1;
                box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
            }
            50% { 
                transform: scale(1.02);
                opacity: 0.9;
                box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
            }
        }
        
        @keyframes popupSlideIn {
            0% { 
                opacity: 0; 
                transform: translateY(-30px) scale(0.9); 
            }
            100% { 
                opacity: 1; 
                transform: translateY(0) scale(1); 
            }
        }

/* Quit Game Modal Button Styles - Matching delete modal */
.quit-game-modal-primary-btn {
    padding: 16px 24px;
    background: #fbbf24;
    color: white;
    font-weight: 700;
    font-size: 16px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect for primary button */
.quit-game-modal-primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.quit-game-modal-primary-btn:hover::before {
    left: 100%;
}

.quit-game-modal-primary-btn:hover {
    background: #f59e0b;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.quit-game-modal-secondary-btn {
    padding: 16px 24px;
    background: #cbd5e1;
    color: #1e293b;
    font-weight: 700;
    font-size: 16px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect for secondary button */
.quit-game-modal-secondary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.quit-game-modal-secondary-btn:hover::before {
    left: 100%;
}

.quit-game-modal-secondary-btn:hover {
    background: #94a3b8;
    border-color: #94a3b8;
    color: white;
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.4);
}

.quit-game-modal-primary-btn span,
.quit-game-modal-secondary-btn span {
    position: relative;
    z-index: 10;
}

/* Equal width buttons on mobile for quit game modal */
@media screen and (max-width: 768px) {
    .quit-game-modal-primary-btn,
    .quit-game-modal-secondary-btn {
        flex: 1 1 50% !important;
        min-width: 0 !important;
        max-width: 50% !important;
        box-sizing: border-box;
    }
}

/* Contest Ended Modal Button Styles - Matching delete modal */
.contest-ended-modal-primary-btn {
    padding: 16px 24px;
    background: #fbbf24;
    color: white;
    font-weight: 700;
    font-size: 16px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect for primary button */
.contest-ended-modal-primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.contest-ended-modal-primary-btn:hover::before {
    left: 100%;
}

.contest-ended-modal-primary-btn:hover {
    background: #f59e0b;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.contest-ended-modal-secondary-btn {
    padding: 16px 24px;
    background: #cbd5e1;
    color: #1e293b;
    font-weight: 700;
    font-size: 16px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect for secondary button */
.contest-ended-modal-secondary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.contest-ended-modal-secondary-btn:hover::before {
    left: 100%;
}

.contest-ended-modal-secondary-btn:hover {
    background: #94a3b8;
    border-color: #94a3b8;
    color: white;
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.4);
}

.contest-ended-modal-primary-btn span,
.contest-ended-modal-secondary-btn span {
    position: relative;
    z-index: 10;
}

/* Equal width buttons on mobile for contest ended modal */
@media screen and (max-width: 768px) {
    .contest-ended-modal-primary-btn,
    .contest-ended-modal-secondary-btn {
        flex: 1 1 50% !important;
        min-width: 0 !important;
        max-width: 50% !important;
        box-sizing: border-box;
    }
}