/* ==========================================================
🧱 Base & Global Styles
========================================================== */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}

body {
font-family: 'Orbitron', system-ui, sans-serif;
background: linear-gradient(to bottom, #0d0d1a, #1a1a2e);
color: #ffffff;
min-height: 100vh;
display: flex;
justify-content: center;
background-image: url("../images/background-game.png");

background-size: cover;
background-position: center;
background-attachment: fixed;
}

/* Main wrapper grid layout */
#app-wrapper {
max-width: 1200px;
width: 100%;
padding: 20px;
display: grid;
grid-template-areas:
"header header"
"nav nav"
"game sidebar"
"footer footer";
grid-template-columns: 2fr 1fr;
grid-gap: 20px;
}

/* ==========================================================
🎬 Intro Screen
========================================================== */
#intro-screen {
position: fixed;
inset: 0;
background: radial-gradient(1200px 600px at 50% 50%, rgba(3,8,16,0.92), rgba(3,8,16,0.98));
display: grid;
place-items: center;
z-index: 2000;
text-align: center;
padding: 2rem;
margin-bottom: 0.5rem;
}
#intro-screen.hidden { display: none; }

/* Branding */
.brand-title {
font-weight: 900;
letter-spacing: 0.06em;
text-transform: uppercase;
color: #66ffe0;
text-shadow: 0 2px 12px rgba(0, 245, 212, 0.4), 0 0 2px #0ff;
}
.brand-title.small {
font-size: 1.35rem;
text-shadow: 0 2px 14px rgba(0, 245, 212, 0.35), 0 0 3px #66ffe0;
;
}
.brand-tagline {
margin-top: 0.5rem;
color: #a6ffe9;
opacity: 0.9;
font-size: 1.55rem;
}

/* Intro actions */
.intro-actions {
margin-top: 1rem;
display: grid;
gap: 1rem;
}
.intro-secondary {
display: flex;
gap: 0.75rem;
justify-content: center;
}

/* Buttons */
.btn {
border: 0;
border-radius: 10px;
padding: 0.75rem 1rem;
font-weight: 700;
letter-spacing: 0.02em;
transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
cursor: pointer;
}
.btn-xl {
padding: 0.95rem 1.25rem;
font-size: 1.05rem;
}
.btn-primary {
color: #021e1b;
background: linear-gradient(135deg, #00f5d4 0%, #00c2a8 100%);
box-shadow: 0 8px 24px rgba(0, 245, 212, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost {
color: #a6ffe9;
background: rgba(0, 245, 212, 0.08);
border: 1px solid rgba(0, 245, 212, 0.25);
}
.btn-ghost:hover {
background: rgba(0, 245, 212, 0.15);
transform: translateY(-1px);
}

/* ==========================================================
🕵️ Header & Meta Bar
========================================================== */
#main-header {
grid-area: header;
margin-bottom: 10px;
padding: 1rem 1.25rem;
display: flex;
align-items: center;
justify-content: space-between;
background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0));
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
#meta-bar {
display: flex;
justify-content: space-between;
font-size: 0.9rem;
color: #00f5d4;
flex-wrap: wrap;
gap: 8px;
}

/* ==========================================================
🧭 Navigation
========================================================== */
#top-nav {
grid-area: nav;
display: flex;
flex-wrap: wrap;
gap: 10px;
justify-content: center;
}
.nav-btn {
padding: 1rem 2rem;
font-size: 1.2rem;
font-weight: bold;
border-radius: 10px;
background: linear-gradient(135deg, #00f5d4, #00c2a8);
color: #021e1b;
border: none;
box-shadow: 0 4px 12px rgba(0, 245, 212, 0.3);
cursor: pointer;
transition: background 0.2s ease, box-shadow 0.3s ease;
}

.nav-btn:hover {
background-color: #ff2e63;
box-shadow: 0 0 50px #ff2e63;
 
}
.mode-toggle {
display: inline-flex;
gap: 8px;
margin-left: 0.5rem;
}
.nav-btn.active {
  background: linear-gradient(135deg, #00f5d4, #00c2a8);
  color: #021e1b; 
  box-shadow: 0 0 40px #00f5d4; 
  border: 1px solid #00f5d4;
}
.nav-btn.active:hover {
  background-color: #00c2a8; 
  box-shadow: 0 0 50px #00f5d4; 
}
/* ==========================================================
🎯 Game Area (Grid + Keyboard)
========================================================== */
#game-area {
grid-area: game;
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
padding: 1.25rem;
border-radius: 18px;
background: rgba(7, 12, 20, 0.65);
box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
backdrop-filter: blur(4px) saturate(1.2);
}
#new-game-btn { margin-top: 10px; animation: fadeIn 0.3s ease; }

/* Word Grid */
#game-grid {
display: grid;
grid-template-rows: repeat(6, 1fr);
gap: 12px;
margin-top: 10px;
position: relative;
}
.guess-row {
display: grid;
grid-template-columns: repeat(5, 80px);
gap: 12px;
justify-content: center;
}
.tile {
width: 80px;
height: 80px;
font-size: 2.5rem;
font-weight: bold;
text-align: center;
line-height: 80px;
text-transform: uppercase;
background-color: #0e1b27;
border: 2px solid rgba(255,255,255,0.12);
color: #eafffb;
border-radius: 8px;
box-shadow: 0 3px 10px rgba(0,0,0,0.4), inset 0 -2px 0 rgba(255,255,255,0.06);
transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}
/* Tile states */
.tile[data-state="correct"] {
background: linear-gradient(135deg, #14ff6f 0%, #06c45a 100%);
border-color: #14ff6f;
color: #04110a;
transform: scale(1.05);
animation: glowPulse 1.5s infinite alternate;
box-shadow: 0 8px 22px rgba(20, 255, 111, 0.35);
}
.tile[data-state="present"] {
background: linear-gradient(135deg, #ffd84a 0%, #f5b400 100%);
border-color: #ffd84a;
color: #221a00;
box-shadow: 0 8px 22px rgba(255, 216, 74, 0.35);
}
.tile[data-state="absent"] {
background: linear-gradient(135deg, #2a3543 0%, #1b2430 100%);
border-color: #1b2430;
color: #b9c7d6;
opacity: 0.92;
}

/* Tile animations */
.tile.flip { animation: flipTile 0.6s ease forwards; }
@keyframes flipTile {
0% { transform: rotateX(0); }
50% { transform: rotateX(90deg); }
100% { transform: rotateX(0); }
}

@keyframes glowPulse {
from { box-shadow: 0 0 6px #00f5d4; }
to { box-shadow: 0 0 20px #00f5d4; }
}

/* ==========================================================
🎯 Keyboard Layout
========================================================== */
#keyboard {
display: flex;
flex-direction: column;
gap: 10px;
margin-top: 20px;
padding: 0 4px;
}
.key-row {
display: flex;
justify-content: center;
gap: 6px;
}
.key {
width: 45px;
height: 60px;
font-size: 1rem;
font-weight: bold;
background-color: #1a1a2e;
color: #fff;
border: 2px solid #3a3a3c;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s ease;
box-shadow: 0 0 6px rgba(0, 245, 212, 0.3);
}
.key:hover {
background-color: #ff2e63;
color: #fff;
box-shadow: 0 0 12px #ff2e63;
}
.key:active {
transform: scale(0.95);
box-shadow: 0 0 6px #ff2e63;
}
.key.wide { width: 70px; }

.clue-btn:focus {
outline:none;
}

/* Key states */
.key.correct {
background-color: #00f5d4;
color: #0d0d1a;
border-color: #00f5d4;
box-shadow: 0 0 12px #00f5d4;
}
.key.present {
background-color: #ff9f1c;
color: #0d0d1a;
border-color: #ff9f1c;
box-shadow: 0 0 12px #ff9f1c;
}
.key.absent {
background-color: #3a3a3c;
color: #888;
border-color: #3a3a3c;
box-shadow: none;
}
.key:focus {
outline: 2px solid #00f5d4;
outline-offset: 2px;
}

/* ==========================================================
📊 Sidebar
========================================================== */
#sidebar {
grid-area: sidebar;
display: flex;
flex-direction: column;
gap: 20px;
overflow-y: auto;
max-height: 80vh;
}
#score-panel {
font-size: 1.2rem;
color: #66ffe0;
text-align: center;
position: relative;
}

/* =======================
🕵️ Clue Exchange
 =======================*/

#clue-exchange {
background-color: #1a1a2e;
border: 2px solid #ff2e63;
border-radius: 8px;
padding: 20px;
text-align: center;
}
#clue-exchange h2 {
color: #00f5d4;
margin-bottom: 10px;
}
.clue-btn {
background-color: #3a3a3c;
color: #fff;
border: none;
padding: 10px;
margin: 5px 0;
border-radius: 6px;
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
transition: background-color 0.2s ease;
}
.clue-btn:hover { background-color: #ff2e63; }
.cost {
background-color: #0d0d1a;
padding: 4px 8px;
border-radius: 4px;
font-size: 0.8rem;
color: #66ffe0;
}
.clue-result {
margin-top: 10px;
font-size: 1rem;
color: #ff9f1c;
}

/* Dynamic panel reveal */
#dynamic-panel {
max-height: 0;
overflow: hidden;
transition: max-height 0.6s ease, opacity 0.4s ease;
opacity: 0;
}
#dynamic-panel.show {
max-height: 500px;
opacity: 1;
}

/* ==========================================================
💫 Score Floats
========================================================== */
.score-float {
position: absolute;
font-weight: bold;
font-size: 1.2em;
animation: floatUp 1s ease-out forwards;
left: 50%;
transform: translateX(-50%);
pointer-events: none;
text-shadow: 0 0 6px rgba(0,0,0,0.6);
color: #ff4444;
}
.score-float.streak {
font-size: 1.4em;
text-shadow: 0 0 10px #ff6600, 0 0 20px #ff3300;
}
@keyframes floatUp {
0% { opacity: 1; transform: translate(-50%, 0); }
100% { opacity: 0; transform: translate(-50%, -40px); }
}





/* ==========================================================
📢 Universal Modal Overlay
========================================================== */
.modal-overlay {
position: fixed;
inset: 0;
width: 100%; height: 100%;
background-color: rgba(13, 13, 26, 0.9);
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease;
}
.modal-overlay.active {
opacity: 1;
pointer-events: auto;
}
.modal-overlay.hidden {
display: none !important;
}

/* Modal sections How to Play */

.modal-section {
margin-bottom: 1.5rem;
text-align: left;
}

.modal-section h3 {
color: #00f5d4;
margin-bottom: 0.5rem;
font-size: 1.2rem;
}

.modal-section ul {
list-style: none;
padding-left: 0;
margin: 0.5rem 0;
}

.modal-section ul li {
margin-bottom: 0.4rem;
color: #ddd;
}

.legend-list li {
display: flex;
align-items: center;
gap: 0.5rem;
}

.note {
font-style: italic;
color: #aaa;
margin-top: 0.5rem;
}

/* ==========================================================
📦 Shared Modal Content
========================================================== */
.modal-content {
background-color: #1a1a2e;
border: 2px solid #ff2e63;
padding: 20px;
border-radius: 10px;
width: min(500px, 90vw);
max-height: 90vh;
overflow-y: auto;
color: #fff;
text-align: center;
animation: fadeIn 0.3s ease forwards;
transform: scale(0.95);
transition: transform 0.3s ease;
box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.modal-content h2 {
color: #00f5d4;
margin-bottom: 12px;
font-size: 1.4rem;
}

/* ==========================================================
❌ Close Buttons (Reusable)
========================================================== */
.modal-close {
margin-top: 12px;
padding: 8px 16px;
background-color: #ff2e63;
color: #fff;
border: none;
border-radius: 6px;
cursor: pointer;
transition: background-color 0.2s ease, transform 0.2s ease;
}
.modal-close:hover {
background-color: #ff9f1c;
transform: translateY(-2px);
}

/* ==========================================================
✨ Animations
========================================================== */
@keyframes fadeIn {
from { opacity: 0; transform: scale(0.95); }
to { opacity: 1; transform: scale(1); }
}

#modal-overlay:focus-within { outline: 2px solid #00f5d4; }

/* ==========================================================
📜 How to Play Screen
========================================================== */

#howto-screen {
/* Inherits everything from #intro-screen */
position: fixed;
inset: 0;
background: radial-gradient(1200px 600px at 50% 50%, rgba(3,8,16,0.92), rgba(3,8,16,0.98));
display: flex;
flex-direction: column;
align-items: center;
z-index: 2000;
text-align: center;
padding: 2rem;
overflow-y: auto;
scroll-behavior: smooth;
}

#howto-screen.hidden {
display: none;
}

.howto-content {
max-width: 600px;
text-align: left;
margin-top: 1rem;
font-size: 1rem;
line-height: 1.6;
color: #a6ffe9;
}

/* ==========================================================
📜 Modal Overlays (How to Play, History, Stats)
========================================================== */
#history-overlay,
#stats-overlay,
#howto-overlay {
position: fixed;
inset: 0;
width: 100%; height: 100%;
background-color: rgba(13, 13, 26, 0.9);
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease;
}

#history-overlay.active,
#stats-overlay.active,
#howto-overlay.active {
opacity: 1;
pointer-events: auto;
}

#history-overlay.hidden,
#stats-overlay.hidden,
#howto-overlay.hidden {
display: none !important;
}

/* Inner content areas */
#history-content,
#stats-content {
margin-top: 15px;
font-size: 0.95rem;
color: #ddd;
}

/* Headings */
#history-overlay h2,
#stats-overlay h2,
#howto-overlay h2 {
color: #00f5d4;
margin-bottom: 10px;
}

/* Close buttons (shared style) */
#close-history,
#close-stats,
#close-howto {
margin-top: 10px;
padding: 8px 16px;
background-color: #ff2e63;
color: #fff;
border: none;
border-radius: 6px;
cursor: pointer;
transition: background-color 0.2s ease, transform 0.2s ease;
}
#close-history:hover,
#close-stats:hover,
#close-howto:hover {
background-color: #ff9f1c;
transform: translateY(-2px);
}

/* Focus outlines */
#history-overlay:focus-within,
#stats-overlay:focus-within,
#howto-overlay:focus-within {
outline: 2px solid #00f5d4;
}

/* ==========================================================
📊 Modal Action Buttons (Stats, etc.)
========================================================== */
.modal-action {
margin-top: 10px;
padding: 10px 20px;
background-color: #3a3a3c;
color: #00f5d4;
border: 2px solid #00f5d4;
border-radius: 6px;
font-weight: bold;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.2s ease, transform 0.2s ease;
}

.modal-action:hover {
background-color: #00f5d4;
color: #0d0d1a;
transform: translateY(-2px);
}
/* ==========================================================
📜 History card
========================================================== */
.history-card {
background: #1a1a2e;
border: 2px solid #3a3a3c;
border-radius: 8px;
padding: 12px;
margin: 8px 0;
text-align: center;
box-shadow: 0 4px 12px rgba(0,0,0,0.4);
transition: transform 0.2s ease;
}
.history-card:hover { transform: translateY(-2px); }
.history-card.win { border-color: #00f5d4; box-shadow: 0 0 12px #00f5d4; }
.history-card.loss { border-color: #ff2e63; box-shadow: 0 0 12px #ff2e63; }
.history-card h3 { margin-bottom: 6px; font-size: 1.1rem; }
.history-card .date {
display: block;
margin-top: 6px;
font-size: 0.8rem;
color: #aaa;
}

/* ==========================================================
📊 Stats Modal
========================================================== */

.stats-metrics {
display: flex;
justify-content: space-around;
margin: 1rem 0 1.5rem;
text-align: center;
}

.metric {
display: flex;
flex-direction: column;
align-items: center;
background: #1a1a2e;
border: 2px solid #3a3a3c;
border-radius: 6px;
padding: 0.75rem 1rem;
min-width: 80px;
box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.metric .label {
font-size: 0.85rem;
font-weight: bold;
color: #ccc;
margin-bottom: 0.4rem;
text-transform: uppercase;
letter-spacing: 0.5px;
}

.metric .value {
font-size: 1.4rem;
font-weight: bold;
color: #66ffe0;
line-height: 1.4;
display: flex;
align-items: center;
justify-content: center;
min-height: 2.2rem;
}

.stats-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1rem;
text-align: center;
margin-bottom: 1.5rem;
}
.stats-grid div {
background: #1a1a2e;
border: 2px solid #3a3a3c;
border-radius: 6px;
padding: 1rem;
font-size: 1rem;
font-weight: bold;
color: #00f5d4;
box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Guess distribution bars */
.guess-distribution { margin-top: 1rem; }
.guess-row {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0.4rem 0;
}
.guess-label {
width: 1.5rem;
text-align: right;
margin-right: 0.5rem;
font-weight: bold;
color: #fff;
}
.guess-bar {
flex: 1;
background: #333;
border-radius: 4px;
overflow: hidden;
height: 1.5rem;
display: flex;
align-items: center;
}
.bar-fill {
background: linear-gradient(90deg, #00f5d4, #44cc44);
color: #000;
font-size: 0.9rem;
font-weight: bold;
white-space: nowrap;
transition: width 0.3s ease;
max-width: 98%;
height: 100%;
display: flex;
align-items: center;
justify-content: flex-start;
padding-left: 0.6rem;
padding-right: 0.6rem;
line-height: 1.5rem;
box-sizing: border-box;
min-width: 2.5rem;
}
.distribution-title {
text-align: center;
font-size: 1.2rem;
color: #66ffe0;
margin-bottom: 0.5rem;
}

/* ==========================================================
⚡ Shake animation
========================================================== */
.shake { animation: shake 0.3s; }
@keyframes shake {
0%,100% { transform: translateX(0); }
25% { transform: translateX(-5px); }
50% { transform: translateX(5px); }
75% { transform: translateX(-5px); }
}

/* ==========================================================
🏆 Endgame Overlay
========================================================== */
#endgame-overlay {
position: fixed;
inset: 0;
width: 100%; height: 100%;
background-color: rgba(13, 13, 26, 0.9);
display: flex;
justify-content: center;
align-items: center;
z-index: 3000;
}
#endgame-overlay.hidden { display: none; }

#endgame-content {
background-color: #1a1a2e;
border: 2px solid #00f5d4;
padding: 30px;
border-radius: 10px;
text-align: center;
width: 350px;
animation: fadeIn 0.3s ease forwards;
}
#endgame-content h2 { color: #ff2e63; margin-bottom: 10px; }
#endgame-content p { color: #fff; margin-bottom: 20px; }

.endgame-buttons {
display: flex;
justify-content: space-around;
gap: 10px;
}
.endgame-buttons #continue-btn {
background-color: #00f5d4;
color: #0d0d1a;
border: none;
border-radius: 6px;
padding: 10px 20px;
font-weight: bold;
cursor: pointer;
transition: background-color 0.2s ease;
}
.endgame-buttons #continue-btn:hover { background-color: #00c9a7; }
.endgame-buttons #restart-btn {
background-color: #3a3a3c;
color: #fff;
border: none;
border-radius: 6px;
padding: 10px 20px;
cursor: pointer;
transition: background-color 0.2s ease;
}
.endgame-buttons #restart-btn:hover { background-color: #ff2e63; }

/* ==========================================================
🧑‍💻 Player Name Input (Endgame)
========================================================== */
#player-name-input {
display: block;
margin: 15px auto 20px auto;
padding: 10px 16px;
width: 80%;
max-width: 300px;
font-size: 1.1rem;
font-family: 'Orbitron', sans-serif;
text-align: center;
color: #00f5d4;
background-color: #0d0d1a;
border: 2px solid #00f5d4;
border-radius: 8px;
box-shadow: 0 0 12px rgba(0, 245, 212, 0.3);
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#player-name-input::placeholder {
color: #888;
font-style: italic;
}

#player-name-input:focus {
outline: none;
border-color: #ff2e63;
box-shadow: 0 0 12px #ff2e63;
}

/* ==========================================================
✨ Animations
========================================================== */
@keyframes fadeIn {
from { opacity: 0; transform: scale(0.95); }
to { opacity: 1; transform: scale(1); }
}

/* ==========================================================
📜 Footer
========================================================== */
#footer {
grid-area: footer;
text-align: center;
font-size: 0.8rem;
color: #e6b800;
margin-top: 20px;
}

/* ==========================================================
📱 Mobile Layout — Arcade Experience
========================================================== */
@media (max-width: 768px) {

#app-wrapper {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
min-height: 100vh;
overflow-y: auto;
padding: 0;
}

/* Top navigation bar */
#top-nav {
display: flex;
justify-content: space-around;
align-items: center;
width: 100%;
padding: 10px;
background-color: #0d0d1a;
border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Icon-only buttons */
.nav-icon {
background: none;
border: none;
color: #00f5d4;
font-size: 1.4rem;
cursor: pointer;
}

/* Compact nav mode */
#top-nav.compact-nav .nav-btn {
padding: 6px;
font-size: 1.2rem;
width: auto;
min-width: 0;
background: none;
border: none;
box-shadow: none;
}

/* Mode selector layout */
#mode-select {
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
margin: 20px 0;
}

/* Navigation buttons */
.nav-btn {
padding: 1rem 2rem;
font-size: 1.2rem;
font-weight: bold;
border-radius: 10px;
background: linear-gradient(135deg, #00f5d4, #00c2a8);
color: #021e1b;
border: none;
box-shadow: 0 4px 12px rgba(0, 245, 212, 0.3);
cursor: pointer;
transition: background 0.2s ease, box-shadow 0.3s ease;
}

.nav-btn:hover {
transform: translateY(-2px);
}

/* Game grid layout */
#game-grid {
display: grid;
grid-template-rows: repeat(6, 1fr);
gap: 8px;
margin-bottom: 20px;
}

.guess-row {
display: grid;
grid-template-columns: repeat(5, minmax(50px, 1fr));
gap: 6px;
justify-content: center;
}

.tile {
width: 100%;
height: 55px;
font-size: 1.6rem;
line-height: 55px;
border-radius: 6px;
}

/* Hide sidebar on mobile */
#sidebar {
display: none !important;
}

/* Floating score display */
#mobile-score {
position: fixed;
top: 10px;
right: 10px;
background: #0d0d1a;
color: #d4a300;
padding: 8px 12px;
border-radius: 6px;
font-size: 1.1rem;
z-index: 1000;
box-shadow: 0 0 8px #66ffe0;
}
}

/* ==========================================================
🎯 Mobile Keyboard — Responsive & Arcade-Polished
========================================================== */
@media (max-width: 768px) {
#keyboard {
display: flex;
flex-direction: column;
gap: 12px;
margin-top: 20px;
padding: 0 8px;
max-width: 600px;
margin-left: auto;
margin-right: auto;
}

.key-row {
display: grid;
grid-template-columns: repeat(10, 1fr);
gap: 6px;
margin-bottom: 8px;
max-width: 360px;
margin-left: auto;
margin-right: auto;
}

.middle-row {
padding-left: 6%;
grid-template-columns: repeat(9, 1fr);
}

.bottom-row {
padding-left: 12%;
grid-template-columns: repeat(7, 1fr);
}


.action-row {
display: flex;
justify-content: center;
gap: 12px;
}

.key {
height: 48px;
font-size: 1rem;
font-weight: bold;
background-color: #1a1a2e;
color: #fff;
border: 2px solid #3a3a3c;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s ease;
box-shadow: 0 0 6px rgba(0, 245, 212, 0.3);
text-align: center;
}

.key:hover {
background-color: #ff2e63;
box-shadow: 0 0 12px #ff2e63;
}

.key:active {
transform: scale(0.95);
box-shadow: 0 0 6px #ff2e63;
}

/* Wide keys */
.key.wide {
min-width: 80px;
padding: 0 12px;
font-size: 1.1rem;
background-color: #0d0d1a;
border-color: #00f5d4;
box-shadow: 0 0 12px #00f5d4;
}

.key.wide:hover {
background-color: #00f5d4;
color: #0d0d1a;
box-shadow: 0 0 16px #00f5d4;
}

/* Key feedback states */
.key.correct {
background-color: #00f5d4;
color: #0d0d1a;
border-color: #00f5d4;
box-shadow: 0 0 12px #00f5d4;
}

.key.present {
background-color: #ff9f1c;
color: #0d0d1a;
border-color: #ff9f1c;
box-shadow: 0 0 12px #ff9f1c;
}

.key.absent {
background-color: #3a3a3c;
color: #888;
border-color: #3a3a3c;
box-shadow: none;
}

.key:focus {
outline: 2px solid #00f5d4;
outline-offset: 2px;
}
}

/* ==========================================================
🔮 Mobile Clue Popup
========================================================== */
#clue-popup {
position: fixed;
bottom: 0; left: 0; right: 0;
background-color: #1a1a2e;
border-top: 3px solid #ff2e63;
border-radius: 12px 12px 0 0;
padding: 20px;
transform: translateY(100%);
transition: transform 0.3s ease;
z-index: 1000;
}

#clue-popup.active {
transform: translateY(0);
}

.popup-content {
text-align: center;
}

.clue-btn {
display: block;
width: 100%;
margin: 0.5rem 0;
padding: 10px;
background-color: #222;
border: 2px solid #3a3a3c;
border-radius: 8px;
color: #fff;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.2s ease, transform 0.2s ease;
}

.clue-btn:hover {
background-color: #333;
transform: translateY(-2px);
}

.clue-result {
margin-top: 10px;
font-size: 0.9rem;
color: #ffcc00;
}

.clue-icon {
position: fixed;
bottom: 20px;
right: 20px;
background-color: #ff2e63;
color: #fff;
border: none;
border-radius: 50%;
font-size: 1.5rem;
padding: 15px;
cursor: pointer;
box-shadow: 0 0 10px #ff2e63;
transition: transform 0.2s ease;
}

.clue-icon:hover {
transform: scale(1.1);
}

#close-clue-popup {
margin-top: 15px;
padding: 8px 16px;
background-color: #ff1f4f;
color: #fff;
border: none;
border-radius: 6px;
cursor: pointer;
transition: background-color 0.2s ease;
}

#close-clue-popup:hover {
background-color: #ff9f1c;
}

/* ==========================================================
🧠 Responsive Visibility Rules
========================================================== */
/* Desktop only */
@media (min-width: 769px) {
#sidebar { display: flex; }
#clue-popup,
#btn-clue-popup { display: none !important; }
#mobile-score { display: none; }
}

/* Mobile only */
@media (max-width: 768px) {
#sidebar { display: none; }
#clue-popup,
#btn-clue-popup { display: block; }
}

/* ==========================================================
📱 Small Phones Layout (≤480px)
========================================================== */
@media (max-width: 480px) {

#app-wrapper {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
min-height: 100vh;
overflow-y: auto;
padding: 0;
}


.guess-row {
grid-template-columns: repeat(5, minmax(40px, 1fr));
gap: 4px;
}


.tile {
height: 48px;
font-size: 1.4rem;
line-height: 48px;
border-radius: 5px;
}


#keyboard {
max-width: 340px;
padding: 0 3px;
}


.key-row {
grid-template-columns: repeat(10, 1fr);
gap: 1px;
max-width: 340px;
margin: 0 auto;
}


.key {
height: 40px;
font-size: 0.9rem;
flex: 0 0 calc(10% - 3px);
max-width: 32px;
}


.key.wide {
flex: 0 0 calc(20% - 3px);
max-width: 70px;
height: 42px;
}

#sidebar {
margin-top: 0.75rem;
gap: 16px;
}


#main-header h1 {
font-size: 1.6rem;
text-shadow: 0 0 6px rgba(255, 46, 99, 0.6);
}

#modal-content {
width: 95%;
padding: 12px;
}
}