 :root {
     --neon-x: #00f3ff;
     --neon-o: #ff00ea;
     --bg-color: #0b0b1a;
     --glass-bg: rgba(20, 20, 40, 0.6);
     --glass-border: rgba(255, 255, 255, 0.1);
 }

 * {
     margin: 0;
     padding: 0;
     box-sizing: border-box;
     font-family: 'Orbitron', sans-serif;
 }

 body {
     background-color: var(--bg-color);
     background-image: radial-gradient(circle at center, #1a1a3a 0%, #0b0b1a 100%);
     color: white;
     min-height: 100vh;
     display: flex;
     flex-direction: column;
     align-items: center;
     overflow-x: hidden;
     padding: 20px;
 }

 /* Background Animated Grid */
 .bg-grid {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background-size: 50px 50px;
     background-image: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
         linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
     z-index: -1;
     animation: panBg 20s linear infinite;
 }

 @keyframes panBg {
     0% {
         transform: translateY(0) translateX(0);
     }

     100% {
         transform: translateY(-50px) translateX(-50px);
     }
 }

 h1.main-title {
     font-size: clamp(2rem, 6vw, 4rem);
     font-weight: 900;
     text-transform: uppercase;
     letter-spacing: 5px;
     margin-top: 20px;
     margin-bottom: 30px;
     text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.3);
     text-align: center;
     z-index: 10;
 }

 /* View Router Setup */
 .view {
     display: none;
     width: 100%;
     max-width: 1000px;
     flex-direction: column;
     align-items: center;
     z-index: 10;
 }

 .view.active {
     display: flex;
     animation: fadeIn 0.5s ease forwards;
 }

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

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

 /* --- HOME SCREEN SPECIFICS --- */
 .home-layout {
     display: flex;
     flex-wrap: wrap;
     gap: 30px;
     width: 100%;
     justify-content: center;
 }

 .panel {
     background: var(--glass-bg);
     border: 1px solid var(--glass-border);
     border-radius: 20px;
     padding: clamp(20px, 4vw, 30px);
     backdrop-filter: blur(10px);
     box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
     flex: 1;
     min-width: min(100%, 300px);
     /* Responsive adjustment */
     display: flex;
     flex-direction: column;
 }

 .panel h2 {
     font-size: clamp(1.2rem, 3vw, 1.5rem);
     margin-bottom: 25px;
     border-bottom: 1px solid rgba(255, 255, 255, 0.1);
     padding-bottom: 10px;
     letter-spacing: 3px;
     color: #aaa;
     text-transform: uppercase;
     text-align: center;
 }

 .feature-list {
     list-style: none;
     display: flex;
     flex-direction: column;
     gap: 15px;
 }

 .feature-item {
     display: flex;
     align-items: center;
     gap: 15px;
     font-size: clamp(0.9rem, 2vw, 1.1rem);
     letter-spacing: 1px;
     background: rgba(0, 0, 0, 0.3);
     padding: 15px;
     border-radius: 10px;
     border-left: 3px solid rgba(255, 255, 255, 0.1);
     transition: all 0.3s ease;
 }

 .feature-item:hover {
     transform: translateX(5px);
     background: rgba(255, 255, 255, 0.05);
     border-left-color: var(--neon-x);
 }

 .feature-icon {
     font-size: 1.5rem;
     flex-shrink: 0;
 }

 /* Action Buttons & Inputs */
 .action-btn {
     background: transparent;
     color: white;
     font-size: clamp(0.9rem, 2vw, 1.1rem);
     padding: 15px 20px;
     border: 2px solid rgba(255, 255, 255, 0.2);
     border-radius: 12px;
     cursor: pointer;
     text-transform: uppercase;
     letter-spacing: 2px;
     transition: all 0.3s ease;
     position: relative;
     overflow: hidden;
     width: 100%;
     margin-bottom: 15px;
     font-weight: bold;
 }

 .action-btn::before {
     content: '';
     position: absolute;
     top: 0;
     left: -100%;
     width: 100%;
     height: 100%;
     background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
     transition: all 0.5s ease;
 }

 .action-btn:hover:not(:disabled) {
     transform: translateY(-2px);
 }

 .action-btn:hover:not(:disabled)::before {
     left: 100%;
 }

 .action-btn:disabled {
     opacity: 0.7;
     cursor: not-allowed;
     animation: pulse 1.5s infinite;
 }

 .btn-cyan {
     border-color: var(--neon-x);
     color: var(--neon-x);
     text-shadow: 0 0 10px var(--neon-x);
 }

 .btn-cyan:hover:not(:disabled) {
     background: rgba(0, 243, 255, 0.1);
     box-shadow: 0 0 15px var(--neon-x);
 }

 .btn-magenta {
     border-color: var(--neon-o);
     color: var(--neon-o);
     text-shadow: 0 0 10px var(--neon-o);
 }

 .btn-magenta:hover:not(:disabled) {
     background: rgba(255, 0, 234, 0.1);
     box-shadow: 0 0 15px var(--neon-o);
 }

 .btn-white:hover:not(:disabled) {
     background: rgba(255, 255, 255, 0.1);
     box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
 }

 .join-group {
     display: flex;
     gap: 10px;
     margin-bottom: 15px;
     width: 100%;
 }

 .join-input {
     flex: 2;
     background: rgba(0, 0, 0, 0.4);
     border: 2px solid rgba(255, 255, 255, 0.1);
     color: white;
     padding: 15px;
     border-radius: 12px;
     font-family: 'Orbitron', sans-serif;
     font-size: clamp(0.9rem, 2vw, 1.1rem);
     text-align: center;
     letter-spacing: 3px;
     outline: none;
     transition: all 0.3s ease;
     min-width: 0;
     /* Prevents flex blowout on mobile */
 }

 .join-input:focus {
     border-color: var(--neon-o);
     box-shadow: 0 0 10px rgba(255, 0, 234, 0.3);
 }

 .join-group .action-btn {
     flex: 1;
     margin-bottom: 0;
     padding: 15px 10px;
 }

 .divider {
     display: flex;
     align-items: center;
     text-align: center;
     color: #555;
     margin: 10px 0 25px 0;
 }

 .divider::before,
 .divider::after {
     content: '';
     flex: 1;
     border-bottom: 1px solid rgba(255, 255, 255, 0.1);
 }

 .divider span {
     padding: 0 15px;
     font-size: 0.9rem;
     letter-spacing: 2px;
 }

 @keyframes pulse {
     0% {
         opacity: 0.6;
     }

     50% {
         opacity: 1;
         box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
     }

     100% {
         opacity: 0.6;
     }
 }

 /* --- FOOTER & WATERMARK --- */
 .site-footer {
     margin-top: auto;
     /* Pushes footer to the bottom */
     padding-top: 40px;
     padding-bottom: 10px;
     text-align: center;
     z-index: 10;
     width: 100%;
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
 }

 .copyright-text {
     color: rgba(255, 255, 255, 0.5);
     font-size: clamp(0.7rem, 2vw, 0.9rem);
     margin-bottom: 8px;
     letter-spacing: 1px;
 }

 .watermark {
     font-size: clamp(0.8rem, 2vw, 1.1rem);
     font-weight: 700;
     color: rgba(255, 255, 255, 0.08);
     /* Faint watermark color */
     letter-spacing: 5px;
     text-transform: uppercase;
     user-select: none;
     pointer-events: none;
     white-space: nowrap;
     margin-top: 5px;
 }

 /* --- GAMEPLAY SCREEN SPECIFICS --- */
 .scoreboard {
     display: flex;
     gap: 20px;
     margin-bottom: 30px;
     width: 100%;
     max-width: 600px;
     z-index: 10;
 }
 
 .score-box {
     flex: 1;
     background: var(--glass-bg);
     border: 1px solid var(--glass-border);
     padding: 15px;
     border-radius: 15px;
     text-align: center;
     display: flex;
     flex-direction: column;
 }
 
 .score-box.x { border-bottom: 3px solid var(--neon-x); }
 .score-box.o { border-bottom: 3px solid var(--neon-o); }
 
 .board {
     display: grid;
     grid-template-columns: repeat(3, 1fr);
     grid-template-rows: repeat(3, 1fr);
     gap: 15px;
     width: min(90vw, 400px);
     height: min(90vw, 400px);
     margin-bottom: 40px;
     z-index: 10;
 }
 
 .tile {
     background: var(--glass-bg);
     border: 1px solid var(--glass-border);
     border-radius: 15px;
     display: flex;
     justify-content: center;
     align-items: center;
     font-size: clamp(2rem, 10vw, 3.5rem);
     cursor: pointer;
     transition: all 0.2s ease;
 }
 
 .tile.playerX {
     color: var(--neon-x);
     text-shadow: 0 0 15px var(--neon-x);
 }
 
 .tile.playerO {
     color: var(--neon-o);
     text-shadow: 0 0 15px var(--neon-o);
 }
 
 .display-player.playerX { color: var(--neon-x); }
 .display-player.playerO { color: var(--neon-o); }
 
 .modal-overlay {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: rgba(0, 0, 0, 0.85);
     display: none;
     justify-content: center;
     align-items: center;
     z-index: 100;
 }
 
 .modal-overlay.active {
     display: flex;
 }

 .modal-content {
     background: var(--bg-color);
     padding: 30px;
     border-radius: 15px;
     text-align: center;
     border: 2px solid var(--glass-border);
     box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
     display: flex;
     flex-direction: column;
     gap: 20px;
 }

 .announcer {
     font-size: 1.5rem;
     font-weight: bold;
 }

 .modal-btn {
     background: var(--neon-x);
     color: var(--bg-color);
     border: none;
     padding: 10px 20px;
     font-size: 1.2rem;
     font-family: 'Orbitron', sans-serif;
     border-radius: 5px;
     cursor: pointer;
     transition: all 0.2s ease;
     font-weight: bold;
 }
 .modal-btn:hover {
     background: white;
     box-shadow: 0 0 15px var(--neon-x);
 }

 .turn-indicator {
    font-size: 1.2rem;
    margin-bottom: 20px;
    background: var(--glass-bg);
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    z-index: 10;
 }