/* ── Catppuccin Mocha palette ──────────────────────────────── */
:root {
  --base:     #1e1e2e;
  --mantle:   #181825;
  --crust:    #11111b;
  --surface0: #313244;
  --surface1: #45475a;
  --overlay:  #6c7086;
  --text:     #cdd6f4;
  --subtext:  #a6adc8;
  --lavender: #b4befe;
  --blue:     #89b4fa;
  --mauve:    #cba6f7;
  --peach:    #fab387;
  --yellow:   #f9e2af;
  --green:    #a6e3a1;
  --teal:     #94e2d5;
}

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

body {
  background-color: var(--base);
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(203,166,247,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(137,180,250,0.08) 0%, transparent 60%);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  min-height: 100vh;
  padding: 60px 20px 20px;
}

/* ── Hamburger button ──────────────────────────────────────── */
.hamburger {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 100;
  background: rgba(49, 50, 68, 0.6);
  border: 1px solid rgba(180, 190, 254, 0.2);
  color: var(--lavender);
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.hamburger:hover {
  background: rgba(180, 190, 254, 0.15);
  border-color: rgba(180, 190, 254, 0.4);
}

/* ── Nav overlay ───────────────────────────────────────────── */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: rgba(24, 24, 37, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(180, 190, 254, 0.15);
  z-index: 200;
  padding: 60px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--overlay);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  margin: 0;
}

.nav-close:hover {
  color: var(--lavender);
  background: transparent;
  border: none;
  box-shadow: none;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  color: var(--subtext);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 2px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.2s;
  text-transform: uppercase;
}

.nav-link:hover {
  color: var(--lavender);
  border-color: rgba(180, 190, 254, 0.3);
  background: rgba(180, 190, 254, 0.05);
}

.nav-link.active {
  color: var(--lavender);
  border-color: rgba(180, 190, 254, 0.3);
  background: rgba(180, 190, 254, 0.08);
}

/* ── Game page layout ──────────────────────────────────────── */
.page-layout {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding-top: 0;
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

/* ── About page layout ─────────────────────────────────────── */
.about-layout {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Side panel (leaderboard) ──────────────────────────────── */
.side-panel {
  width: 180px;
  min-width: 180px;
  max-width: 180px;   /* NEW: locks it so .glass width:100% can't expand it */
  flex-shrink: 0;
  flex-grow: 0;       /* NEW: never grows beyond 180px */
  padding: 16px;
}

/* ── Glass card ────────────────────────────────────────────── */
.glass {
  background: rgba(49, 50, 68, 0.4);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(180, 190, 254, 0.15);
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.07);
  padding: 20px;
  /* REMOVED: width: 100% — was making the leaderboard expand full width */
}

/* NEW: only glass cards inside the game column get full width */
.main-area .glass {
  width: 100%;
}

/* ── Title ─────────────────────────────────────────────────── */
h1 {
  font-size: 2rem;
  letter-spacing: 10px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--mauve), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  text-align: center;
}

h2 {
  color: var(--lavender);
  font-size: 1rem;
  margin-bottom: 14px;
  letter-spacing: 2px;
}

p {
  color: var(--subtext);
  line-height: 1.8;
  margin-bottom: 12px;
  font-size: 0.88rem;
}

/* ── Buttons ───────────────────────────────────────────────── */
button {
  background: rgba(180, 190, 254, 0.12);
  color: var(--lavender);
  border: 1px solid rgba(180, 190, 254, 0.25);
  padding: 7px 16px;
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  margin: 3px;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

button:hover {
  background: rgba(180, 190, 254, 0.25);
  border-color: rgba(180, 190, 254, 0.5);
  box-shadow: 0 0 16px rgba(180, 190, 254, 0.2);
}

button:disabled {
  background: rgba(108, 112, 134, 0.1);
  color: var(--overlay);
  border-color: rgba(108, 112, 134, 0.2);
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Controls ──────────────────────────────────────────────── */
.controls {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

/* ── Letter board ──────────────────────────────────────────── */
#letter-board {
  display: flex;
  gap: 6px;
  margin: 8px 0;
  flex-wrap: nowrap;
  justify-content: center;
  min-height: 60px;
}

.tile {
  width: 52px;
  height: 52px;
  background: rgba(249, 226, 175, 0.12);
  border: 1px solid rgba(249, 226, 175, 0.3);
  backdrop-filter: blur(12px);
  color: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  border-radius: 10px;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ── Timer ─────────────────────────────────────────────────── */
#timer {
  font-size: 3.5rem;
  font-weight: bold;
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--peach), var(--yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 4px 0;
  text-align: center;
  width: 100%;
}

/* ── Inputs ────────────────────────────────────────────────── */
input[type="text"],
input[type="number"] {
  background: rgba(49, 50, 68, 0.5);
  border: 1px solid rgba(180, 190, 254, 0.25);
  color: var(--text);
  padding: 8px 14px;
  font-size: 0.9rem;
  font-family: 'JetBrains Mono', monospace;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]       { width: 200px; }
input[type="number"]     { width: 70px; text-align: center; }

input:focus {
  border-color: rgba(180, 190, 254, 0.6);
  box-shadow: 0 0 12px rgba(180, 190, 254, 0.15);
}

input::placeholder { color: var(--overlay); }

label {
  color: var(--subtext);
  font-size: 0.85rem;
}

/* ── Feedback ──────────────────────────────────────────────── */
#feedback {
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 2px;
  min-height: 22px;
  margin: 4px 0;
}

#feedback.valid   { color: var(--green); }
#feedback.invalid { color: #f38ba8; }

/* ── Bottom row ────────────────────────────────────────────── */
.bottom-row {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  align-items: flex-start;
}

.bottom-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.bottom-col.center { align-items: center; }

.col-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--overlay);
}

#score-display {
  font-size: 2rem;
  font-weight: bold;
  color: var(--green);
  letter-spacing: 2px;
}

/* ── Submitted words ───────────────────────────────────────── */
#submitted-words {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.submitted-word {
  background: rgba(166, 227, 161, 0.1);
  border: 1px solid rgba(166, 227, 161, 0.3);
  color: var(--green);
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  letter-spacing: 1px;
}

/* ── Best words ────────────────────────────────────────────── */
#best-words-list {
  font-size: 0.8rem;
  color: var(--teal);
  letter-spacing: 1px;
  line-height: 1.6;
}

/* ── Save score form ───────────────────────────────────────── */
#save-score-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(180, 190, 254, 0.1);
}

.hidden { display: none; }

/* ── Leaderboard ───────────────────────────────────────────── */
.history-entry {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(180, 190, 254, 0.1);
}

.history-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.history-rank  { color: var(--overlay); font-size: 0.65rem; }
.history-name  { color: var(--lavender); font-weight: bold; font-size: 0.8rem; flex: 1; }
.history-score { color: var(--green); font-weight: bold; font-size: 0.8rem; }
.history-words { color: var(--subtext); font-size: 0.65rem; }
.history-date  { color: var(--overlay); font-size: 0.6rem; }

/* ── Stats row (about page) ────────────────────────────────── */
.stats-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 130px;
  background: rgba(180, 190, 254, 0.07);
  border: 1px solid rgba(180, 190, 254, 0.15);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--mauve);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--subtext);
  text-align: center;
  line-height: 1.5;
}

/* ── Links ─────────────────────────────────────────────────── */
a {
  color: var(--lavender);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover { opacity: 0.8; }

/* ── Nav divider ───────────────────────────────────────────── */
.nav-divider {
  height: 1px;
  background: rgba(180, 190, 254, 0.1);
  margin: 12px 0;
}