:root {
  --green: #2f7d4a;
  --green-d: #1d3b2a;
  --cream: #fffaf0;
  --ink: #1a2a20;
  --yellow: #ffe14d;
  --pink: #f07a9a;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--green-d); color: var(--ink); font-family: var(--font); overscroll-behavior: none; }
button, .button { font: inherit; }
#app { position: relative; width: 100%; max-width: 480px; height: 100%; height: 100dvh; margin: 0 auto; overflow: hidden; background: #24452f; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }

#hud { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); pointer-events: none;
  background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,0)); }
#hud .l, #hud .c, #hud .r { display: flex; flex-direction: column; gap: 2px; }
#hud .c { align-items: center; } #hud .r { align-items: flex-end; }
#hud b { font-size: 18px; font-weight: 900; }
#hud .c b { font-size: 26px; color: var(--yellow); }
#hud small, #hud span { font-size: 12px; opacity: .9; }
#hint { position: absolute; left: 0; right: 0; bottom: 3%; margin: 0; text-align: center; color: #fff; font-weight: 700; font-size: 15px;
  text-shadow: 0 1px 4px rgba(0,0,0,.8); pointer-events: none; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
#mute { position: absolute; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 5; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.35); color: #fff; font-size: 18px; cursor: pointer; }

.panel { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(16,32,22,.55); backdrop-filter: blur(3px); }
.panel.scroll { align-items: flex-start; overflow-y: auto; }
.box { width: 100%; max-width: 380px; background: var(--cream); border-radius: 22px; padding: 22px 18px; text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.box.wide { max-width: 448px; padding: 14px 12px 18px; }
.hero { width: 64%; max-width: 230px; margin: -6px auto 0; display: block; filter: drop-shadow(0 8px 10px rgba(0,0,0,.25)); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) scale(1.02); } }
h1 { margin: 4px 0 2px; font-size: 38px; font-weight: 900; color: var(--green); letter-spacing: 2px; }
h2 { margin: 8px 0 2px; font-size: 22px; font-weight: 900; color: var(--green); }
.sub { margin: 0 0 12px; color: #4b5d50; font-size: 15px; }
.daily { display: inline-block; margin: 0 0 14px; padding: 4px 12px; border-radius: 99px; background: #fff3c4; color: #8a5a00; font-size: 13px; font-weight: 700; }
#loading { margin: 8px 0 0; font-size: 13px; color: #6b7d70; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 16px; border-radius: 14px;
  border: 2px solid var(--green); background: #fff; color: var(--green); font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; }
button:disabled { opacity: .5; }
.primary { background: var(--green); color: #fff; }
.big { width: 100%; min-height: 54px; font-size: 19px; font-weight: 900; margin-top: 8px; }
.row { display: flex; gap: 8px; margin-top: 8px; } .row > * { flex: 1; }
.row2 { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 12px 0 0; font-size: 13px; color: #6b7d70; }
.link { border: 0; background: none; min-height: 0; padding: 4px; color: var(--green); text-decoration: underline; font-size: 14px; }
#r-threads { background: #000; color: #fff; border-color: #000; }
#r-x { background: #fff; color: #000; border-color: #000; }
#card { width: 100%; height: auto; display: block; border-radius: 12px; margin-bottom: 6px; }
.record { margin: 2px 0 8px; font-weight: 900; color: #c0392b; font-size: 18px; }

#dex-list { list-style: none; padding: 0; margin: 10px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
#dex-list li { background: #fff; border: 2px solid #dfe8df; border-radius: 14px; padding: 8px 4px 6px; display: flex; flex-direction: column;
  align-items: center; gap: 4px; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--ink); }
#dex-list li img { width: 44px; height: 44px; }
#dex-list li.unknown img, #dex-card img.unknown { filter: brightness(0); opacity: .28; }
#dex-list li.unknown span { color: #9aa79d; }
#dex-list li.got.legend { border-color: #e2b200; background: #fffbe6; }
#dex-card { position: fixed; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.55); padding: 24px; }
#dex-card[hidden] { display: none; }
#dex-card .c { background: var(--cream); border-radius: 22px; padding: 24px 20px; width: 100%; max-width: 320px; text-align: center; }
#dex-card img { width: 120px; height: 120px; }
#dex-card .n { font-size: 26px; font-weight: 900; margin: 6px 0; }
#dex-card .tier { display: inline-block; padding: 2px 10px; border-radius: 99px; background: #e5efe6; color: var(--green); font-size: 12px; font-weight: 900; }
#dex-card .tier.legend { background: #fff0b3; color: #8a5a00; }
#dex-card .say { font-size: 16px; font-weight: 700; margin: 8px 0; }
#dex-card .digest, #dex-card .date { font-size: 13px; color: #6b7d70; margin: 2px 0; }
#dex-card small { display: block; margin-top: 12px; color: #9aa79d; }
[hidden] { display: none !important; }
.story { background: linear-gradient(90deg, #f58529, #dd2a7b 45%, #8134af 75%, #515bd4); color: #fff; border: 0; }
.tip { margin: 8px 2px 0; padding: 8px 10px; border-radius: 10px; background: #fff3c4; color: #6b4a00; font-size: 13px; text-align: left; }
