/* NUSHI — tampilan game.
   Bahasa visual "gyotaku": HUD = sapuan tinta sumi di atas dunia, menu = lembar washi bertepi sobek,
   aksen = stempel merah (hanko) & pelampung pancing. Huruf: Alegreya (judul/angka), Alegreya Sans (UI),
   Alegreya Sans SC (label), Yuji Syuku (kanji kuas). Aset tekstur ada di assets/ui (SVG prosedural). */
:root {
  --washi: #f3ead6;
  --washi-2: #e7dcc4;
  --washi-a: rgba(246, 240, 226, 0.86);
  --ink: #1f1c18;
  --ink-2: #4a443b;
  --ink-3: #847b6b;
  --shu: #c0412f;
  --shu-d: #a03325;
  --shu-l: #ef8f74;
  --ai: #2c3a5c;
  --gold: #b8892f;
  --moss: #5d7d4c;
  --line: rgba(31, 28, 24, 0.16);
  --wash: rgba(21, 18, 14, 0.7);
  --wash-line: rgba(243, 234, 214, 0.16);
  --r: 2px;
  --display: 'Alegreya', 'Yuji Syuku', 'Hiragino Mincho ProN', serif;
  --ui: 'Alegreya Sans', 'Yuji Syuku', system-ui, sans-serif;
  --sc: 'Alegreya Sans SC', 'Alegreya Sans', system-ui, sans-serif;
  --kanji: 'Yuji Syuku', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --mono: 'Alegreya Sans', system-ui, sans-serif; /* angka memakai lnum+tnum, tanpa huruf mono */
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* tekstur */
  --fibre: url('../assets/ui/washi-fibre.svg?v=1');
  --deckle: url('../assets/ui/washi-edge.svg?v=1');
  --brush: url('../assets/ui/brush-bar.svg?v=1');
  --brush-w: url('../assets/ui/brush-wide.svg?v=1');
  --rule: url('../assets/ui/brush-rule.svg?v=1');
  --mark-rule: url('../assets/ui/brush-mark.svg?v=1');
  --enso: url('../assets/ui/enso.svg?v=1');
  --grain: url('../assets/ui/stamp-grain.svg?v=1');
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1b1a18; color: var(--ink); font-family: var(--ui); font-size: 15px; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
:focus-visible { outline: 2px solid var(--shu); outline-offset: 2px; }

/* ── bahan bersama ── */
/* lembar washi: serat + tepi sobek (border-image di luar kotak, jadi tata letak tidak bergeser) */
.dress-card, .sheet-card, .rv-card, .modal .box {
  background: var(--washi) var(--fibre) 0 0 / 320px;
  border: 0;
  border-radius: 0;
  border-image: var(--deckle) 60 / 30px / 6px round;
  filter: drop-shadow(0 20px 30px rgba(10, 8, 5, 0.42));
}
/* pita tinta: sapuan kuas lebar sebagai mask */
.tide, .pots, .feed .item, .prompt, .mylines, .phase, .online, .purse, .leave-btn, .toast {
  background: var(--wash);
  color: var(--washi);
  -webkit-mask: var(--brush-w) 0 0 / 100% 100% no-repeat;
  mask: var(--brush-w) 0 0 / 100% 100% no-repeat;
}
/* kanji vertikal pada pita merah (penanda lembar) */
.sheet-card::before, .dress-card::before {
  position: absolute; top: 0; right: 20px; z-index: 1; width: 28px; padding: 9px 0 15px;
  display: grid; place-items: center; writing-mode: vertical-rl;
  font: 400 19px/1 var(--kanji); color: var(--washi); background: var(--shu);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 7px), 0 100%);
}
#castSheet .sheet-card::before { content: '釣'; }
#menu .sheet-card::before { content: '帳'; }
#settingsSheet .sheet-card::before { content: '設'; }
#helpSheet .sheet-card::before { content: '習'; }
#shareSheet .sheet-card::before { content: '写'; }
.dress-card::before { content: '装'; }

/* ── layar muat ── */
#loader { position: fixed; inset: 0; z-index: 50; overflow: hidden; display: grid; grid-template-rows: 1fr auto; color: var(--washi); background: #15130f; transition: opacity 0.8s, visibility 0.8s; }
#loader.done { opacity: 0; visibility: hidden; }
/* latar: lukisan danau bergerak pelan + Sang Nushi berenang sebagai bayangan di bawah permukaan */
.ld-bg { position: absolute; inset: -4%; background: url('../assets/art/lake.webp') center / cover no-repeat; animation: ldDrift 24s ease-in-out infinite alternate; }
.ld-lord { position: absolute; left: 0; top: 52%; width: min(620px, 80vw); opacity: 0.5; mix-blend-mode: multiply; filter: brightness(0.25) saturate(0.4) blur(1.5px); animation: ldSwim 26s linear infinite; pointer-events: none; }
.ld-shade { position: absolute; inset: 0; background: radial-gradient(70% 55% at 50% 40%, rgba(16, 13, 11, 0.15), rgba(16, 13, 11, 0.62)), linear-gradient(180deg, rgba(16, 13, 11, 0) 55%, rgba(16, 13, 11, 0.85)); }
.ld-center { position: relative; align-self: center; justify-self: center; display: grid; justify-items: center; gap: 10px; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45); animation: ldIn 0.9s ease both; }
.ld-mark { width: 104px; height: 123px; background: var(--washi); filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.45)); -webkit-mask: url('../assets/brand/nushi-mark.svg?v=1') center / contain no-repeat; mask: url('../assets/brand/nushi-mark.svg?v=1') center / contain no-repeat; animation: ldBreath 3.2s ease-in-out infinite; }
.ld-word { font: 800 56px/1 var(--display); letter-spacing: 0.3em; margin-left: 0.3em; margin-top: 6px; }
.ld-sub { font: 500 16px var(--sc); letter-spacing: 0.32em; opacity: 0.85; margin-left: 0.32em; }
.ld-foot { position: relative; width: min(560px, 86vw); justify-self: center; padding-bottom: max(42px, env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.ld-tip { margin: 0; min-height: 2.6em; text-align: center; font: italic 500 17px/1.45 var(--display); opacity: 0.94; transition: opacity 0.35s, transform 0.35s; }
.ld-tip.out { opacity: 0; transform: translateY(4px); }
/* bar = senar pancing; pelampung merah-putih bergerak & terayun di ujungnya */
.ld-line { position: relative; height: 16px; }
.ld-bar { position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: rgba(244, 237, 221, 0.22); border-radius: 2px; }
.ld-bar i { display: block; height: 100%; width: 0; background: var(--washi); border-radius: 2px; transition: width 0.35s ease; }
.ld-bob { position: absolute; top: -3px; left: 0; width: 14px; height: 20px; margin-left: -7px; transition: left 0.35s ease; animation: ldBob 1.4s ease-in-out infinite; }
.ld-bob::before { content: ''; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(180deg, var(--shu) 50%, #f4efe6 50%); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.ld-bob::after { content: ''; position: absolute; left: 6px; top: -2px; width: 2px; height: 7px; background: #f4efe6; border-radius: 1px; }
.ld-meta { display: flex; justify-content: space-between; align-items: baseline; font: 500 14px var(--sc); letter-spacing: 0.08em; opacity: 0.85; }
.ld-note button { color: inherit; }
.ld-pct { font: 700 15px var(--ui); font-variant-numeric: lining-nums tabular-nums; }
@keyframes ldDrift { from { transform: scale(1.04) translate(-1%, 0); } to { transform: scale(1.08) translate(1%, -1%); } }
@keyframes ldSwim { from { transform: translateX(-70%) rotate(-2deg); } 50% { transform: translateX(60vw) rotate(2deg); } to { transform: translateX(120vw) rotate(-2deg); } }
@keyframes ldBreath { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes ldBob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(3px) rotate(4deg); } }
@keyframes ldIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) { .ld-word { font-size: 40px; } .ld-mark { width: 80px; height: 95px; } .ld-tip { font-size: 15.5px; } }
@media (prefers-reduced-motion: reduce) { .ld-bg, .ld-lord, .ld-mark, .ld-bob { animation: none; } .ld-lord { display: none; } }

/* ── HUD atas: tinta di atas dunia ── */
.hud { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--washi); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4); }
.mark { width: 30px; height: 35px; flex: none; background: currentColor; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.35)); -webkit-mask: url('../assets/brand/nushi-mark.svg?v=1') center / contain no-repeat; mask: url('../assets/brand/nushi-mark.svg?v=1') center / contain no-repeat; }
.word { font: 800 21px var(--display); letter-spacing: 0.26em; }
.tide { display: flex; align-items: center; gap: 10px; padding: 7px 22px 7px 14px; margin-left: 6px; }
.ring { width: 34px; height: 34px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .trk { stroke: var(--wash-line); }
.ring .val { stroke: var(--shu-l); stroke-linecap: round; stroke-dasharray: 106.8; stroke-dashoffset: 106.8; transition: stroke-dashoffset 0.5s linear; }
.tide-txt { display: flex; flex-direction: column; line-height: 1.15; }
.tide .lbl { font: 500 13px var(--sc); color: rgba(243, 234, 214, 0.66); letter-spacing: 0.06em; }
.tide .lbl b { color: var(--washi); font: 700 13px var(--ui); font-variant-numeric: lining-nums tabular-nums; }
.tide .val2 { font-size: 14.5px; font-weight: 500; }
.tag { font: 700 11.5px var(--sc); font-style: normal; padding: 0 6px 1px; margin-left: 5px; letter-spacing: 0.06em; color: var(--washi); box-shadow: inset 0 0 0 1px rgba(243, 234, 214, 0.5); }
.tag.live { background: var(--shu); box-shadow: none; }
.clock { font: 800 21px var(--display); font-variant-numeric: lining-nums tabular-nums; margin-left: 4px; min-width: 56px; text-align: right; }
.pots { display: flex; margin: 0 auto; padding: 0 12px; }
.pot { padding: 7px 15px 8px; display: flex; flex-direction: column; gap: 0; position: relative; }
.pot + .pot::before { content: ''; position: absolute; left: 0; top: 11px; bottom: 11px; width: 1px; background: var(--wash-line); }
.pot span { font: 500 12.5px var(--sc); color: rgba(243, 234, 214, 0.62); letter-spacing: 0.06em; white-space: nowrap; }
.pot b { font: 800 17px var(--display); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.pot.jp b { color: var(--shu-l); }
.hud-r { display: flex; align-items: center; gap: 8px; }
.phase { font: 600 14px var(--sc); padding: 0 18px; height: 34px; letter-spacing: 0.06em; display: inline-flex; gap: 6px; align-items: center; }
.phase::after { content: '↻'; opacity: 0.6; font-family: var(--ui); }
.ico { width: 38px; height: 38px; border-radius: 50%; background: var(--wash); color: var(--washi); font-size: 16px; display: inline-grid; place-items: center; transition: background 0.2s; }
.ico:hover, .phase:hover { background: rgba(21, 18, 14, 0.86); }
.ico.off { opacity: 0.45; }
.wbtn { height: 36px; padding: 0 20px; background: var(--washi); color: var(--ink); font: 700 15px var(--sc); letter-spacing: 0.06em; -webkit-mask: var(--brush) 0 0 / 100% 100%; mask: var(--brush) 0 0 / 100% 100%; }
.wbtn:hover { background: #fffaf0; }
.online { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 18px; font-size: 14px; white-space: nowrap; }
.online[hidden] { display: none; }
.online i { width: 7px; height: 7px; border-radius: 50%; background: #8fd19e; }
.purse { display: inline-flex; align-items: center; gap: 8px; height: 36px; white-space: nowrap; padding: 0 18px; font: 700 15px var(--ui); font-variant-numeric: lining-nums tabular-nums; }
.purse[hidden] { display: none; }
.purse i { width: 13px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe7a3, #c9973a 60%, #8a5f17); box-shadow: inset 0 0 0 1.5px rgba(120, 80, 10, 0.5); }
.wbtn.connected { background: var(--wash); color: var(--washi); font: 600 14px var(--ui); font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0.02em; -webkit-mask-image: var(--brush-w); mask-image: var(--brush-w); }

/* kolom nama di ruang ganti */
.name-in { width: 100%; height: 46px; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: rgba(255, 251, 242, 0.6); padding: 0 12px; font: 700 19px var(--display); color: var(--ink); outline: none; box-shadow: inset 0 0 0 1px var(--line); }
.name-in::placeholder { color: var(--ink-3); font-weight: 500; font-style: italic; }
.name-in:focus { border-bottom-color: var(--shu); background: #fffaf0; }

/* ── umpan aktivitas ── */
.feed { position: fixed; right: 14px; top: 76px; z-index: 9; width: 262px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: none; }
.feed .item { padding: 7px 18px 8px 20px; font-size: 14px; line-height: 1.3; animation: fin 0.4s ease-out; }
.feed .item b { font-weight: 700; }
.feed .item .w { font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }
.feed .item.rare b { color: #ecc77d; }
.feed .item.lord { background: rgba(150, 44, 30, 0.86); }
@keyframes fin { from { opacity: 0; transform: translateX(16px); } }

/* ── petunjuk & aksi ── */
.prompt { position: fixed; left: 50%; bottom: calc(118px + var(--safe-b)); transform: translateX(-50%); z-index: 9; padding: 9px 30px 10px; font-size: 16px; white-space: nowrap; transition: opacity 0.3s; }
.prompt:empty { opacity: 0; }
.mylines { position: fixed; left: 14px; top: 74px; z-index: 9; padding: 8px 22px 9px 16px; font-size: 14px; line-height: 1.4; max-width: 260px; }
.mylines:empty { display: none; }
.mylines b { font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }
/* tombol aksi: piring pernis merah dalam lingkaran kuas (enso) */
.act { position: fixed; right: 26px; bottom: calc(28px + var(--safe-b)); z-index: 11; width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #cf4a36, var(--shu) 62%, #a8372a); color: var(--washi); font: 700 19px var(--sc); letter-spacing: 0.06em; box-shadow: inset 0 0 0 3px rgba(31, 28, 24, 0.18), inset 0 0 0 4px rgba(255, 236, 214, 0.22), 0 8px 18px rgba(20, 8, 4, 0.3); display: grid; place-items: center; transition: transform 0.15s, opacity 0.3s, background 0.3s; touch-action: none; user-select: none; -webkit-user-select: none; }
.act::before { content: ''; position: absolute; inset: -11px; background: rgba(21, 18, 14, 0.62); -webkit-mask: var(--enso) center / 100% 100% no-repeat; mask: var(--enso) center / 100% 100% no-repeat; pointer-events: none; }
.act svg { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); transform: rotate(-90deg); pointer-events: none; }
.act svg circle { fill: none; stroke-width: 4; }
.act svg .trk { stroke: rgba(255, 255, 255, 0); }
.act svg .val { stroke: var(--washi); stroke-dasharray: 226.2; stroke-dashoffset: 226.2; stroke-linecap: round; }
.act:active, .act.hold { transform: scale(0.94); }
.act[disabled] { opacity: 0.35; pointer-events: none; }
.act.ink { background: var(--ink); }
.act.gold { background: radial-gradient(circle at 50% 38%, #e7c06a, #c9973a 62%, #9c6d1f); color: var(--ink); }
.act span { position: relative; text-align: center; line-height: 1.02; font-size: 18px; padding: 0 6px; }
/* joystick: lingkaran kuas tipis + kenop washi */
.stick { position: fixed; left: 26px; bottom: calc(26px + var(--safe-b)); z-index: 11; width: 120px; height: 120px; border-radius: 50%; background: rgba(21, 18, 14, 0.26); display: none; touch-action: none; }
.stick::before { content: ''; position: absolute; inset: -6px; background: rgba(243, 234, 214, 0.6); -webkit-mask: var(--enso) center / 100% 100% no-repeat; mask: var(--enso) center / 100% 100% no-repeat; pointer-events: none; }
.stick i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: var(--washi); box-shadow: inset 0 0 0 5px var(--washi), inset 0 0 0 6px rgba(31, 28, 24, 0.25), 0 4px 12px rgba(0, 0, 0, 0.25); }
.run-btn { position: fixed; left: 160px; bottom: calc(40px + var(--safe-b)); z-index: 11; width: 56px; height: 56px; border-radius: 50%; background: var(--wash); color: var(--washi); font: 700 15px var(--sc); letter-spacing: 0.04em; display: none; }
.run-btn.on { background: var(--shu); }
/* berhenti memancing (gulung senar) — muncul hanya saat menunggu/menarik */
.leave-btn { position: fixed; right: 134px; bottom: calc(52px + var(--safe-b)); z-index: 11; height: 42px; padding: 0 20px 0 24px; display: inline-flex; align-items: center; gap: 8px; font: 600 15.5px var(--sc); letter-spacing: 0.04em; }
.leave-btn[hidden] { display: none; }
.touch .leave-btn kbd { display: none; }
body.dressing .leave-btn { display: none; }
.touch .stick, .touch .run-btn { display: block; }
body.dressing .act, body.dressing .prompt, body.dressing .stick, body.dressing .run-btn, body.dressing .feed, body.dressing .mylines { display: none; }

/* ── teks & tombol umum di atas washi ── */
.kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font: 700 14px var(--sc); letter-spacing: 0.1em; color: var(--shu-d); }
.kicker::before { content: ''; flex: none; width: 7px; height: 7px; background: var(--shu); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; margin: 0 0 12px; letter-spacing: -0.005em; color: var(--ink); }
h1 { font-size: 32px; line-height: 1.05; }
h2 { font-size: 29px; line-height: 1.08; }
h3 { font-size: 19px; margin-top: 20px; }
/* tombol utama: lempeng tinta dengan ujung sapuan kuas */
.primary { width: 100%; height: 52px; background: var(--ink); color: var(--washi); font: 700 17.5px var(--sc); letter-spacing: 0.08em; -webkit-mask: var(--brush) 0 0 / 100% 100%; mask: var(--brush) 0 0 / 100% 100%; transition: background 0.2s, transform 0.1s; }
.primary:hover { background: #38332c; }
.primary:active { transform: scale(0.985); }
.primary:focus-visible { outline: 0; background: var(--ai); }
.primary.shu { background: var(--shu); }
.primary.shu:hover { background: var(--shu-d); }
.primary[disabled] { opacity: 0.4; pointer-events: none; }
/* tombol kedua: bingkai garis rambut tinta, sudut tegas */
.ghost { height: 44px; padding: 0 16px; border-radius: var(--r); background: rgba(31, 28, 24, 0.04); box-shadow: inset 0 0 0 1px rgba(31, 28, 24, 0.34); font: 600 15.5px var(--sc); letter-spacing: 0.05em; color: var(--ink); transition: background 0.15s, box-shadow 0.15s; }
.ghost:hover { background: rgba(31, 28, 24, 0.09); box-shadow: inset 0 0 0 1px rgba(31, 28, 24, 0.6); }
.ghost.wide { width: 100%; margin-top: 8px; color: var(--ink-2); }
.x { position: absolute; right: 56px; top: 8px; z-index: 2; width: 36px; height: 36px; font: 400 28px/1 var(--display); color: var(--ink-2); }
.x:hover { color: var(--shu-d); }

/* ── ruang ganti ── */
.dress { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; padding: 24px clamp(22px, 5vw, 64px); pointer-events: none; background: linear-gradient(90deg, rgba(20, 18, 15, 0.45), rgba(20, 18, 15, 0) 55%); transition: opacity 0.5s, visibility 0.5s; }
.dress.hidden { opacity: 0; visibility: hidden; }
.dress-card { pointer-events: auto; width: min(380px, 100%); padding: 28px 24px 20px; position: relative; }
.row { margin: 16px 0; }
.row .lbl { display: block; font: 600 14px var(--sc); color: var(--ink-3); letter-spacing: 0.08em; margin-bottom: 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; box-shadow: inset 0 0 0 1px rgba(31, 28, 24, 0.3); padding: 3px; }
.seg button { height: 40px; font: 700 16px var(--display); color: var(--ink-2); transition: background 0.15s, color 0.15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--washi); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), inset 0 -4px 6px rgba(0, 0, 0, 0.12); position: relative; }
.sw.on::after { content: ''; position: absolute; inset: -6px; background: var(--ink); -webkit-mask: var(--enso) center / 100% 100% no-repeat; mask: var(--enso) center / 100% 100% no-repeat; }
.soon { font: italic 500 15px/1.4 var(--display); color: var(--ink-2); padding: 1px 0 1px 12px; border-left: 2px solid var(--shu); margin: 6px 0 18px; }
.hint { font-size: 13.5px; color: var(--ink-3); text-align: center; margin: 12px 0 0; }

/* ── lembar (sheet) ── */
.sheet { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 22px; background: radial-gradient(120% 90% at 50% 45%, rgba(15, 13, 11, 0.3), rgba(15, 13, 11, 0.6)); opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s; }
.sheet.open { opacity: 1; visibility: visible; }
.sheet-card { position: relative; width: min(420px, 100%); max-height: calc(100vh - 44px); overflow: auto; padding: 26px 24px 22px; transform: translateY(14px); transition: transform 0.3s; scrollbar-width: thin; scrollbar-color: rgba(31, 28, 24, 0.3) transparent; }
.sheet.open .sheet-card { transform: none; }
.sheet-card.wide { width: min(720px, 100%); }
.sheet-card > .kicker, .sheet-card > h2 { padding-right: 70px; }
/* jumlah tali: ubin kayu bergaris rambut */
.counts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px 0 16px; }
.counts button { position: relative; height: 58px; border-radius: var(--r); box-shadow: inset 0 0 0 1px rgba(31, 28, 24, 0.28); font: 800 23px/1 var(--display); font-variant-numeric: lining-nums tabular-nums; transition: background 0.15s; }
.counts button:hover { background: rgba(31, 28, 24, 0.06); }
.counts button small { display: block; margin-top: 3px; font: 500 12.5px var(--sc); color: var(--ink-3); letter-spacing: 0.04em; }
.counts button.on { background: var(--ink); color: var(--washi); box-shadow: none; }
.counts button.on::after { content: ''; position: absolute; right: 5px; top: 5px; width: 6px; height: 6px; background: var(--shu-l); }
.counts button.on small { color: rgba(243, 234, 214, 0.62); }
.cost { position: relative; display: flex; justify-content: space-between; align-items: baseline; padding: 13px 0 12px; margin-bottom: 12px; }
.cost::before, .cost::after, .menu-tools::before, .set-togs::before, .chat-emotes::before { content: ''; position: absolute; left: 0; right: 0; height: 4px; background: var(--rule) 0 0 / 100% 100% no-repeat; pointer-events: none; }
.cost::before { top: 0; }
.cost::after { bottom: 0; transform: scaleX(-1); }
.cost span { font: 600 15px var(--sc); color: var(--ink-2); letter-spacing: 0.06em; }
.cost b { font: 800 26px var(--display); font-variant-numeric: lining-nums tabular-nums; }
.rules { list-style: none; margin: 0 0 18px; padding: 0; font-size: 15px; color: var(--ink-2); line-height: 1.45; }
.rules li { position: relative; padding-left: 18px; margin: 5px 0; }
.rules li::before { content: ''; position: absolute; left: 3px; top: 0.5em; width: 5px; height: 9px; border-radius: 3px; background: linear-gradient(var(--shu) 50%, transparent 50%); box-shadow: inset 0 0 0 1px rgba(31, 28, 24, 0.45); }
.rules b { color: var(--ink); }
.fine { font-size: 13.5px; color: var(--ink-3); text-align: center; margin: 10px 0 0; min-height: 1em; line-height: 1.45; }

/* ── kartu hasil (catatan gyotaku) ── */
.reveal { position: fixed; z-index: 25; right: clamp(16px, 4vw, 48px); top: 50%; transform: translate(30px, -50%); width: min(380px, calc(100vw - 32px)); opacity: 0; visibility: hidden; transition: opacity 0.4s, transform 0.4s, visibility 0.4s; }
.reveal.open { opacity: 1; visibility: visible; transform: translate(0, -50%); }
.rv-card { position: relative; padding: 22px 22px 18px; max-height: calc(100vh - 120px); overflow: auto; scrollbar-width: thin; }
.rv-head { display: flex; justify-content: space-between; align-items: flex-start; min-height: 30px; }
/* stempel hanko: tinta tidak rata (mask bintik), bingkai ganda */
.hanko { display: inline-block; padding: 7px 11px 7px; font: 800 16px/1 var(--sc); letter-spacing: 0.08em; color: var(--ink-2); box-shadow: inset 0 0 0 2px currentColor, inset 0 0 0 4px transparent, inset 0 0 0 5px currentColor; transform: rotate(-4deg); -webkit-mask: var(--grain) 0 0 / 120px; mask: var(--grain) 0 0 / 120px; }
.hanko.Uncommon { color: var(--moss); }
.hanko.Rare { color: var(--ai); }
.hanko.Epic { color: var(--shu); }
.hanko.Legendary { color: var(--gold); }
.hanko.Lake { color: var(--washi); background: var(--shu); box-shadow: inset 0 0 0 3px var(--shu), inset 0 0 0 4px var(--washi); }
/* kanji spesies: pita merah vertikal di pojok, seperti label gyotaku */
.rv-jp { position: absolute; top: 0; right: 22px; min-width: 32px; padding: 10px 0 16px; text-align: center; font: 400 22px/1.05 var(--kanji); color: var(--washi); background: var(--shu); writing-mode: vertical-rl; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 8px), 0 100%); }
.rv-card .kicker { margin-top: 14px; padding-right: 48px; }
.rv-card h2 { margin-bottom: 2px; padding-right: 48px; }
.rv-weight { font: 800 42px/1.05 var(--display); font-variant-numeric: lining-nums; margin: 0 0 6px; }
.rv-blurb { font: italic 500 16px/1.4 var(--display); color: var(--ink-2); margin: 0 0 14px; }
/* angka ringkasan: kisi bergaris rambut, bukan kotak berwarna */
.rv-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-bottom: 12px; border-top: 1px solid var(--line); }
.rv-stats div { padding: 8px 2px 9px; border-bottom: 1px solid var(--line); min-width: 0; }
.rv-stats div:nth-child(odd) { border-right: 1px solid var(--line); padding-right: 10px; }
.rv-stats div:nth-child(even) { padding-left: 14px; }
.rv-stats span { display: block; font: 600 13px var(--sc); color: var(--ink-3); letter-spacing: 0.05em; }
.rv-stats b { font: 800 19px var(--display); font-variant-numeric: lining-nums tabular-nums; }
.rv-stats .pay b { color: var(--shu-d); }
.rv-list { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; max-height: 128px; overflow: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 4px 7px; border-radius: var(--r); background: rgba(31, 28, 24, 0.06); box-shadow: inset 0 0 0 1px rgba(31, 28, 24, 0.1); font-size: 14px; }
.chip i { width: 4px; height: 13px; border-radius: 1px; }
.chip .w { font-weight: 700; color: var(--ink-2); font-variant-numeric: lining-nums tabular-nums; }
.rv-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.rv-btns .primary { flex: 1 1 100%; }
.rv-btns .ghost { flex: 1; }

/* ── menu ── */
.tabs { display: flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: -4px 94px 16px -4px; padding: 0 18px 4px 0; -webkit-mask: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; flex: none; white-space: nowrap; padding: 8px 10px 10px; font: 600 16px var(--sc); letter-spacing: 0.04em; color: var(--ink-3); transition: color 0.15s; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); }
.tabs button.on::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: 2px; height: 5px; background: var(--shu); -webkit-mask: var(--mark-rule) 0 0 / 100% 100% no-repeat; mask: var(--mark-rule) 0 0 / 100% 100% no-repeat; }
.tab p { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.tab code { font: 700 14px var(--ui); background: rgba(31, 28, 24, 0.07); padding: 1px 5px; border-radius: var(--r); }
.split { display: flex; height: 32px; overflow: hidden; font: 700 13.5px var(--sc); letter-spacing: 0.03em; color: var(--washi); }
.split div { display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.odds { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.odds td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.odds td:last-child, .odds td:nth-child(3) { text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.odds i { display: inline-block; width: 4px; height: 13px; border-radius: 1px; margin-right: 8px; vertical-align: -1px; }
.links a { color: var(--shu-d); }
/* buku ikan: label spesimen */
.dex { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.dex .card { position: relative; overflow: hidden; padding: 12px 12px 11px; border-radius: var(--r); background: rgba(255, 251, 242, 0.55); box-shadow: inset 0 0 0 1px var(--line); }
.dex .card .jp { position: absolute; right: 8px; top: 6px; font: 400 30px/1 var(--kanji); color: rgba(31, 28, 24, 0.16); writing-mode: vertical-rl; }
.dex .card b { display: block; font: 800 17px var(--display); padding-right: 26px; }
.dex .card small { font: 600 13px var(--sc); color: var(--ink-3); letter-spacing: 0.04em; }
.dex .card .n { font-size: 14px; font-variant-numeric: lining-nums tabular-nums; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); }
.dex .card.locked b { color: var(--ink-3); }
.dex .card.locked { opacity: 0.6; background: transparent; }
.board h4, .haul h4 { font: 800 18px var(--display); margin: 16px 0 6px; }
.lb { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.lb td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.lb td.r { text-align: right; font-variant-numeric: lining-nums tabular-nums; }

/* ── toast & modal dompet (dipakai wallet.js) ── */
.toast { position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 60; padding: 11px 34px 12px; font-size: 16px; background: rgba(21, 18, 14, 0.9); opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none; max-width: calc(100vw - 24px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; z-index: 70; display: none; place-items: center; background: rgba(15, 13, 11, 0.5); padding: 22px; }
.modal.open { display: grid; }
.modal .box { width: min(380px, 100%); padding: 22px; }
.modal h3 { margin-top: 0; }
.modal p { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.wlist { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.wlist button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); box-shadow: inset 0 0 0 1px rgba(31, 28, 24, 0.24); font-weight: 600; font-size: 15.5px; }
.wlist button:hover { background: rgba(31, 28, 24, 0.06); }
.wlist img { width: 26px; height: 26px; border-radius: 6px; }
.modal .btn.ghost { width: 100%; height: 42px; }

/* ── banner besar (Fish on! / THE NUSHI): judul di atas sapuan tinta ── */
.banner { position: fixed; left: 0; right: 0; top: 30%; z-index: 24; width: max-content; max-width: 94vw; margin: 0 auto; padding: 22px clamp(40px, 7vw, 90px) 26px; text-align: center; pointer-events: none; font: 800 clamp(40px, 8vw, 84px)/1 var(--display); color: var(--washi); background: rgba(21, 18, 14, 0.72); -webkit-mask: var(--brush-w) 0 0 / 100% 100% no-repeat; mask: var(--brush-w) 0 0 / 100% 100% no-repeat; opacity: 0; transform: scale(0.94); transition: opacity 0.35s, transform 0.35s; letter-spacing: 0.01em; }
.banner.show { opacity: 1; transform: none; }
.banner small { display: block; font: 700 17px var(--sc); letter-spacing: 0.24em; margin-top: 10px; opacity: 0.85; }
.banner.lord { color: #ffe3a1; background: rgba(120, 32, 22, 0.8); }
.flash { position: fixed; inset: 0; z-index: 23; background: #fff6dc; opacity: 0; pointer-events: none; transition: opacity 1.2s; }
.flash.on { opacity: 0.85; transition: none; }

/* ── laptop sedang: HUD dirampingkan ── */
@media (max-width: 1400px) and (min-width: 761px) {
  .hide-sm { display: none; }
  .tide .val2 { max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pot { padding: 7px 12px 8px; }
  .purse, .online { white-space: nowrap; }
}
@media (max-width: 1180px) and (min-width: 761px) {
  .word { display: none; }
  .phase { padding: 0 14px; }
  .online { font-size: 0; gap: 0; padding: 0 16px; }
  .online i { width: 9px; height: 9px; }
}
/* ── HP ── */
@media (max-width: 760px) {
  .hud { flex-wrap: wrap; padding: 8px 10px; gap: 6px; }
  .word { display: none; }
  .tide { order: 2; padding: 4px 16px 4px 10px; margin-left: 0; }
  .tide .val2 { font-size: 13.5px; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .clock { font-size: 17px; min-width: 46px; }
  .hud-r { order: 3; margin-left: auto; gap: 6px; }
  .phase { order: -1; padding: 0 12px; height: 32px; font-size: 13px; }
  .ico { width: 34px; height: 34px; }
  .online { display: none; }
  .purse { padding: 0 14px; font-size: 14px; }
  .pots { order: 4; width: 100%; margin: 0; padding: 0 6px; }
  .pot { flex: 1; padding: 5px 9px 6px; }
  .pot span { font-size: 11.5px; letter-spacing: 0.03em; }
  .pot b { font-size: 15px; }
  .hide-sm { display: none; }
  .feed { top: auto; bottom: calc(150px + var(--safe-b)); right: 10px; width: 220px; }
  .feed .item { font-size: 13px; padding: 6px 14px 7px 16px; }
  .feed .item:nth-child(n + 3) { display: none; }
  .mylines { top: 124px; left: 10px; font-size: 13px; }
  .act { width: 82px; height: 82px; right: 20px; bottom: calc(24px + var(--safe-b)); }
  .act span { font-size: 17px; }
  .prompt { bottom: calc(130px + var(--safe-b)); font-size: 14.5px; padding: 8px 24px 9px; }
  .dress { align-items: flex-end; padding: 14px; background: linear-gradient(0deg, rgba(20, 18, 15, 0.5), rgba(20, 18, 15, 0) 60%); }
  .dress-card { padding: 20px 18px 14px; }
  .dress-card h1 { font-size: 26px; padding-right: 40px; }
  .row { margin: 11px 0; }
  .dress-card .soon { display: none; }
  .dress-card .kicker { display: none; }
  .sw { width: 30px; height: 30px; }
  .seg button { height: 36px; }
  .sheet { padding: 16px 14px; }
  .sheet-card { padding: 22px 18px 18px; max-height: calc(100vh - 32px); }
  .sheet-card::before { right: 14px; }
  .x { right: 48px; }
  h2 { font-size: 26px; }
  .tabs { margin-right: 84px; }
  .reveal { left: 14px; right: 14px; top: auto; bottom: 14px; transform: translateY(30px); width: auto; }
  .reveal.open { transform: none; }
  .rv-card { max-height: 62vh; }
  .rv-weight { font-size: 36px; }
  .banner { padding: 18px 34px 22px; }
}
/* turnamen mingguan */
.lb tr.you td { background: rgba(201, 151, 58, 0.16); }
.lb td.muted { color: var(--ink-3); }
.board .fine { text-align: left; }
/* chip interaksi fitur (F · Open shop, Board boat, …) */
.interact-chip { position: fixed; left: 50%; bottom: 128px; transform: translateX(-50%); z-index: 30; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 8px; background: rgba(29, 27, 25, 0.86); color: var(--washi, #f4eddd); border-radius: 6px; font: 600 15px 'Alegreya Sans', system-ui, sans-serif; }
.interact-chip[hidden] { display: none; } /* display:inline-flex di atas mengalahkan atribut hidden */
.interact-chip kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 4px; background: var(--washi, #f4eddd); color: var(--ink, #1d1b19); font: 700 13px 'Alegreya Sans SC', 'Alegreya Sans', sans-serif; }
