:root {
  color-scheme: light;
  --canvas: #eef1ed;
  --surface: #ffffff;
  --ink: #18221f;
  --muted: #65716c;
  --line: #d7ddd9;
  --green: #1b705b;
  --gold: #b58429;
  --red: #9d4f46;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
body { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; background: var(--canvas); color: var(--ink); letter-spacing: 0; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 3px solid rgba(27, 112, 91, .25); outline-offset: 3px; }

.topbar { min-height: 70px; padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .94); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 6px; background: #1f302b; color: #f3c85c; font-weight: 850; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 9px; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.icon-button, .home-link { min-height: 38px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
.icon-button { width: 38px; padding: 0; cursor: pointer; font-size: 18px; }
.home-link { padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 750; text-decoration: none; }

main { width: min(1060px, calc(100% - 48px)); margin: 0 auto; padding: 56px 0 70px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: 11px; font-weight: 850; }
h1 { margin: 0; font-size: 34px; line-height: 1.2; }
.access-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.access-note span { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(27, 112, 91, .12); }

.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.game-card { min-height: 180px; padding: 26px; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: inherit; text-decoration: none; box-shadow: 0 10px 28px rgba(24, 34, 31, .05); transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease; }
.game-card:hover { transform: translateY(-2px); border-color: #aeb9b3; box-shadow: 0 15px 34px rgba(24, 34, 31, .09); }
.game-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 7px; background: #253630; color: #fff; font-size: 17px; font-weight: 900; }
.odds .game-icon { background: var(--green); }
.sudoku .game-icon { position: relative; overflow: hidden; background: #3f554d; color: #f3c85c; }
.sudoku .card-meta { color: #3f6d5e; }
.sudoku-grid::before, .sudoku-grid::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 31%, rgba(255,255,255,.34) 32%, rgba(255,255,255,.34) 34%, transparent 35%, transparent 65%, rgba(255,255,255,.34) 66%, rgba(255,255,255,.34) 68%, transparent 69%); }
.sudoku-grid::after { transform: rotate(90deg); }
.sudoku-grid i { position: relative; z-index: 1; font-style: normal; }
.gomoku .game-icon { position: relative; background: #d8ad68; box-shadow: inset 0 0 0 1px rgba(91, 58, 24, .24); }
.gomoku .card-meta { color: #795226; }
.gomoku-stones i, .gomoku-stones b { position: absolute; width: 19px; height: 19px; border-radius: 50%; }
.gomoku-stones i { top: 9px; left: 8px; background: radial-gradient(circle at 34% 28%, #555d59, #171b19 70%); }
.gomoku-stones b { right: 7px; bottom: 8px; border: 1px solid #aaa59b; background: radial-gradient(circle at 34% 28%, #fff, #dedbd3 72%); }
.lottery .game-icon { background: #a73f39; color: #fff; }
.lottery .card-meta { color: #a73f39; }
.xiangqi .game-icon { border: 2px solid #a8473d; border-radius: 50%; background: #f4dfbc; color: #a02f2f; font-family: STKaiti, KaiTi, serif; font-size: 22px; }
.xiangqi .card-meta { color: #a02f2f; }
.chess .game-icon { background: #384843; color: #f2f4ef; font-size: 28px; }
.chess .card-meta { color: #526f65; }
.sensitivity .game-icon { position: relative; background: #9a6333; border-radius: 50%; }
.sensitivity .game-icon::before, .sensitivity .game-icon::after, .sensitivity .game-icon i { content: ""; position: absolute; border: 2px solid #fff; border-radius: 50%; }
.sensitivity .game-icon::before { inset: 10px; }
.sensitivity .game-icon::after { inset: 19px; background: #fff; }
.sensitivity .game-icon i { inset: 2px 24px; border-width: 0 2px; border-radius: 0; }
.hd2 .game-icon { background: #24302a; color: #f3c442; }
.game-copy { min-width: 0; }
.game-copy > span, .game-copy strong { display: block; }
.card-meta { margin-bottom: 5px; color: var(--green); font-size: 10px; font-weight: 850; }
.hd2 .card-meta { color: var(--gold); }
.game-copy strong { margin-bottom: 7px; font-size: 19px; }
.game-copy > span:last-child { color: var(--muted); font-size: 13px; line-height: 1.55; }
.launch { color: #7b8781; font-size: 22px; }

footer { min-height: 74px; padding: 18px 24px calc(18px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

@media (max-width: 720px) {
  .topbar { min-height: 62px; padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .brand small { display: none; }
  .home-link { width: 38px; padding: 0; justify-content: center; }
  .home-link span:last-child { display: none; }
  main { width: calc(100% - 28px); padding: 34px 0 48px; }
  .intro { align-items: flex-start; flex-direction: column; gap: 12px; }
  h1 { font-size: 28px; }
  .game-grid { grid-template-columns: 1fr; }
  .game-card { min-height: 142px; padding: 20px 17px; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 14px; }
  .game-icon { width: 46px; height: 46px; }
  .game-copy strong { font-size: 17px; }
  .game-copy > span:last-child { font-size: 12px; }
  footer { align-items: flex-start; flex-direction: column; gap: 4px; }
}

@media (display-mode: standalone) { .topbar { padding-top: env(safe-area-inset-top); } }
@media (prefers-reduced-motion: reduce) { .game-card { transition: none; } }
