/* =====================================================================
   Reel Quiet — fixed "quiet lake" theme.
   Same cabinet frame as the arcade games (full-height shell, frosted top
   bar, chunky buttons, hard-shadow 16:9 stage, overlay-scrolled modal) with
   a soft dawn palette: pale sky, deep reed green, hemp gold and bobber coral.
   Deliberately ignores the center's light/dark mode; no glass.css loaded.
   ===================================================================== */
:root {
  --rq-sky:   #cfe7e6;   /* hazy morning sky */
  --rq-lake:  #2f6a72;   /* mid water */
  --rq-deep:  #10282f;   /* app body */
  --rq-night: #07171d;   /* page bottom */
  --rq-reed:  #8fc39a;   /* keylines and accents */
  --rq-gold:  #f2c98a;   /* rod, coins, highlights */
  --rq-coral: #ff7c66;   /* bobber + badges */
  --rq-cream: #f4efe2;   /* main text */
  --rq-dim:   rgba(226, 240, 236, .66);
  --rq-line:  rgba(143, 195, 154, .38);
}

html, body { height: 100%; }
body.rq-page {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(66% 44% at 18% 0%, rgba(242, 201, 138, .13), transparent 62%),
    radial-gradient(58% 38% at 86% 4%, rgba(143, 195, 154, .13), transparent 66%),
    linear-gradient(180deg, #1c4650 0%, #10282f 48%, var(--rq-night) 100%);
  color: var(--rq-cream);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
body.rq-page *,
body.rq-page *::before,
body.rq-page *::after { box-sizing: border-box; }

/* ---------- App frame ---------- */
.c-app {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- Top bar ---------- */
.c-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px 18px;
  flex-wrap: wrap;
  padding: 12px clamp(12px, 3vw, 28px);
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(9, 30, 36, .62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--rq-line);
  z-index: 20;
}
.c-bar__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.c-bar__brand svg { filter: drop-shadow(0 0 7px rgba(242, 201, 138, .32)); }
.c-bar__title {
  margin: 0;
  font-size: clamp(19px, 3.4vw, 26px);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #f7f3e8;
  text-shadow: 0 0 14px rgba(242, 201, 138, .28), 0 0 30px rgba(60, 130, 120, .28);
}
.c-bar__stats { display: flex; align-items: center; gap: 8px 16px; margin-left: auto; }
.c-bar__controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat { font-size: 14px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; color: var(--rq-dim); }
.stat b { color: #eaf6ef; font-size: 16px; text-shadow: 0 0 8px rgba(143, 195, 154, .3); }
#clock { color: var(--rq-sky); }
#caught { color: var(--rq-reed); }
#best { color: var(--rq-gold); }
#coins { color: var(--rq-gold); text-shadow: 0 0 9px rgba(242, 201, 138, .42); }

/* ---------- Buttons ---------- */
.c-btn {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  padding: 9px 16px;
  border-radius: 12px;
  border: 2px solid var(--rq-line);
  background: rgba(12, 40, 46, .85);
  color: var(--rq-cream);
  box-shadow: 0 3px 0 rgba(3, 14, 18, .7);
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.c-btn:hover { background: rgba(20, 56, 62, .95); border-color: var(--rq-reed); }
.c-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(3, 14, 18, .7); }
.c-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(143, 195, 154, .45); }
.c-btn:disabled { opacity: .42; cursor: not-allowed; }
.c-btn:disabled:hover { background: rgba(12, 40, 46, .85); border-color: var(--rq-line); }
/* .c-btn sets display:inline-block, which would beat the UA's [hidden] rule. */
.c-btn[hidden] { display: none; }
.c-btn--primary {
  background: linear-gradient(140deg, #ffeec2, #e9b567);
  border-color: rgba(255, 246, 220, .7);
  color: #33240d;
  text-shadow: none;
  box-shadow: 0 3px 0 rgba(78, 50, 12, .5);
}
.c-btn--primary:hover { background: linear-gradient(140deg, #fff6d9, #f6c684); border-color: #fffaf0; }
.c-btn--icon { padding: 8px 11px; }
.c-btn--icon svg { display: block; }
/* Sound icon: waves hide when muted, slash hides when live. */
.rq-slash { display: none; }
body.rq-muted .rq-wave { opacity: 0; }
body.rq-muted .rq-slash { display: block; }

/* ---------- Table / stage column ---------- */
.c-table {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2.4vh, 22px);
}
.rq-board {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* 16:9 landscape; capped by viewport height minus bar + caption. */
  width: min(96vw, calc((100vh - 178px) * 1.7778));
  width: min(96vw, calc((100dvh - 178px) * 1.7778));
}
.rq-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: var(--rq-night);
  border: 3px solid rgba(143, 195, 154, .26);
  box-shadow: 0 10px 0 rgba(4, 16, 20, .5), 0 22px 48px rgba(3, 14, 18, .62), 0 0 42px rgba(143, 195, 154, .12);
  touch-action: none;
  cursor: pointer;
}
#board {
  display: block;
  width: 100%; height: 100%;
  touch-action: none;                  /* capture holds without page scroll */
  -webkit-user-select: none; user-select: none;
}

/* ---------- Caption ---------- */
.rq-caption {
  flex: none;
  margin: 0;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.9;
  color: var(--rq-dim);
}
.rq-card kbd, .c-modal kbd, .rq-caption kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin: 0 1px;
  font: 700 12px/1.5 ui-monospace, "Segoe UI", monospace;
  text-align: center;
  color: var(--rq-cream);
  background: rgba(10, 34, 40, .92);
  border: 1px solid var(--rq-line);
  border-radius: 6px;
  box-shadow: 0 2px 0 rgba(3, 14, 18, .6);
}

/* ---------- Title / pause / catch overlays ---------- */
.rq-overlay {
  touch-action: manipulation;
  position: absolute; inset: 0; z-index: 8;
  display: flex;
  overflow: auto;                      /* the overlay scrolls, never the card */
  padding: 16px;
  background: rgba(4, 16, 20, .58);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  cursor: default;
}
.rq-overlay[hidden] { display: none; }
.rq-card {
  position: relative;
  margin: auto;                        /* centers AND lets a tall card scroll in */
  width: min(100%, 392px);
  text-align: center;
  padding: 20px 24px 18px;
  border-radius: 16px;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(242, 201, 138, .12), transparent 62%),
    linear-gradient(160deg, #17414a, #0a222a);
  border: 2px solid var(--rq-line);
  box-shadow: 0 8px 0 rgba(3, 14, 18, .45), 0 22px 50px rgba(3, 14, 18, .62), 0 0 30px rgba(143, 195, 154, .12);
  color: var(--rq-cream);
  animation: rqPop .28s ease;
}
@keyframes rqPop { from { transform: scale(.9); opacity: 0; } }
.rq-mark { display: flex; justify-content: center; margin-bottom: 2px; filter: drop-shadow(0 0 10px rgba(242, 201, 138, .3)); }
.rq-card h2 {
  margin: 4px 0 6px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #fbf7ea;
  text-shadow: 0 0 14px rgba(242, 201, 138, .3);
}
.rq-card__blurb { margin: 0 0 12px; color: var(--rq-dim); font-size: 13.5px; line-height: 1.55; }
.rq-card__blurb b { color: var(--rq-gold); }
.rq-card__bestline {
  margin: -4px 0 12px;
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(143, 195, 154, .1);
  border: 1px solid rgba(143, 195, 154, .3);
  color: #bfe4c6;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
}
.rq-card__bestline[hidden] { display: none; }

/* ---------- Catch card (landed fish) ---------- */
.rq-catch { margin: 0 0 12px; }
.rq-catch[hidden] { display: none; }
.rq-catch__art {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 84px;
  margin-bottom: 6px;
  border-radius: 12px;
  background:
    radial-gradient(70% 90% at 50% 20%, rgba(242, 201, 138, .1), transparent 70%),
    rgba(6, 26, 32, .55);
  border: 1px solid rgba(143, 195, 154, .18);
}
.rq-catch__art svg { display: block; max-height: 72px; }
.rq-catch__name {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--rq-gold);
}
.rq-catch__meta {
  margin: 2px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--rq-dim);
}
.rq-catch__sep { opacity: .5; }
#catchCoins { color: #bfe4c6; }
.rq-catch__badge {
  margin: 8px 0 0;
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 124, 102, .16);
  border: 1px solid rgba(255, 124, 102, .5);
  color: #ffb9ab;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.rq-catch__badge[hidden] { display: none; }

/* Card buttons: full-width stacked blocks */
.rq-card .c-btn { display: block; width: 100%; margin-top: 8px; font-size: 14px; }
.rq-card .c-btn[hidden] { display: none; }
.rq-card__hint {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--rq-dim);
}
.rq-card__hint kbd { font-size: 11px; }

/* ---------- Toast ---------- */
.rq-toast {
  position: absolute;
  left: 50%; top: 14px;
  z-index: 9;
  transform: translate(-50%, -6px);
  max-width: 92%;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(6, 24, 30, .92);
  border: 1px solid rgba(143, 195, 154, .4);
  box-shadow: 0 6px 20px rgba(3, 14, 18, .5);
  color: #eefaf2;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}
.rq-toast[hidden] { display: none; }
.rq-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Rules modal (overlay scrolls; panel never does) ---------- */
.c-modal { position: fixed; inset: 0; z-index: 50; display: flex; overflow: auto; padding: 14px; }
.c-modal[hidden] { display: none; }
.c-modal__backdrop {
  position: fixed; inset: 0;
  background: rgba(4, 16, 20, .68);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.c-modal__panel {
  position: relative;
  margin: auto;
  width: min(92vw, 500px);
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(143, 195, 154, .08), transparent 60%),
    linear-gradient(160deg, #17414a, #081e25);
  color: #e4f2ec;
  border-radius: 16px;
  border: 2px solid var(--rq-line);
  box-shadow: 0 8px 0 rgba(3, 14, 18, .45), 0 24px 60px rgba(3, 14, 18, .7), 0 0 34px rgba(143, 195, 154, .14);
}
.c-modal__panel.rq-panel--wide { width: min(92vw, 656px); }
.c-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(143, 195, 154, .22);
}
.c-modal__head h2 {
  margin: 0; font-size: 18px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  color: #fbf7ea; text-shadow: 0 0 10px rgba(242, 201, 138, .32);
}
.c-modal__x {
  appearance: none; border: 0; background: none;
  color: #e6f4ee; font-size: 26px; line-height: 1;
  cursor: pointer; padding: 0 4px;
}
.c-modal__x:hover { color: var(--rq-gold); }
.c-modal__body { padding: 6px 20px 2px; font-size: 13.5px; line-height: 1.5; }
.c-modal__body h3 {
  margin: 12px 0 5px; font-size: 13px;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--rq-reed);
}
.c-modal__body ul { margin: 0; padding-left: 20px; }
.c-modal__body li { margin: 2.5px 0; }
.c-modal__body b { color: var(--rq-gold); }
.c-modal__lead { margin: 10px 0; }
.c-modal__note {
  margin: 12px 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(143, 195, 154, .07);
  border: 1px solid rgba(143, 195, 154, .24);
  font-size: 13px;
  color: #d6ebe0;
}
.c-modal__foot { display: flex; justify-content: flex-end; padding: 12px 20px 16px; }
.c-modal .c-btn { border-color: var(--rq-line); box-shadow: 0 3px 0 rgba(3, 14, 18, .6); }

/* ---------- Journal grid ---------- */
.rq-journal {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.rq-entry {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px 7px;
  border-radius: 11px;
  background: rgba(6, 26, 32, .5);
  border: 1px solid rgba(143, 195, 154, .16);
  text-align: center;
}
.rq-entry svg { display: block; width: 54px; height: 34px; }
.rq-entry__name {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.25;
  color: #e9f6ee;
}
.rq-entry__wt { font-size: 10px; font-weight: 700; color: var(--rq-gold); }
.rq-entry.is-unknown { border-style: dashed; border-color: rgba(143, 195, 154, .22); }
.rq-entry.is-unknown .rq-entry__name { color: rgba(226, 240, 236, .42); }
.rq-entry.is-unknown .rq-entry__wt { color: rgba(242, 201, 138, .38); }
.rq-entry.is-new { border-color: rgba(255, 124, 102, .55); box-shadow: 0 0 12px rgba(255, 124, 102, .18); }
.rq-entry__rarity {
  position: absolute;
  top: 5px; right: 6px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(242, 201, 138, .62);
}

/* ---------- Gear lists ---------- */
.rq-gear { display: flex; flex-direction: column; gap: 7px; margin: 6px 0 4px; }
.rq-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 11px;
  background: rgba(6, 26, 32, .5);
  border: 1px solid rgba(143, 195, 154, .16);
}
.rq-item.is-on { border-color: rgba(242, 201, 138, .55); background: rgba(52, 44, 22, .28); }
.rq-item__icon {
  flex: none;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: rgba(143, 195, 154, .1);
  color: var(--rq-gold);
}
.rq-item__text { min-width: 0; flex: 1 1 auto; }
.rq-item__name { font-size: 13px; font-weight: 800; color: #f0f8f2; }
.rq-item__desc { font-size: 11.5px; line-height: 1.4; color: var(--rq-dim); }
.rq-item__desc b { color: var(--rq-gold); }
.rq-item .c-btn { flex: none; padding: 6px 12px; font-size: 11.5px; }
.rq-item__tag {
  flex: none;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(242, 201, 138, .8);
}

/* ---------- Responsive ---------- */
@media (max-width: 760px), (max-height: 560px) {
  .c-bar { gap: 5px 12px; padding: 7px clamp(10px, 3vw, 18px); padding-top: max(7px, env(safe-area-inset-top)); }
  .c-bar__brand { gap: 8px; }
  .c-bar__title { font-size: 16px; }
  .c-bar__stats { gap: 4px 11px; margin-left: auto; }
  .stat { font-size: 12px; }
  .stat b { font-size: 13px; }
  .c-btn { padding: 8px 10px; font-size: 12px; }
  .c-btn--icon { padding: 7px 9px; }
  .c-bar__controls { gap: 6px; }
  .c-bar__controls .c-btn { padding: 9px 10px; white-space: nowrap; }
  .rq-board { width: min(96vw, calc((100vh - 156px) * 1.7778)); width: min(96vw, calc((100dvh - 156px) * 1.7778)); }
}
/* Narrow screens: controls get their own full-width row, and the overlay
   leaves the tiny 16:9 stage so the card is readable. */
@media (max-width: 700px) {
  .c-bar__controls { flex: 1 1 100%; flex-wrap: nowrap; }
  .c-bar__controls .c-btn { flex: 1 1 auto; min-width: 0; padding: 9px 6px; overflow: hidden; text-overflow: ellipsis; }
  .rq-overlay { position: fixed; z-index: 40; padding: 12px; }
  .rq-card { width: min(100%, 360px); padding: 18px 20px 16px; }
  .rq-card h2 { font-size: 21px; }
  .rq-caption { display: none; }
  .rq-journal { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}
/* Smallest phones: labels scale down instead of stacking. */
@media (max-width: 380px) {
  .c-bar { gap: 5px 8px; }
  .c-bar__title { font-size: 15px; }
  .stat { font-size: 11px; }
  .stat b { font-size: 12px; }
  .c-bar__controls { gap: 4px; }
  .c-bar__controls .c-btn { font-size: clamp(10px, 3.2vw, 12px); padding: 9px 4px; letter-spacing: .01em; }
  .rq-journal { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
  .rq-item .c-btn { padding: 6px 9px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .c-btn, .rq-card, .rq-toast { transition: none; animation: none; }
}
