/* ================================================================
   brand.css — LettersSay Design System
   One file. All 32 games inherit from here.
   Never edit per-game; extend with game-specific stylesheets.
   ================================================================ */

:root {
  /* ── Backgrounds ── */
  --bg:          #FAFAF8;
  --bg-card:     #FFFFFF;
  --bg-subtle:   #F2F2EE;
  --bg-hover:    #ECECEA;

  /* ── Pastel Tile Colors ── */
  --tile-coral:       #FF8F7E;
  --tile-coral-deep:  #E06B5A;
  --tile-coral-text:  #6B1E14;

  --tile-mint:        #7EEFC0;
  --tile-mint-deep:   #42D49A;
  --tile-mint-text:   #0A4228;

  --tile-sky:         #72D4F5;
  --tile-sky-deep:    #3ABAED;
  --tile-sky-text:    #063350;

  --tile-yellow:      #FFE04A;
  --tile-yellow-deep: #DDB800;
  --tile-yellow-text: #5A3D00;

  /* ── Brand ── */
  --brand:         #FF7B5E;
  --brand-dark:    #E86348;
  --brand-darker:  #C44930;
  --brand-blue:    #5B8DEF;
  --brand-green:   #6BCF9E;

  /* ── Text ── */
  --text:          #1C1C1E;
  --text-2:        #48484A;
  --text-3:        #6E6E73;
  --text-muted:    #8E8E93;
  --text-white:    #FFFFFF;

  /* ── Scrabble Value Colors ── */
  --score-common: #27AE60;   /* 1–2 pts  */
  --score-medium: #E67E22;   /* 3–4 pts  */
  --score-rare:   #E74C3C;   /* 5–8 pts  */
  --score-ultra:  #9B59B6;   /* 10 pts   */

  /* ── Borders ── */
  --border:       #E5E5EA;
  --border-2:     #C7C7CC;

  /* ── Radii ── */
  --r-xs:   6px;
  --r-sm:   10px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-full: 9999px;

  /* ── Shadows ── */
  --shadow-tile:  0 3px 0 rgba(0,0,0,0.18), 0 1px 5px rgba(0,0,0,0.10);
  --shadow-card:  0 2px 12px rgba(0,0,0,0.07);
  --shadow-float: 0 8px 32px rgba(0,0,0,0.14);

  /* ── Spacing scale ── */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;

  /* ── Typography ── */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --tx-xs:   11px;
  --tx-sm:   13px;
  --tx-base: 15px;
  --tx-md:   17px;
  --tx-lg:   20px;
  --tx-xl:   24px;
  --tx-2xl:  30px;
  --tx-3xl:  38px;

  /* ── Motion ── */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur:  150ms;

  /* ── Layout ── */
  --max-w:      1200px;
  --game-w:     900px;
  --sidebar-w:  300px;
  --header-h:   64px;
}

/* ================================================================
   RESET
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: var(--tx-base);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
input { font-family: var(--font); }

/* ================================================================
   LAYOUT
   ================================================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s4);
}
.game-container {
  max-width: var(--game-w);
  margin: 0 auto;
  padding: 0 var(--s4);
}

/* ================================================================
   HEADER
   ================================================================ */
.site-header {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--s2);
  text-decoration: none !important;
  flex-shrink: 0;
}
.logo-tiles {
  display: flex;
  gap: 3px;
}
.logo-t {
  width: 26px; height: 26px;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}
.logo-t:nth-child(1) { background: var(--tile-coral);  color: var(--tile-coral-text); }
.logo-t:nth-child(2) { background: var(--tile-mint);   color: var(--tile-mint-text); }
.logo-t:nth-child(3) { background: var(--tile-sky);    color: var(--tile-sky-text); }
.logo-t:nth-child(4) { background: var(--tile-yellow); color: var(--tile-yellow-text); }
.logo-name {
  font-size: var(--tx-lg);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
}
.logo-name em { color: var(--brand); font-style: normal; }

/* Nav */
.site-nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  font-size: var(--tx-sm);
  font-weight: 500;
  color: var(--text-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
}
.nav-link:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--brand); font-weight: 600; }

/* Dropdown */
.nav-drop { position: relative; }
.nav-drop-menu {
  display: none;
  position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-float);
  min-width: 200px;
  padding: var(--s2);
  z-index: 300;
}
.nav-drop:hover .nav-drop-menu,
.nav-drop:focus-within .nav-drop-menu { display: block; }
.drop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-xs);
  font-size: var(--tx-sm);
  color: var(--text-2);
  transition: background var(--dur) var(--ease);
}
.drop-item:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }
.drop-item.disabled { opacity: 0.45; pointer-events: none; }
.soon-chip {
  font-size: 10px; font-weight: 700;
  background: var(--bg-subtle); color: var(--text-muted);
  padding: 2px 7px; border-radius: var(--r-full);
}

/* ================================================================
   LETTER TILES  — the core visual primitive
   ================================================================ */
.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-tile);
  font-weight: 800;
  user-select: none;
  cursor: default;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  letter-spacing: 0;
}
.tile-val {
  position: absolute; bottom: 3px; right: 4px;
  font-size: var(--tx-xs); font-weight: 700; opacity: 0.65; line-height: 1;
}

/* Sizes */
.tile-xl { width: 64px; height: 64px; font-size: 28px; border-radius: 12px; }
.tile-lg { width: 56px; height: 56px; font-size: 24px; border-radius: 11px; }
.tile-md { width: 44px; height: 44px; font-size: 18px; border-radius: 9px; }
.tile-sm { width: 36px; height: 36px; font-size: 15px; border-radius: 8px; }
.tile-xs { width: 28px; height: 28px; font-size: 12px; border-radius: 6px; }

/* Color variants */
.tile-coral  { background: var(--tile-coral);  color: var(--tile-coral-text); }
.tile-mint   { background: var(--tile-mint);   color: var(--tile-mint-text); }
.tile-sky    { background: var(--tile-sky);    color: var(--tile-sky-text); }
.tile-yellow { background: var(--tile-yellow); color: var(--tile-yellow-text); }

/* Keyboard key coloring by Scrabble value */
.key-common { background: #E8F5E9; color: #2E7D32; } /* 1-2 pts */
.key-medium { background: #FFF3E0; color: #BF360C; } /* 3-4 pts */
.key-rare   { background: #FCE4EC; color: #880E4F; } /* 5-8 pts */
.key-ultra  { background: #F3E5F5; color: #4A148C; } /* 10 pts  */

/* Clickable tile behavior */
.tile-btn {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tile-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 rgba(0,0,0,0.18), 0 3px 8px rgba(0,0,0,0.12);
}
.tile-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,0.15); }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s2);
  padding: 12px 24px;
  border-radius: var(--r-full);
  font-size: var(--tx-base); font-weight: 600;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 0 var(--brand-dark), 0 2px 10px rgba(255,123,94,0.30);
}
.btn-primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 2px 0 var(--brand-darker), 0 2px 10px rgba(255,123,94,0.30);
  transform: translateY(2px);
}
.btn-primary:active { transform: translateY(3px); box-shadow: 0 0 0 var(--brand-darker); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-2);
  border: 1.5px solid var(--border-2);
  box-shadow: var(--shadow-card);
}
.btn-secondary:hover { background: var(--bg-subtle); color: var(--text); }

.btn-ghost {
  background: transparent;
  color: var(--text-3);
  padding: 8px 14px;
  font-size: var(--tx-sm);
}
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text-2); }

.btn-lg  { padding: 16px 36px; font-size: var(--tx-md); }
.btn-sm  { padding: 8px 16px;  font-size: var(--tx-sm); }
.btn-xl  { padding: 18px 44px; font-size: var(--tx-lg); border-radius: var(--r-full); }

.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s6);
  box-shadow: var(--shadow-card);
}
.card-sm { padding: var(--s4); border-radius: var(--r-md); }
.card-title { font-size: var(--tx-lg); font-weight: 700; }

/* ================================================================
   PILLS / FILTER CHIPS
   ================================================================ */
.pill {
  display: inline-flex; align-items: center;
  padding: 6px 16px;
  border-radius: var(--r-full);
  font-size: var(--tx-sm); font-weight: 600;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.pill:hover { border-color: var(--brand); color: var(--brand); }
.pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: var(--tx-xs); font-weight: 700;
}
.badge-len  { background: var(--bg-subtle); color: var(--text-3); }
.badge-pts  { background: #E8F5E9; color: var(--score-common); }
.badge-pts.m { background: #FFF3E0; color: var(--score-medium); }
.badge-pts.r { background: #FCE4EC; color: var(--score-rare); }
.badge-pts.u { background: #F3E5F5; color: var(--score-ultra); }

/* ================================================================
   AD ZONES — empty placeholders; AdSense injected later
   ================================================================ */
.ad-zone {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-subtle);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: var(--tx-xs); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.06em;
  overflow: hidden;
}
.ad-zone:empty::after { content: 'Advertisement'; }

/* Top banner — 728×90 desktop / 320×50 mobile */
.ad-top { width: 100%; height: 90px; margin: var(--s3) 0; }

/* Sidebar — 300×250 */
.ad-sidebar { width: var(--sidebar-w); min-height: 250px; flex-shrink: 0; }

/* Bottom banner */
.ad-bottom { width: 100%; height: 90px; margin: var(--s8) 0 var(--s3); }

@media (max-width: 740px) {
  .ad-top, .ad-bottom { height: 50px; }
  .ad-sidebar { display: none; }
}

/* ================================================================
   FOOTER
   ================================================================ */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: var(--s6) 0;
  margin-top: auto;
}
.footer-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--s3); text-align: center;
}
.footer-links {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--s1) var(--s4);
}
.footer-link { font-size: var(--tx-sm); color: var(--text-muted); }
.footer-link:hover { color: var(--text-2); }
.footer-ai {
  font-size: var(--tx-xs); color: var(--text-muted);
  display: flex; align-items: center; gap: var(--s1);
}
.footer-tagline { font-size: var(--tx-sm); color: var(--text-muted); font-style: italic; }
.footer-copy { font-size: var(--tx-xs); color: var(--text-muted); }

/* ================================================================
   GAME LAYOUT — main + optional sidebar
   ================================================================ */
.game-layout {
  display: flex;
  gap: var(--s6);
  align-items: flex-start;
  max-width: var(--game-w);
  margin: 0 auto;
  padding: var(--s6) var(--s4);
}
.game-main   { flex: 1; min-width: 0; }
.game-side   { flex-shrink: 0; display: flex; flex-direction: column; gap: var(--s4); }

@media (max-width: 720px) {
  .game-side { display: none; }
  .game-layout { padding: var(--s4) var(--s3); }
}

/* ================================================================
   RESULT ROWS
   ================================================================ */
.result-list { display: flex; flex-direction: column; gap: 6px; }
.result-row {
  display: flex; align-items: center; gap: var(--s3);
  padding: 10px var(--s4);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  animation: rowIn 180ms var(--ease) both;
}
.result-row:hover { background: var(--bg-subtle); border-color: var(--border-2); }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity:1; transform: translateY(0); } }
.result-word {
  font-size: var(--tx-md); font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; flex: 1;
}
.result-badges { display: flex; gap: 5px; margin-left: auto; flex-shrink: 0; }

/* Best word */
.result-best {
  background: linear-gradient(135deg, #FFFDE7, #FFF9C4);
  border-color: var(--tile-yellow-deep);
  border-width: 2px;
}
.result-best .result-word { color: #5D4200; }

/* ================================================================
   HOMEPAGE — HERO
   ================================================================ */
.hero {
  text-align: center;
  padding: var(--s12) var(--s4) var(--s10);
}
.hero-tiles {
  display: flex; justify-content: center; gap: var(--s2);
  margin-bottom: var(--s6); flex-wrap: wrap;
}
.hero-headline {
  font-size: clamp(var(--tx-2xl), 5vw, var(--tx-3xl));
  font-weight: 800; line-height: 1.15;
  margin-bottom: var(--s3); letter-spacing: -0.5px;
}
.hero-sub {
  font-size: var(--tx-md); color: var(--text-2);
  max-width: 480px; margin: 0 auto var(--s6); line-height: 1.6;
}

/* ================================================================
   GAMES GRID
   ================================================================ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s4);
}
.game-card {
  display: flex; flex-direction: column; gap: var(--s3);
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s5);
  box-shadow: var(--shadow-card);
  text-decoration: none; color: inherit;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-float); border-color: var(--border-2); text-decoration: none; }
.game-card.coming { opacity: 0.62; cursor: default; pointer-events: none; }
.gc-icon  { font-size: 32px; line-height: 1; }
.gc-title { font-size: var(--tx-md); font-weight: 700; }
.gc-desc  { font-size: var(--tx-sm); color: var(--text-2); line-height: 1.5; flex: 1; }
.gc-tag {
  display: inline-block; padding: 3px 10px; border-radius: var(--r-full);
  font-size: var(--tx-xs); font-weight: 700; width: fit-content;
  background: #E8F5E9; color: #2E7D32;
}
.gc-tag.soon { background: var(--bg-subtle); color: var(--text-muted); }

/* ================================================================
   EMPTY / LOADING STATES
   ================================================================ */
.empty-state {
  text-align: center; padding: var(--s10) var(--s6); color: var(--text-muted);
}
.empty-icon  { font-size: 48px; margin-bottom: var(--s4); }
.empty-title { font-size: var(--tx-lg); font-weight: 700; color: var(--text-2); margin-bottom: var(--s2); }
.empty-desc  { font-size: var(--tx-sm); line-height: 1.6; }

/* ================================================================
   SECTION
   ================================================================ */
.section { padding: var(--s10) 0; }
.section-title { font-size: var(--tx-xl); font-weight: 800; margin-bottom: var(--s2); }
.section-sub   { font-size: var(--tx-base); color: var(--text-2); margin-bottom: var(--s6); }

/* ================================================================
   UTILITY
   ================================================================ */
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--s2); }
.gap-3 { gap: var(--s3); }
.gap-4 { gap: var(--s4); }
.mt-4  { margin-top: var(--s4); }
.mt-6  { margin-top: var(--s6); }
.w-full { width: 100%; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }

/* ================================================================
   MOBILE BREAKPOINTS
   ================================================================ */
@media (max-width: 540px) {
  :root { --header-h: 56px; }
  .site-nav .nav-link { padding: var(--s2) 10px; font-size: var(--tx-xs); }
  .tile-xl { width: 52px; height: 52px; font-size: 22px; }
  .tile-lg { width: 46px; height: 46px; font-size: 20px; }
  .hero { padding: var(--s8) var(--s3) var(--s6); }
  .games-grid { grid-template-columns: 1fr 1fr; gap: var(--s3); }
  .game-card { padding: var(--s4); }
}
@media (max-width: 360px) {
  .games-grid { grid-template-columns: 1fr; }
  .tile-xl { width: 46px; height: 46px; font-size: 19px; }
}
