/* Font */
@font-face {
  font-family: "Zpix";
  src: url("../fonts/zpix.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* Color Palette */
:root {
  --bg: #a9b0a2;
  --h-title: #283023;
  --c-bg: #a9b0a2;
  --c-text: #283023;
  --c-btn-bg: #b0b7a7;
  --c-btn-shadow: #373f30;
  --c-btn-text: #283023;
  --t-bg: #a9b0a2;
  --t-text: #283023;
  --t-text-placeholder: rgba(46, 54, 40, 0.55);
  --c-err: #cc1e1e;
  --grid-bg:
    repeating-linear-gradient(0deg, rgba(40,48,35,0.07) 0px, rgba(40,48,35,0.07) 1px, transparent 1px, transparent 4px),
    repeating-linear-gradient(90deg, rgba(40,48,35,0.07) 0px, rgba(40,48,35,0.07) 1px, transparent 1px, transparent 4px);
  --grid-btn:
    repeating-linear-gradient(0deg, rgba(40,48,35,0.10) 0px, rgba(40,48,35,0.10) 1px, transparent 1px, transparent 4px),
    repeating-linear-gradient(90deg, rgba(40,48,35,0.10) 0px, rgba(40,48,35,0.10) 1px, transparent 1px, transparent 4px);
  --grid-dark:
    repeating-linear-gradient(0deg, rgba(40,48,35,0.16) 0px, rgba(40,48,35,0.16) 1px, transparent 1px, transparent 4px),
    repeating-linear-gradient(90deg, rgba(40,48,35,0.16) 0px, rgba(40,48,35,0.16) 1px, transparent 1px, transparent 4px);
}

/* Global Styles */
* {
  box-sizing: border-box;
  font-family: "Zpix", monospace;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
}

body {
  margin: 0;
  background: var(--bg);
  background-image: var(--grid-bg);
  color: var(--c-text);
  padding: 0;
  overflow: hidden;
  height: 100dvh;
  width: 100%;
  position: fixed;
  overscroll-behavior: none;
}

canvas {
  display: block;
  -webkit-user-select: none;
  user-select: none;
}

.page {
  display: none;
  flex-direction: column;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  background: var(--bg);
  background-image: var(--grid-bg);
}

/* ── Swipe Tutorial Page ─────────────────────────────────── */
.tutorial-page {
  background: var(--bg);
  position: relative;
  align-items: center;
  justify-content: center;
}

.tut-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.tut-flash-overlay {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}
.tut-flash-overlay.active {
  animation: tutFlash 0.5s ease-out forwards;
}
@keyframes tutFlash {
  0%   { opacity: 0.7; }
  30%  { opacity: 0.4; }
  60%  { opacity: 0.7; }
  100% { opacity: 0; }
}

.tutorial-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  padding: 2rem;
}

.tutorial-text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
}

.tut-line {
  font-family: "Zpix", monospace;
  font-size: 18px;
  color: var(--c-text);
  margin: 0;
  letter-spacing: 0.05em;
  line-height: 2;
}

.tut-line-en {
  font-family: "Zpix", monospace;
  font-size: 12px;
  color: rgba(46, 54, 40, 0.55);
  margin: -1rem 0 0;
  letter-spacing: 0.04em;
  line-height: 1.6;
  text-align: center;
}

.tut-word-en {
  display: inline-block;
  color: var(--c-text);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  border-bottom: 1px dashed rgba(46, 54, 40, 0.5);
  position: relative;
}

.tut-word-en.tut-glitching {
  animation: wordGlitch 0.45s ease-out forwards;
}

/* Interactive keyword spans */
.tut-word {
  display: inline-block;
  color: var(--c-text);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  border-bottom: 1px dashed var(--c-text);
  position: relative;
}

/* Glitch + shake fires on .tut-word.tut-glitching */
.tut-word.tut-glitching {
  animation: wordGlitch 0.45s ease-out forwards;
}
@keyframes wordGlitch {
  0%   { color: var(--c-text); transform: none; text-shadow: none; }
  12%  { color: #cc1e1e; transform: translateX(-4px); text-shadow: 4px 0 #cc1e1e; }
  25%  { color: var(--c-text); transform: translateX(4px); text-shadow: -3px 1px rgba(42,56,32,0.5); }
  40%  { color: #cc1e1e; transform: translateX(-2px) skewX(-5deg); }
  55%  { color: var(--c-text); transform: translateX(2px); }
  70%  { color: #cc1e1e; transform: translateX(-1px); text-shadow: 3px 1px #cc1e1e; }
  100% { color: var(--c-text); transform: none; text-shadow: none; }
}

/* Float text near 短按 — appears on short-press after long-press text submitted */
.tut-short-wrap {
  position: relative;
}
.tut-float-text {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: "Zpix", monospace;
  font-size: 13px;
  color: var(--c-text);
  pointer-events: none;
  animation: tutFloatIn 0.4s ease-out forwards;
}
.tut-float-text.tut-hidden { display: none; }
@keyframes tutFloatIn {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Long-press popup */
.tut-popup {
  position: absolute;
  inset: 0;
  background: rgba(192, 200, 184, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.tut-popup.tut-hidden { display: none; }
.tut-popup-inner {
  background: var(--c-bg);
  border: 2px solid rgba(55, 63, 48, 0.45);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 260px;
  box-shadow: 0 0 0 2px rgba(55,63,48,0.5), inset 2px 2px 0 rgba(255,255,255,0.10), inset -2px -2px 0 rgba(55,63,48,0.15);
}
.tut-popup-label {
  font-family: "Zpix", monospace;
  color: var(--c-text);
  font-size: 14px;
  margin: 0;
}
.tut-popup-input {
  background: var(--t-bg) !important;
  color: var(--t-text) !important;
  border-color: rgba(55, 63, 48, 0.45) !important;
}
.tut-popup-btn {
  background: var(--c-btn-bg) !important;
  color: var(--c-btn-text) !important;
  border-color: rgba(55, 63, 48, 0.45) !important;
}

/* Enter button — hidden until tutorial complete */
.tut-enter-wrap {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  text-align: center;
  padding: 1rem 2rem;
  border: 2px solid rgba(55, 63, 48, 0.45);
  animation: enterPulse 1.8s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.tut-enter-wrap.tut-hidden { display: none; }
.tut-enter-word {
  font-family: "Zpix", monospace;
  font-size: 22px;
  color: var(--c-text);
  letter-spacing: 0.1em;
}
.tut-ellipsis {
  font-family: "Zpix", monospace;
  font-size: 22px;
  color: var(--c-text);
  animation: dotsBlink 1.2s step-end infinite;
}
@keyframes dotsBlink {
  0%, 100% { opacity: 1; }
  33%       { opacity: 0; }
  66%       { opacity: 0.4; }
}
@keyframes enterPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(55,63,48,0.45); border-color: rgba(55,63,48,0.40); }
  50%       { box-shadow: 0 0 0 2px rgba(55,63,48,0.70); border-color: rgba(55,63,48,0.65); }
}
.tut-enter-wrap:active {
  background: rgba(46, 54, 40, 0.15);
}

/* ── Onboarding overlay (replaces swipe-tutorial page) ───── */
#onboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 8500;
  background: rgba(192, 200, 184, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
#onboard-overlay.hidden { display: none; }

.ob-step { display: none; flex-direction: column; align-items: center; gap: 2rem; padding: 2.5rem 2rem; width: 100%; max-width: 420px; position: relative; }
.ob-step.active { display: flex; }

/* scanline texture inside overlay */
.ob-scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
  pointer-events: none;
  z-index: 0;
}

.ob-step-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2rem; width: 100%; }

.ob-progress {
  font-family: "Zpix", monospace;
  font-size: 11px;
  color: rgba(42,56,32,0.5);
  letter-spacing: 0.15em;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.07);
}

.ob-title-zh {
  font-family: "Zpix", monospace;
  font-size: 32px;
  color: var(--c-text);
  margin: 0;
  text-align: center;
  text-shadow: 1px 1px 0 rgba(42,56,32,0.08);
  letter-spacing: 0.1em;
}
.ob-title-en {
  font-family: "Zpix", monospace;
  font-size: 13px;
  color: rgba(42,56,32,0.55);
  margin: -1.5rem 0 0;
  text-align: center;
  letter-spacing: 0.08em;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.07);
}
.ob-sub-zh {
  font-family: "Zpix", monospace;
  font-size: 14px;
  color: rgba(42,56,32,0.85);
  margin: 0;
  text-align: center;
  line-height: 1.9;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.08);
}
.ob-sub-en {
  font-family: "Zpix", monospace;
  font-size: 11px;
  color: rgba(42,56,32,0.5);
  margin: -1rem 0 0;
  text-align: center;
  line-height: 1.6;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.07);
}

/* Interactive demo word */
.ob-demo-word {
  display: inline-block;
  font-family: "Zpix", monospace;
  font-size: 18px;
  color: var(--c-text);
  border-bottom: 2px dashed var(--c-text);
  padding: 0.4rem 1rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  transition: opacity 0.2s;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}
.ob-demo-word.ob-glitch { animation: wordGlitch 0.45s ease-out forwards; }
.ob-demo-word.ob-done {
  border-color: rgba(42,56,32,0.3);
  color: rgba(42,56,32,0.4);
}

.ob-short-wrap { position: relative; }
.ob-float-text {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: "Zpix", monospace;
  font-size: 13px;
  color: var(--c-text);
  pointer-events: none;
  animation: tutFloatIn 0.4s ease-out forwards;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}
.ob-float-text.hidden { display: none; }

/* Agree words */
.ob-agree-wrap { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.ob-agree-word {
  display: inline-block;
  font-family: "Zpix", monospace;
  font-size: 15px;
  color: var(--c-text);
  border-bottom: 1px dashed var(--c-text);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: font-size 0.15s;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}
.ob-agree-word.ob-glitch { animation: wordGlitch 0.45s ease-out forwards; }

.ob-agree-counter {
  font-family: "Zpix", monospace;
  font-size: 12px;
  color: rgba(42,56,32,0.5);
  text-align: center;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.07);
}

/* Long-press popup inside overlay */
.ob-input-wrap {
  background: var(--c-bg);
  border: 2px solid rgba(55, 63, 48, 0.45);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
  box-shadow: 0 0 0 2px rgba(55,63,48,0.5), inset 2px 2px 0 rgba(255,255,255,0.10), inset -2px -2px 0 rgba(55,63,48,0.15);
}
.ob-input-wrap.hidden { display: none; }
.ob-input-label {
  font-family: "Zpix", monospace;
  font-size: 12px;
  color: rgba(42,56,32,0.7);
  margin: 0;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.07);
}
.ob-nes-input {
  background: var(--t-bg) !important;
  color: var(--t-text) !important;
  border-color: rgba(55, 63, 48, 0.45) !important;
  width: 100%;
}
.ob-submit-btn {
  background: var(--c-btn-bg) !important;
  color: var(--c-btn-text) !important;
  border-color: rgba(55, 63, 48, 0.45) !important;
  align-self: flex-end;
}

/* Impression demo */
.ob-impression-demo {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}
.ob-imp-icon {
  font-size: 20px;
  flex-shrink: 0;
}

/* Close / unlock button */
.ob-close-btn {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2;
  width: 40px;
  height: 40px;
  background: var(--c-btn-bg);
  border: 2px solid rgba(55, 63, 48, 0.45);
  color: var(--c-btn-text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Zpix", monospace;
  transition: opacity 0.3s, box-shadow 0.3s;
  -webkit-tap-highlight-color: transparent;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}
.ob-close-btn.locked {
  opacity: 0.2;
  pointer-events: none;
  box-shadow: none;
}
.ob-close-btn.unlocked {
  opacity: 1;
  pointer-events: auto;
  animation: enterPulse 1.8s ease-in-out infinite;
}

/* Interactive big titles (the element you press) */
.ob-title-interactive {
  font-family: "Zpix", monospace;
  font-size: 48px;
  color: var(--c-text);
  text-shadow: 1px 1px 0 rgba(42,56,32,0.08);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: block;
  text-align: center;
  letter-spacing: 0.12em;
  border-bottom: 2px dashed rgba(42,56,32,0.4);
  padding: 0.2rem 1.2rem 0.4rem;
  animation: obTitlePulse 2.2s ease-in-out infinite;
}
.ob-title-interactive.ob-done {
  border-color: rgba(42,56,32,0.15);
  color: rgba(42,56,32,0.3);
  text-shadow: none;
  animation: none;
  cursor: default;
}
.ob-title-interactive.ob-glitch { animation: wordGlitch 0.45s ease-out forwards; }
@keyframes obTitlePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}

/* Floating interpretation word in step 2 */
.ob-float-word {
  font-family: "Zpix", monospace;
  font-size: 22px;
  color: #cc1e1e;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  letter-spacing: 0.1em;
  transition: font-size 0.15s ease-out;
  display: block;
  padding: 0.6rem 1.2rem;
  animation: obFadeIn 0.5s ease-out forwards;
}
.ob-float-word.hidden { display: none; }
.ob-float-word.ob-glitch { animation: wordGlitch 0.45s ease-out forwards; }
@keyframes obFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Agree instruction block */
.ob-agree-instr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
  animation: obFadeIn 0.4s ease-out forwards;
}
.ob-agree-instr.hidden { display: none; }

.ob-agree-sub {
  font-family: "Zpix", monospace;
  font-size: 12px;
  color: rgba(42,56,32,0.55);
  letter-spacing: 0.06em;
  text-align: center;
  margin: 0;
}

.ob-agree-tally {
  font-family: "Zpix", monospace;
  font-size: 28px;
  color: var(--c-text);
  text-shadow: 1px 1px 0 rgba(42,56,32,0.08);
  letter-spacing: 0.05em;
}

/* Avatar image in step 3 */
.ob-avatar-img {
  width: 250px;
  height: 250px;
  image-rendering: pixelated;
  border: 2px solid rgba(55, 63, 48, 0.45);
  box-shadow: 0 0 0 2px rgba(55,63,48,0.5), inset 2px 2px 0 rgba(255,255,255,0.10), inset -2px -2px 0 rgba(55,63,48,0.15);
  transition: opacity 0.3s ease;
  display: block;
}

/* Flash transition between steps */
#ob-flash {
  position: fixed;
  inset: 0;
  background: #b4bbaf;
  opacity: 0;
  pointer-events: none;
  z-index: 9000;
}
#ob-flash.active { animation: tutFlash 0.4s ease-out forwards; }

/* ── Hobby tags ──────────────────────────────────────────── */
.hobby-hint {
  font-size: 12px;
  opacity: 0.6;
  margin: 4px 0 10px;
}
.hobby-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}
.hobby-tag {
  display: inline-block;
  padding: 5px 12px;
  border: 2px solid rgba(55, 63, 48, 0.45);
  box-shadow: 0 0 0 2px rgba(55,63,48,0.45);
  background: var(--c-bg);
  background-image: var(--grid-bg);
  color: var(--c-text);
  font-family: "Zpix", monospace;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, color 0.12s;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}
.hobby-tag.selected {
  background: var(--c-btn-shadow);
  color: var(--c-btn-text);
}
.hobby-cat-label {
  flex-basis: 100%;
  width: 100%;
  font-size: 12px;
  font-weight: bold;
  color: var(--h-title);
  border-bottom: 2px solid rgba(55, 63, 48, 0.40);
  padding: 10px 0 4px;
  margin-top: 6px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.08);
}
.hobby-cat-label:first-child {
  padding-top: 0;
  margin-top: 0;
}
/* Tier tint on individual tags — all use the same dark palette */
.hobby-tag.tier-0.selected,
.hobby-tag.tier-1.selected,
.hobby-tag.tier-2.selected,
.hobby-tag.tier-3.selected,
.hobby-tag.tier-5.selected { background: var(--c-btn-shadow); color: #e0e8d0; border-color: rgba(55,63,48,0.7); }
@keyframes hobby-limit-flash {
  0%,100% { border-color: inherit; }
  40% { border-color: #cc1e1e; background: rgba(231,76,60,0.18); }
}
.hobby-tag-limit-flash { animation: hobby-limit-flash 0.6s ease; }

/* ── Like opener belt modal ──────────────────────────────── */
#like-opener-popup.hidden { display: none; }
#like-opener-popup:not(.hidden) {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.72);
  align-items: center;
  justify-content: center;
}
.opener-modal {
  background: var(--c-bg);
  border: 3px solid rgba(55, 63, 48, 0.45);
  padding: 20px 16px 16px;
  width: min(92vw, 480px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.opener-modal-title {
  font-size: 15px;
  font-weight: bold;
  margin: 0;
  text-align: center;
}
.opener-belt-outer {
  overflow: hidden;
  width: 100%;
  border: 2px solid rgba(55, 63, 48, 0.45);
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.opener-belt {
  display: flex;
  gap: 10px;
  width: max-content;
  padding: 2px 6px;
}
.opener-belt-r0 { animation: beltScroll    101s linear infinite; }
.opener-belt-r1 { animation: beltScrollRev 100s linear infinite; }
.opener-belt-r2 { animation: beltScroll    103s linear infinite; }
.opener-chip.selected { background: #464f3c; color: #fff; border-color: #464f3c; outline: 3px solid #464f3c; outline-offset: 2px; }
@keyframes beltScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes beltScrollRev {
  0%   { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}
@keyframes chipGlitch {
  0%, 91%, 100% { transform: translateX(0); text-shadow: none; }
  92% { transform: translateX(-3px); text-shadow: 3px 0 #464f3c; }
  93% { transform: translateX(3px); text-shadow: -3px 0 #373f30; }
  94% { transform: translateX(-1px); text-shadow: 3px 1px #464f3c; }
  95% { transform: translateX(0); }
}
.opener-chip {
  padding: 8px 14px;
  border: 2px solid rgba(55, 63, 48, 0.45);
  box-shadow: 0 0 0 2px rgba(55,63,48,0.5), inset 2px 2px 0 rgba(255,255,255,0.10);
  background: var(--c-bg);
  background-image: var(--grid-bg);
  color: var(--c-text);
  font-family: "Zpix", monospace;
  font-size: 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.opener-chip.selected { background: #464f3c; color: #fff; border-color: #464f3c; }
.opener-chip.opener-boring,
.opener-chip.opener-weird,
.opener-chip.opener-flagged { animation: chipGlitch 4s infinite; }
.opener-selected-display {
  min-height: 38px;
  border: 2px dashed var(--c-btn-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 14px;
  text-align: center;
}
.opener-modal-btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}
/* ── Custom hobby category picker ────────────────────────── */
#hobby-cat-picker.hidden { display: none; }
#hobby-cat-picker:not(.hidden) {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.65);
  align-items: center;
  justify-content: center;
}
.hobby-cat-picker-box {
  background: var(--c-bg);
  border: 3px solid rgba(55, 63, 48, 0.45);
  padding: 16px;
  width: min(86vw, 360px);
  max-height: 72dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.hobby-cat-picker-title {
  font-size: 14px;
  font-weight: bold;
  margin: 0;
  text-align: center;
}
.hobby-cat-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.hobby-cat-option {
  padding: 8px 12px;
  border: 2px solid rgba(55, 63, 48, 0.45);
  background: transparent;
  color: var(--c-text);
  font-family: "Zpix", monospace;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}
.hobby-cat-option:active { background: var(--c-btn-shadow); color: var(--c-btn-text); }
.edit-hobby-collapsed {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid rgba(55, 63, 48, 0.45);
  padding: 8px 12px;
  cursor: pointer;
  min-height: 38px;
}
.edit-hobby-summary-text {
  font-size: 12px;
  opacity: 0.6;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.edit-hobby-edit-btn {
  font-size: 12px;
  flex-shrink: 0;
  margin-left: 8px;
  opacity: 0.8;
}
.hobby-custom-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.hobby-custom-row .nes-input {
  flex: 1;
  font-size: 13px;
  min-height: 36px;
}
.hobby-custom-row .nes-btn {
  flex-shrink: 0;
  font-size: 16px;
  padding: 4px 14px;
}

.page.active {
  display: flex;
}

.phone {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Setup pages layout ─────────────────────────────────── */
.setup-page {
  position: relative;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image: var(--grid-bg);
}

.setup-page .setup-content {
  flex: 0 0 auto;
  width: 100%;
  max-width: 420px;
  align-items: stretch;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100dvh - 100px);
}

/* Input sizing inside setup forms */
.setup-page .setup-content label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  margin-top: 10px;
}

.setup-page .setup-content .nes-input,
.setup-page .setup-content .nes-textarea,
.setup-page .setup-content .nes-select select {
  font-size: 13px;
  min-height: 40px;
  width: 100%;
  box-sizing: border-box;
}

.setup-page .setup-content .nes-select + .nes-select {
  margin-top: 6px;
}

.setup-page .setup-content .nes-textarea {
  min-height: 72px;
}

.setup-page .setup-content .nes-field {
  margin-top: 10px;
}

.setup-prev-btn {
  position: absolute !important;
  top: 1rem;
  left: 1rem;
  font-size: 0.65rem !important;
  line-height: 1 !important;
  padding: 4px 10px !important;
  z-index: 10;
}

.setup-next-btn {
  position: absolute !important;
  bottom: 1.5rem;
  right: 1rem;
  z-index: 10;
}

.scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

#p5-canvas-container {
  position: relative;
  touch-action: none;
  border: 2px solid rgba(55, 63, 48, 0.45);
  box-shadow:
    0 0 0 1px rgba(55,63,48,0.5),
    inset 2px 2px 0 rgba(0,0,0,0.10),
    inset -1px -1px 0 rgba(255,255,255,0.12),
    3px 4px 0 rgba(40,48,35,0.30);
  background: var(--c-bg);
}

.logo {
  font-size: 48px;
  text-align: center;
  margin-top: 100px;
}

.subtitle {
  text-align: center;
  opacity: 0.6;
}

.nes-btn img {
  pointer-events: none;
  display: block;
  image-rendering: pixelated;
}

.section-header-label {
  color: var(--h-title);
  font-size: 15px;
  border-bottom: 1px solid rgba(46, 54, 40, 0.3);
  padding-bottom: 4px;
  margin-top: 8px;
}

.nes-btn,
.nes-btn.is-primary,
.nes-btn.is-success,
.nes-btn.is-warning,
.nes-btn.is-error,
.nes-btn.is-disabled,
.nes-btn[disabled] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  border-radius: 2px !important;
  background-color: var(--c-btn-bg) !important;
  color: var(--c-btn-text) !important;
  /* semi-transparent border: grid texture bleeds through, forming pixel-block feel */
  border: 4px solid rgba(55, 63, 48, 0.45) !important;
  box-shadow:
    0 0 0 1px rgba(55,63,48,0.6),
    inset -2px -2px 0 rgba(55,63,48,0.25),
    inset 1px 1px 0 rgba(255,255,255,0.15) !important;
  background-image: var(--grid-btn) !important;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}

.nes-btn::before,
.nes-btn.is-primary::before,
.nes-btn.is-success::before,
.nes-btn.is-warning::before,
.nes-btn.is-error::before {
  display: none !important;
}

.nes-btn::after,
.nes-btn.is-primary::after,
.nes-btn.is-success::after,
.nes-btn.is-warning::after,
.nes-btn.is-error::after {
  display: none !important;
}

.nes-btn:active,
.nes-btn.is-primary:active,
.nes-btn.is-success:active,
.nes-btn.is-warning:active,
.nes-btn.is-error:active {
  background-color: var(--c-btn-shadow) !important;
  color: #e0e8d0 !important;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.3) !important;
}

.nes-input,
.nes-textarea,
.nes-select select {
  background-color: var(--t-bg);
  color: var(--t-text);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
  border-image: none !important;
  border: 2px solid rgba(55, 63, 48, 0.45) !important;
  border-radius: 2px !important;
  box-shadow:
    0 0 0 1px rgba(55,63,48,0.5),
    inset 2px 2px 0 rgba(0, 0, 0, 0.10),
    inset -1px -1px 0 rgba(255, 255, 255, 0.12);
}

.nes-input:focus,
.nes-textarea:focus,
.nes-select select:focus {
  border-color: rgba(55, 63, 48, 0.75) !important;
  outline: none !important;
  box-shadow:
    0 0 0 1px rgba(55,63,48,0.7),
    inset 2px 2px 0 rgba(0, 0, 0, 0.12),
    inset -1px -1px 0 rgba(255, 255, 255, 0.15) !important;
}

/* 文字加LCD残影感 */
.value,
h1,
h2,
label,
p {
  text-shadow: 1px 1px 0 rgba(46,54,40,0.08);
  letter-spacing: 1px;
}

input::placeholder {
  color: var(--t-text-placeholder);
}

textarea::placeholder {
  color: var(--t-text-placeholder);
}

textarea {
  resize: none;
  height: 60px;
}

.pixeldraw {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/*  float 抖动 像素
li.other .words {
  letter-spacing: 2px;
  animation: float 1.5s infinite alternate;
}

@keyframes float {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-2px);
  }
} */

#swipe-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
#swipe-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#profile-edit {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  background-image: var(--grid-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#profile-edit.hidden {
  display: none;
}

.edit-overlay-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 20px 0;
}

.edit-overlay-inner > button.nes-btn {
  flex-shrink: 0;
  margin: 8px 0 20px;
}

.profile-view-row {
  display: flex;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  align-items: baseline;
}
.profile-view-label {
  flex: 0 0 110px;
  font-size: 12px;
  opacity: 0.5;
  white-space: nowrap;
}
.profile-view-value {
  flex: 1;
  font-size: 14px;
  word-break: break-word;
}

#my-self-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 4px 8px;
  margin-top: 8px;
}

#my-self-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
  margin-bottom: 10px;
}

#my-self-avatar img {
  display: block;
}

/* Stamp at bottom-right corner of avatar, minimal overlap */
#my-self-stats #my-self-stamp.profile-score-stamp {
  top: auto;
  bottom: -14px;
  right: -14px;
  left: auto;
}

#my-self-stats-right {
  display: flex;
  flex-direction: row;
  gap: 20px;
  justify-content: center;
  width: 100%;
  flex-wrap: wrap;
}

.stats-side {
  flex: 1;
  min-width: 80px;
  max-width: 180px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  justify-content: center;
  align-content: flex-start;
  min-height: 36px;
}

#swipe-topbar {
  display: none;
}

#swipe-page.active #swipe-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  z-index: 1000;
  background: var(--bg);
  background-image: var(--grid-bg);
}

#swipe-page .phone {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 20px;
}

.card {
  background: transparent;
  padding: 20px;
  border-radius: 2px;
  font-family: sans-serif;
  position: relative;
  border: none;
  box-shadow: none;
}

.profile-score-stamp {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 2.5px solid rgba(46, 54, 40, 0.70);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  transform: rotate(-14deg);
  background: var(--c-bg);
  pointer-events: none;
  z-index: 2;
  opacity: 0.92;
  box-shadow:
    inset 3px 3px 6px rgba(0,0,0,0.22),
    inset -1px -1px 3px rgba(255,255,255,0.18),
    0 1px 0 rgba(255,255,255,0.30);
}
.profile-score-stamp::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1.5px solid rgba(46, 54, 40, 0.70);
}
.profile-score-stamp .stamp-date {
  font-family: "Zpix", monospace;
  font-size: 7.5px;
  color: rgba(46, 54, 40, 0.92);
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
  margin-top: 4px;
}
.profile-score-stamp .stamp-num {
  font-family: "Zpix", monospace;
  font-size: 30px;
  font-weight: bold;
  font-style: italic;
  color: rgba(46, 54, 40, 0.92);
  line-height: 1;
  position: relative;
  z-index: 1;
}
.profile-score-stamp .stamp-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 34px;
  position: relative;
  z-index: 1;
  margin-bottom: 4px;
}
.profile-score-stamp .stamp-lines span {
  display: block;
  height: 2.5px;
  background: rgba(46, 54, 40, 0.88);
  border-radius: 2px;
}
.profile-score-stamp .stamp-lines span:last-child {
  width: 62%;
  margin-left: 19%;
}
.profile-score-stamp.stamp-red { border-color: rgba(200, 30, 30, 0.92); }
.profile-score-stamp.stamp-red::after { border-color: rgba(200, 30, 30, 0.82); }
.profile-score-stamp.stamp-red .stamp-date,
.profile-score-stamp.stamp-red .stamp-num { color: rgba(200, 30, 30, 0.96); }
.profile-score-stamp.stamp-red .stamp-lines span { background: rgba(200, 30, 30, 0.92); }

.avatar-box {
  border: 2px solid rgba(55, 63, 48, 0.58);
  box-shadow:
    0 0 0 1px rgba(55, 63, 48, 0.18),
    inset 0 0 0 1px rgba(255,255,255,0.10),
    inset 3px 3px 0 rgba(0,0,0,0.18),
    inset -2px -2px 0 rgba(255,255,255,0.22);
  margin: 3px 0;
  overflow: hidden;
  line-height: 0;
}

.avatar {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
}

.section,
.cell {
  position: relative;
  container-type: inline-size;
  background: var(--c-bg);
  border: 2px solid rgba(55, 63, 48, 0.58);
  box-shadow:
    0 0 0 1px rgba(55, 63, 48, 0.18),
    inset 0 0 0 1px rgba(255,255,255,0.10),
    inset 3px 3px 0 rgba(0,0,0,0.18),
    inset -2px -2px 0 rgba(255,255,255,0.22);
  min-height: 64px;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 3px 0;
  padding: 8px 10px;
  gap: 2px;
  box-sizing: border-box;
  overflow: visible;
}
.section::-webkit-scrollbar,
.cell::-webkit-scrollbar {
  display: none;
}


.label {
  font-size: clamp(10px, 4cqi, 14px);
  opacity: 0.7;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  width: 100%;
  text-align: center;
  flex-shrink: 0;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.value {
  font-size: clamp(13px, 9cqi, 18px);
  font-weight: bold;
  text-align: center;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  word-break: normal;
  overflow-wrap: break-word;
  max-width: 100%;
  width: 100%;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bi-zh {
  display: block;
  width: 100%;
  text-align: center;
  line-height: 1.3;
}

.bi-en {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.78em;
  opacity: 0.72;
  line-height: 1.2;
  margin-top: 1px;
}

.value.big {
  font-size: clamp(16px, 11cqi, 22px);
}

.value.territory {
  font-size: clamp(11px, 7cqi, 15px);
  font-weight: bold;
  text-align: center;
  line-height: 1.25;
  opacity: 0.9;
  padding: 0 4px;
}

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

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

.swipebutton {
  display: none;
  justify-content: space-around;
  padding: 12px;
  background: var(--bg);
  border-top: 3px solid rgba(55, 63, 48, 0.40);
  position: sticky;
  bottom: 0;
}

#swipe-page.active .swipebutton {
  display: flex;
}

.date-picker {
  margin-top: 10px;
  padding: 10px;
  background: var(--c-bg);
  border: 2px solid rgba(55, 63, 48, 0.55);
  box-shadow:
    0 0 0 1px rgba(55, 63, 48, 0.18),
    inset 3px 3px 0 rgba(0,0,0,0.12),
    inset -2px -2px 0 rgba(255,255,255,0.22);
  display: flex;
  gap: 10px;
  justify-content: center;
}

.hidden {
  display: none;
}

.wheel {
  width: 80px;
  height: 120px;
  overflow-y: scroll;
  text-align: center;
  border: 2px solid rgba(55, 63, 48, 0.55);
  box-shadow:
    0 0 0 1px rgba(55, 63, 48, 0.18),
    inset 2px 2px 0 rgba(0,0,0,0.14),
    inset -1px -1px 0 rgba(255,255,255,0.18);
  background: var(--c-bg);
  background-image: var(--grid-dark);
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
}

.wheel div {
  padding: 6px 0;
  font-size: 14px;
  scroll-snap-align: center;
  border-bottom: 1px solid rgba(55, 63, 48, 0.15);
  box-sizing: border-box;
  color: var(--c-text);
  background: transparent;
}

.wheel div:last-child {
  border-bottom: none;
}

.wheel div.selected {
  background: rgba(55, 63, 48, 0.18);
  color: var(--c-text);
  font-weight: bold;
  border-top: 2px solid rgba(55, 63, 48, 0.45);
  border-bottom: 2px solid rgba(55, 63, 48, 0.45);
}

/* ── 画图区域 ── */
.pixeldraw {
  padding: 12px;
}

/* 画图页面允许整体滚动，但画布本身不触发滚动 */
#profile-photo .phone {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

#tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.tool-active {
  background-color: var(--c-btn-shadow) !important;
  color: #e0e8d0 !important;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.35), 0 0 0 1px rgba(55,63,48,0.6) !important;
  transform: translate(2px, 2px);
}

/* Interpretation states on value spans */
@keyframes glitch {
  0%    { transform: translate(0, 0); }
  8%    { transform: translate(-1px, 0); }
  9%    { transform: translate(0, 0); }
  55%   { transform: translate(0, 0); }
  55.5% { transform: translate(1px, 0); }
  56%   { transform: translate(0, 0); }
  100%  { transform: translate(0, 0); }
}

.has-interpretations {
  cursor: pointer;
  position: relative;
  animation: interp-glow 1.6s ease-in-out infinite;
}

@keyframes interp-glow {
  0%, 100% {
    color: var(--c-text);
    text-shadow: none;
  }
  50% {
    color: #b83030;
    text-shadow:
      0 0 4px rgba(204, 30, 30, 0.30),
      0 0 8px rgba(204, 30, 30, 0.15);
  }
}

/* Interpretation explode state — floating bubbles, original text untouched */
.interp-expanded {
  position: relative !important;
  animation: none !important;
  border-bottom: none !important;
  overflow: visible !important;
}

.interp-bubble {
  position: absolute;
  left: 50%;
  top: 50%;
  white-space: nowrap;
  color: #cc1e1e;
  font-size: 11px;
  cursor: pointer;
  text-shadow: 1px 1px 7px rgba(255, 60, 60, 0.7);
  animation: bubble-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards,
             bubble-drift 2.8s ease-in-out infinite;
  transition: font-size 0.18s ease;
  user-select: none;
  pointer-events: all;
  z-index: 1;
  line-height: 1.3;
}

@keyframes bubble-in {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  38% {
    transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) scale(1);
    opacity: 1;
  }
}

@keyframes bubble-drift {
  0%, 100% {
    transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) scale(1);
  }
  33% {
    transform: translate(calc(-50% + var(--fx) + var(--dx)), calc(-50% + var(--fy) + var(--dy))) scale(1);
  }
  66% {
    transform: translate(calc(-50% + var(--fx) - var(--dy)), calc(-50% + var(--fy) + var(--dx))) scale(1);
  }
}

.label-toggled {
  color: #cc1e1e !important;
  text-shadow: none !important;
  border-bottom-color: rgba(139, 58, 58, 0.5) !important;
}

/* Like / Skip reason popup */
#reason-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#reason-popup.hidden {
  display: none;
}
.reason-box {
  background: var(--c-bg);
  border: 2px solid rgba(55, 63, 48, 0.45);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 88vw;
  max-width: 360px;
  box-shadow: 0 0 0 2px rgba(55,63,48,0.6), inset 2px 2px 0 rgba(255,255,255,0.12), inset -2px -2px 0 rgba(55,63,48,0.2);
}
.reason-box p {
  color: var(--c-text);
  font-size: 12px;
  margin: 0;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}
.reason-hint {
  opacity: 0.6;
  font-size: 10px !important;
}
.reason-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.reason-label-btn {
  padding: 4px 10px;
  border: 1px solid rgba(55, 63, 48, 0.40);
  color: var(--c-text);
  background: transparent;
  font-size: 10px;
  font-family: "Zpix", monospace;
  cursor: pointer;
  line-height: 1.4;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.08);
}
.reason-label-btn.selected {
  background: var(--c-btn-shadow);
  color: var(--c-btn-text);
}

/* Swipe action popups */
#swipe-impression-popup,
#swipe-sendmsg-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#swipe-impression-popup.hidden,
#swipe-sendmsg-popup.hidden {
  display: none;
}

/* Interpretation popup overlay */
#interpret-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#interpret-popup.hidden {
  display: none;
}

.interpret-box {
  background: var(--c-bg);
  border: 2px solid rgba(55, 63, 48, 0.45);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 80vw;
  max-width: 320px;
  box-shadow: 0 0 0 2px rgba(55,63,48,0.6), inset 2px 2px 0 rgba(255,255,255,0.12), inset -2px -2px 0 rgba(55,63,48,0.2);
}

.interpret-box p {
  color: var(--c-text);
  margin: 0;
  font-size: 12px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}

.interpret-btn-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* ── Swipe topbar ── */
#swipe-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

/* 给 swipe 页的滚动区域留出 topbar 的高度 */
#swipe-page.active .scroll {
  padding-top: 52px;
  background: #828980;
  background-image: var(--grid-dark);
}

/* ── Notification badge ── */
.notif-badge {
  display: inline-block;
  background: #cc1e1e;
  color: #e0e8d0;
  border-radius: 0;
  border: 2px solid #790c0c;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  line-height: 12px;
  text-align: center;
  padding: 0 2px;
  margin-left: 2px;
  vertical-align: middle;
  image-rendering: pixelated;
}

.notif-badge.hidden {
  display: none;
}

/* ── Messages panel overlay ── */
#messages-panel {
  position: fixed;
  inset: 0;
  background: var(--bg);
  background-image: var(--grid-bg);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#messages-panel.hidden {
  display: none;
}

.messages-overlay-inner {
  background: var(--bg);
  background-image: var(--grid-bg);
  border: 2px solid rgba(55, 63, 48, 0.45);
  padding: 16px;
  padding-top: 40px;
  width: 88vw;
  max-width: 340px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 0 0 2px rgba(55,63,48,0.6), inset 2px 2px 0 rgba(255,255,255,0.12), inset -2px -2px 0 rgba(55,63,48,0.2);
  position: relative;
}

.panel-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--c-text);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}

.panel-close-btn:active {
  opacity: 0.6;
}

.messages-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.messages-header h2 {
  color: var(--c-text);
  margin: 0;
  font-size: 14px;
}

.messages-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 45vh;
}

.messages-list.hidden {
  display: none;
}

.messages-header.hidden {
  display: none;
}

.msg-item {
  background: var(--bg);
  background-image: var(--grid-bg);
  border: 2px solid rgba(55, 63, 48, 0.45);
  box-shadow: 0 0 0 2px rgba(55,63,48,0.5), inset 2px 2px 0 rgba(0,0,0,0.10), inset -1px -1px 0 rgba(255,255,255,0.12);
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.msg-item:active {
  background: rgba(46, 54, 40, 0.15);
}

.msg-unread {
  border-color: #cc1e1e;
  box-shadow: 0 0 6px rgba(255, 51, 51, 0.4);
}

.msg-from {
  color: var(--c-text);
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 4px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.07);
}

.msg-unread .msg-from::before {
  content: "● ";
  color: #cc1e1e;
}

.msg-content {
  color: #e0e8d0;
  font-size: 12px;
  margin: 4px 0;
  word-break: break-word;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}

.msg-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.msg-time {
  color: #373f30;
  font-size: 10px;
}

.convo-unread-badge {
  display: inline-block;
  background: #cc1e1e;
  color: #e0e8d0;
  border-radius: 0;
  border: 2px solid #790c0c;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  line-height: 12px;
  text-align: center;
  padding: 0 2px;
  margin-left: 4px;
  vertical-align: middle;
}

.msg-reply-btn {
  background: none;
  border: 1px solid rgba(55, 63, 48, 0.40);
  color: var(--c-text);
  font-size: 10px;
  font-family: inherit;
  padding: 2px 8px;
  cursor: pointer;
}

.msg-reply-btn:active {
  background: rgba(46, 54, 40, 0.15);
}

/* ── Send message form ── */
.send-msg-form {
  border-top: 1px solid rgba(55, 63, 48, 0.35);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.send-msg-form p {
  color: var(--c-text);
  margin: 0;
  font-size: 12px;
}

/* ── Swipe interrupt popups ── */
.swipe-interrupt {
  position: fixed;
  z-index: 8000;
  background: var(--c-bg);
  border: 4px solid rgba(55, 63, 48, 0.45);
  box-shadow: 0 0 0 2px rgba(55,63,48,0.6), inset 2px 2px 0 rgba(255,255,255,0.10);
  color: var(--c-text);
  font-family: "Zpix", monospace;
  font-size: 11px;
  padding: 10px 36px 10px 12px;
  max-width: 210px;
  line-height: 1.6;
  animation: interrupt-in 0.18s ease-out;
  pointer-events: all;
  image-rendering: pixelated;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}

.swipe-interrupt .interrupt-close {
  position: absolute;
  top: 5px;
  right: 7px;
  background: none;
  border: none;
  color: var(--c-text);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  line-height: 1;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}

.swipe-interrupt .interrupt-close:hover {
  opacity: 0.7;
}

.swipe-interrupt.skip-notif {
  border-color: #cc1e1e;
  color: #cc1e1e;
}
.swipe-interrupt.skip-notif .interrupt-close {
  color: #cc1e1e;
}

@keyframes interrupt-in {
  from { opacity: 0; transform: scale(0.75); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Toast notification ── */
#toast-notif {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--c-bg);
  border: 1px solid rgba(55, 63, 48, 0.40);
  color: var(--c-text);
  padding: 10px 18px;
  font-size: 12px;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}

#toast-notif.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#like-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99998;
  background: var(--c-bg);
  background-image: var(--grid-bg);
  border-bottom: 2px solid rgba(55,63,48,0.45);
  color: var(--c-text);
  font-size: 13px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18), 0 0 14px rgba(200,40,40,0.12);
  animation: warnFadeIn 0.2s ease;
}
#like-banner strong { color: var(--c-text); font-weight: bold; }
#like-banner button {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--c-text);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.6;
}

/* ── Conversation thread view ── */
#convo-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

#convo-view.hidden {
  display: none;
}

.convo-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border-bottom: 1px solid rgba(55, 63, 48, 0.35);
  padding-bottom: 8px;
  color: var(--c-text);
  font-size: 12px;
}

.convo-bubbles {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 38vh;
  padding: 4px 0;
  background: var(--bg);
  background-image: var(--grid-bg);
}

.convo-empty {
  text-align: center;
  opacity: 0.5;
  font-size: 12px;
  color: #e0e8d0;
}

.bubble-row {
  display: flex;
}

.bubble-mine {
  justify-content: flex-end;
}

.bubble-theirs {
  justify-content: flex-start;
}

.bubble {
  max-width: 72%;
  padding: 7px 10px;
  font-size: 12px;
  word-break: break-word;
  background: var(--c-bg);
  border: 2px solid rgba(55, 63, 48, 0.58);
  box-shadow:
    0 0 0 1px rgba(55, 63, 48, 0.18),
    inset 0 0 0 1px rgba(255,255,255,0.10),
    inset 3px 3px 0 rgba(0,0,0,0.18),
    inset -2px -2px 0 rgba(255,255,255,0.22);
  border-radius: 2px;
}

.bubble-mine .bubble {
  border-color: rgba(40, 48, 35, 0.75);
}

.bubble-theirs .bubble {
  border-color: rgba(55, 63, 48, 0.58);
}

.bubble-text {
  color: var(--c-text);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.07);
}

.bubble-mine .bubble-text {
  color: var(--c-text);
}

.bubble-time {
  font-size: 9px;
  color: rgba(40, 48, 35, 0.55);
  margin-top: 3px;
  text-align: right;
}

.convo-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
  border-top: 2px solid rgba(55, 63, 48, 0.45);
  padding: 8px 8px 4px;
  background: var(--bg);
  background-image: var(--grid-bg);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.12);
}

.convo-input-row .nes-input {
  flex: 1;
  font-size: 12px;
}

/* ── Incoming message popup ── */
#msg-popup {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 99999;
  width: 84vw;
  max-width: 320px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

#msg-popup.hidden {
  display: none;
}

#msg-popup.popup-slide-in {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.msg-popup-box {
  background: var(--c-bg);
  border: 2px solid rgba(55, 63, 48, 0.45);
  box-shadow: 0 0 0 2px rgba(55,63,48,0.6), inset 2px 2px 0 rgba(255,255,255,0.12), inset -2px -2px 0 rgba(55,63,48,0.2);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
}

.msg-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.msg-popup-header span {
  color: var(--c-text);
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}

.msg-popup-close {
  background: none;
  border: none;
  color: var(--c-text);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  font-family: inherit;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}

.msg-popup-box.msg-alert {
  border-color: #cc1e1e;
}
.msg-popup-box.msg-alert .msg-popup-header span {
  color: #cc1e1e;
}
.msg-popup-box.msg-alert .msg-popup-close {
  color: #cc1e1e;
}

.msg-popup-content {
  color: var(--c-text);
  font-size: 13px;
  word-break: break-word;
  border-left: 2px solid var(--c-btn-shadow);
  padding-left: 8px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}

.msg-popup-open-btn {
  font-size: 11px !important;
  width: 100%;
}

/* ── Convo name clickable ───────────────────────── */
.convo-name-link {
  cursor: pointer;
  text-decoration: underline dotted;
  padding-left: 2px;
  font-size: 14px;
  font-weight: bold;
}
.convo-name-link:hover {
  color: #fff;
}

/* ── Profile View Overlay ───────────────────────── */
#profile-view-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
}
#profile-view-overlay.hidden {
  display: none;
}
.profile-view-box {
  background: var(--bg);
  background-image: var(--grid-bg);
  border: 2px solid rgba(55, 63, 48, 0.45);
  box-shadow: 0 0 0 2px rgba(55,63,48,0.5);
  width: min(480px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 16px;
  box-sizing: border-box;
}
.profile-view-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--c-text);
  font-size: 16px;
  cursor: pointer;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
}
.profile-view-content {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
}
.profile-view-avatar {
  width: 100px;
  height: 100px;
  border: 2px solid rgba(55, 63, 48, 0.45);
  image-rendering: pixelated;
  background: #b4bbaf;
}
.profile-view-name {
  color: var(--c-text);
  font-size: 16px;
  margin: 4px 0 0;
  text-align: center;
}
.profile-view-species {
  color: var(--c-text);
  opacity: 0.7;
  font-size: 12px;
  margin: 0;
}
.profile-view-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 4px 0;
}
.pv-tag {
  border: 1px solid rgba(55, 63, 48, 0.40);
  color: var(--c-text);
  font-size: 11px;
  padding: 2px 6px;
}
.pv-row {
  width: 100%;
  color: var(--c-text);
  font-size: 12px;
  margin: 2px 0;
  word-break: break-word;
}
.pv-label {
  display: block;
  opacity: 0.55;
  font-size: 10px;
  margin-bottom: 1px;
}

/* ── Housing floor row ── */
.house-floor-row {
  display: flex;
  gap: 10px;
}

.house-floor-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Pixel hearts ── */
.pixel-hearts-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3px;
  padding: 6px;
  width: 100%;
}

.pixel-heart {
  width: 21px;
  height: 18px;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 rgba(40,48,35,0.30));
}

.pixel-vomit {
  width: 21px;
  height: 27px;
}

/* ── Income dice ── */
.dice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.dice-btn {
  width: 44px !important;
  height: 44px !important;
  padding: 4px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.dice-display {
  font-size: 24px;
  min-width: 32px;
  text-align: center;
}

.dice-hint {
  font-size: 10px;
  opacity: 0.55;
  line-height: 1.2;
}

.dice-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.dice-roll-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  flex-shrink: 0;
  padding: 2px;
  background: transparent;
  border: none;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}

.dice-roll-btn img {
  filter: drop-shadow(1px 1px 0 rgba(40,48,35,0.28));
}

.dice-roll-btn:active {
  transform: scale(0.9);
}

.dice-roll-btn:disabled,
.dice-roll-btn.dice-exhausted {
  opacity: 0.35;
  cursor: not-allowed;
}

.dice-result-input {
  flex: 1;
  height: 40px;
  padding: 0 10px;
  background: var(--t-bg);
  border: 2px solid rgba(55, 63, 48, 0.45);
  box-shadow: 0 0 0 2px rgba(55,63,48,0.5), inset 2px 2px 0 rgba(0,0,0,0.10), inset -1px -1px 0 rgba(255,255,255,0.12);
  font-size: 12px;
  font-family: inherit;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
  display: flex;
  align-items: center;
  min-width: 0;
  box-sizing: border-box;
}

/* ── MBTI Custom Picker ── */
.mbti-slot-wrap {
  position: relative;
  margin-bottom: 4px;
}

.mbti-pickable {
  cursor: pointer;
  user-select: none;
}

.mbti-pickable::after {
  content: " ✎";
  font-size: 10px;
  opacity: 0.5;
}

.mbti-char-picker {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  padding: 4px;
  border: 2px solid rgba(55, 63, 48, 0.45);
  background: var(--c-bg);
  margin-bottom: 6px;
}

.mbti-char-btn {
  background: transparent;
  border: 1px solid rgba(55, 63, 48, 0.40);
  color: var(--c-text);
  font-family: monospace;
  font-size: 11px;
  padding: 5px 2px;
  cursor: pointer;
  text-align: center;
  line-height: 1;
  transition: background 0.08s;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
  box-shadow: 1px 1px 0 rgba(40,48,35,0.20);
}

.mbti-char-btn:hover {
  background: rgba(55, 63, 48, 0.08);
}

.mbti-char-btn.active {
  background: rgba(55, 63, 48, 0.22);
}

/* MBTI option buttons (E/I/S/N etc.) */
.mbti-option-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.mbti-opt-btn {
  min-width: 38px;
  padding: 6px 10px;
  font-family: monospace;
  font-size: 18px;
  font-weight: bold;
  border: 3px solid rgba(55, 63, 48, 0.45);
  box-shadow: inset -2px -2px 0 var(--c-btn-shadow), inset 2px 2px 0 rgba(255,255,255,0.12);
  background: var(--c-bg);
  background-image: var(--grid-btn);
  color: var(--c-text);
  cursor: pointer;
  letter-spacing: 0;
}

.mbti-opt-btn:active {
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.25);
}

.mbti-opt-btn:hover {
  background-color: var(--c-btn-bg);
  color: var(--c-btn-text);
}

.mbti-opt-btn.selected {
  background-color: rgba(55, 63, 48, 0.20);
  background-image: var(--grid-dark);
  color: var(--c-text);
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.18), inset -1px -1px 0 rgba(255,255,255,0.10);
  border-color: rgba(55, 63, 48, 0.65);
}

.mbti-opt-label {
  font-size: 11px;
  color: #464f3c;
  margin-right: 4px;
}

.mbti-custom-btn {
  font-size: 11px !important;
  min-width: unset;
  padding: 6px 10px;
}

.mbti-custom-btn:hover {
  background: var(--c-btn-shadow) !important;
  color: #e0e8d0 !important;
  opacity: 1;
}

.mbti-edit-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.mbti-edit-display {
  height: 40px;
  background: var(--t-bg);
  border: 2px solid rgba(55, 63, 48, 0.45);
  box-shadow: 0 0 0 2px rgba(55,63,48,0.5), inset 2px 2px 0 rgba(0,0,0,0.10), inset -1px -1px 0 rgba(255,255,255,0.12);
  font-size: 16px;
  font-family: monospace;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 0 6px;
  font-weight: bold;
}

/* ── Score System ── */
#score-running-badge {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: "Zpix", monospace;
  font-size: 11px;
  padding: 4px 8px;
  border: 2px solid rgba(55, 63, 48, 0.45);
  box-shadow: 0 0 0 2px rgba(55,63,48,0.5), 2px 3px 0 rgba(40,48,35,0.25);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.10);
  display: none;
  pointer-events: none;
  image-rendering: pixelated;
}

.score-delta-pop {
  position: fixed;
  top: 38%;
  left: 50%;
  z-index: 10000;
  font-family: "Zpix", monospace;
  font-size: 64px;
  font-weight: bold;
  color: var(--c-text);
  pointer-events: none;
  text-align: center;
  text-shadow: 1px 1px 0 rgba(42,56,32,0.08);
  animation: score-delta-anim 1.8s ease-out forwards;
}

.score-delta-pop.negative {
  color: #cc1e1e;
  text-shadow: none;
}

@keyframes score-delta-anim {
  0%   { opacity: 1; transform: translateX(-50%) scale(1.6); }
  20%  { opacity: 1; transform: translateX(-50%) translateY(-16px) scale(1); }
  65%  { opacity: 1; transform: translateX(-50%) translateY(-48px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-90px); }
}

#score-settlement {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(192, 200, 184, 0.94);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "Zpix", monospace;
  color: var(--c-text);
}

#score-settlement.active {
  display: flex;
}

#score-settlement .settle-label {
  font-size: 12px;
  margin-bottom: 12px;
  opacity: 0.7;
  letter-spacing: 2px;
}

#score-settlement .settle-number {
  font-size: 80px;
  line-height: 1;
  text-shadow: 1px 1px 0 rgba(42,56,32,0.08);
}

#score-settlement .settle-suffix {
  font-size: 14px;
  margin-top: 12px;
  opacity: 0.8;
}

/* ── Risk Warning Overlay ── */
#warning-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: warnFadeIn 0.15s ease;
}

#warning-overlay.hidden { display: none; }

@keyframes warnFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.warning-box {
  max-width: 340px;
  width: 90%;
  background: var(--c-bg);
  border: 3px solid rgba(55,63,48,0.55);
  padding: 28px 20px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.3), 0 0 12px rgba(200,40,40,0.25), 0 0 28px rgba(200,40,40,0.12);
  animation: warnBoxPulse 1.4s ease-in-out infinite alternate;
}

@keyframes warnBoxPulse {
  from { box-shadow: 3px 3px 0 rgba(0,0,0,0.3), 0 0 8px rgba(200,40,40,0.20), 0 0 20px rgba(200,40,40,0.08); }
  to   { box-shadow: 3px 3px 0 rgba(0,0,0,0.3), 0 0 18px rgba(200,40,40,0.40), 0 0 40px rgba(200,40,40,0.18); }
}

.warning-icon {
  font-size: 72px;
  line-height: 1;
  animation: warnPulse 0.7s ease-in-out infinite alternate;
}

.warning-icon.critical {
  animation: warnPulse 0.5s ease-in-out infinite alternate;
}

@keyframes warnPulse {
  from { filter: drop-shadow(0 0 6px rgba(255,50,50,0.55)); }
  to   { filter: drop-shadow(0 0 20px rgba(255,50,50,1.0)); }
}

.warning-block {
  border: 1px solid rgba(55, 63, 48, 0.35);
  background: rgba(0, 0, 0, 0.06);
  padding: 10px 12px;
  text-align: left;
  box-shadow: 0 0 6px rgba(200,40,40,0.10);
}

.warning-block.critical {
  border-color: rgba(55, 63, 48, 0.55);
  background: rgba(0, 0, 0, 0.10);
  box-shadow: 0 0 10px rgba(200,40,40,0.18);
}

.warning-line {
  color: var(--c-text);
  font-size: 11px;
  margin: 3px 0;
  line-height: 1.5;
  text-shadow: 0 0 6px rgba(220,40,40,0.30);
}

.warning-block.critical .warning-line:first-child {
  font-size: 12px;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(220,40,40,0.50);
}

.warning-btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Mixed-breed checkbox */
#isMixed + span::before {
  border-color: rgba(55, 63, 48, 0.45) !important;
}
#isMixed:checked + span::before {
  color: var(--c-text) !important;
  border-color: rgba(55, 63, 48, 0.70) !important;
}

/* Vehicle type checkboxes */
.vehicle-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.vehicle-cb-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border: 2px solid rgba(55, 63, 48, 0.45);
  background: transparent;
  color: var(--c-text);
}

.vehicle-cb-label input[type="checkbox"] {
  accent-color: var(--c-btn-shadow);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.vehicle-cb-label:has(input:checked) {
  border-color: rgba(55, 63, 48, 0.45);
  background: var(--c-btn-bg);
  color: var(--c-btn-text);
}

/* ── Custom Alert Modal ──────────────────────────────────────── */
.custom-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
}
.custom-alert-overlay.hidden { display: none; }
.custom-alert-box {
  background: var(--c-bg);
  border: 3px solid rgba(55, 63, 48, 0.45);
  padding: 28px 24px 20px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  font-family: "Zpix", monospace;
  box-shadow: 0 0 0 2px rgba(55,63,48,0.6), inset 2px 2px 0 rgba(255,255,255,0.12), inset -2px -2px 0 rgba(55,63,48,0.2);
  animation: alert-pop 0.18s ease;
}
@keyframes alert-pop {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.custom-alert-box p {
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 18px;
  white-space: pre-line;
}

/* ── 全局格子纹理 — 所有实心背景容器 ── */

/* topbar 保留深格子 */
#swipe-topbar {
  background-image: var(--grid-dark);
}

/* 按钮格子：稍浅的深色格子 */
.swipebutton,
.ob-close-btn {
  background-image: var(--grid-btn);
}

/* 普通格子：模态框 / 面板 / 弹窗 */
.ob-input-wrap,
#profile-edit,
.edit-overlay-inner,
.opener-modal,
.hobby-cat-picker-box,
.reason-box,
.interpret-box,
.messages-overlay-inner,
.msg-popup-box,
.profile-view-box,
.custom-alert-box,
.warning-box,
.swipe-interrupt,
#toast-notif,
#score-settlement,
.date-picker,
.wheel,
.mbti-char-picker {
  background-image: var(--grid-bg);
}
