/* App layout and components. Colors only through tokens. */
.app { min-height: 100%; display: grid; grid-template-rows: auto 1fr auto; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 24px; padding: 0 20px; min-height: 60px; border-bottom: 2px solid var(--wood-dark); background: rgba(20, 12, 6, 0.35); }
.brand { font: 700 24px var(--font-head); letter-spacing: 0.5px; color: var(--brass); display: flex; flex-direction: column; line-height: 1.05; }
.brand .version { font: 500 11px var(--font-ui); letter-spacing: 0.5px; color: var(--cream-muted); }
.money { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 600; }
.lvl { display: flex; align-items: center; gap: 10px; }
.lvl b { font-size: 15px; }
.xpbar { width: 140px; height: 8px; border-radius: 4px; background: var(--wood-dark); overflow: hidden; }
.xpbar > span { display: block; height: 100%; background: var(--xp); }
.lvl small { font-size: 13px; color: var(--cream-muted); }
.spacer { flex: 1; }
.clock { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.clock small { color: var(--cream-muted); font-size: 13px; }
.journal-btn { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 8px; background: var(--paper); color: var(--ink); font: 600 16px var(--font-head); border: 2px solid var(--brass-edge); }

/* Main row */
.main { display: grid; grid-template-columns: minmax(0, 1fr) 368px; gap: 16px; padding: 16px 16px 0; min-height: 0; }
.scene-wrap { position: relative; border-radius: var(--radius-l); overflow: hidden; border: 3px solid var(--brass-edge); background: var(--water-deep); aspect-ratio: 1040 / 640; max-height: calc(100vh - 290px); width: 100%; justify-self: center; align-self: start; }
.scene-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }
.loc-chip { position: absolute; left: 14px; bottom: 14px; display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 8px; background: rgba(20, 14, 8, 0.62); color: var(--cream); }
.loc-chip b { font: 600 16px var(--font-head); }
.loc-chip small { font-size: 13px; color: var(--cream-muted); }
.att-badge { display: none; position: absolute; right: 14px; top: 14px; min-width: var(--tap); min-height: var(--tap); border-radius: 24px; border: 2px solid var(--wood-dark); background: var(--brick); color: var(--moss-text); font-weight: 700; font-size: 16px; }
.side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.side .paper { padding: 14px 16px; }

/* Attention */
.att-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.att-head h2 { margin: 0; }
.count { font-size: 12px; font-weight: 600; background: var(--brick); color: var(--moss-text); border-radius: 10px; padding: 2px 8px; }
.att-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.att-item { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--paper-rule); }
.att-item:last-child { border-bottom: none; padding-bottom: 0; }
.att-item .what { flex: 1; min-width: 0; }
.att-item .what b { display: block; font-size: 14px; }
.att-item .what span { font-size: 13px; color: var(--ink-muted); }
.att-item svg { flex: none; }
.att-empty { font-size: 14px; color: var(--ink-muted); margin: 0; }
.fix-all { width: 100%; margin-top: 12px; min-height: 40px; }

/* Rig */
.rig { display: grid; grid-template-columns: 52px minmax(0, 1fr) 80px; gap: 8px 10px; align-items: center; font-size: 13px; }
.rig .rig-slot { color: var(--ink-muted); }
.rig .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rig .name.broken { text-decoration: line-through; color: var(--brick); }
.bait-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--paper-rule); flex-wrap: wrap; }
.bait-row .what { flex: 1; min-width: 120px; }
.bait-row .what b { display: block; font-size: 14px; }
.bait-row .what span { font-size: 12px; color: var(--ink-muted); }
.bait-row select { min-height: 36px; border-radius: var(--radius-s); border: 1.5px solid var(--ink-muted); background: transparent; color: var(--ink); padding: 0 6px; }

/* Biting now */
.biting p { font: 500 21px/1.15 var(--font-hand); color: var(--ink-hand); margin: 0 0 10px; }
.biting p.hint { font: 13px var(--font-ui); color: var(--ink-muted); }
.abund { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-muted); margin-bottom: 4px; }
.biting .bar > span { background: var(--rarity-rare); }

/* Bottom */
.bottom { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 12px; }
.bottom-row { display: flex; gap: 16px; align-items: stretch; }
.cast { width: 300px; min-height: 92px; border-radius: var(--radius-l); border: 3px solid var(--wood-dark); background: var(--reel); color: var(--wood-dark); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 4px 0 var(--wood-dark); padding: 8px 20px; }
.cast .label { font: 700 30px/1 var(--font-head); letter-spacing: 2px; }
.cast .sub { font: 500 13px var(--font-ui); opacity: 0.85; text-align: center; text-wrap: balance; max-width: 100%; }
.cast .meter { display: block; width: 100%; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.2); visibility: hidden; }
.cast .meter > span { display: block; height: 100%; border-radius: 3px; background: var(--wood-dark); }
.cast[data-mode="reel"] { background: var(--reel); }
.cast[data-mode="reel"] .meter { visibility: visible; }
.cast[data-mode="waiting"] { background: var(--paper); animation: pulse 1.6s ease-in-out infinite; }
.cast[data-mode="blocked"] { background: var(--paper-track); }
.cast:disabled { cursor: default; }
.cast:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 var(--wood-dark); }
@keyframes pulse { 50% { opacity: 0.75; } }
.recent { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.recent h3 { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--cream-muted); margin: 0; font-weight: 500; }
.recent ul { display: flex; gap: 10px; margin: 0; padding: 0; list-style: none; overflow: hidden; }
.recent li { width: 196px; flex: none; min-height: 70px; padding: 8px 10px; border-radius: 8px; display: flex; gap: 10px; align-items: center; border-top: 4px solid var(--rc, var(--rarity-common)); }
.recent li b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent li small { display: block; font-size: 12px; color: var(--ink-muted); }
.recent li em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--rci, var(--ink)); }
.recent .empty { color: var(--cream-muted); font-size: 13px; border-top: none; width: auto; min-height: 0; background: none; }
.tabs { display: flex; gap: 8px; }
.tab { flex: 1 1 0; min-height: var(--tap); border-radius: 8px; border: 1.5px solid var(--tab-edge); background: rgba(20, 12, 6, 0.3); color: var(--cream); display: flex; align-items: center; justify-content: center; gap: 8px; font: 500 14px var(--font-ui); }
.tab[aria-pressed="true"] { background: rgba(243, 217, 152, 0.18); border-color: var(--brass-edge); }

/* Overlay panel (screens) */
.panel { position: fixed; top: 76px; right: 16px; bottom: 16px; width: min(66vw, 900px); z-index: 20; padding: 20px 22px; overflow: auto; }
.panel[hidden] { display: none; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 24px; }
.panel-head .btn { margin-left: auto; }
.panel section { margin-bottom: 20px; }
.panel h3 { font: 600 17px var(--font-head); margin: 0 0 8px; }
.panel .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fish-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fish-list li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--paper-rule); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rc); }

/* Catch card */
.card-scrim { position: fixed; inset: 0; z-index: 30; background: rgba(12, 8, 4, 0.58); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; overflow: auto; }
.card-scrim[hidden] { display: none; }
.card-headline { text-align: center; }
.card-headline h2 { font: 700 30px var(--font-head); color: var(--ring); margin: 0; letter-spacing: 1px; }
.card-headline p { color: var(--cream-muted); margin: 4px 0 0; font-size: 14px; }
.catch-card { width: min(560px, 100%); max-height: calc(100vh - 140px); overflow: auto; border-radius: 22px; padding: 10px 22px 24px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.35); animation: rise 240ms cubic-bezier(0.2, 0.9, 0.3, 1.15); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.grip { align-self: center; width: 44px; height: 5px; border-radius: 3px; background: var(--paper-rule); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-height: 34px; }
.rarity { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 14px; background: var(--rci, var(--rc)); color: var(--moss-text); font-size: 13px; font-weight: 600; }
.rarity[data-tier="mythic"] { background: var(--rarity-mythic-sheen); color: var(--ink); }
.stamps { display: flex; gap: 8px; flex-wrap: wrap; }
.stamp { transform: rotate(-6deg); border: 3px solid var(--brick); color: var(--brick); border-radius: 6px; padding: 3px 9px; font: 700 14px var(--font-head); letter-spacing: 1.5px; }
.stamp.trophy { border-color: var(--brass-edge); color: var(--brass-edge); }
.fish-art svg { width: 100%; height: auto; display: block; }
.catch-card h1 { margin: 0; font: 700 30px/1.1 var(--font-head); }
.catch-card .sci { font: italic 15px var(--font-head); color: var(--ink-muted); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.facts > div { border-top: 2px solid var(--ink); padding-top: 4px; }
.facts small { display: block; font-size: 12px; color: var(--ink-muted); }
.facts strong { font: 600 20px var(--font-head); }
.facts .best { font: 600 12px var(--font-ui); color: var(--brick); }
.qdots { display: inline-flex; gap: 4px; align-items: center; height: 26px; }
.qdots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); }
.qdots i.on { background: var(--ink); }
.note { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: var(--attention-bg); border: 1px solid var(--attention); font-size: 13px; line-height: 1.3; }
.rumor { font: 500 21px var(--font-hand); color: var(--ink-hand); }
.choices { display: flex; gap: 12px; margin-top: 6px; }
.choice { flex: 1 1 0; min-height: 58px; border-radius: var(--radius-l); border: 2.5px solid var(--ink); background: transparent; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; font: 700 19px var(--font-head); }
.choice small { font: 500 12px var(--font-ui); color: var(--ink-muted); }
.choice.sell { background: var(--moss); color: var(--moss-text); box-shadow: 0 3px 0 var(--ink); }
.choice.sell small { color: var(--moss-sub); }
.more-choices { display: flex; gap: 8px; flex-wrap: wrap; }
.room { border-top: 1px dashed var(--paper-rule); padding-top: 8px; }

/* Toasts and messages */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 190px; z-index: 40; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: var(--paper); color: var(--ink); border-radius: 18px; padding: 8px 16px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-ledge); animation: toast 3.2s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.banner { margin: 10px 16px 0; padding: 10px 14px; border-radius: 8px; background: var(--attention-bg); color: var(--ink); border: 1px solid var(--attention); display: flex; gap: 10px; align-items: center; }
.banner[hidden] { display: none; }
.banner .btn { margin-left: auto; }

/* Tablet: the tray folds into a badge on the scene */
@media (max-width: 1099px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .side.open { display: flex; position: fixed; z-index: 25; top: 76px; right: 12px; width: min(380px, 92vw); max-height: calc(100vh - 100px); overflow: auto; }
  .att-badge { display: block; }
  .panel { left: 12px; right: 12px; width: auto; }
  .scene-wrap { max-height: calc(100vh - 300px); }
}
/* Phone: stack everything; phase 12 does the full phone layout */
@media (max-width: 699px) {
  .topbar { gap: 12px; padding: 6px 12px; flex-wrap: wrap; }
  .brand, .lvl small, .clock small, .xpbar { display: none; }
  .money { font-size: 17px; }
  .main { padding: 8px 8px 0; }
  .scene-wrap { aspect-ratio: auto; height: 52vh; max-height: none; }
  .bottom-row { flex-direction: column; }
  .cast { width: 100%; }
  .recent { display: none; }
  .tabs { overflow-x: auto; }
  .tab { flex: none; padding: 0 12px; }
  .panel { top: 0; left: 0; right: 0; bottom: 0; border-radius: 0; }
  /* Phone: the catch card is a bottom sheet in thumb reach */
  .card-scrim { justify-content: flex-end; padding: 0; }
  .catch-card { border-radius: 22px 22px 0 0; max-height: 86vh; }
}

/* ---------- Screens (phase 10) ---------- */
.panel.screen { padding: 0; background: var(--wood); color: var(--cream); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); display: flex; flex-direction: column; }
.panel.screen .panel-head { padding: 14px 20px 10px; margin: 0; }
.panel.screen .panel-head h2 { color: var(--brass); font-size: 26px; }
.panel.screen .panel-head .sub { color: var(--cream-muted); font-size: 14px; }
.panel.screen .panel-head .btn { color: var(--cream); border-color: var(--tab-edge); }
.screen-body { flex: 1; min-height: 0; overflow: auto; padding: 0 20px 20px; }
.chip { min-height: 34px; padding: 0 12px; border-radius: 17px; border: 1.5px solid var(--paper-rule); background: transparent; color: var(--ink); font: 500 13px var(--font-ui); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.lbl { font-size: 12px; color: var(--ink-muted); }
.pencil { font: 500 20px var(--font-hand); }

/* Journal */
.j-tabs { display: flex; gap: 6px; align-items: flex-end; overflow-x: auto; padding: 0 0 0 16px; }
.j-tab { min-height: 40px; padding: 0 16px; border: none; border-radius: 10px 10px 0 0; background: var(--paper-track); color: var(--ink); font: 600 15px var(--font-head); white-space: nowrap; }
.j-tab[aria-selected="true"] { background: var(--paper); min-height: 46px; }
.j-tab small { font: 500 13px var(--font-ui); color: var(--ink-muted); }
.j-tab.locked { border: 1.5px dashed var(--paper-rule); border-bottom: none; background: rgba(243, 234, 212, 0.18); color: var(--paper-track); font: 500 18px var(--font-hand); }
.book { display: grid; grid-template-columns: minmax(0, 1.15fr) 12px minmax(0, 1fr); filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35)); }
.page { background: var(--paper); color: var(--ink); padding: 22px 26px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.page.left { border-radius: 8px 0 0 8px; }
.page.right { border-radius: 0 8px 8px 0; }
.spine { background: linear-gradient(90deg, var(--spine-light), var(--spine-dark) 50%, var(--spine-light)); }
.sp-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sp-head h3 { margin: 0; font: 700 30px var(--font-head); }
.sp-head i { font: italic 16px var(--font-head); color: var(--ink-muted); }
.sp-no { margin-left: auto; font-size: 12px; font-weight: 600; letter-spacing: 1px; color: var(--ink-muted); border: 1.5px solid var(--paper-rule); border-radius: 4px; padding: 3px 8px; }
.sp-art svg { width: 100%; height: auto; display: block; max-height: 220px; }
.sp-art.unknown svg { opacity: 0.22; }
.sp-notes { font: 500 22px/1.2 var(--font-hand); color: var(--ink-hand); }
.stat4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat4 > div { border-top: 2px solid var(--ink); padding-top: 6px; }
.stat4 strong { display: block; font: 600 20px var(--font-head); }
.sp-cols { display: flex; gap: 22px; flex-wrap: wrap; }
.sp-cols > div { flex: 1 1 200px; }
.caps { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 8px; }
.variants { display: flex; gap: 8px; flex-wrap: wrap; }
.variant-dot { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 44px; font-size: 10px; color: var(--ink-muted); }
.variant-dot span { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--rc); color: var(--moss-text); }
.variant-dot.no span { background: transparent; border: 2px dashed var(--paper-rule); }
.dayparts { display: flex; gap: 6px; align-items: flex-end; height: 44px; }
.dayparts div { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 32px; font-size: 10px; color: var(--ink-muted); }
.dayparts i { width: 16px; background: var(--rarity-rare); border-radius: 3px 3px 0 0; }
.seasons { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.seasons span { font-size: 11px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--paper-rule); color: var(--ink-muted); }
.seasons span.on { background: var(--rarity-rare); border-color: var(--rarity-rare); color: var(--moss-text); font-weight: 600; }
.j-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.j-cell { min-height: 84px; border-radius: 6px; padding: 6px; background: rgba(255, 255, 255, 0.35); border: 1.5px solid var(--paper-rule); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink); font: 600 12px var(--font-ui); text-align: center; line-height: 1.15; }
.j-cell.unknown { background: transparent; border-style: dashed; color: var(--ink-muted); font-weight: 500; }
.j-cell[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--rc, var(--ink)); }
.j-cell svg { width: 76px; height: 28px; }
.j-boxes { display: flex; gap: 12px; flex-wrap: wrap; }
.j-named { flex: 1 1 200px; border: 3px double var(--brass-edge); border-radius: 8px; padding: 12px 14px; background: rgba(214, 178, 74, 0.1); }
.j-named .caps { color: var(--rarity-legendary-ink); }
.j-named b { display: block; font: 700 20px var(--font-head); margin: 2px 0 4px; }
.j-named p { margin: 0; font: 500 19px/1.15 var(--font-hand); color: var(--ink-hand); }
.j-set { flex: 1 1 200px; border: 1.5px solid var(--paper-rule); border-radius: 8px; padding: 12px 14px; }
.j-set b { display: block; font: 600 16px var(--font-head); margin: 2px 0 8px; }
.j-set .bar > span { background: var(--brass-edge); }

/* Trophy wall */
.panel.screen.wall, .wall { background-color: var(--wall); background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0, rgba(0, 0, 0, 0.22) 2px, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, 0) 120px); }
.plaques { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px 22px; padding: 6px 0; }
.plaque { min-height: 200px; border-radius: 18px; background: var(--plaque); box-shadow: inset 0 0 0 4px var(--plaque-dark), inset 0 0 0 7px var(--plaque-light), 0 8px 12px rgba(0, 0, 0, 0.45); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px; text-align: center; }
.plaque svg { width: 100%; max-width: 250px; height: auto; }
.brass-plate { background: linear-gradient(180deg, var(--brass-2), var(--brass-edge)); color: var(--wood-dark); border-radius: 4px; padding: 5px 14px; box-shadow: 0 1px 0 var(--brass-shadow); }
.brass-plate b { display: block; font: 700 16px var(--font-head); }
.brass-plate small { font: 500 11px var(--font-ui); }
.plaque .where, .empty-plaque .where { font-size: 12px; color: var(--wall-muted); }
.empty-plaque { min-height: 200px; border-radius: 18px; border: 2px dashed var(--tab-edge); background: rgba(0, 0, 0, 0.18); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px; color: var(--wall-text); text-align: center; }
.empty-plaque.three { border-color: var(--brass-edge); }
.empty-plaque .q { font: 700 28px var(--font-head); color: var(--wall-mark); }
.empty-plaque.three .q { color: var(--brass-edge); }
.empty-plaque .hint { font: 600 19px/1.1 var(--font-hand); }
.empty-plaque.three .hint { color: var(--brass-2); }

/* Storage */
.store { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; }
.store-list { display: flex; flex-direction: column; gap: 10px; }
.cont { border-radius: 10px; padding: 12px 14px; color: var(--ink); display: flex; flex-direction: column; gap: 6px; border: none; text-align: left; background: var(--paper); font: inherit; }
.cont[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--brass-edge); }
.buy-cooler { min-height: 48px; border-radius: 10px; border: 2px dashed var(--brass-2); background: transparent; color: var(--brass); font: 600 15px var(--font-head); }
.buy-cooler:disabled { opacity: 0.5; }
.cont b { font: 600 17px var(--font-head); display: flex; justify-content: space-between; align-items: center; }
.cont .full-tag { font: 700 11px var(--font-ui); color: var(--full-ink); background: var(--attention-bg); padding: 2px 8px; border-radius: 10px; }
.cont .bar > span { background: var(--rarity-rare); }
.store-main { border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.store-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.store-head h3 { margin: 0; font: 700 22px var(--font-head); }
.store-head .spacer { flex: 1; }
.fish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.fish-card { position: relative; min-height: 100px; border-radius: 8px; padding: 8px 10px; background: rgba(255, 255, 255, 0.4); border: 1.5px solid var(--paper-rule); display: flex; flex-direction: column; gap: 2px; text-align: left; color: var(--ink); font: inherit; }
.fish-card[aria-pressed="true"] { border: 2.5px solid var(--rc); background: rgba(255, 255, 255, 0.7); }
.fish-card .check { position: absolute; right: 8px; top: 8px; width: 18px; height: 18px; border-radius: 4px; border: 2px solid var(--ink-muted); }
.fish-card[aria-pressed="true"] .check { background: var(--rc); border-color: var(--rc); }
.fish-card svg { width: 54px; height: 22px; color: var(--rc); }
.fish-card b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 20px; }
.fish-card .foot { display: flex; justify-content: space-between; align-items: center; }
.fish-card .foot span:first-child { font-size: 11px; font-weight: 600; color: var(--rci, var(--ink)); }
.fish-card .foot span:last-child { font: 600 14px var(--font-head); }
.store-foot { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--paper-rule); flex-wrap: wrap; }
.store-foot .spacer { flex: 1; }

/* Tackle box */
.tackle { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 20px; }
.tbox { border-radius: 10px; background: var(--tackle); border: 4px solid var(--tackle-edge); box-shadow: 0 8px 14px rgba(0, 0, 0, 0.35); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.tbox-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tbox-head .latch { width: 46px; height: 10px; border-radius: 3px; background: var(--brass-edge); }
.tbox-head .caps { color: var(--tackle-text); margin: 0; font-size: 14px; }
.tbox-head .spacer { flex: 1; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.slot { border-radius: 8px; padding: 14px; background: var(--paper); color: var(--ink); display: flex; flex-direction: column; gap: 8px; box-shadow: inset 0 0 0 2px var(--paper-rule); }
.slot.warn { box-shadow: inset 0 0 0 2px var(--brick); }
.slot.empty { background: rgba(243, 234, 212, 0.35); }
.slot h4 { margin: 0; font: 600 18px var(--font-head); }
.slot h4.broken { text-decoration: line-through; color: var(--brick); }
.slot .stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.slot .row { display: flex; gap: 8px; flex-wrap: wrap; }
.slot select { min-height: 36px; border-radius: var(--radius-s); border: 1.5px solid var(--ink-muted); background: transparent; color: var(--ink); }
.warn-tag { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--brick); }
.spares { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.spare { position: relative; border-radius: 6px; padding: 10px 12px; background: var(--paper); color: var(--ink); overflow: hidden; }
.spare b { font: 600 15px var(--font-head); }
.spare.broken { background: var(--broken-bg); }
.spare.broken b { text-decoration: line-through; }
.broken-stamp { position: absolute; right: 6px; top: 6px; transform: rotate(8deg); border: 2px solid var(--broken-ink); color: var(--broken-ink); font: 700 11px var(--font-head); letter-spacing: 1px; padding: 1px 5px; border-radius: 3px; }
.outfitter { border-radius: 10px; padding: 16px 18px; }
.outfitter h3 { margin: 0; font: 700 22px var(--font-head); }
.outfitter .note-hand { font: 500 20px var(--font-hand); color: var(--ink-hand); margin-bottom: 6px; }
.shop-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--paper-rule); }
.shop-row .what { flex: 1; min-width: 0; }
.shop-row b { font: 600 16px var(--font-head); }
.shop-row.locked { opacity: 0.6; }
.shop-row.locked b { font: 500 21px var(--font-hand); }
.shop-group { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-muted); margin: 14px 0 0; }

@media (max-width: 1099px) {
  .book { grid-template-columns: minmax(0, 1fr); }
  .spine { display: none; }
  .page.left, .page.right { border-radius: 8px; }
  .page.right { margin-top: 12px; }
  .store, .tackle { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 699px) { .stat4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Screens (phase 11) ---------- */
.panel.screen.wide { left: 16px; width: auto; }
.btn.brass { border: 2px solid var(--brass-edge); background: transparent; color: var(--brass); font: 600 15px var(--font-head); display: inline-flex; align-items: center; gap: 8px; }
.btn.outline { border: 2px solid var(--brass-2); background: transparent; color: var(--cream); }

/* Lodge */
.lodge { display: flex; flex-direction: column; gap: 16px; }
.lodge-bar, .lodge-door { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lodge-bar .lbl { color: var(--cream-muted); }
.lodge-bar .back { color: var(--brass); border-color: transparent; background: transparent; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; }
.lodge-door { padding: 12px 16px; border-radius: 8px; background: var(--attention-bg); color: var(--ink); border: 1px solid var(--attention); }
.lodge-door > div { flex: 1; min-width: 260px; }
.lodge-door .btn.brass { color: var(--ink); }
.lodge-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 24px; }
.chalkboard { background-color: var(--chalk-bg); background-image: radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 50%), radial-gradient(ellipse at 75% 70%, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 45%); border: 14px solid var(--wood-frame); border-radius: 6px; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35); padding: 16px 24px; color: var(--chalk-ink); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.chalk-title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; font: 700 38px var(--font-hand); }
.chalk-title small { font: 500 19px var(--font-hand); color: var(--chalk-muted); }
.chalk-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr) 70px minmax(0, 0.8fr) minmax(0, 1.3fr); gap: 0 14px; align-items: center; font: 600 24px var(--font-hand); min-height: 36px; }
.chalk-row.head { font: 500 14px var(--font-ui); color: var(--chalk-muted); border-bottom: 2px solid var(--chalk-line); padding-bottom: 6px; min-height: 0; }
.chalk-rows { max-height: 360px; overflow: auto; }
.chalk-row .held { color: var(--chalk-muted); }
.trend { display: flex; align-items: center; gap: 2px; font-size: 18px; }
.trend .arrow { display: flex; }
.trend.up { color: var(--chalk-up); }
.trend.down { color: var(--chalk-down); }
.trend.down .arrow { transform: rotate(180deg); }
.trend.flat .arrow { transform: rotate(90deg); }
.chalk-btn { min-height: 44px; padding: 0 18px; border: 2px solid var(--chalk-ink); border-radius: 22px; background: transparent; color: var(--chalk-ink); font: 700 21px var(--font-hand); }
.chalk-btn.small { min-height: 36px; font-size: 18px; padding: 0 12px; justify-self: start; }
.chalk-btn.dashed { border-style: dashed; color: var(--chalk-muted); border-color: var(--chalk-muted); }
.chalk-btn:disabled { opacity: 0.45; }
.chalk-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.chalk-note, .chalk-empty { font: 500 19px var(--font-hand); color: var(--chalk-muted); }
.corkboard { position: relative; background-color: var(--cork); background-image: radial-gradient(circle at 2px 2px, var(--cork-dot) 1px, rgba(0, 0, 0, 0) 1.5px), radial-gradient(circle at 7px 9px, var(--cork-fleck) 1px, rgba(0, 0, 0, 0) 1.5px); background-size: 9px 11px, 13px 12px; border: 14px solid var(--wood-frame); border-radius: 6px; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35); color: var(--ink); padding: 60px 16px 18px; min-width: 0; }
.cork-title { position: absolute; left: 18px; top: 12px; background: var(--note); padding: 4px 14px; font: 700 22px var(--font-head); transform: rotate(-2deg); box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3); }
.pin-notes { display: flex; flex-wrap: wrap; gap: 22px 18px; align-items: flex-start; }
.pin-note { position: relative; width: 230px; background: var(--note); padding: 22px 16px 12px; transform: rotate(var(--tilt)); box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3); display: flex; flex-direction: column; gap: 4px; }
.pin-note .pin { position: absolute; left: calc(50% - 8px); top: -6px; width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 2px 2px rgba(0, 0, 0, 0.4); }
.pin-note .nt { font: 700 23px/1.05 var(--font-hand); }
.pin-note .who { font: 500 18px var(--font-hand); color: var(--note-ink); }
.pin-note .nrow { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--note-ink); margin-top: 6px; }
.pin-note .reward { font: 600 18px var(--font-head); color: var(--ink); }
.pin-note .bar { height: 6px; border-radius: 3px; background: var(--paper-track); }
.pin-note .bar > span { display: block; height: 100%; border-radius: 3px; background: var(--moss); }
.pin-note .deliver { width: 100%; }
.pin-note .until { font-size: 11px; color: var(--note-ink); }
.pin-hint { width: 180px; min-height: 90px; border: 2px dashed var(--cork-pencil); border-radius: 4px; display: flex; align-items: center; justify-content: center; text-align: center; font: 600 20px var(--font-hand); color: var(--plaque-dark); padding: 8px; }
.counter-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.counter-head h3 { font: 700 22px var(--font-head); color: var(--brass); margin: 0; }
.counter-head .lbl { color: var(--cream-muted); font-size: 13px; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; align-items: end; padding: 0 12px 18px; border-bottom: 18px solid var(--wood-frame); box-shadow: 0 10px 0 var(--wood-dark); }
.shelf-item { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.shelf-item b { font: 600 15px var(--font-head); }
.shelf-item .lbl { color: var(--cream-muted); }
.shelf-item .good { font-size: 11px; min-height: 28px; }
.shelf-item .btn { min-width: 120px; }
.jar { position: relative; width: 70px; height: 84px; }
.jar .lid { position: absolute; left: 10px; top: 2px; width: 50px; height: 10px; border-radius: 3px; }
.jar .glass { position: absolute; left: 6px; top: 14px; width: 58px; height: 68px; box-sizing: border-box; border-radius: 0 0 8px 8px; border: 2px solid var(--glass-edge); background: var(--glass); overflow: hidden; }
.jar .fill { position: absolute; left: 0; bottom: 0; width: 100%; }
.jar .label { position: absolute; left: 7px; top: 22px; width: 40px; height: 18px; border-radius: 2px; background: var(--paper); }
@media (max-width: 1099px) { .lodge-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 699px) { .chalk-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 60px minmax(0, 0.8fr); } .chalk-row > span:last-child { grid-column: 1 / -1; } .pin-note { width: 100%; } }

/* Automation */
.auto { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; }
.auto-units, .auto-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.unit { border-radius: 10px; padding: 14px 16px; color: var(--ink); display: grid; grid-template-columns: 56px minmax(0, 1.2fr) minmax(0, 2fr) 160px; gap: 16px; align-items: center; box-shadow: inset 4px 0 0 var(--tone, var(--rarity-common)), 0 3px 0 var(--wood-dark); }
.unit.tone-run { --tone: var(--rarity-uncommon); }
.unit.tone-stop { --tone: var(--brick); }
.unit.tone-warn { --tone: var(--brass-edge); }
.unit-art { color: var(--ink-hand); display: flex; }
.unit-name b { font: 600 18px var(--font-head); }
.pill { display: inline-flex; margin-top: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 12px; background: var(--paper-track); color: var(--ink); }
.pill.run { background: var(--pill-run-bg); color: var(--pill-run-ink); }
.pill.stop { background: var(--pill-stop-bg); color: var(--pill-stop-ink); }
.pill.warn { background: var(--attention-bg); color: var(--full-ink); }
.meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.meters .bar { height: 8px; border-radius: 4px; background: var(--paper-track); margin: 4px 0 2px; overflow: hidden; }
.meters .bar > span { display: block; height: 100%; border-radius: 4px; }
.lbl.alert { color: var(--brick); font-weight: 600; }
.unit-act { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.unit-act .earn { font: 600 15px var(--font-head); text-align: right; }
.btn.ghost { border: 1.5px solid var(--ink-muted); background: transparent; color: var(--ink); }
.place { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; border-top: 1px dashed var(--paper-rule); padding-top: 10px; }
.place label { display: flex; flex-direction: column; gap: 2px; }
.place select { min-height: 40px; }
.unit-locked { border-radius: 10px; padding: 12px 16px; border: 2px dashed var(--pencil-edge); display: flex; align-items: center; gap: 16px; color: var(--paper-track); }
.unit-locked > div { flex: 1; }
.unit-locked .pencil { font-size: 24px; }
.unit-locked .lbl { color: var(--paper-track); font-size: 13px; }
.link { background: none; border: none; color: var(--brass); font-weight: 600; font-size: 14px; text-decoration: underline; min-height: var(--tap); }
.unit-empty { font: 500 22px var(--font-hand); color: var(--cream-muted); }
.side-card { border-radius: 10px; padding: 16px 18px; color: var(--ink); box-shadow: 0 3px 0 var(--wood-dark); }
.side-card h3 { font: 700 19px var(--font-head); margin: 0 0 8px; }
.side-card p { font-size: 14px; line-height: 1.5; margin: 0 0 8px; }
.ledger { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; font-size: 14px; }
.ledger .neg { color: var(--brick); }
.ledger .total { border-top: 2px solid var(--ink); padding-top: 6px; font-weight: 600; }
.ledger .net { font: 700 18px var(--font-head); }
.ledger .net.up { color: var(--pill-run-ink); }
.ledger .net.down { color: var(--brick); }
.buy-unit { min-height: 52px; border-radius: 10px; border: 2px dashed var(--brass-2); background: transparent; color: var(--brass); font: 600 16px var(--font-head); padding: 0 12px; }
.buy-unit:disabled { opacity: 0.5; }
@media (max-width: 1099px) { .auto { grid-template-columns: minmax(0, 1fr); } .unit { grid-template-columns: 48px minmax(0, 1fr); } .unit .meters, .unit .unit-act { grid-column: 1 / -1; } }

/* Map */
.map { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.map-sheet { border-radius: 8px; overflow: hidden; box-shadow: 0 8px 14px rgba(0, 0, 0, 0.35); }
.map-sheet svg { display: block; width: 100%; height: auto; }
.m-hill { fill: none; stroke: var(--map-hill); stroke-width: 1.5; }
.m-tree { fill: var(--map-tree); opacity: 0.75; }
.m-river { fill: none; stroke: var(--map-river); stroke-linecap: round; }
.m-water { fill: var(--map-water); stroke: var(--map-ink); stroke-width: 2; }
.m-pencil { fill: none; stroke: var(--map-pencil); stroke-width: 1.8; stroke-dasharray: 6 4; }
.m-trail { fill: none; stroke: var(--brick); stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; }
.m-here { fill: var(--brick); stroke: var(--map-ink); stroke-width: 2; }
.m-here-dot, .fill-parch { fill: var(--parch-1); }
.m-dot, .fill-ink { fill: var(--map-ink); }
.m-pencil-dot { fill: none; stroke: var(--map-pencil); stroke-width: 2; stroke-dasharray: 3 3; }
.m-name { font: 700 20px var(--font-head); fill: var(--map-ink); }
.m-sub { font: 600 13px var(--font-ui); fill: var(--map-sub); }
.m-sub.here { fill: var(--brick); }
.m-pencil-name { font: 600 26px var(--font-hand); fill: var(--map-pencil-text); }
.m-pencil-sub, .m-rumor { font: 500 20px var(--font-hand); fill: var(--map-pencil-text); }
.m-compass { fill: none; stroke: var(--map-ink); stroke-width: 1.5; }
.m-n { font: 14px var(--font-head); fill: var(--map-ink); stroke: none; }
.m-cart { fill: var(--parch-1); stroke: var(--map-ink); stroke-width: 2; }
.m-cart-in { fill: none; stroke: var(--map-ink); stroke-width: 1; }
.m-cart-title { font: 700 22px var(--font-head); fill: var(--map-ink); }
.m-cart-sub { font: italic 13px var(--font-head); fill: var(--map-sub); }
.map-side { display: flex; flex-direction: column; gap: 12px; }
.next-name { font: 700 24px var(--font-head) !important; margin: 2px 0 !important; }
.req { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--paper-rule); font-size: 14px; }
.req:last-of-type { border-bottom: none; }
.req > span:first-of-type { flex: 1; }
.req.done svg { color: var(--pill-run-ink); }
.req.todo svg { color: var(--brick); }
.wide-btn { width: 100%; margin-top: 8px; min-height: 48px; }
.btn.pencil-btn { border: 1.5px solid var(--pencil-edge); background: transparent; color: var(--ink-muted); }
.travel { display: flex; flex-direction: column; gap: 8px; }
.go { min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1.5px solid var(--ink-muted); background: transparent; color: var(--ink); font: 600 14px var(--font-ui); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.go.here { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.go.here .lbl { color: var(--paper-track); }
@media (max-width: 1099px) { .map { grid-template-columns: minmax(0, 1fr); } }

/* Skills */
.skills-head { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-bottom: 10px; }
.points { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 18px; background: var(--attention); color: var(--wood-dark); font: 700 15px var(--font-ui); }
.skills-head .lbl { color: var(--cream-muted); font-size: 13px; }
.skill-pages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.skill-page { border-radius: 8px; padding: 18px 16px; color: var(--ink); display: flex; flex-direction: column; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35); min-width: 0; }
.skill-page h3 { font: 700 22px var(--font-head); margin: 0; }
.bar.prof { height: 8px; border-radius: 4px; background: var(--paper-track); margin: 4px 0 14px; overflow: hidden; }
.bar.prof > span { display: block; height: 100%; background: var(--rarity-rare); }
.tier { display: flex; gap: 8px; justify-content: center; }
.tlink { width: 2px; height: 14px; background: var(--ink-muted); align-self: center; }
.tlink.off { width: 0; background: none; border-left: 2px dashed var(--pencil-edge); }
.node { flex: 1 1 0; min-width: 0; border-radius: 8px; padding: 8px 10px; min-height: 72px; border: none; text-align: left; font-family: var(--font-ui); display: flex; flex-direction: column; gap: 2px; }
.node.done { background: var(--node-done); color: var(--paper); }
.node.done .eff { color: var(--node-done-sub); }
.node.open { background: var(--node-open); color: var(--ink); box-shadow: inset 0 0 0 2.5px var(--brass-edge); cursor: pointer; }
.node.lock { background: transparent; color: var(--ink-muted); box-shadow: inset 0 0 0 1.5px var(--paper-rule); cursor: default; }
.node .nm { font: 600 14px var(--font-head); }
.node .eff { font-size: 12px; line-height: 1.3; color: var(--ink-muted); }
.node .cost { font-size: 11px; font-weight: 700; color: var(--rarity-legendary-ink); }
.legend { display: flex; gap: 22px; font-size: 13px; color: var(--legend-text); margin-top: 14px; flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.sw.done { background: var(--node-done); }
.sw.open { background: var(--node-open); box-shadow: inset 0 0 0 2.5px var(--brass-edge); }
.sw.lock { box-shadow: inset 0 0 0 1.5px var(--paper-rule); }
@media (max-width: 1099px) { .skill-pages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 699px) { .skill-pages { grid-template-columns: minmax(0, 1fr); } }

/* Settings */
.settings { display: flex; gap: 24px; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
.set-card { border-radius: 10px; padding: 22px 26px; color: var(--ink); box-shadow: 0 8px 14px rgba(0, 0, 0, 0.35); display: flex; flex-direction: column; gap: 14px; }
.settings > .set-card { width: min(100%, 680px); }
.set-side { width: min(100%, 420px); display: flex; flex-direction: column; gap: 16px; }
.set-card section { margin: 0; }
.sec { font: 700 20px var(--font-head) !important; margin: 0 0 4px !important; }
.sec.small-h { font-size: 16px !important; }
.set { display: flex; align-items: center; gap: 16px; min-height: 52px; border-bottom: 1px dashed var(--paper-rule); flex-wrap: wrap; }
.set:last-child { border-bottom: none; }
.set .t { flex: 1; font-size: 15px; min-width: 160px; }
.set .sub { display: block; font-size: 12px; color: var(--ink-muted); }
.set input[type="range"] { width: 180px; accent-color: var(--moss); }
.seg { display: flex; border: 1.5px solid var(--ink-muted); border-radius: 8px; overflow: hidden; }
.seg label { min-height: 36px; padding: 0 14px; display: flex; align-items: center; font-size: 13px; font-weight: 600; cursor: pointer; position: relative; }
.seg label.on { background: var(--ink); color: var(--paper); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: -3px; }
.switch { width: 48px; height: 28px; border-radius: 14px; position: relative; flex-shrink: 0; border: none; background: var(--switch-off); }
.switch[aria-checked="true"] { background: var(--moss); }
.switch > span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--switch-knob); transition: left 0.15s; }
.switch[aria-checked="true"] > span { left: 23px; }
.save-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; font-size: 14px; }
.save-facts .stale { color: var(--brick); font-weight: 600; }
.set-card .small, .set-card p { font-size: 13px; line-height: 1.5; color: var(--ink-hand); margin: 0; }
.set-note { border-radius: 10px; padding: 16px 20px; background: var(--attention-bg); color: var(--ink); border: 1.5px solid var(--attention); font-size: 14px; line-height: 1.45; }
.btn.danger { border: 1.5px solid var(--brick); background: transparent; color: var(--brick); align-self: flex-start; }

/* Phase 11 fixes: every screen has a Back button; the lodge wall fits a 1080p window */
.panel-head .back-btn { margin-left: 0 !important; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); border: 2px solid var(--brass-edge) !important; background: transparent; color: var(--brass) !important; font: 600 15px var(--font-ui); padding: 0 14px; }
.panel-head .back-btn:hover { background: rgba(0, 0, 0, 0.18); }
.lodge-trip { max-width: 560px; margin: 40px auto; border-radius: 10px; padding: 24px 28px; color: var(--ink); box-shadow: 0 8px 14px rgba(0, 0, 0, 0.35); display: flex; flex-direction: column; gap: 10px; }
.lodge-trip h3 { font: 700 24px var(--font-head); margin: 0; }
.lodge-trip p { margin: 0; line-height: 1.5; }
.lodge-bar .lbl { font-size: 13px; }
@media (min-height: 780px) {
  .panel.wide .screen-body:has(> .lodge) { display: flex; flex-direction: column; }
  .lodge { flex: 1; min-height: 0; }
  .lodge-top { flex: 1; min-height: 0; }
  .chalkboard, .corkboard { min-height: 0; overflow: hidden; }
  .chalkboard .chalk-rows { flex: 1; min-height: 0; max-height: none; }
  .corkboard { overflow-y: auto; }
}
.chalkboard { padding: 12px 22px; }
.chalk-title { font-size: 32px; }
.chalk-row { min-height: 32px; font-size: 22px; }
.corkboard { padding-top: 54px; }
.pin-note { padding: 18px 14px 10px; }
.pin-note .nt { font-size: 21px; }
.shelf { gap: 10px 12px; padding: 0 12px 10px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.shelf-item { gap: 2px; }
.shelf-item .btn { min-width: 0; width: 100%; max-width: 140px; min-height: 40px; }
.jar { width: 54px; height: 62px; }
.jar .lid { left: 8px; top: 2px; width: 38px; height: 8px; }
.jar .glass { left: 5px; top: 11px; width: 44px; height: 50px; }
.jar .label { left: 5px; top: 16px; width: 30px; height: 13px; }
.counter-head { margin-bottom: 4px; }

/* A screen opened from another sits on top of it, which stays in view */
.panel.screen.layer { box-shadow: -12px 0 24px rgba(0, 0, 0, 0.5); }

/* Achievement popup */
.celebrate { z-index: 40; }
.achieve { width: min(420px, 100%); border-radius: 22px; padding: 18px 28px 26px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); animation: rise 280ms cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.achieve .rosette { margin-top: -4px; }
.achieve .caps { margin: 0; color: var(--rarity-legendary-ink); }
.achieve h2 { font: 700 30px var(--font-head); margin: 0; }
.achieve .reward { font: 700 34px var(--font-head); color: var(--pill-run-ink); }
.achieve .ribbon-name { font: 600 22px var(--font-hand); color: var(--brick); }
.achieve p { margin: 0; font-size: 14px; color: var(--ink-hand); }
.achieve .next { font: 600 19px var(--font-hand); color: var(--ink-muted); }
.achieve .btn { margin-top: 10px; min-width: 180px; min-height: var(--tap); font-size: 16px; }

/* Main screen: storage counts, save note, attention column stays inside the window */
.side { max-height: calc(100vh - 290px); overflow-y: auto; }
.strip-h { font: 600 13px var(--font-ui); color: var(--ink-muted); margin: 12px 0 6px; text-transform: uppercase; letter-spacing: 1px; }
.store-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.strip-box { flex: 1 1 0; min-width: 0; min-height: var(--tap); display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 10px; border-radius: 8px; border: 1.5px solid var(--paper-rule); background: transparent; color: var(--ink); font: 500 13px var(--font-ui); text-align: left; }
.strip-box span, .strip-box b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-box span { font-size: 12px; color: var(--ink-muted); }
.strip-box b { font-size: 14px; }
.strip-box .bar { display: block; height: 5px; border-radius: 3px; background: var(--paper-track); overflow: hidden; }
.strip-box .bar > i { display: block; height: 100%; background: var(--rarity-rare); }
.strip-box.full { border-color: var(--brass-edge); background: var(--attention-bg); }
.strip-box.full .bar > i { background: var(--brass-edge); }
.creel-chip { padding-left: 10px; border-left: 1px solid var(--cream-muted); }
.creel-chip.full { color: var(--attention); font-weight: 700; }
.saved { font-size: 12px; color: var(--cream-muted); white-space: nowrap; transition: color 0.3s; }
.saved.flash { color: var(--xp); font-weight: 600; }
.saved.bad { color: var(--attention); font-weight: 600; }
@media (max-width: 1099px) { .side { max-height: none; } }
@media (max-width: 699px) { .saved { display: none; } }
.more-choices.keep-in { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ready-unit { --tone: var(--brass-edge); }
.ready-unit .ready-what { margin: 0; font-size: 14px; color: var(--ink-hand); }
.rules-line { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: -4px; }
.unit .link { color: var(--rarity-rare-ink); min-height: 32px; font-size: 13px; }

/* ---------- Phase 12: phones, tablets, sheets ---------- */
.rig-strip, .cast-hint, .phone-nav, .menu-btn, #clock-short, .side-grip { display: none; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(12, 8, 4, 0.58); display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop[hidden] { display: none; }
.sheet { width: min(100%, 560px); max-height: 82dvh; overflow: auto; border-radius: 22px 22px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); color: var(--ink); box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.35); transition: transform 0.2s ease-out; animation: rise 220ms ease-out; touch-action: pan-y; }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--paper-rule); margin: 0 auto 10px; }
.sheet .sheet-grip { display: block; }
.sheet-head h2 { font: 700 24px var(--font-head); margin: 0 0 12px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { min-height: 96px; border-radius: 12px; padding: 12px 14px; border: none; background: rgba(255, 255, 255, 0.45); box-shadow: inset 0 0 0 1.5px var(--paper-rule); display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 8px; color: var(--ink); text-align: left; }
.tile b { display: block; font: 600 17px var(--font-head); }
.tile small { display: block; font-size: 12px; color: var(--ink-muted); }
.tile.bad { box-shadow: inset 0 0 0 2px var(--brick); }
.tile.bad small { color: var(--brick); font-weight: 600; }
.tile.warn { box-shadow: inset 0 0 0 2px var(--brass-edge); }
.tile.gold { box-shadow: inset 0 0 0 2px var(--brass-edge); }
.tile.gold small { color: var(--rarity-legendary-ink); font-weight: 600; }

/* Tablet: screens are full-height side sheets */
@media (min-width: 700px) and (max-width: 1099px) {
  .panel { top: 0; bottom: 0; right: 0; left: auto; width: min(760px, 100vw); border-radius: 0; }
  .panel.screen.wide { left: 0; width: auto; }
}

/* Phone portrait */
@media (max-width: 699px) {
  .app { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 52px; padding: env(safe-area-inset-top) 16px 0; gap: 12px; flex-wrap: nowrap; }
  .journal-btn, #clock, .clock small, .clock svg, .brand, .lvl small, .saved { display: none; }
  #clock-short { display: inline; font-size: 13px; color: var(--cream-muted); }
  .xpbar { display: block; width: 56px; height: 6px; }
  .money { font-size: 18px; }
  .main { padding: 0; grid-template-columns: minmax(0, 1fr); }
  .scene-wrap { border-radius: 0; border: none; aspect-ratio: auto; height: 55dvh; max-height: none; }
  .loc-chip { left: 12px; bottom: 12px; padding: 6px 12px; gap: 8px; }
  .loc-chip b { font-size: 15px; }
  .loc-chip #found { display: none; }
  .rig-strip { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 16px; border: none; border-bottom: 1px solid rgba(0, 0, 0, 0.3); background: transparent; color: var(--cream); font: 600 14px var(--font-ui); text-align: left; }
  .rig-strip svg { flex: none; }
  .pill-warn { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 12px; background: rgba(168, 67, 47, 0.25); border: 1px solid var(--brick); color: var(--pill-stop-bg); }
  .creel-mini { font-size: 12px; color: var(--cream-muted); font-weight: 500; }
  .bottom { padding: 16px 16px 10px; }
  .bottom-row { flex-direction: column; gap: 8px; }
  .cast { width: 100%; min-height: 104px; border-radius: 16px; }
  .cast .label { font-size: 34px; }
  .cast-hint { display: block; text-align: center; font-size: 13px; color: var(--cream-muted); margin: 0; }
  .recent, .tabs { display: none; }
  .phone-nav { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 22; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--wall); border-top: 1px solid var(--wood-dark); }
  .nav-btn { min-height: 54px; border: none; background: transparent; color: var(--wall-text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 500 11px var(--font-ui); }
  .nav-btn[aria-current="true"] { color: var(--brass); }
  .att-badge { display: block; right: 12px; top: 12px; }
  .side.open { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 84dvh; border-radius: 22px 22px 0 0; z-index: 35; background: var(--paper); padding: 10px 12px calc(18px + env(safe-area-inset-bottom)); overflow: auto; box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.35); transition: transform 0.2s ease-out; }
  .side.open .side-grip { display: block; }
  .side.open .paper { box-shadow: none; }
  .panel { top: 0; left: 0; right: 0; bottom: calc(66px + env(safe-area-inset-bottom)); width: auto; border-radius: 0; }
  .panel.screen.wide { left: 0; }
  .panel-head { flex-wrap: wrap; row-gap: 6px; }
  .panel-head .sub { display: none; }
  .btn, .chip, select { min-height: var(--tap); }
}

/* Phone landscape: the scene fills the screen, CAST floats bottom right, one menu button */
@media (max-height: 500px) and (orientation: landscape) {
  .topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 6; min-height: 40px; padding: 0 calc(12px + env(safe-area-inset-right)) 0 calc(12px + env(safe-area-inset-left)); background: rgba(20, 12, 6, 0.55); border: none; }
  .journal-btn, .brand, .saved, .lvl small { display: none; }
  .main { position: fixed; inset: 0; padding: 0; display: block; }
  .scene-wrap { position: absolute; inset: 0; height: 100%; max-height: none; aspect-ratio: auto; border: none; border-radius: 0; }
  .side:not(.open) { display: none; }
  .att-badge { display: block; top: 50px; }
  .bottom { position: fixed; right: calc(12px + env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom)); padding: 0; z-index: 6; }
  .bottom-row { display: block; }
  .cast { width: 210px; min-height: 76px; }
  .cast .label { font-size: 26px; }
  .cast-hint, .recent, .tabs, .rig-strip, .phone-nav { display: none; }
  .menu-btn { display: flex; align-items: center; justify-content: center; position: fixed; left: calc(12px + env(safe-area-inset-left)); top: 50px; z-index: 6; width: var(--tap); height: var(--tap); border-radius: 24px; border: 2px solid var(--brass-edge); background: rgba(20, 12, 6, 0.7); color: var(--brass); }
  .app { padding-bottom: 0; }
  .panel { top: 0; bottom: 0; }
  .side.open { position: fixed; top: 0; bottom: 0; right: 0; left: auto; width: min(380px, 90vw); max-height: none; overflow: auto; z-index: 35; border-radius: 0; background: var(--paper); }
}

/* Attention in the top bar (desktop); the side column keeps the rig and biting now */
.att-top { display: none; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1.5px solid var(--tab-edge); background: transparent; color: var(--cream-muted); font: 600 14px var(--font-ui); }
.att-top.busy { background: var(--brick); border-color: var(--brick); color: var(--moss-text); }
.att-top.busy svg { color: var(--moss-text); }
.att-top[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--brass-edge); }
.att-pop { position: fixed; top: 70px; right: 16px; width: min(400px, calc(100vw - 32px)); max-height: calc(100vh - 100px); overflow: auto; z-index: 26; padding: 14px 16px; border-radius: var(--radius-m); color: var(--ink); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45); }
.att-pop[hidden] { display: none; }
@media (min-width: 1100px) {
  .att-top { display: inline-flex; }
  .side #att { display: none; }
}

/* Catch card on small phones: headline and XP move into the card; Keep / Release stay pinned */
.card-xp { display: none; }
@media (max-width: 699px) {
  .card-scrim .card-headline { display: none; }
  .card-xp { display: block; text-align: center; font: 700 15px var(--font-head); color: var(--ink-hand); }
  .catch-card { max-height: calc(100dvh - env(safe-area-inset-top) - 12px); padding-bottom: 0; }
  .catch-card .fish-art svg { max-height: 120px; }
  .catch-card h1 { font-size: 26px; }
  .card-actions { position: sticky; bottom: 0; z-index: 1; margin: 0 -22px; padding: 10px 22px calc(12px + env(safe-area-inset-bottom)); background: var(--paper); box-shadow: 0 -6px 10px rgba(46, 34, 22, 0.12); display: flex; flex-direction: column; gap: 8px; }
  .card-actions .choices { margin-top: 0; }
  .card-actions .more-choices.keep-in .btn { flex: 1 1 0; min-width: 0; font-size: 13px; }
}
.small-btn { min-height: 34px; padding: 0 10px; font-size: 13px; }
.spare .small-btn { margin-top: 6px; }
.spare-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.spare-acts .small-btn { margin-top: 0; }
.tbox-head .small-btn { color: var(--tackle-text); border-color: var(--tackle-text); background: transparent; }
.sheet-foot { margin: 14px 0 0; text-align: center; font-size: 11px; color: var(--ink-muted); }

/* How to play */
.help-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1.5px solid var(--tab-edge); background: transparent; color: var(--cream); font: 600 14px var(--font-ui); }
.help-btn > span:first-child { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brass-2); color: var(--wood-dark); font: 700 14px var(--font-head); }
.help { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.help-card { border-radius: 10px; padding: 14px 18px; color: var(--ink); box-shadow: 0 3px 0 var(--wood-dark); }
.help-card h3 { font: 700 19px var(--font-head) !important; margin: 0 0 6px !important; }
.help-card ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; }
.help-foot { display: flex; justify-content: center; margin-top: 16px; }
@media (max-width: 699px) {
  .help-btn { min-height: 36px; padding: 0 6px; border: none; }
  .help-btn .help-label { display: none; }
}
