/* シャーレ — a light table on a night desk; living colour inside the dish, precise paper outside it. */
/* fonts are bundled (subset, OFL): the app makes no network requests */
@font-face { font-family: 'Shippori Mincho'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/ShipporiMincho-500.woff2') format('woff2'); }
@font-face { font-family: 'Shippori Mincho'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/ShipporiMincho-700.woff2') format('woff2'); }
@font-face { font-family: 'Shippori Mincho'; font-weight: 800; font-style: normal; font-display: swap; src: url('fonts/ShipporiMincho-800.woff2') format('woff2'); }
@font-face { font-family: 'Zen Kaku Gothic New'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/ZenKakuGothicNew-400.woff2') format('woff2'); }
@font-face { font-family: 'Zen Kaku Gothic New'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/ZenKakuGothicNew-500.woff2') format('woff2'); }
@font-face { font-family: 'Zen Kaku Gothic New'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/ZenKakuGothicNew-700.woff2') format('woff2'); }
@font-face { font-family: 'DM Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/DMMono-400.woff2') format('woff2'); }
@font-face { font-family: 'DM Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/DMMono-500.woff2') format('woff2'); }
:root {
  --desk: #10161a;
  --desk-2: #172025;
  --desk-3: #212c31;
  --paper: #f3eee2;
  --paper-2: #e6ddc8;
  --paper-3: #d6cbb1;
  --ink: #1b2225;
  --ink-2: #4a5558;
  --muted: #8b9a9d;
  --line: rgba(243, 238, 226, .13);
  --line-2: rgba(243, 238, 226, .24);
  --gold: #e8c26a;
  --gold-2: #f3d995;
  --invader: #b65fd8;
  --invader-ink: #30203c;
  --bad: #d4645a;
  --mincho: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --gothic: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SFMono-Regular', monospace;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--desk);
  color: var(--paper);
  font-family: var(--gothic);
  overflow: hidden;
  overscroll-behavior: none; /* no rubber-banding of the whole page */
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* the desk: faint wood-free darkness, a light table glowing under the dish */
#app {
  position: relative;
  height: 100%;
  height: 100dvh;
  padding: 0 var(--safe-r) 0 var(--safe-l);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(ellipse 60% 50% at 50% 42%, rgba(255, 222, 160, .13), transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 0%, var(--desk-2), var(--desk) 70%);
}
#app::after { /* paper grain over everything, very faint */
  content: '';
  position: absolute; inset: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- top bar ---------- */
#top {
  display: flex; align-items: center; gap: 14px;
  padding: calc(10px + var(--safe-t)) 16px 6px;
  min-height: 52px;
  transition: opacity .5s;
}
.brand { font-family: var(--mincho); font-weight: 700; font-size: 17px; letter-spacing: .3em; color: var(--paper-2); }
#days { display: flex; gap: 7px; margin: 0 auto; padding: 0; list-style: none; }
#days li {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--line-2);
  position: relative;
  transition: background .4s, border-color .4s, transform .4s var(--ease-spring);
}
#days li.done { background: radial-gradient(circle at 40% 40%, var(--gold-2), var(--gold)); border-color: var(--gold); }
#days li.lost { background: var(--invader-ink); border-color: var(--invader); }
#days li.now { border-color: var(--paper); transform: scale(1.2); box-shadow: 0 0 0 3px rgba(243, 238, 226, .12); }
#days li.final::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; border: 1px dashed var(--invader); }
.top-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 1px solid transparent; border-radius: 12px; cursor: pointer; color: var(--paper-2);
  transition: background .2s, border-color .2s, transform .1s;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: rgba(243, 238, 226, .06); border-color: var(--line); }
.icon-btn:active { transform: scale(.94); }

/* ---------- board ---------- */
#board { display: flex; justify-content: center; align-items: center; gap: 24px; min-height: 0; padding: 0 12px; }
#dishArea { display: flex; justify-content: center; align-items: center; min-width: 0; }
#dishWrap { position: relative; touch-action: none; }
#dishWrap canvas { position: absolute; inset: 0; display: block; }
#dishFX { cursor: crosshair; }
#app:not([data-phase="aim"]) #dishFX { cursor: default; }

/* the day's card, laid over the fresh plate */
#dayCard {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.96);
  min-width: 220px; max-width: 86%;
  padding: 18px 26px 16px; text-align: center;
  background: rgba(16, 22, 26, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--line-2); border-radius: 18px;
  opacity: 0; pointer-events: none;
  transition: opacity .45s var(--ease-out), transform .6s var(--ease-out);
}
#dayCard.show { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; cursor: pointer; }
#dayCard .d { font-family: var(--mincho); font-size: 34px; font-weight: 800; letter-spacing: .18em; }
#dayCard .goal { margin-top: 2px; font-size: 14px; color: var(--paper-2); }
#dayCard .goal b { font-family: var(--mono); font-size: 22px; color: var(--gold); font-weight: 500; margin: 0 2px; }
#dayCard .foe { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: #dcbfe8; display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
#dayCard .tap { margin-top: 10px; font-size: 11px; color: var(--muted); letter-spacing: .2em; }

/* judgement stamp */
#stamp {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-9deg) scale(1.6);
  font-family: var(--mincho); font-weight: 800; font-size: clamp(26px, 7vw, 40px); letter-spacing: .25em;
  padding: 12px 10px 12px 22px; border: 4px double currentColor; border-radius: 10px;
  opacity: 0; pointer-events: none; text-align: center; white-space: nowrap;
}
#stamp small { display: block; font-family: var(--mono); font-size: 15px; letter-spacing: .1em; font-weight: 500; margin-top: 2px; }
#stamp.pass { color: var(--gold); text-shadow: 0 0 20px rgba(232, 194, 106, .5); background: rgba(16, 22, 26, .55); }
#stamp.fail { color: var(--bad); background: rgba(16, 22, 26, .6); }
#stamp.show { animation: stamp .55s var(--ease-spring) forwards; }
@keyframes stamp { from { opacity: 0; transform: translate(-50%, -50%) rotate(-9deg) scale(1.6); } to { opacity: 1; transform: translate(-50%, -50%) rotate(-9deg) scale(1); } }

/* generations: eight marks along the lower rim */
#gen { position: absolute; left: 50%; bottom: 9.5%; transform: translateX(-50%); display: flex; gap: 6px; padding: 5px 9px; border-radius: 999px; background: rgba(16, 22, 26, .62); opacity: 0; transition: opacity .3s; }
#gen.show { opacity: 1; }
#gen i { width: 7px; height: 7px; border-radius: 50%; background: rgba(243, 238, 226, .2); transition: background .2s, transform .2s; }
#gen i.on { background: var(--paper); transform: scale(1.15); }
#speedBtn {
  position: absolute; right: 2%; bottom: 1%;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(16, 22, 26, .7); border: 1px solid var(--line-2); color: var(--paper-2); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .3s, background .2s;
}
#speedBtn svg { width: 18px; height: 18px; }
#speedBtn.show { opacity: 1; pointer-events: auto; }
#speedBtn.on { background: var(--paper); color: var(--ink); }

/* ---------- notebook ---------- */
#notebook {
  width: 300px; flex: none; align-self: center;
  max-height: 100%; overflow-y: auto;
  background: var(--paper); color: var(--ink);
  border-radius: 6px;
  padding: 14px 16px 16px;
  box-shadow: 0 1px 0 var(--paper-3), 0 18px 40px rgba(0, 0, 0, .45);
  background-image: repeating-linear-gradient(transparent 0 27px, rgba(27, 34, 37, .06) 27px 28px);
}
.sheet-handle { display: none; }
.nb-sec + .nb-sec { margin-top: 14px; }
.nb-sec h2 { margin: 0 0 6px; font-family: var(--mincho); font-size: 14px; font-weight: 700; letter-spacing: .15em; color: var(--ink-2); border-bottom: 1px solid rgba(27, 34, 37, .18); padding-bottom: 4px; }
#nbStrains { list-style: none; margin: 0; padding: 0; }
#nbStrains li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 4px 0; }
#nbStrains .sw { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .25); }
#nbStrains .nm { font-family: var(--mincho); font-weight: 700; font-size: 15px; display: flex; gap: 6px; align-items: center; }
#nbStrains .tr { display: inline-flex; gap: 2px; color: var(--ink-2); }
#nbStrains .tr svg { width: 15px; height: 15px; }
#nbStrains .pc { font-family: var(--mono); font-size: 13px; color: var(--ink-2); min-width: 3.2em; text-align: right; }
#nbStrains li.absent { opacity: .45; }
#nbStrains li.foe .nm { color: #5d3270; }
.trait-line { display: grid; grid-template-columns: 20px 1fr; gap: 6px; align-items: start; font-size: 12.5px; line-height: 1.5; padding: 2px 0; }
.trait-line svg { width: 18px; height: 18px; margin-top: 1px; }
.trait-line b { font-weight: 700; margin-right: 4px; }
#nbInvader .head { font-family: var(--mincho); font-weight: 700; font-size: 15px; color: #5d3270; margin-bottom: 2px; }
#nbEnv { list-style: none; margin: 0; padding: 0; }
.muted-note { font-size: 12px; color: var(--ink-2); }

/* ---------- console: share bar + hand ---------- */
#console { padding: 6px 12px calc(10px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 10px; transition: opacity .5s; }
#shareBar { width: min(100%, 560px); }
#shareBar .labels { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
#shareBar .labels span { display: flex; align-items: baseline; gap: 6px; }
#shareBar small { font-size: 11px; color: var(--muted); letter-spacing: .1em; }
#shareBar b { font-family: var(--mono); font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; }
#shareBar .theirs b { color: #d7a6ea; }
#shareBar.passing .mine b { color: var(--gold); }
.track { position: relative; height: 12px; border-radius: 6px; background: rgba(243, 238, 226, .07); box-shadow: inset 0 0 0 1px var(--line); overflow: visible; }
.segs { position: absolute; inset: 0 auto 0 0; display: flex; border-radius: 6px 0 0 6px; overflow: hidden; }
.segs i { display: block; height: 100%; transition: width .35s var(--ease-out); }
.inv { position: absolute; inset: 0 0 0 auto; width: 0; border-radius: 0 6px 6px 0; background: linear-gradient(90deg, #4a2c5c, var(--invader-ink)); box-shadow: inset 2px 0 0 var(--invader); transition: width .35s var(--ease-out); }
.tline { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: var(--paper); border-radius: 1px; transition: left .6s var(--ease-out), background .3s; }
.tline span { position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; color: var(--paper-2); white-space: nowrap; }
#shareBar.passing .tline { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
#shareBar.passing .tline span { color: var(--gold); }

#handRow { display: flex; align-items: stretch; gap: 10px; width: min(100%, 560px); }
#drops { display: flex; flex-direction: column; justify-content: center; gap: 4px; color: #9fd3e0; }
#drops i { width: 16px; height: 20px; display: block; transition: opacity .3s, transform .3s var(--ease-spring); }
#drops i svg { width: 100%; height: 100%; filter: drop-shadow(0 0 4px rgba(159, 211, 224, .45)); }
#drops i.used { opacity: .16; transform: scale(.75); }
#hand { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; transition: opacity .3s; }
#hand.wait { opacity: .45; pointer-events: none; }

/* a specimen label */
.card {
  position: relative; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 8px 9px 9px; text-align: left; cursor: pointer;
  background: var(--paper); color: var(--ink);
  border: none; border-radius: 6px;
  box-shadow: 0 1px 0 var(--paper-3), 0 6px 16px rgba(0, 0, 0, .35);
  transition: transform .22s var(--ease-spring), box-shadow .22s;
}
.card::before { /* the coloured tab at the top of the label */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 6px 6px 0 0; background: var(--c);
}
.card:hover { transform: translateY(-3px); }
.card.sel { transform: translateY(-8px); box-shadow: 0 0 0 2px var(--c), 0 14px 26px rgba(0, 0, 0, .45); }
.card:active { transform: translateY(-5px) scale(.98); }
.card .rec { position: absolute; top: -9px; right: 8px; padding: 2px 8px; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 11px; font-weight: 700; letter-spacing: .08em; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.card .head { display: flex; align-items: center; gap: 7px; width: 100%; }
.card canvas { width: 30px; height: 30px; flex: none; }
.card .nm { font-family: var(--mincho); font-weight: 800; font-size: 18px; letter-spacing: .05em; line-height: 1; }
.card .key { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
@media (hover: none) { .card .key { display: none; } } /* the 1-3 keys are a keyboard hint */
.card .traits { display: flex; flex-direction: column; gap: 1px; width: 100%; }
.card .traits span { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .traits svg { width: 15px; height: 15px; flex: none; color: var(--ink); }

/* ---------- full-screen layers ---------- */
#layer { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l)); overflow-y: auto; }
#layer[hidden] { display: none; }
#layer.dim { background: rgba(9, 13, 15, .78); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .3s; }
#layer.solid { background: radial-gradient(ellipse at 50% 30%, var(--desk-3), var(--desk) 75%); animation: fade .4s; }
#layer.clear { background: linear-gradient(180deg, rgba(16, 22, 26, .35), rgba(16, 22, 26, .1) 40%, rgba(16, 22, 26, .85)); }
@keyframes fade { from { opacity: 0; } }
.panel {
  width: min(100%, 560px); max-height: 100%; overflow-y: auto;
  background: var(--paper); color: var(--ink); border-radius: 10px;
  padding: 22px 22px 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: rise .45s var(--ease-out);
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.panel h2 { margin: 0 0 12px; font-family: var(--mincho); font-size: 22px; letter-spacing: .12em; }
.panel h3 { margin: 16px 0 6px; font-family: var(--mincho); font-size: 15px; letter-spacing: .1em; border-bottom: 1px solid rgba(27, 34, 37, .16); padding-bottom: 3px; }
.panel p { margin: 4px 0; font-size: 14px; line-height: 1.7; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(243, 238, 226, .04); color: var(--paper);
  font-size: 15px; letter-spacing: .12em;
  transition: background .2s, transform .12s, border-color .2s;
}
.btn:hover { background: rgba(243, 238, 226, .1); border-color: var(--paper-2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--paper); color: var(--ink); border-color: var(--paper); font-weight: 700; }
.btn.primary:hover { background: #fff; }
.btn.ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.panel .btn { color: var(--ink); border-color: rgba(27, 34, 37, .25); background: none; }
.panel .btn.ink { color: var(--paper); background: var(--ink); }
.panel .btn.danger { color: #9c2f28; border-color: rgba(156, 47, 40, .4); }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* title */
.title-screen { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; margin-top: auto; margin-bottom: auto; }
.title-screen .title-name { margin: 0; font-family: var(--mincho); font-weight: 800; font-size: clamp(56px, 15vw, 112px); letter-spacing: .22em; padding-left: .22em; line-height: 1; text-shadow: 0 6px 30px rgba(0, 0, 0, .6); animation: titleIn 1.6s var(--ease-out); }
.title-screen .sub { font-family: var(--mono); font-size: 12px; letter-spacing: .6em; color: var(--paper-2); padding-left: .6em; animation: titleIn 1.6s .2s var(--ease-out) backwards; }
.title-screen .tag { font-family: var(--mincho); font-size: 15px; color: var(--paper-2); letter-spacing: .15em; animation: titleIn 1.6s .35s var(--ease-out) backwards; }
@keyframes titleIn { from { opacity: 0; transform: translateY(10px); letter-spacing: .5em; } }
.title-menu { display: flex; flex-direction: column; gap: 10px; width: min(100%, 300px); margin-top: 18px; animation: titleIn 1.4s .5s var(--ease-out) backwards; }
.title-menu .btn { width: 100%; }
.title-menu .btn small { font-family: var(--mono); font-size: 11px; color: inherit; opacity: .7; letter-spacing: .05em; }
.title-stats { margin-top: 10px; font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .12em; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.title-foot { display: flex; gap: 4px; justify-content: center; }

/* reward */
.reward-screen { width: min(100%, 760px); text-align: center; animation: rise .45s var(--ease-out); }
.reward-screen .kicker { font-family: var(--mincho); font-size: 26px; font-weight: 800; letter-spacing: .2em; }
.reward-screen .kicker small { display: block; font-family: var(--mono); font-size: 13px; color: var(--gold); letter-spacing: .15em; font-weight: 400; margin-top: 4px; }
.reward-screen .lead { color: var(--paper-2); font-size: 14px; margin: 10px 0 18px; }
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.offer {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 8px; text-align: left;
  background: var(--paper); color: var(--ink); border: none; border-radius: 8px; padding: 14px 14px 16px; cursor: pointer;
  box-shadow: 0 1px 0 var(--paper-3), 0 14px 30px rgba(0, 0, 0, .45);
  transition: transform .25s var(--ease-spring), box-shadow .25s;
  animation: rise .5s var(--ease-out) backwards;
}
.offer:hover { transform: translateY(-6px); box-shadow: 0 0 0 2px var(--gold), 0 20px 40px rgba(0, 0, 0, .5); }
.offer.picked { animation: picked .55s var(--ease-out) forwards; }
@keyframes picked { to { transform: translateY(-30px) scale(.9); opacity: 0; } }
.offer .kind { font-size: 11px; letter-spacing: .25em; color: var(--ink-2); }
.offer .vial { display: flex; align-items: center; gap: 10px; }
.offer .vial canvas { width: 54px; height: 54px; flex: none; }
.offer .vial .nm { font-family: var(--mincho); font-weight: 800; font-size: 20px; line-height: 1.25; }
.offer .vial .nm small { display: block; font-family: var(--gothic); font-weight: 400; font-size: 11px; color: var(--ink-2); letter-spacing: .05em; }
.offer .vial .arrow { color: var(--ink-2); font-size: 18px; }
.offer .desc { font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }
.offer .desc .trait-line { color: var(--ink); }
.offer .new { color: #2f6e4a; }
.library-strip { margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.library-strip .chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--paper-2); }
.library-strip .chip i { width: 12px; height: 12px; border-radius: 50%; display: block; }

/* end of run */
.end-screen { width: min(100%, 720px); display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; animation: rise .6s var(--ease-out); }
.specimen { position: relative; width: min(64vw, 280px); aspect-ratio: 1; }
.specimen img { width: 100%; height: 100%; display: block; border-radius: 50%; box-shadow: 0 20px 50px rgba(0, 0, 0, .55); }
.specimen .label {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%) rotate(-2deg);
  background: var(--paper); color: var(--ink); padding: 6px 14px; border-radius: 3px; white-space: nowrap;
  font-family: var(--mincho); font-weight: 700; font-size: 13px; box-shadow: 0 6px 16px rgba(0, 0, 0, .4);
}
.specimen .label small { font-family: var(--mono); font-weight: 400; font-size: 11px; color: var(--ink-2); margin-left: 6px; }
.end-info h2 { margin: 0; font-family: var(--mincho); font-weight: 800; font-size: 30px; letter-spacing: .15em; }
.end-info .why { color: var(--paper-2); margin: 6px 0 14px; font-size: 14px; line-height: 1.6; }
.end-info .hint { margin: -4px 0 14px; padding: 10px 14px; border-left: 3px solid var(--gold); background: rgba(243, 238, 226, .06); border-radius: 0 8px 8px 0; font-size: 14px; line-height: 1.6; color: var(--paper); }
.end-info .hint b { display: block; font-size: 11px; letter-spacing: .2em; color: var(--gold); margin-bottom: 2px; }
.history { display: flex; gap: 6px; align-items: flex-end; height: 74px; margin: 6px 0 4px; }
.history .b { flex: 1; position: relative; height: 100%; background: rgba(243, 238, 226, .05); border-radius: 3px; }
.history .b i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 3px; background: var(--gold); transform-origin: bottom; animation: grow .7s var(--ease-out) backwards; }
.history .b.fail i { background: var(--bad); }
.history .b em { position: absolute; left: -2px; right: -2px; height: 2px; background: var(--paper); opacity: .6; }
.history .b span { position: absolute; top: calc(100% + 3px); left: 0; right: 0; text-align: center; font-family: var(--mono); font-size: 11px; color: var(--muted); }
@keyframes grow { from { transform: scaleY(0); } }
.end-info .lib { margin: 22px 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.end-info .lib .chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--paper-2); }
.end-info .lib .chip i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.end-info .row { justify-content: flex-start; }

/* shelf */
.shelf { width: min(100%, 860px); max-height: 100%; overflow-y: auto; animation: rise .45s var(--ease-out); }
.shelf header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.shelf h2 { margin: 0; font-family: var(--mincho); font-size: 24px; letter-spacing: .15em; }
.shelf .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 14px; }
.shelf figure { margin: 0; text-align: center; }
.shelf figure img { width: 100%; aspect-ratio: 1; border-radius: 50%; display: block; box-shadow: 0 10px 24px rgba(0, 0, 0, .5); }
.shelf figcaption { margin-top: 8px; font-size: 12px; color: var(--paper-2); }
.shelf figcaption b { display: block; font-family: var(--mincho); font-size: 14px; color: var(--paper); }
.shelf figure.won img { box-shadow: 0 0 0 3px var(--gold), 0 10px 24px rgba(0, 0, 0, .5); }
.empty { text-align: center; color: var(--muted); padding: 50px 10px; line-height: 1.8; }
.empty .ring { width: 90px; height: 90px; margin: 0 auto 14px; border-radius: 50%; border: 1.5px dashed var(--line-2); }

/* settings */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(27, 34, 37, .1); font-size: 14px; }
.set-row input[type=range] { width: 160px; height: 44px; accent-color: var(--ink); }
.toggle { position: relative; width: 64px; height: 44px; background: none; border: none; cursor: pointer; flex: none; }
.toggle::before { content: ''; position: absolute; left: 7px; top: 7px; width: 50px; height: 30px; border-radius: 15px; background: var(--paper-3); transition: background .2s; }
.toggle::after { content: ''; position: absolute; top: 10px; left: 10px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s var(--ease-out); }
.toggle[aria-checked="true"]::before { background: var(--ink); }
.toggle[aria-checked="true"]::after { transform: translateX(20px); }
.seg { display: inline-flex; border: 1px solid rgba(27, 34, 37, .25); border-radius: 999px; overflow: hidden; }
.seg button { border: none; background: none; min-height: 44px; padding: 0 16px; cursor: pointer; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* rules */
.rules .fig { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; margin: 6px 0; font-size: 13.5px; line-height: 1.6; }
.rules .fig svg { width: 22px; height: 22px; margin-top: 2px; }
.rules .steps { counter-reset: s; list-style: none; padding: 0; margin: 6px 0; }
.rules .steps li { position: relative; padding-left: 30px; margin: 6px 0; font-size: 14px; line-height: 1.6; }
.rules .steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 1px; width: 21px; height: 21px; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 12px; display: grid; place-items: center; }
.rules .bar-demo { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 8px 0 4px; position: relative; background: var(--paper-2); }
.rules .bar-demo i { display: block; height: 100%; }
.rules .bar-demo em { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.panel .close-row { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
/* long sheets (rules): the close button stays in reach instead of waiting at the bottom of the scroll */
.panel .close-row { position: sticky; bottom: -18px; margin: 14px -22px -18px; padding: 24px 22px 18px; background: linear-gradient(rgba(243, 238, 226, 0), var(--paper) 42%); }

/* confirm & pause */
.menu-panel { width: min(100%, 340px); text-align: center; }
.menu-panel .btn { width: 100%; margin: 5px 0; }

/* ---------- coach marks (first run) ---------- */
#coach { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
#coach[hidden] { display: none; }
#coach .hole { position: absolute; border-radius: 14px; /* circle for the dish */ box-shadow: 0 0 0 200vmax rgba(9, 13, 15, .62); transition: all .45s var(--ease-out); }
#coach .tip {
  position: absolute; width: min(320px, calc(100vw - 32px)); pointer-events: auto;
  background: var(--paper); color: var(--ink); border-radius: 10px; padding: 14px 16px 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5); font-size: 14px; line-height: 1.65;
  animation: rise .4s var(--ease-out);
}
#coach .tip b { font-weight: 700; }
#coach .tip .step { font-family: var(--mono); font-size: 11px; color: var(--ink-2); letter-spacing: .15em; }
#coach .tip .row { justify-content: flex-end; margin-top: 8px; }
#coach .tip .btn { min-height: 38px; padding: 0 16px; font-size: 13px; color: var(--ink); border-color: rgba(27, 34, 37, .3); background: none; }
#coach .tip .btn.ink { color: var(--paper); background: var(--ink); }

/* ---------- screens ---------- */
#app[data-screen="title"] #top,
#app[data-screen="title"] #console,
#app[data-screen="title"] #notebook { opacity: 0; pointer-events: none; }
#app[data-screen="title"] #notebook { display: none; }
#app[data-screen="title"] #dishWrap { filter: saturate(.85) brightness(.55); }
#dishWrap { transition: filter .8s; }

/* ---------- layout: narrow (phones, portrait) ---------- */
@media (max-width: 959px), (orientation: portrait) {
  .brand { display: none; }
  #board { padding: 0 4px; }
  #days { margin: 0; }
  #top { justify-content: space-between; }
  #notebook {
    position: fixed; left: 0; right: 0; bottom: 0; width: auto; z-index: 20;
    max-height: 70vh; border-radius: 16px 16px 0 0; padding: 8px 18px calc(18px + var(--safe-b));
    transform: translateY(105%); transition: transform .4s var(--ease-out);
  }
  #notebook.open { transform: none; }
  .sheet-handle { display: block; width: 40px; height: 4px; border-radius: 2px; background: rgba(27, 34, 37, .25); margin: 4px auto 10px; }
  .end-screen { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 30px; }
  .end-info .row, .end-info .lib { justify-content: center; }
}
@media (min-width: 960px) and (orientation: landscape) {
  #notesBtn { display: none; }
}
@media (max-width: 380px) {
  .card .nm { font-size: 16px; }
  .card .traits span { font-size: 11px; }
}

/* fewer moving parts when asked */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .01s !important; transition-duration: .01s !important; }

/* ---------- 今日の培養 ---------- */
.btn.daily { border-color: rgba(232, 194, 106, .7); color: var(--gold-2); background: rgba(232, 194, 106, .09); }
.btn.daily:hover { background: rgba(232, 194, 106, .16); border-color: var(--gold); }
.btn.daily small { color: var(--paper-2); }
.btn.daily.done { border-color: var(--line-2); color: var(--paper); background: rgba(243, 238, 226, .04); }
.daily-card { margin: 0 0 16px; padding: 12px 16px; border: 1px solid rgba(232, 194, 106, .45); border-radius: 12px; background: rgba(232, 194, 106, .07); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; }
.daily-card .k { font-size: 12px; letter-spacing: .2em; color: var(--gold); }
.daily-card .score { font-family: var(--mono); font-size: 38px; font-weight: 500; line-height: 1.1; }
.daily-card .score small { font-size: 14px; margin-left: 4px; color: var(--paper-2); }
.daily-card .sub { font-size: 13px; color: var(--paper-2); line-height: 1.5; }
.daily-card .btn { margin-top: 8px; }
.daily-card.practice { border-color: var(--line); background: rgba(243, 238, 226, .04); }
.daily-card.practice .k { color: var(--muted); letter-spacing: .1em; }
.daily-card.inline { align-items: center; text-align: center; background: none; border: none; margin: 0; }
.daily-sheet { width: min(100%, 420px); text-align: center; display: flex; flex-direction: column; gap: 10px; animation: rise .45s var(--ease-out); }
.daily-sheet h2 { margin: 0; font-family: var(--mincho); font-size: 24px; letter-spacing: .15em; }
.daily-sheet .history { margin: 8px 0 18px; }
.daily-sheet .sub.dim { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
#dayCard .dline { font-size: 12px; letter-spacing: .25em; color: var(--gold); margin-bottom: 6px; }
@media (max-width: 959px), (orientation: portrait) { .end-info .daily-card { align-items: center; text-align: center; } }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
