:root {
  --text: #e9f8f4;
  --muted: #9dc4bf;
  --muted-2: #7ba5a0;
  --glass: rgba(6, 21, 26, 0.72);
  --glass-strong: rgba(7, 24, 30, 0.94);
  --line: rgba(158, 226, 216, 0.16);
  --line-strong: rgba(158, 226, 216, 0.28);
  --teal: #7fe3d3;
  --teal-deep: #3ba99c;
  --gold: #f6c85f;
  --coral: #ff8fa3;
  --shadow: 0 12px 34px rgba(0, 6, 8, 0.5);
  --radius: 16px;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

#app {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 18px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

#app.booting { opacity: 0; }

canvas#tank {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

svg.ic {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sprite { position: absolute; width: 0; height: 0; }

.hidden { display: none !important; }

/* ---------------------------------------------------------------- drag */
.drag-strip {
  position: absolute;
  top: 3px;
  left: 16px;
  right: 16px;
  height: 16px;
  z-index: 6;
  -webkit-app-region: drag;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grip {
  display: flex;
  gap: 3px;
  opacity: 0.18;
  transition: opacity 0.2s ease;
}

.grip i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #d9f7f2;
  display: block;
}

.drag-strip:hover .grip { opacity: 0.5; }

/* ---------------------------------------------------------------- hud */
.hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.top-actions {
  pointer-events: auto;
}

.resources {
  position: absolute;
  top: 28px;
  left: 14px;
  display: flex;
  gap: 5px;
  align-items: center;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.pill {
  height: 22px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border-radius: 18px;
  background: rgba(5, 18, 22, 0.6);
  border: 1px solid var(--line);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: 0.1px;
  box-shadow: 0 2px 8px rgba(0, 10, 12, 0.15);
}

.pill .ic { width: 12px; height: 12px; }
.pill:nth-child(1) .ic { color: var(--gold); }
.pill:nth-child(2) .ic { color: #f3b56d; }
.pill.ghost { color: var(--muted); background: rgba(5, 18, 22, 0.38); }
.pill.ghost .ic { color: #9de0d5; }

.pill.bump { animation: bump 0.32s ease; }

@keyframes bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.top-actions {
  position: absolute;
  top: 22px;
  right: 10px;
  display: flex;
  gap: 4px;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.icon-btn {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(5, 18, 22, 0.6);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  -webkit-app-region: no-drag;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(14, 40, 46, 0.78);
}

.icon-btn:active { transform: scale(0.94); }
.icon-btn .ic { width: 15px; height: 15px; }

.toolbar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 16px;
  background: rgba(5, 19, 23, 0.82);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 8, 10, 0.35);
  pointer-events: auto;
  transition: opacity 0.24s ease, transform 0.24s ease;
  -webkit-app-region: no-drag;
  max-width: calc(100% - 24px);
  flex-wrap: nowrap;
  justify-content: center;
}

.tbtn {
  height: 36px;
  min-width: 44px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: #f1fffb;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  -webkit-app-region: no-drag;
  white-space: nowrap;
  flex: 0 0 auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.tbtn.primary { background: rgba(246, 200, 95, 0.15); border-color: rgba(246, 200, 95, 0.35); }

.tbtn .ic { width: 17px; height: 17px; }
.tbtn:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.4); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); }
.tbtn:active { transform: scale(0.95); }
.tbtn.primary:hover { background: rgba(246, 200, 95, 0.25); }

.tbtn.primary {
  background: linear-gradient(180deg, #8cebdc, #5fcabb);
  color: #062b2a;
  border-color: rgba(210, 255, 248, 0.4);
  box-shadow: 0 2px 10px rgba(84, 210, 190, 0.28);
}

.tbtn.primary:hover { background: linear-gradient(180deg, #9df3e5, #6dd5c6); color: #04211f; }
.tbtn.primary .ic { stroke-width: 1.9; }

.tbtn.sell.active {
  background: rgba(246, 200, 95, 0.16);
  border-color: rgba(246, 200, 95, 0.55);
  color: var(--gold);
}

.tcost {
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(4, 39, 37, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
}

.tbtn.sell.active .tcost { background: rgba(246, 200, 95, 0.2); }

.tbadge {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  color: #062b2a;
  font-size: 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: 4px;
}

.hint {
  position: absolute;
  bottom: 57px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 9.5px;
  letter-spacing: 0.1px;
  color: rgba(219, 245, 240, 0.72);
  text-shadow: 0 1px 4px rgba(0, 10, 12, 0.8);
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.hint-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(219, 245, 240, 0.45);
}

.banner {
  position: absolute;
  bottom: 62px;
  left: 50%;
  transform: translateX(-50%);
  height: 26px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border-radius: 20px;
  background: rgba(44, 31, 9, 0.78);
  border: 1px solid rgba(246, 200, 95, 0.4);
  color: var(--gold);
  font-size: 10px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 8, 10, 0.3);
  white-space: nowrap;
  max-width: 76%;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 12;
}

.banner .ic { width: 12px; height: 12px; }

#app.selling .hint { opacity: 0; pointer-events: none; }

/* idle fade */
#app.idle .resources,
#app.idle .top-actions,
#app.idle .toolbar,
#app.idle .hint {
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
}

#app.idle .toolbar { transform: translateX(-50%) translateY(5px); }
#app.idle .top-actions { transform: translateY(-3px); }
#app.idle .resources { transform: translateY(-3px); }
#app.idle .drag-strip { pointer-events: none; }
#app.idle.selling .banner { opacity: 1; }

/* ---------------------------------------------------------------- toasts */
.toasts {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  z-index: 25;
  width: max-content;
  max-width: 82%;
}

.toast {
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(7, 25, 30, 0.9);
  border: 1px solid var(--line);
  box-shadow: 0 5px 16px rgba(0, 8, 10, 0.35);
  color: var(--text);
  font-size: 10.5px;
  letter-spacing: 0.1px;
  animation: toast-in 0.22s ease both;
  text-align: center;
}

.toast.good { border-color: rgba(127, 227, 211, 0.4); color: #c9fff5; }
.toast.warn { border-color: rgba(246, 200, 95, 0.42); color: #ffe6a9; }
.toast.bad { border-color: rgba(255, 143, 163, 0.4); color: #ffd0d8; }
.toast.out { animation: toast-out 0.35s ease both; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-5px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(-4px); }
}

/* ---------------------------------------------------------------- modals */
.modal {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(2, 10, 12, 0.58);
  animation: fade-in 0.16s ease both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.panel {
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(30, 68, 74, 0.5), rgba(4, 17, 21, 0) 65%),
    var(--glass-strong);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(220, 255, 248, 0.08);
  overflow: hidden;
  animation: panel-in 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
  -webkit-app-region: no-drag;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.shop-panel, .settings-panel, .guide-panel { height: 100%; }
.shop-panel.compact { height: auto; }
.help-panel { max-height: 100%; }

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px 9px;
  flex: 0 0 auto;
}

.head-copy { min-width: 0; }

.panel h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.1px;
  color: #f1fffb;
}

.head-sub {
  margin: 3px 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.head-sub .ic { width: 11px; height: 11px; color: var(--gold); }
.head-sub .dot, .about .dot {
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: rgba(158, 226, 216, 0.4);
}

.head-sub.soft {
  display: block;
  line-height: 1.45;
  max-width: 340px;
  font-size: 9.5px;
  color: var(--muted);
}

.modal-close {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.panel-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 14px 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 210, 200, 0.25) transparent;
}

.panel-foot {
  flex: 0 0 auto;
  padding: 0 14px 14px;
}

.panel-foot .btn.wide { margin-top: 4px; }

.panel-body::-webkit-scrollbar { width: 7px; }
.panel-body::-webkit-scrollbar-thumb {
  background: rgba(140, 210, 200, 0.22);
  border-radius: 10px;
}
.panel-body::-webkit-scrollbar-track { background: transparent; }

/* tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 0 14px 9px;
  flex: 0 0 auto;
}

.tab {
  flex: 1;
  height: 28px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: rgba(122, 205, 195, 0.06);
  color: var(--muted);
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab:hover { background: rgba(122, 205, 195, 0.12); color: var(--text); }
.tab.active {
  background: rgba(127, 227, 211, 0.14);
  border-color: rgba(127, 227, 211, 0.3);
  color: #ccfff6;
}

/* buttons */
.btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: rgba(127, 227, 211, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  -webkit-app-region: no-drag;
}

.btn:hover { background: rgba(127, 227, 211, 0.15); border-color: rgba(127, 227, 211, 0.42); }
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(180deg, #8cebdc, #5fcabb);
  border-color: rgba(210, 255, 248, 0.4);
  color: #062b2a;
}
.btn.primary:hover { background: linear-gradient(180deg, #9df3e5, #6dd5c6); }
.btn.ghost { background: rgba(255, 255, 255, 0.03); }
.btn.small { height: 26px; font-size: 9.5px; padding: 0 10px; }
.btn:disabled {
  opacity: 0.42;
  cursor: default;
  transform: none;
}
.btn:disabled:hover {
  background: rgba(127, 227, 211, 0.08);
  border-color: var(--line-strong);
}
.btn.wide { width: 100%; margin-top: 12px; flex: 0 0 auto; }
.btn.danger {
  background: rgba(255, 120, 140, 0.16);
  border-color: rgba(255, 130, 150, 0.4);
  color: #ffd3da;
}
.btn.danger:hover { background: rgba(255, 120, 140, 0.24); }
.btn.danger-ghost { color: #ffb7c2; border-color: rgba(255, 130, 150, 0.24); background: transparent; }
.btn.danger-ghost:hover { background: rgba(255, 120, 140, 0.1); }

/* ---------------------------------------------------------------- shop */
.food-list { display: grid; gap: 8px; }

.pack-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 11px;
  background: rgba(127, 227, 211, 0.055);
  border: 1px solid var(--line);
}

.pack-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, rgba(243, 181, 109, 0.25), rgba(243, 181, 109, 0.06));
  border: 1px solid rgba(243, 181, 109, 0.24);
  color: #f3b56d;
  flex: 0 0 auto;
}

.pack-ico .ic { width: 18px; height: 18px; }
.pack-info { flex: 1 1 auto; min-width: 0; }
.pack-buy { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.pack-buy .ic { width: 11px; height: 11px; }
.pack-name { font-size: 11px; font-weight: 600; }
.pack-amount { font-size: 9.5px; color: var(--muted); margin-top: 1px; }

.shop-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.shop-price .ic { width: 11px; height: 11px; }

.fish-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fish-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(45, 111, 116, 0.22), rgba(9, 34, 40, 0.3));
  border: 1px solid var(--line);
  min-width: 0;
}

.fish-card canvas {
  width: 100%;
  height: 44px;
  display: block;
  border-radius: 8px;
  background: radial-gradient(90% 100% at 50% 30%, rgba(54, 138, 140, 0.25), rgba(4, 17, 21, 0.1));
}

.fish-card .fish-name {
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.fish-card .fish-blurb {
  font-size: 8.5px;
  color: var(--muted-2);
  line-height: 1.3;
  height: 22px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.fish-card .fish-life {
  font-size: 8.5px;
  line-height: 1.2;
  color: rgba(178, 235, 224, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.fish-card .fish-price-note {
  font-size: 8.5px;
  line-height: 1.25;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fish-card .fish-buy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 1px;
}

.fish-card .buy-btn {
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid rgba(127, 227, 211, 0.32);
  background: rgba(127, 227, 211, 0.12);
  color: #c8fff6;
  font: inherit;
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fish-card .buy-btn:hover { background: rgba(127, 227, 211, 0.22); }
.fish-card .buy-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.shop-footnote {
  margin: 10px 2px 0;
  font-size: 8.5px;
  line-height: 1.45;
  color: var(--muted-2);
}

/* ---------------------------------------------------------------- guide */
.guide-progress {
  flex: 0 0 auto;
  padding: 0 14px 9px;
}

.guide-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 9px;
  color: var(--muted);
}

.guide-progress-copy strong {
  color: #b9f5ea;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.guide-track {
  height: 5px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(158, 226, 216, 0.08);
}

.guide-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #59cabb, #9de9dd 60%, #f6c85f);
  transition: width 0.3s ease;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.guide-card {
  position: relative;
  min-height: 112px;
}

.guide-card canvas { height: 48px; }

.guide-card.locked {
  opacity: 0.76;
  background: linear-gradient(180deg, rgba(35, 70, 77, 0.16), rgba(8, 26, 31, 0.24));
}

.guide-card.locked canvas {
  filter: brightness(0) opacity(0.32);
}

.guide-card.locked .fish-name { color: var(--muted); }

.guide-card .guide-line {
  min-height: 21px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 8.3px;
  line-height: 1.3;
  color: var(--muted-2);
}

.guide-card .guide-meta {
  overflow: hidden;
  font-size: 8.2px;
  line-height: 1.25;
  color: rgba(178, 235, 224, 0.72);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.guide-card .guide-date {
  min-height: 10px;
  overflow: hidden;
  font-size: 7.8px;
  line-height: 1.2;
  color: var(--muted-2);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.guide-card.locked .guide-meta { color: var(--muted-2); }

.guide-tag {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(246, 200, 95, 0.14);
  border: 1px solid rgba(246, 200, 95, 0.25);
  color: #ffdf9b;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.guide-card.locked .guide-tag { opacity: 0.45; }

.guide-empty {
  padding: 20px 8px;
  text-align: center;
  font-size: 9px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- settings */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(158, 226, 216, 0.07);
}

.row:last-of-type { border-bottom: 0; }
.row-text { min-width: 0; }
.row-label { font-size: 11px; font-weight: 600; color: #e2f7f2; }
.row-desc { font-size: 8.8px; color: var(--muted-2); line-height: 1.35; margin-top: 2px; max-width: 280px; }
.row-text + .switch { flex: 0 0 auto; }
.row > .switch { flex: 0 0 auto; }

.switch {
  position: relative;
  width: 34px;
  height: 19px;
  display: inline-block;
  flex: 0 0 auto;
  cursor: pointer;
}

.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch .track {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: rgba(120, 180, 174, 0.2);
  border: 1px solid rgba(158, 226, 216, 0.18);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #b9d7d1;
  box-shadow: 0 1px 3px rgba(0, 10, 12, 0.4);
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch input:checked + .track {
  background: rgba(95, 202, 187, 0.5);
  border-color: rgba(127, 227, 211, 0.55);
}

.switch input:checked + .track::after { transform: translateX(15px); background: #ecfffb; }
.switch input:focus-visible + .track { outline: 1px solid var(--teal); outline-offset: 2px; }

.segmented {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border-radius: 9px;
  background: rgba(4, 16, 20, 0.45);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.segmented button {
  height: 23px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.segmented button:hover { color: var(--text); }
.segmented button.active {
  background: rgba(127, 227, 211, 0.17);
  color: #d6fff8;
  box-shadow: inset 0 0 0 1px rgba(127, 227, 211, 0.24);
}

.corner-grid {
  display: grid;
  grid-template-columns: repeat(2, 22px);
  grid-template-rows: repeat(2, 18px);
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: rgba(4, 16, 20, 0.45);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.corner-grid button {
  border: 0;
  border-radius: 4px;
  background: transparent;
  padding: 2px;
  cursor: pointer;
}

.corner-grid button span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  background: rgba(150, 205, 198, 0.16);
  border: 1px solid rgba(158, 226, 216, 0.14);
  transition: all 0.15s ease;
}

.corner-grid button:hover span { background: rgba(127, 227, 211, 0.18); }
.corner-grid button.active span {
  background: rgba(127, 227, 211, 0.5);
  border-color: rgba(190, 255, 245, 0.6);
}

.actions-row {
  gap: 8px;
  justify-content: flex-end;
  border-bottom: 0;
  padding-bottom: 4px;
}

.divider {
  height: 1px;
  background: rgba(158, 226, 216, 0.09);
  margin: 4px 0;
}

.about {
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  color: var(--muted-2);
  font-size: 8.5px;
}

/* ---------------------------------------------------------------- help */
.steps { display: flex; flex-direction: column; gap: 9px; }

.step {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(127, 227, 211, 0.045);
  border: 1px solid rgba(158, 226, 216, 0.08);
}

.step-ico {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(127, 227, 211, 0.1);
  border: 1px solid rgba(127, 227, 211, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  flex: 0 0 auto;
}

.step-ico .ic { width: 14px; height: 14px; }
.step h3 { margin: 0; font-size: 10.5px; font-weight: 650; color: #e7fbf6; }
.step p { margin: 2px 0 0; font-size: 9px; line-height: 1.45; color: var(--muted); }

/* ---------------------------------------------------------------- confirm */
.confirm-panel { width: 100%; max-width: 300px; }
.confirm-body { padding: 16px; }
.confirm-body h2 { font-size: 13px; margin: 0 0 6px; }
.confirm-body p { margin: 0; font-size: 9.5px; line-height: 1.5; color: var(--muted); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; }

/* ---------------------------------------------------------------- rename */
.rename-panel { width: 100%; max-width: 320px; }
.rename-body { padding: 16px; }
.rename-body h2 { font-size: 13px; margin: 0 0 5px; }
.rename-sub { min-height: 13px; margin: 0 0 10px; font-size: 9.5px; line-height: 1.4; color: var(--muted); }
.rename-label { display: block; margin-bottom: 5px; font-size: 9px; letter-spacing: 0.2px; color: var(--muted-2); text-transform: uppercase; }
.text-input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(3, 15, 19, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.text-input:focus { border-color: rgba(127, 227, 211, 0.7); box-shadow: 0 0 0 2px rgba(127, 227, 211, 0.12); }

/* ---------------------------------------------------------------- demo */
.demo-badge {
  position: absolute;
  right: 16px;
  bottom: 13px;
  z-index: 12;
  font-size: 9px;
  letter-spacing: 1.6px;
  text-transform: lowercase;
  color: rgba(224, 255, 248, 0.4);
  pointer-events: none;
}

/* ---------------------------------------------------------------- postcard */
.postcard-panel { height: auto; max-width: 340px; }
.postcard-panel .panel-body { padding: 14px 14px 8px; }
.postcard-goal {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(127, 227, 211, 0.05);
  border: 1px solid var(--line);
  margin-bottom: 6px;
}
.postcard-goal.done {
  background: rgba(127, 227, 211, 0.12);
  border-color: rgba(127, 227, 211, 0.3);
}
.postcard-goal .check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 11px;
}
.postcard-goal.done .check { background: rgba(127, 227, 211, 0.2); color: #b9f5ea; }
.postcard-goal .check.empty { color: var(--muted-2); }
.postcard-goal .text { flex: 1 1 auto; font-size: 9.5px; line-height: 1.4; }
.postcard-goal.done .text { color: var(--text); }
.postcard-goal .text.todo { color: var(--muted); }
.postcard-reward {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(246, 200, 95, 0.1);
  border: 1px solid rgba(246, 200, 95, 0.25);
  font-size: 9.5px;
  color: #ffe7a8;
}

/* ---------------------------------------------------------------- visitor */
.visitor-panel { height: auto; max-width: 340px; }
.visitor-panel .panel-body { padding: 14px 14px 8px; }
.visitor-detail {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 166, 154, 0.1);
  border: 1px solid rgba(255, 166, 154, 0.25);
  margin-bottom: 10px;
}
.visitor-detail .ico {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 166, 154, 0.2);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.visitor-detail .text { flex: 1 1 auto; }
.visitor-detail .text .name {
  font-size: 11px;
  font-weight: 650;
  color: var(--text);
}
.visitor-detail .text .desc {
  font-size: 9px;
  color: var(--muted);
  line-height: 1.4;
}
/* ---------------------------------------------------------------- photo */
.photo-panel { height: auto; max-width: 700px; }
.photo-panel .panel-body { padding: 14px 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
/* ---------------------------------------------------------------- show */
.show-panel { height: auto; max-width: 340px; }
.show-panel .panel-body { padding: 14px 14px 8px; }
.show-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(127, 227, 211, 0.05);
  border: 1px solid var(--line);
  margin-bottom: 6px;
}
.show-entry.voted {
  border-color: rgba(127, 227, 211, 0.3);
  background: rgba(127, 227, 211, 0.12);
}
.show-entry.winner {
  border-color: rgba(246, 200, 95, 0.5);
  background: rgba(246, 200, 95, 0.15);
}
.show-entry .preview {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: radial-gradient(90% 100% at 50% 30%, rgba(54, 138, 140, 0.25), rgba(4, 17, 21, 0.1));
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.show-entry .info { flex: 1 1 auto; min-width: 0; }
.show-entry .info .name {
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.show-entry .info .meta {
  font-size: 8px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.show-entry .votes {
  font-size: 9px;
  font-weight: 700;
  color: var(--gold);
  flex: 0 0 auto;
}
.show-entry button {
  flex: 0 0 auto;
  height: 26px;
  padding: 0 10px;
  font-size: 8.5px;
}
/* ---------------------------------------------------------------- order */
.order-panel { height: auto; max-width: 340px; }
.order-panel .panel-body { padding: 14px 14px 8px; }
.order-detail {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(246, 200, 95, 0.1);
  border: 1px solid rgba(246, 200, 95, 0.25);
  margin-bottom: 10px;
}
.order-detail .ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(246, 200, 95, 0.2);
  flex: 0 0 auto;
}
.order-detail .ico .ic { width: 18px; height: 18px; color: var(--gold); }
.order-detail .text { flex: 1 1 auto; }
.order-detail .text .desc {
  font-size: 9.5px;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 4px;
}
.order-detail .text .meta {
  font-size: 8px;
  color: var(--muted);
}
.order-detail .pay {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

/* ---------------------------------------------------------------- decor */
.decor-panel { height: auto; max-width: 340px; }
.decor-panel .panel-body { padding: 14px 14px 8px; }
.decor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.decor-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 10px;
  background: rgba(127, 227, 211, 0.05);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s ease;
}
.decor-item:hover {
  background: rgba(127, 227, 211, 0.12);
  border-color: rgba(127, 227, 211, 0.3);
}
.decor-item .preview {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(90% 100% at 50% 30%, rgba(54, 138, 140, 0.25), rgba(4, 17, 21, 0.1));
  border: 1px solid var(--line);
}
.decor-item .name {
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.decor-item .cost {
  font-size: 8px;
  color: var(--muted-2);
}

/* small windows */
@media (max-height: 340px) {
  .resources { top: 25px; }
  .top-actions { top: 23px; }
  .hint { display: none; }
  .toolbar { bottom: 8px; }
  .banner { bottom: 50px; }
  .tbtn { height: 29px; padding: 0 9px; }
  .toasts { top: 54px; }
  .row { padding: 7px 0; }
  .row-desc { display: none; }
}

@media (max-width: 500px) {
  .toolbar { bottom: 8px; padding: 2px; gap: 2px; }
  .tbtn { height: 26px; padding: 0 6px; font-size: 9px; }
  .tbtn .tlabel { display: none; }
  .tbadge { width: 10px; height: 10px; font-size: 7px; }
  .top-actions { top: 20px; right: 8px; gap: 3px; }
  .icon-btn { width: 22px; height: 22px; }
  .resources { top: 22px; left: 10px; gap: 3px; }
  .pill { height: 20px; padding: 0 7px; font-size: 9px; }
}

@media (max-height: 430px) {
  .settings-panel .panel-head { padding: 10px 14px 6px; }
  .settings-panel .row { padding: 6px 0; }
  .settings-panel .row-desc { display: none; }
  .settings-panel .panel-body { padding-bottom: 10px; }
  .settings-panel .about { padding-top: 7px; }
  .help-panel .panel-head { padding: 10px 14px 7px; }
  .step { padding: 6px 8px; }
  .steps { gap: 7px; }
}

@media (max-width: 380px) {
  .hint { font-size: 8.5px; }
  .tbtn .tlabel { display: none; }
  .tbtn { padding: 0 9px; }
  .tcost { display: none; }
  .fish-grid, .guide-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- naming */
.naming-panel { width: 100%; max-width: 320px; }
.naming-body { padding: 16px; }
.naming-body h2 { font-size: 13px; margin: 0 0 5px; }
.naming-sub { min-height: 13px; margin: 0 0 10px; font-size: 9.5px; line-height: 1.4; color: var(--muted); }
.naming-label { display: block; margin-bottom: 5px; font-size: 9px; letter-spacing: 0.2px; color: var(--muted-2); text-transform: uppercase; }

/* ---------------------------------------------------------------- family tree */
.familytree-panel { height: auto; max-width: 340px; }
.familytree-panel .panel-body { padding: 14px 14px 8px; }
.familytree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(158, 226, 216, 0.07);
  font-size: 9px;
}
.familytree-row:last-child { border-bottom: 0; }
.familytree-name { font-weight: 650; color: var(--text); min-width: 80px; }
.familytree-info { color: var(--muted); flex: 1 1 auto; }
.familytree-label { color: var(--muted-2); font-size: 8px; flex: 0 0 auto; }

/* ---------------------------------------------------------------- diary */
.diary-panel { height: auto; max-width: 340px; }
.diary-panel .panel-body { padding: 14px 14px 8px; }
.diary-entry {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(127, 227, 211, 0.05);
  border: 1px solid var(--line);
  margin-bottom: 6px;
  font-size: 9px;
}
.diary-type { color: var(--muted-2); font-size: 8.5px; }
.diary-text { color: var(--text); line-height: 1.45; }

/* ---------------------------------------------------------------- snail */
.snail-panel { height: auto; max-width: 340px; }
.snail-panel .panel-body { padding: 14px 14px 8px; display: flex; align-items: center; justify-content: center; }
.snail-letter {
  font-size: 11px;
  line-height: 1.6;
  color: var(--text);
  text-align: center;
  font-style: italic;
}
