/* games.73qrz.com — 73QRZ colors and type, Wordle-style calm layout */
:root {
  --bg: #0A0E17; --bg-2: #0D1320; --card: #101726; --card-2: #162033; --inset: #182235;
  --line: #1E2A3D; --line-2: #2C3850;
  --text: #E8EEF7; --text-2: #C9D6E6; --muted: #93A1B5;
  --cyan: #22D3EE; --yellow: #FFCC00; --green: #34D399; --red: #F87171; --orange: #FF9B80;
  --hit: #22C55E; --near: #EAB308; --miss: #3A4558;
  --on-fill: #0A0E17;
  --head: 'Barlow', 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
:root.light-theme {
  --bg: #F4F6FA; --bg-2: #FFFFFF; --card: #FFFFFF; --card-2: #EEF2F7; --inset: #E7ECF3;
  --line: #CBD5E1; --line-2: #94A3B8;
  --text: #0F172A; --text-2: #334155; --muted: #475569;
  --cyan: #0E7490; --yellow: #A16207; --green: #047857; --red: #B91C1C; --orange: #C2410C;
  --hit: #16A34A; --near: #CA8A04; --miss: #6B7280;
  --on-fill: #FFFFFF;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--body); -webkit-text-size-adjust: 100%; }
a { color: var(--cyan); }
button { font: inherit; color: inherit; }

/* Top bar */
.g-top { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.g-brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--text); }
.g-logo { font-family: var(--head); font-weight: 800; font-size: 20px; letter-spacing: .02em; color: var(--yellow); }
.g-logo b { color: var(--cyan); }
.g-brand-sub { font-family: var(--head); font-weight: 700; font-size: 15px; color: var(--muted); }
.g-title { margin: 0; font-family: var(--head); font-weight: 800; font-size: 26px; letter-spacing: .01em; text-align: center; white-space: nowrap; }
.g-icons { display: flex; justify-content: flex-end; gap: 6px; }
.g-icon { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text-2); font-weight: 700; font-size: 18px; cursor: pointer; display: grid; place-items: center; }
.g-icon:hover { border-color: var(--cyan); color: var(--cyan); }
@media (max-width: 520px) {
  .g-top { grid-template-columns: auto 1fr auto; padding: 8px 12px; }
  .g-brand-sub { display: none; }
  .g-title { font-size: 21px; }
  .g-icon { width: 36px; height: 36px; }
}

.g-main { max-width: 520px; margin: 0 auto; padding: 18px 16px 28px; min-height: calc(100vh - 140px); }
.g-main.wide { max-width: 1100px; }
.g-foot { text-align: center; padding: 20px 16px 32px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
.g-foot a { color: var(--muted); }
.g-coffee-wrap { margin-top: 12px; }
.g-foot a.g-coffee { display: inline-block; padding: 7px 16px; border-radius: 999px; background: #ffdd00; color: #222; font-weight: 600; text-decoration: none; }
.g-foot a.g-coffee:hover { filter: brightness(0.95); }

.g-sub { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.g-sub b { color: var(--text-2); font-family: var(--mono); }

/* Letter tiles */
.g-board { display: grid; gap: 6px; justify-content: center; margin: 4px auto 18px; }
.g-row { display: grid; grid-auto-flow: column; gap: 6px; }
.g-row.shake { animation: g-shake .45s; }
.tile { width: min(15vw, 62px); height: min(15vw, 62px); display: grid; place-items: center; border: 2px solid var(--line-2); border-radius: 6px; font-family: var(--head); font-weight: 800; font-size: min(8vw, 32px); text-transform: uppercase; background: var(--bg); user-select: none; }
.tile.filled { border-color: var(--muted); animation: g-pop .1s; }
.tile.hit, .tile.near, .tile.miss { color: #fff; border-color: transparent; }
.tile.hit { background: var(--hit); } .tile.near { background: var(--near); } .tile.miss { background: var(--miss); }
.tile.flip { animation: g-flip .5s ease forwards; }
@keyframes g-pop { 50% { transform: scale(1.08); } }
@keyframes g-flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes g-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }

/* Keyboard */
.g-kb { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; user-select: none; }
.g-kb-row { display: flex; gap: 6px; justify-content: center; }
.key { flex: 1; max-width: 44px; height: 56px; border: 0; border-radius: 6px; background: var(--card-2); color: var(--text); font-weight: 700; font-size: 15px; cursor: pointer; text-transform: uppercase; touch-action: manipulation; }
.key.wide { max-width: 68px; flex: 1.5; font-size: 12px; }
.key.hit { background: var(--hit); color: #fff; } .key.near { background: var(--near); color: #fff; } .key.miss { background: var(--miss); color: #fff; opacity: .8; }
:root.light-theme .key { background: #D8DEE8; }

/* Generic game UI */
.g-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 0 0 14px; }
.g-input-row { display: flex; gap: 8px; }
.g-input { flex: 1; min-width: 0; min-height: 50px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: 600 17px var(--body); }
.g-input:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
.g-btn { min-height: 50px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--cyan); color: var(--on-fill); font-weight: 800; cursor: pointer; }
.g-btn.alt { background: var(--card-2); color: var(--text); border: 1px solid var(--line-2); }
.g-btn:disabled { opacity: .5; cursor: default; }
.g-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.g-suggest { position: relative; }
.g-suggest-list { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin-top: 4px; max-height: 240px; overflow: auto; background: var(--card); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.g-suggest-list button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; background: none; cursor: pointer; font-size: 15px; }
.g-suggest-list button:hover, .g-suggest-list button.on { background: var(--card-2); }
.g-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--inset); font-size: 13px; font-weight: 600; color: var(--text-2); }
.g-reveal { text-align: center; }
.g-reveal .big { font-family: var(--head); font-weight: 800; font-size: 34px; letter-spacing: .02em; }
.g-learn { font-size: 15px; color: var(--text-2); line-height: 1.6; }
.g-learn strong { color: var(--text); }

/* Toast + modal */
.g-toast { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 60; pointer-events: none; display: flex; flex-direction: column; gap: 6px; }
.g-toast div { background: var(--text); color: var(--bg); font-weight: 700; padding: 10px 16px; border-radius: 8px; animation: g-fade 1.6s forwards; }
@keyframes g-fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
.g-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(5, 8, 14, .7); }
.g-modal[hidden] { display: none; }
.g-modal-card { position: relative; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px 20px 20px; animation: g-up .2s ease; }
@keyframes g-up { from { transform: translateY(16px); opacity: 0; } }
.g-modal-x { position: absolute; top: 8px; right: 10px; width: 40px; height: 40px; border: 0; background: none; font-size: 28px; color: var(--muted); cursor: pointer; }
.g-modal h2 { margin: 0 0 12px; font-family: var(--head); font-size: 22px; text-align: center; letter-spacing: .02em; }
.g-modal h3 { margin: 18px 0 8px; font-family: var(--head); font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; }
.g-modal p, .g-modal li { color: var(--text-2); font-size: 15px; }
.g-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.g-stats b { display: block; font-family: var(--head); font-size: 32px; }
.g-stats span { font-size: 12px; color: var(--muted); }
.g-dist { display: flex; flex-direction: column; gap: 4px; }
.g-dist div { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.g-dist i { display: block; min-width: 22px; padding: 2px 6px; text-align: right; font-style: normal; font-weight: 700; background: var(--miss); color: #fff; border-radius: 3px; }
.g-dist i.now { background: var(--hit); }
.g-stats.g-stats-2 { grid-template-columns: repeat(2, 1fr); }
#g-world .g-dist i { min-width: 44px; }
.g-world-note { text-align: center; color: var(--muted); font-size: 14px; margin: 6px 0; }
.g-world-beat { text-align: center; margin: 8px 0 10px; }
.g-end { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 14px; align-items: center; margin-top: 18px; }
.g-end .sep { background: var(--line); height: 60px; }
.g-next { text-align: center; }
.g-next span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.g-next b { font-family: var(--mono); font-size: 26px; }
.g-share { min-height: 52px; border: 0; border-radius: 12px; background: var(--hit); color: #fff; font-weight: 800; font-size: 18px; cursor: pointer; }
.g-ex { display: flex; gap: 4px; margin: 8px 0; }
.g-ex .tile { width: 40px; height: 40px; font-size: 20px; }
.g-sources { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* Hub */
.hub-hero { text-align: center; margin: 8px 0 22px; }
.hub-hero h2 { font-family: var(--head); font-size: clamp(28px, 5vw, 44px); margin: 0 0 6px; line-height: 1.1; }
.hub-hero h2 em { font-style: normal; color: var(--cyan); }
.hub-hero p { color: var(--text-2); margin: 0; }
.hub-day { display: inline-block; margin-top: 10px; font-family: var(--mono); color: var(--yellow); }
.hub-group { margin: 26px 0 10px; font-family: var(--head); font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.hub-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: transform .12s, border-color .12s; }
.hub-card:hover { transform: translateY(-2px); border-color: var(--cyan); }
.hub-card .ic { font-size: 26px; line-height: 1; }
.hub-card h3 { margin: 0; font-family: var(--head); font-size: 21px; }
.hub-card p { margin: 0; font-size: 14px; color: var(--text-2); }
.hub-card .st { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.hub-card .st.done { color: var(--green); }
.hub-card.soon { opacity: .55; pointer-events: none; }
.hub-card.soon .st { color: var(--muted); }

/* Easy / Hard switch (Callword, Callwordless) */
.g-mode { display: flex; justify-content: center; gap: 0; margin: 0 auto 12px; width: max-content; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.g-mode button { border: 0; background: none; color: var(--muted); font: 600 14px var(--body); padding: 8px 16px; min-height: 36px; border-radius: 999px; cursor: pointer; }
.g-mode button.on { background: var(--cyan); color: var(--bg); }
.g-mode.locked button:not(.on) { opacity: .45; }
.g-mode-note { text-align: center; color: var(--muted); font-size: 13px; margin: -6px 0 10px; }
