/* ===================== THEME VARS ===================== */
/* Default: dark (can be overridden by [data-theme] on <html>) */
:root{
  --brand:#497f64;
  --ws-cols: 5;

  /* Dark */
  --bg:#000000;
  --text:#ffffff;
  --muted:#a5b3a8;
  --border:#2a2d31;
  --btnBg:#12161a;

  --tile:#0f1214;
  --tileFilled:#111419;

  --tileSize: clamp(40px, min(9.2vw, (100vw - 64px)/7), 56px);

  --correct:#2ea043;
  --present:#e3b341;
  --absent:#3a3f45;

  --link-color:#ffffff;
  --link-hover-color:#ffffff;

  --glass:#0e1115cc;
  --card:#111419;
  --shadow: 0 12px 32px rgba(0,0,0,.45);
  --bubbleShadow: 0 6px 18px rgba(0,0,0,.35);
}

/* Light theme overrides */
:root[data-theme="light"]{
  --bg: #ffffff;
  --text:#0b0d0f;
  --muted:#5c636a;
  --border:#d5d9df;
  --btnBg:#ffffff;

  --tile:#ffffff;
  --tileFilled:#f0f3f6;

  --absent:#cbd3dc;

  --glass:#ffffffcc;
  --card:#ffffff;
  --shadow: 0 10px 26px rgba(0,0,0,.08);
  --bubbleShadow: 0 8px 16px rgba(0,0,0,.10);
  --brand-green-msg:#3b6d52;

  --link-color:var(--brand);
  --link-hover-color:#2f5e45;

}

:root[data-theme="dark"]{
  --bg:#000000;
  --link-color:#ffffff;
  --link-hover-color:#ffffff;
}

/* ===================== GLOBAL ===================== */
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  overflow-x:hidden;
}

a:not(.wh-btn):not(.ws-btn){
  color:var(--link-color);
  text-decoration:underline;
  transition:opacity .15s ease;
}

a:not(.wh-btn):not(.ws-btn):hover{
  color:var(--link-hover-color);
  opacity:.85;
}

[hidden]{
  display:none!important;
}

.ws-install-btn{
  margin-top:8px;
  padding:10px 16px;
  border-radius:999px;
  font-size:0.9rem;
  font-weight:500;
  border:1px solid var(--border, #2a2d31);
  background:var(--btnBg, #12161a);
  color:var(--text, #ffffff);
  cursor:pointer;
}

.ws-settings-item{
  width:100%;
  text-align:center;
}

.ws-install-btn:hover{
  filter:brightness(1.08);
}

.ws-install-hint{
  margin-top:4px;
  font-size:0.8rem;
  color:var(--muted, #a5b3a8);
}

/* App-controlled backdrop (overrides host CMS/page bg) */
.ws-page-bg{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;

  /* Base background from theme */
  background-color:var(--bg);

  /* Optional very subtle vignette behind game (safe & non-busy) */
  background-image:
    radial-gradient(circle at top center,
      rgba(73,127,100,0.10),
      transparent 60%
    );
  background-repeat:no-repeat;
}

/* ===================== TOP BAR ===================== */
.ws-topbar{
  position:sticky; top:0; z-index:40; width:100%;
  background:var(--glass);
  backdrop-filter: blur(6px);
  border-bottom:1px solid var(--border);
}
.ws-topbar-inner{
  max-width:920px; margin:0 auto; padding:10px 16px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.ws-brand{
  display:flex; align-items:center; gap:10px;
  font:800 18px/1 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  letter-spacing:.3px;
}
.ws-brand-link{
  display:inline-flex;
  align-items:center;
  text-decoration:none;
  color:inherit;
}

/* Old dot (unused now, but safe to keep) */
.ws-brand .dot{
  width:10px; height:10px; border-radius:50%;
  background:var(--brand); display:inline-block;
}

.ws-actions{ display:flex; align-items:center; gap:8px; }
.icon-btn{
  display:grid; place-items:center;
  width:38px; height:38px; padding:3px; box-sizing:border-box;
  border-radius:10px; border:1px solid var(--border); background:var(--btnBg);
  cursor:pointer; line-height:0;
}
.icon-btn svg{ width:20px; height:20px; stroke:currentColor; color:var(--text); overflow:visible; stroke-linecap:round; stroke-linejoin:round; }

/* ===================== HUD ===================== */
/* Game container – support legacy #game and new #game-root */
#game,
#game-root{
  position:relative;
  z-index:1;
  width:100%;
  max-width:720px;
  margin:24px auto 48px;
  padding:0 16px 48px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:16px;
}

#play #game-root{
  margin-left:auto;
  margin-right:auto;
  max-width:720px;
}
.ws-hud{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin:16px auto 8px;
  max-width:720px;
  padding:0 16px;
  box-sizing:border-box;
}

.ws-hud-right{
  display:flex;
  gap:8px;
  align-items:center;
}

.ws-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  font:600 14px/1 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  border:1px solid var(--border);
  background:var(--card);
  color:var(--text);
  gap:6px;
}

/*
 * HUD + layout adjustments
 * ------------------------
 * Keep ≤430px rules scoped to the HUD/grid/keyboard so it is clear where
 * we tailor the narrow-phone experience. Broader mobile adjustments live
 * farther down the file with the same breakpoint.
  */
@media (max-width: 430px){
  :root{
    --tileSize: clamp(30px, 8.6vw, 42px);
  }

  #play #game-root{
    padding-left:0;
    padding-right:0;
  }

  #game,
  #game-root{
    margin:16px auto 32px;
    padding:0 8px 32px;
    gap:12px;
  }

  /* Keep Level / Score / Streak in a single horizontal row on mobile */
  .ws-hud{
    flex-direction:row;        /* row instead of column */
    align-items:center;
    justify-content:center;    /* center the whole group */
    gap:6px;
    padding:0 8px;
    margin:12px auto 4px;
    flex-wrap:nowrap;          /* keep them on one line if possible */
  }

  .ws-hud-right{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    flex-wrap:nowrap;          /* keep Score + Streak together */
  }

  .ws-tag{
    text-align:center;
    flex:0 1 auto;
    max-width:100%;
  }

  .ws-stage{
    padding:0 8px;
    margin-top:4px;
    gap:10px;
  }

  .ws-kb{
    padding:0 8px;
    max-width:100%;
    margin-left:auto;
    margin-right:auto;
    margin-top:0;
  }

  .ws-kb-row{
    justify-content:center;
  }

  /* Bigger keyboard keys on mobile */
  .ws-kb-key{
    height:64px;          /* previously ~52px — now larger for easier tapping */
    font-size:17px;       /* slightly larger key labels */
    border-radius:8px;    /* soften for touch screens */
  }

  /* "Enter" and "Backspace" also scale proportionally */
  .ws-kb-key[data-key="ENTER"],
  .ws-kb-key[data-key="BACK"],
  .ws-kb-key[data-key="←"]{
    height:64px;
    padding-left:10px;
    padding-right:10px;
  }
}

@media (max-width:360px){
  .ws-tag{
    font-size:13px;
    padding:3px 6px;
  }
}

@keyframes ws-pulse{ 0%{transform:scale(1)} 40%{transform:scale(1.07)} 100%{transform:scale(1)} }
.ws-tag.pulse{ animation: ws-pulse 260ms ease; }

/* ===================== STAGE ===================== */
.ws-stage{
  position:relative;
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
  margin:16px auto 0;
  max-width:720px;
  width:auto;
  padding:0 16px;
  box-sizing:border-box;

  /* Reserve room for the Hint Bee on the right (desktop/tablet) */
  padding-right:56px;
}

/* ===================== GRID ===================== */
.ws-grid{
  display:grid;
  justify-content:center;
  gap:8px;
  margin:0 auto 16px;
}
.ws-row{
  display:grid;
  gap:8px;
  grid-template-columns:repeat(var(--ws-cols), var(--tileSize));
}
.ws-tile{
  width:var(--tileSize); height:var(--tileSize);
  border:1px solid var(--border); border-radius:8px;
  display:grid; place-items:center;
  font-weight:700; text-transform:uppercase;
  background:var(--tile); color:var(--text);
  user-select:none;
  transition:transform .06s ease, background .15s ease, border-color .15s ease;
  transform-style:preserve-3d;
}
.ws-tile.active{ outline:2px solid var(--brand); outline-offset:-2px; }
.ws-tile.filled{ background:var(--tileFilled); border-color:#3a3f45; }
:root[data-theme="light"] .ws-tile.filled{ border-color:var(--border); }
.ws-row.ws-locked .ws-tile{ opacity:.9; }

.ws-tile.state-correct{ background:var(--correct); border-color:var(--correct); color:#000; }
.ws-tile.state-present{ background:var(--present); border-color:var(--present); color:#000; }
.ws-tile.state-absent{  background:var(--absent);  border-color:#000; color:var(--text); }

@keyframes ws-flip-1{ 0%{transform:rotateX(0)} 49%{transform:rotateX(90deg)} 51%{transform:rotateX(90deg)} 100%{transform:rotateX(0)} }
.ws-tile.flip{ animation: ws-flip-1 420ms ease var(--flip-delay,0ms) both; }

@keyframes ws-shake{ 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
.ws-row.shake .ws-tile{ animation:ws-shake 120ms linear 0s 2; }

/* ===================== KEYBOARD ===================== */
/* Centered, responsive keyboard */
.ws-kb{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin:0 auto 24px;
  max-width:720px;
  padding:0 16px;
  box-sizing:border-box;
  -webkit-tap-highlight-color:transparent;
}

.ws-kb-row{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:4px;
}

.ws-kb-key{
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  font:600 14px/1 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  padding:12px 10px;
  min-width:34px;
  border-radius:8px;
  border:1px solid var(--border);
  background:var(--btnBg);
  color:var(--text);
  cursor:pointer;
  user-select:none;
  touch-action:manipulation;
}
.ws-kb-key:active{ transform:translateY(1px) }
.ws-kb-enter{ padding:12px 14px; }
.ws-kb-back{  padding:12px 14px; }

@media (max-width:380px){
  .ws-kb-row{
    flex-wrap:wrap;
    justify-content:center;
    gap:4px;
  }

  .ws-kb-key{
    flex: 0 1 calc(9% + 10px);
  }
}

.ws-kb-key.k-correct{ background:var(--correct); border-color:var(--correct); color:#000; }
.ws-kb-key.k-present{ background:var(--present); border-color:var(--present); color:#000; }
.ws-kb-key.k-absent{  background:var(--absent);  border-color:#000; color:var(--text); }

/* Desktop: give Enter/Back more room so label/icon stay centered */
@media (min-width:431px){
  .ws-kb-enter,
  .ws-kb-back{
    min-width:72px;
    padding:12px 18px;
  }
}

/* Unified, responsive system message bubbles (errors + hints) */
.ws-bubble,
.ws-streak-toast{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%, -50%) scale(0.96);
  background:var(--brand-green-msg, var(--brand));
  color:#ffffff;
  border:1px solid var(--brand);
  border-radius:12px;
  padding:12px 18px;
  font:700 14px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  box-shadow:0 8px 16px rgba(0,0,0,0.25);
  z-index:200;
  opacity:0;
  pointer-events:none;

  /* ✅ Wider, but still responsive */
  max-width:min(440px, 92vw);  /* was ~320px before */
  text-align:center;
  white-space:normal;          /* allow normal wrapping */
  word-break:normal;
  transition:opacity .22s ease, transform .22s ease;
}

.ws-bubble.show,
.ws-streak-toast.show{
  opacity:1;
  transform:translate(-50%, -50%) scale(1);
  pointer-events:auto;
}

.ws-bubble.show{
  animation: ws-bubble-fade 1.4s ease-out forwards;
}

@keyframes ws-bubble-fade {
  0%   { opacity:1; transform:translate(-50%, -50%) scale(1); }
  82%  { opacity:1; transform:translate(-50%, -50%) scale(1); }
  100% { opacity:0; transform:translate(-50%, -50%) scale(0.96); }
}

/* Hint/streak toast extra text styling */
.ws-streak-toast .sub{
  display:block;
  margin-top:4px;
  font:600 13px/1.35 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--muted);
}

.ws-streak-toast .row{
  margin-top:8px;
  display:flex;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
}

/* Centered Hint Popup */
.ws-hint-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5000;

  max-width: 90%;
  width: 320px;
  background: var(--brand);
  color: #fff;

  border-radius: 14px;
  padding: 20px 18px;
  text-align: center;
  font: 600 16px/1.4 system-ui, -apple-system, Arial;

  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.ws-hint-popup.show {
  opacity: 1;
  pointer-events: auto;
}

.ws-hint-popup[hidden] {
  display: none !important;
  pointer-events: none !important;
}

/* Close button */
.ws-hint-popup button.ws-hint-close {
  margin-top: 16px;
  width: 100%;
  padding: 10px 0;
  background: #fff;
  color: var(--brand);
  border: none;
  border-radius: 8px;
  font: 600 15px system-ui, -apple-system, Arial;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.ws-hint-popup button.ws-hint-close:hover {
  background: #f3f3f3;
}

/* 📱 Mobile fine-tune: slightly smaller text + almost full width */
@media (max-width:480px){
  .ws-bubble,
  .ws-streak-toast{
    font-size:13px;
    padding:10px 14px;
    max-width:94vw;
  }
}

/* Anchored streak tooltip */
.ws-streak-tip{
  position:fixed; background:var(--card); color:var(--text);
  border:1px solid var(--border); border-radius:12px; padding:10px 12px;
  font:600 13px/1.35 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  box-shadow:var(--bubbleShadow); z-index:56; opacity:0; transform:translateY(-6px);
  transition:opacity .16s ease, transform .16s ease; max-width:260px;
}
.ws-streak-tip.show{ opacity:1; transform:translateY(0); }
.ws-streak-tip .row{ display:flex; gap:8px; margin-top:8px; }
.ws-streak-tip .ws-btn{ padding:8px 10px; }

/* ===================== MODALS / CARDS ===================== */
.ws-modal, .ws-endcard{
  position:fixed; inset:0; background:rgba(0,0,0,.6);
  display:flex; align-items:center; justify-content:center; z-index:50;
}
:root[data-theme="light"] .ws-modal, :root[data-theme="light"] .ws-endcard{ background:rgba(8,10,12,.35); }
.ws-modal .card, .ws-endcard .card{
  width:min(92vw,560px); background:var(--card); border:1px solid var(--border);
  border-radius:16px; padding:20px; box-shadow:var(--shadow);
}
.ws-endcard .ws-endcard-invite{
  margin:8px 0 4px;
  color:var(--muted);
  font-size:14px;
}
.ws-modal h3, .ws-endcard h3{ margin:0 0 10px 0; font:700 20px/1.2 system-ui; }
.ws-modal p, .ws-modal li, .ws-endcard p{ margin:6px 0; color:var(--muted) }
.ws-modal .row, .ws-endcard .row{ display:flex; gap:8px; margin-top:12px; flex-wrap:wrap }
.ws-btn{
  border:1px solid var(--border); background:var(--btnBg); color:var(--text);
  border-radius:10px; padding:10px 12px; font:600 14px/1 system-ui; cursor:pointer;
}
.ws-btn.primary{ background:var(--brand); color:#fff; border-color:var(--brand) }

/* Brand Green CTA Button */
.ws-btn.brand-cta {
  background: var(--brand);
  color: white;
  border: none;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity .15s ease-in-out;
}

.ws-btn.brand-cta:hover,
.ws-btn.brand-cta:active {
  opacity: 0.85;
}

.ws-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.6);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:55;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
:root[data-theme="light"] .ws-overlay{ background:rgba(8,10,12,.35); }
.ws-overlay.ws-overlay-visible{
  opacity:1;
  pointer-events:auto;
}

.ws-level-card .ws-card{
  width:min(92vw,560px);
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:24px;
  box-shadow:var(--shadow);
  text-align:center;
}
.ws-card-header{ margin-bottom:6px; }
.ws-card-title{
  margin:0;
  font:700 22px/1.25 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.ws-card-body{ color:var(--muted); font:600 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.ws-card-body p{ margin:8px 0; }
.ws-card-actions{ display:flex; justify-content:center; gap:10px; margin-top:14px; flex-wrap:wrap; }
.ws-card-bee{ display:flex; justify-content:center; margin-bottom:10px; }
.ws-bee-icon{
  width:72px;
  height:72px;
  border-radius:16px;
  background:linear-gradient(135deg, rgba(255,191,0,.2), rgba(255,191,0,.05));
  border:1px solid var(--border);
  display:grid;
  place-items:center;
  font-size:40px;
}
.ws-bee-icon::before{ content:'🐝'; }
.ws-bee-anim{ animation: ws-bee-buzz 900ms ease-in-out infinite; }

.ws-answer-def{
  margin:12px auto 0;
  padding:12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--tile);
  color:var(--text);
}
.ws-answer-word{
  font:800 18px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  letter-spacing:0.04em;
}
.ws-answer-def-text{
  margin-top:6px;
  font:600 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--muted);
}

.ws-mini-row{ display:grid; grid-auto-flow:column; gap:6px; margin-top:8px; }
.ws-mini-tile{ width:28px; height:28px; border-radius:6px; display:grid; place-items:center;
  font:700 12px/1 system-ui; text-transform:uppercase; border:1px solid transparent;
}
.ws-mini-tile.correct{ background:var(--correct); color:#000; }
.ws-mini-tile.present{ background:var(--present); color:#000; }
.ws-mini-tile.absent{  background:var(--absent); color:var(--text); }

/* Settings form */
.ws-form{ display:grid; gap:10px; }
.ws-field{
  display:flex; align-items:center; justify-content:space-between;
  background:var(--tile); border:1px solid var(--border);
  padding:10px; border-radius:10px;
}
.ws-field label{ font:600 14px/1 system-ui; }
.ws-field input[type="checkbox"]{ width:18px; height:18px; }
.ws-field select{
  font:600 14px/1 system-ui; color:var(--text); background:var(--btnBg);
  border:1px solid var(--border); border-radius:8px; padding:8px 10px;
}

/* Floating points chip */
.ws-fxfloat{
  position:fixed; z-index:60; pointer-events:none; font:800 14px/1 system-ui;
  padding:6px 8px; border-radius:999px; background:var(--card); border:1px solid var(--border);
  color:var(--text); box-shadow:0 8px 20px rgba(0,0,0,.45);
  transition: transform 420ms cubic-bezier(.22,.82,.25,1), opacity 420ms ease, left 420ms ease, top 420ms ease;
  opacity:.98;
}
:root[data-theme="light"] .ws-fxfloat{ box-shadow:0 8px 16px rgba(0,0,0,.12); }
.ws-fxfloat.green{ background:var(--correct); color:#000; border-color:var(--correct); }
.ws-fxfloat.yellow{ background:var(--present); color:#000; border-color:var(--present); }

/* ===================== MOBILE ===================== */
@media (max-width:430px){
  :root{ --tileSize: clamp(36px, 10.5vw, 48px); }

  #game{
    padding-left:0;
    padding-right:0;
    box-sizing:border-box;
  }

  #play #game-root{
    padding-left:0;
    padding-right:0;
  }

  .ws-kb{
    padding:0;
    gap:10px;
    max-width:100%;
    margin-left:auto;
    margin-right:auto;
  }

  .ws-kb-row{
    gap:6px;
    justify-content:center;
    flex-wrap:nowrap;
  }

  .ws-kb-key{
    justify-self:center;
    min-width:auto;
    min-height:clamp(40px, 9.8vw, 50px);
    padding:clamp(10px, 2.4vw, 14px) clamp(8px, 2.6vw, 12px);
    font-size:clamp(13px, 3.6vw, 16px);
    border-radius:10px;
  }
  .ws-kb-enter, .ws-kb-back{
    grid-column:span 2;
    padding:clamp(10px, 2.4vw, 14px) clamp(10px, 3.2vw, 16px);
  }

  .ws-modal .card, .ws-endcard .card { padding:16px; }

  /* On small screens, don’t reserve extra bee space */
  .ws-stage{
    padding-right:0;
  }
}

/* ===================== HINT BEE HELPER ===================== */
.ws-helper-bubble {
  display: none !important;
}

.ws-helper{
  position:absolute;
  top:50%;
  right:-52px;  /* tuned so bee is close but not overlapping 7-letter rows on desktop */
  transform:translateY(-50%);
  z-index:80;
  width:44px;
  height:44px;
  pointer-events:auto;
  display:flex;
  align-items:center;
  justify-content:center;
}

.ws-helper-bee{
  pointer-events:auto;
  width:42px;
  height:42px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--card);
  box-shadow:var(--bubbleShadow);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  cursor:pointer;
}

/* 🟢 Bee glow when a hint has been revealed for this level */
.ws-helper-bee.hint-active{
  box-shadow:
    0 0 0 2px var(--brand),
    0 0 14px rgba(73,127,100,0.7);
}

/* Slight emphasis on hover when a hint is active (desktop-ish only) */
.ws-helper-bee.hint-active:hover{
  transform:scale(1.04);
  box-shadow:
    0 0 0 2px var(--brand),
    0 0 18px rgba(73,127,100,0.9);
}

.ws-helper-bee.ws-helper-disabled{
  opacity:0.4;
}

/* On very small screens, keep Bee near the grid but tighter so it doesn't break layout */
@media (max-width:430px){
  .ws-helper{
    right:-40px;
    top:45%;
    transform:translateY(-50%);
  }
}

@media (max-width:380px){
  .ws-helper{
    right:-24px;
    width:36px;
    height:36px;
  }

  .ws-helper-bee{
    width:34px;
    height:34px;
    font-size:18px;
  }
}

/* ===================== WORDHIVE LANDING PAGE ===================== */
.wh-body{
  background:var(--bg);
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  margin:0;
}

.wh-hidden{
  display:none;
}

.wh-hero{
  padding:72px 16px 48px;
  border-bottom:1px solid var(--border);
}

.wh-hero-inner{
  max-width:720px;
  margin:0 auto;
  text-align:center;
}

.wh-brand{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin-bottom:12px;
}

.wh-logo{
  height:36px;
  width:auto;
  display:block;
}

.wh-logo-text{
  font-weight:800;
  letter-spacing:.4px;
}

.wh-hero-title{
  font-size:clamp(28px, 4vw, 36px);
  margin:8px 0 10px;
}

.wh-hero-subtitle{
  margin:0 0 20px;
  color:var(--muted);
  font-size:15px;
}

.wh-hero-actions{
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.wh-meta{
  color:var(--muted);
  font-size:13px;
}

.wh-main{
  max-width:960px;
  margin:0 auto;
  padding:32px 16px 64px;
}

.wh-section{
  margin-top:40px;
}

.wh-section-title{
  font-size:22px;
  margin:0 0 10px;
}

.wh-section-lead{
  margin:0 0 16px;
  color:var(--muted);
}

.wh-archive{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:24px 20px 32px;
  box-shadow:var(--shadow);
}

.wh-archive-header h1{
  margin:0 0 12px;
  font-size:24px;
}

.wh-archive-header p,
.wh-archive-list p{
  margin:0 0 12px;
  color:var(--muted);
}

.wh-archive-list{
  margin-top:16px;
}

.wh-archive-items{
  list-style:none;
  margin:16px 0 0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.wh-archive-item{
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card);
  box-shadow:var(--shadow);
}

.wh-archive-link{
  display:block;
  padding:14px 16px;
  text-decoration:none;
  color:var(--text);
}

.wh-archive-link:hover{
  color:var(--brand);
}

.wh-archive-title{
  margin:0 0 6px;
  font-weight:700;
}

.wh-archive-meta{
  margin:0;
  color:var(--muted);
  font-size:14px;
}

.wh-list{
  margin:0 0 0 18px;
  padding:0;
  color:var(--muted);
  line-height:1.6;
}

.wh-footer{
  border-top:1px solid var(--border);
  padding:16px;
  text-align:center;
  font-size:13px;
  color:var(--muted);
}

.wh-footer-nav{
  margin-top:6px;
  display:flex;
  justify-content:center;
  gap:12px;
}

.wh-footer-nav a{
  color:var(--muted);
  text-decoration:none;
}

.wh-footer-nav a:hover{
  text-decoration:underline;
}

.wh-btn{
  border-radius:999px;
  padding:10px 18px;
  font:600 14px/1 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  cursor:pointer;
  border:1px solid var(--border);
  background:var(--btnBg);
  color:var(--text);
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.wh-btn-primary{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}

.wh-btn-ghost{
  background:transparent;
}

/* Tighten spacing for the Play section and game container */
.wh-section-game {
  margin-top: 24px; /* less than the default 40px */
}

.wh-section-game #game-root{
  margin-top: 8px;      /* smaller top margin above the game header */
  margin-bottom: 32px;  /* a bit of space below the keyboard */
  padding-top: 0;       /* no extra padding above the game */
}

/* WordHive: Remove spacing above the game when displayed */
#ws-game-shell {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Ensure game root has no unexpected spacing */
#game {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Shared brand logos */
.ws-brand-logo {
  display: block;
  height: 32px;
  width: auto;
}

.ws-brand-logo--light {
  display: none;
}

html[data-theme="light"] .ws-brand-logo--dark {
  display: none;
}

html[data-theme="light"] .ws-brand-logo--light {
  display: block;
}

/* Hide redundant header logo text */
.wh-logo-text {
  display: none !important;
}

.wh-brand .ws-brand-logo {
  height: 36px;
}

.ws-topbar .ws-brand {
  display: flex;
  align-items: center;
}

/* Safety: hide legacy text logo pieces if they ever appear */
.ws-brand-block,
.ws-brand-text {
  display: none;
}

.ws-level-modal .ws-level-word{
  margin:8px 0;
  font:600 16px/1.3 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}
.ws-level-modal .ws-level-sub{
  margin:4px 0 8px;
  color:var(--muted);
}
.ws-level-modal .ws-level-def{
  margin:6px 0 10px;
  color:var(--muted);
}

.ws-level-bee{
  display:inline-block;
  animation: ws-bee-buzz 900ms ease-in-out infinite;
}

@keyframes ws-bee-buzz{
  0%,100%{ transform:translate(0,0) rotate(0deg); }
  25%{ transform:translate(-1px,-1px) rotate(-5deg); }
  75%{ transform:translate(1px,1px) rotate(5deg); }
}
