/* :root CSS variables */
:root {
  --bg: #f5f9ff;
  --bg-soft: #edf4fb;
  --ink: #121a2e;
  --muted: #75849d;
  --muted-2: #9aa9bd;
  --card: rgba(255, 255, 255, 0.94);
  --line: #c9daf1;
  --line-strong: #8fbaff;
  --verification-card-bg: #f9f9f9;
  --verification-card-border: #d0d0d0;
  --checkbox-border: #b7b7b7;
  --blue: #2d76dc;
  --blue-soft: #e8f2ff;
  --check-green: #0d9859;
  --red: #dd4052;
  --red-soft: #fff0f2;
  --shadow: 0 16px 46px rgba(62, 104, 155, 0.16);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 0;
}

/* base layout */
* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  overflow-x: hidden;
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background: #f5f9ff;
  font-family: var(--sans);
  overflow-x: hidden;
}

button,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.phone-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 18px 14px 28px;
  overflow: hidden;
  background: #f9f9f9;
}

.phone-shell::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: transparent;
}

.main-stage,
.site-footer {
  position: relative;
}

.site-footer {
  z-index: 1;
}

[hidden] {
  display: none !important;
}

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

/* language selector */
.language-select {
  display: block;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 4px 14px rgba(57, 89, 130, 0.08);
}

.language-switcher {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.footer-language {
  justify-content: center;
  margin: 0 0 18px;
}

.language-select {
  min-width: 78px;
  height: 36px;
  padding: 0 30px 0 12px;
  border-radius: 0;
  color: var(--blue);
  font-family: var(--mono);
  font-weight: 700;
  cursor: pointer;
}

.language-select:hover,
.language-select:focus-visible {
  outline: 0;
  border-color: var(--blue);
  color: var(--blue);
  background: #ffffff;
}

/* archive intro */
.vault-intro {
  margin: 4px 2px 16px;
  padding: 8px 2px 2px;
}

.vault-intro h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1.26rem;
  line-height: 1.25;
  letter-spacing: 0;
}

/* verification card */
.verification-card,
.alert-card,
.puzzle-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.verification-card {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 142px;
  padding: 22px 22px;
  gap: 18px;
  border-color: var(--verification-card-border);
  background: var(--verification-card-bg);
  z-index: 30;
  isolation: isolate;
}

.verification-card::after {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  content: "";
  opacity: 0;
  background:
    linear-gradient(90deg, transparent, rgba(45, 118, 220, 0.22), transparent),
    linear-gradient(180deg, transparent, rgba(221, 64, 82, 0.08), transparent);
  transition: opacity 180ms ease;
}

.verification-card.is-checked {
  border-color: var(--verification-card-border);
}

.verification-card.is-accepted,
.puzzle-card.is-accepted {
  animation: softGlow 760ms ease;
}

.check-control {
  position: relative;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border: 3px solid var(--checkbox-border);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.check-control:hover,
.check-control:focus-visible {
  outline: 0;
  transform: translateY(-1px);
  border-color: var(--blue);
  box-shadow: 0 0 0 5px rgba(45, 118, 220, 0.12);
}

.check-control[aria-pressed="true"] {
  border-color: var(--checkbox-border);
  background: #ffffff;
}

.check-mark {
  position: absolute;
  left: 18px;
  top: 13px;
  width: 30px;
  height: 44px;
  border-right: 7px solid var(--check-green);
  border-bottom: 7px solid var(--check-green);
  opacity: 0;
  transform: rotate(42deg) scale(0.75);
  transition: opacity 180ms ease, transform 180ms ease;
}

.check-control[aria-pressed="true"] .check-mark {
  opacity: 1;
  transform: rotate(42deg) scale(1);
}

.verification-copy {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding-right: 0;
}

.verification-title {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.5rem;
  line-height: 1.18;
  letter-spacing: 0;
  text-wrap: normal;
  overflow-wrap: anywhere;
}

/* legacy mascot styles */
.noa {
  position: relative;
  width: 74px;
  height: 92px;
  filter: drop-shadow(0 12px 12px rgba(15, 32, 55, 0.18));
}

.noa-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.noa:hover {
  animation: noaWobble 900ms ease-in-out;
}

.noa-body {
  position: absolute;
  inset: 7px 5px 12px;
  border: 2px solid #d7e0ec;
  border-radius: 17px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(239, 245, 252, 0.96)),
    #ffffff;
  box-shadow:
    inset 0 1px 0 #ffffff,
    inset -8px -12px 18px rgba(93, 119, 151, 0.1);
}

.noa-eye {
  position: absolute;
  top: 27px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #111827;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.05);
}

.noa-eye-left {
  left: 20px;
}

.noa-eye-right {
  right: 20px;
}

.noa-tick {
  position: absolute;
  left: 24px;
  top: 43px;
  width: 24px;
  height: 36px;
  border-right: 7px solid var(--blue);
  border-bottom: 7px solid var(--blue);
  border-radius: 2px;
  transform: rotate(42deg);
}

.noa-arm,
.noa-foot {
  position: absolute;
  background: linear-gradient(180deg, #ffffff, #e8eef7);
  border: 2px solid #c8d3e1;
}

.noa-arm {
  top: 42px;
  width: 14px;
  height: 22px;
  border-radius: 999px;
  z-index: 2;
}

.noa-arm-left {
  left: 0;
  transform: rotate(-18deg);
}

.noa-arm-right {
  right: 0;
  transform: rotate(18deg);
}

.noa-foot {
  bottom: 2px;
  width: 20px;
  height: 13px;
  border-radius: 60% 60% 45% 45%;
}

.noa-foot-left {
  left: 17px;
  transform: rotate(-10deg);
}

.noa-foot-right {
  right: 14px;
  transform: rotate(9deg);
}

.noa-hero {
  position: absolute;
  top: 57%;
  right: -4px;
  width: 88px;
  height: 104px;
  opacity: 0;
  z-index: 2;
  transform: translate(42px, -50%) rotate(8deg) scale(0.82);
  transition: opacity 280ms ease, transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.verification-card.is-checked .noa-hero {
  opacity: 1;
  transform: translate(0, -50%) rotate(4deg) scale(1);
  animation: noaPop 460ms ease;
}

.noa-small {
  width: 58px;
  height: 72px;
  transform: rotate(3deg);
}

.noa-small .noa-eye {
  top: 22px;
  width: 6px;
  height: 6px;
}

.noa-small .noa-eye-left {
  left: 16px;
}

.noa-small .noa-eye-right {
  right: 16px;
}

.noa-small .noa-tick {
  left: 18px;
  top: 34px;
  width: 19px;
  height: 27px;
  border-right-width: 5px;
  border-bottom-width: 5px;
}

.noa.is-worried .noa-eye-left {
  transform: translateY(1px);
}

.noa.is-worried .noa-eye-right {
  transform: translateY(-1px);
}

.noa.is-worried {
  transform: rotate(-5deg);
}

/* alert card */
.alert-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 18px 18px;
  border-color: rgba(221, 64, 82, 0.35);
  background: linear-gradient(180deg, rgba(255, 247, 248, 0.98), rgba(255, 255, 255, 0.92));
}

.alert-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  background: rgba(221, 64, 82, 0.11);
}

.alert-icon img {
  display: block;
  width: 43px;
  height: 43px;
  object-fit: contain;
}

.alert-card h2 {
  margin: 0 0 5px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 1.22rem;
  letter-spacing: 0;
}

.alert-card p {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.45;
}

/* puzzle grid */
.puzzle-card {
  position: relative;
  margin-top: 18px;
  padding: 18px;
}

.puzzle-card.is-shaking {
  animation: shake 380ms ease;
}

.puzzle-instruction {
  margin: -18px -18px 16px;
  padding: 18px;
  background: #1a73e9;
  color: #ffffff;
  font-family: var(--mono);
  font-size: 1.08rem;
  line-height: 1.45;
  letter-spacing: 0;
}

.puzzle-instruction strong {
  color: #ffffff;
  font-weight: 900;
}

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

.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  min-width: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 0;
  background: #dce7f2;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.tile::before {
  position: absolute;
  inset: 0;
  content: "";
  display: none;
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.26), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(8, 18, 33, 0.18));
  z-index: 2;
}

.tile-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.tile:focus-visible {
  outline: 3px solid rgba(45, 118, 220, 0.45);
  outline-offset: 2px;
}

.tile.is-selected {
  border-color: var(--blue);
  box-shadow:
    0 0 0 3px rgba(45, 118, 220, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.tile-check {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  opacity: 0;
  background: var(--blue);
  z-index: 6;
}

.tile-check::after {
  position: absolute;
  left: 7px;
  top: 3px;
  width: 7px;
  height: 12px;
  border-right: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
  content: "";
  transform: rotate(42deg);
}

.tile.is-selected .tile-check {
  opacity: 1;
}

.scene {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.tile-signal {
  background: linear-gradient(180deg, #7893a9, #2c4152 65%, #162534);
}

.tile-signal .pole {
  position: absolute;
  left: 25%;
  top: 8%;
  width: 7%;
  height: 92%;
  background: #162333;
  box-shadow: 10px 0 0 rgba(16, 29, 43, 0.45);
}

.tile-signal .traffic-box {
  position: absolute;
  left: 31%;
  top: 13%;
  width: 30%;
  height: 70%;
  border-radius: 12px;
  background: #101923;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
}

.tile-signal .lamp {
  position: absolute;
  left: 29%;
  width: 42%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #243344;
}

.tile-signal .lamp-red {
  top: 12%;
  background: radial-gradient(circle, #ff4b54 0 22%, #981c29 46%, #2c1218 72%);
  box-shadow: 0 0 24px rgba(255, 60, 74, 0.72);
}

.tile-signal .lamp-eye {
  top: 39%;
  background: radial-gradient(circle at 50% 52%, #05070a 0 13%, #84a9c9 15% 39%, #101820 42% 70%);
}

.tile-signal .lamp-dark {
  top: 66%;
}

.tile-signal .wire {
  position: absolute;
  right: -8%;
  top: 24%;
  width: 80%;
  height: 1px;
  background: rgba(8, 16, 27, 0.46);
  transform: rotate(-15deg);
}

.tile-crosswalk {
  background: linear-gradient(180deg, #b8c9d7 0%, #8798a5 44%, #334655 100%);
}

.tile-crosswalk .void {
  position: absolute;
  right: -10%;
  bottom: -4%;
  width: 72%;
  height: 54%;
  background: linear-gradient(180deg, #8a9cab, #263744);
  clip-path: polygon(18% 0, 100% 15%, 100% 100%, 0 100%);
}

.tile-crosswalk .stripe {
  position: absolute;
  left: 18%;
  width: 68%;
  height: 8%;
  border-radius: 1px;
  background: rgba(248, 251, 255, 0.92);
  transform: perspective(80px) rotateX(32deg) skewX(-13deg);
}

.tile-crosswalk .s1 { bottom: 18%; opacity: 0.95; }
.tile-crosswalk .s2 { bottom: 29%; opacity: 0.86; }
.tile-crosswalk .s3 { bottom: 40%; opacity: 0.72; }
.tile-crosswalk .s4 { bottom: 51%; opacity: 0.46; }
.tile-crosswalk .s5 { bottom: 62%; opacity: 0.22; }

.tile-door {
  background: linear-gradient(90deg, #1c2c3a, #405365);
}

.tile-door .wall-line {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 23px, rgba(255, 255, 255, 0.04) 23px 24px);
}

.tile-door .light-slit {
  position: absolute;
  right: 17%;
  top: 8%;
  width: 16%;
  height: 82%;
  background: linear-gradient(180deg, #fff3d2, #91bad9);
  filter: blur(0.2px);
}

.tile-door .door-panel {
  position: absolute;
  right: 22%;
  top: 12%;
  width: 42%;
  height: 78%;
  border: 2px solid #132334;
  background: linear-gradient(135deg, #293b4c, #0f1b28);
  transform: rotateY(-12deg) skewY(-1deg);
  transform-origin: right;
}

.tile-door .door-eye {
  position: absolute;
  left: 38%;
  top: 44%;
  width: 22%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, #101722 0 20%, #7fb3d8 22% 52%, #101722 55%);
}

.tile-playground {
  background: linear-gradient(180deg, #8896c4 0%, #6b7d9b 48%, #2c3949 100%);
}

.tile-playground .ground {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 0;
  height: 32%;
  background: linear-gradient(180deg, rgba(21, 35, 52, 0.38), rgba(18, 25, 36, 0.88));
}

.tile-playground .swing-bar {
  position: absolute;
  left: 11%;
  top: 20%;
  width: 48%;
  height: 4%;
  background: #26384a;
  transform: rotate(-5deg);
}

.tile-playground .swing-leg {
  position: absolute;
  top: 22%;
  width: 3%;
  height: 48%;
  background: #26384a;
}

.tile-playground .l1 { left: 15%; transform: rotate(9deg); }
.tile-playground .l2 { left: 50%; transform: rotate(-8deg); }

.tile-playground .seat {
  position: absolute;
  left: 29%;
  top: 58%;
  width: 18%;
  height: 5%;
  border-radius: 8px;
  background: #1a2938;
}

.tile-playground .slide {
  position: absolute;
  right: 13%;
  bottom: 24%;
  width: 35%;
  height: 26%;
  border-bottom: 8px solid #da9da7;
  border-left: 6px solid transparent;
  transform: skewX(-18deg);
}

.tile-bus {
  background: linear-gradient(180deg, #9eb8ce, #41596d 45%, #162334 100%);
}

.tile-bus .window {
  position: absolute;
  inset: 10% 8% 49%;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(219, 238, 249, 0.8), rgba(99, 132, 158, 0.38));
  box-shadow: inset 0 -10px 18px rgba(12, 22, 37, 0.22);
}

.tile-bus .seat {
  position: absolute;
  bottom: 12%;
  width: 33%;
  height: 42%;
  border-radius: 16px 16px 8px 8px;
  background:
    radial-gradient(circle at 24% 28%, rgba(255, 255, 255, 0.2) 0 2px, transparent 3px),
    linear-gradient(180deg, #243b56, #102034);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.07);
}

.tile-bus .seat-a { left: 9%; }
.tile-bus .seat-b { right: 9%; }

.tile-bus .tiny-noa-seat {
  position: absolute;
  left: 42%;
  top: 43%;
  width: 28%;
  height: 34%;
  border: 2px solid rgba(206, 219, 235, 0.8);
  border-radius: 13px;
  background: #f8fbff;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.22);
}

.tile-bus .tiny-noa-seat::before,
.tile-bus .tiny-noa-seat::after {
  position: absolute;
  top: 32%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #111827;
  content: "";
}

.tile-bus .tiny-noa-seat::before { left: 25%; }
.tile-bus .tiny-noa-seat::after { right: 25%; }

.tile-bus .tiny-tick {
  position: absolute;
  left: 51%;
  top: 58%;
  width: 9%;
  height: 14%;
  border-right: 3px solid var(--blue);
  border-bottom: 3px solid var(--blue);
  transform: rotate(42deg);
}

.tile-tunnel {
  background: linear-gradient(180deg, #223445 0%, #152331 58%, #0a121d 100%);
}

.tile-tunnel .ceiling {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 28%;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 12px, transparent 12px 20px);
}

.tile-tunnel .light {
  position: absolute;
  right: 22%;
  top: 16%;
  width: 25%;
  height: 4%;
  border-radius: 999px;
  background: #cceeff;
  box-shadow: 0 0 22px rgba(188, 229, 255, 0.62);
}

.tile-tunnel .stairs {
  position: absolute;
  left: 38%;
  bottom: 0;
  width: 44%;
  height: 53%;
  background: linear-gradient(180deg, #283a49, #101c29);
  clip-path: polygon(25% 0, 100% 0, 88% 100%, 0 100%);
}

.tile-tunnel .exit {
  position: absolute;
  right: 8%;
  top: 39%;
  padding: 2px 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(241, 247, 255, 0.75);
  color: #132033;
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 800;
}

.tile-mirror {
  background: linear-gradient(180deg, #657d8c, #243747 66%, #121d29);
}

.tile-mirror .alley {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent 30% 70%, rgba(0, 0, 0, 0.2)),
    repeating-linear-gradient(90deg, transparent 0 20px, rgba(255, 255, 255, 0.05) 20px 21px);
}

.tile-mirror .mirror {
  position: absolute;
  left: 10%;
  top: 12%;
  width: 40%;
  height: 72%;
  border: 4px solid #5d3727;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(188, 215, 230, 0.65), rgba(35, 53, 70, 0.82));
}

.tile-mirror .shadow-person {
  position: absolute;
  left: 44%;
  bottom: 18%;
  width: 12%;
  height: 34%;
  border-radius: 50% 50% 18% 18%;
  background: rgba(8, 12, 18, 0.82);
}

.tile-mirror .shadow-person::before {
  position: absolute;
  top: -20%;
  left: 18%;
  width: 64%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(8, 12, 18, 0.92);
  content: "";
}

.tile-rain {
  background: linear-gradient(180deg, #8aa4b5, #405665 49%, #182634 100%);
}

.tile-rain .rain-line {
  position: absolute;
  top: -10%;
  width: 1px;
  height: 128%;
  background: rgba(224, 241, 255, 0.28);
  transform: rotate(20deg);
}

.tile-rain .r1 { left: 20%; }
.tile-rain .r2 { left: 41%; }
.tile-rain .r3 { left: 66%; }
.tile-rain .r4 { left: 85%; }

.tile-rain .wet-road {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -6%;
  height: 45%;
  background: linear-gradient(180deg, rgba(30, 45, 58, 0.45), rgba(8, 14, 22, 0.94));
}

.tile-rain .cross-stripe {
  position: absolute;
  left: 9%;
  width: 84%;
  height: 6%;
  border-radius: 1px;
  background: rgba(245, 250, 255, 0.78);
  transform: skewX(-22deg);
}

.tile-rain .c1 { bottom: 12%; }
.tile-rain .c2 { bottom: 22%; }
.tile-rain .c3 { bottom: 32%; }
.tile-rain .c4 { bottom: 42%; }

.tile-rain .walk-eye {
  position: absolute;
  right: 13%;
  top: 18%;
  width: 15%;
  height: 21%;
  border-radius: 4px;
  background: #102035;
}

.tile-rain .walk-eye::before {
  position: absolute;
  inset: 27% 25%;
  border-radius: 50%;
  background: #94e7ff;
  box-shadow: 0 0 13px rgba(120, 220, 255, 0.8);
  content: "";
}

.tile-vending {
  background: linear-gradient(180deg, #7e9bb1, #2d4659 52%, #122131);
}

.tile-vending .machine {
  position: absolute;
  right: 13%;
  top: 15%;
  width: 42%;
  height: 66%;
  border-radius: 7px;
  background: linear-gradient(180deg, #d5e8f5, #3b79a4 45%, #1e4d73);
  box-shadow: 0 0 22px rgba(146, 213, 255, 0.22);
}

.tile-vending .machine::before {
  position: absolute;
  inset: 8% 12% 43%;
  border-radius: 4px;
  background:
    radial-gradient(circle at 30% 45%, #111827 0 4px, transparent 5px),
    radial-gradient(circle at 68% 45%, #111827 0 4px, transparent 5px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(151, 205, 234, 0.55));
  content: "";
}

.tile-vending .machine::after {
  position: absolute;
  left: 17%;
  bottom: 18%;
  width: 32%;
  height: 11%;
  border-radius: 3px;
  background: rgba(16, 32, 48, 0.65);
  content: "";
}

.tile-vending .cat {
  position: absolute;
  left: 13%;
  bottom: 16%;
  width: 22%;
  height: 24%;
  border-radius: 52% 52% 42% 42%;
  background: #07101b;
}

.tile-vending .cat::before,
.tile-vending .cat::after {
  position: absolute;
  top: -14%;
  width: 38%;
  height: 33%;
  background: #07101b;
  content: "";
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.tile-vending .cat::before { left: 5%; }
.tile-vending .cat::after { right: 5%; }

.mini-noa {
  position: absolute;
  width: 16px;
  height: 19px;
  border: 1px solid rgba(215, 226, 239, 0.9);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.22);
  z-index: 4;
}

.mini-noa::before,
.mini-noa::after {
  position: absolute;
  top: 6px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #111827;
  content: "";
}

.mini-noa::before { left: 4px; }
.mini-noa::after { right: 4px; }

.mini-noa.one { left: 10%; bottom: 12%; transform: rotate(-8deg); }
.mini-noa.two { right: 10%; top: 12%; transform: scale(0.72) rotate(12deg); opacity: 0.78; }
.mini-noa.three { left: 44%; top: 66%; transform: scale(0.58); opacity: 0.64; }

.status-line {
  min-height: 0;
  margin: 5px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.2;
  white-space: pre-line;
}

.status-line.is-accepted {
  color: var(--blue);
}

.status-line.is-error {
  color: var(--red);
}

.noa-dialogue {
  display: none;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  min-height: 78px;
  margin-top: 6px;
}

.speech-bubble {
  position: relative;
  max-width: 68%;
  margin: 0 0 11px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #ffffff;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.35;
  box-shadow: 0 8px 18px rgba(25, 45, 70, 0.12);
}

.speech-bubble::before {
  position: absolute;
  right: 18px;
  bottom: -13px;
  width: 18px;
  height: 18px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background: #ffffff;
  content: "";
  transform: rotate(45deg);
}

/* buttons */
.puzzle-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

.primary-button,
.ghost-button {
  min-height: 52px;
  padding: 10px;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  border: 1px solid #1f64c5;
  background: linear-gradient(180deg, #3b86ec, var(--blue));
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(45, 118, 220, 0.22);
}

.ghost-button {
  border: 2px solid var(--blue);
  background: rgba(255, 255, 255, 0.82);
  color: var(--blue);
}

.primary-button:hover,
.ghost-button:hover,
.primary-button:focus-visible,
.ghost-button:focus-visible {
  outline: 0;
  transform: translateY(-1px);
}

.primary-button:focus-visible,
.ghost-button:focus-visible {
  box-shadow: 0 0 0 5px rgba(45, 118, 220, 0.18);
}

.ghost-dark {
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.08);
  color: #f6fbff;
}

/* final screen */
.phone-shell.is-final {
  color: var(--ink);
  overflow: hidden;
}

.phone-shell.is-final::before {
  background: transparent;
}

.final-screen {
  margin-top: 10px;
  animation: fadeInFlat 360ms ease both;
}

.final-result-card {
  position: relative;
  overflow: visible;
  padding: 18px;
  border: 1px solid rgba(221, 64, 82, 0.58);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 250, 250, 0.98), #ffffff 62%);
  box-shadow: 0 16px 42px rgba(150, 47, 58, 0.12);
}

.final-result-head {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 16px;
  align-items: center;
}

.result-check-icon {
  position: relative;
  display: block;
  width: 66px;
  height: 66px;
  border: 0;
  background:
    rgba(221, 64, 82, 0.08)
    url("https://s3.ap-northeast-1.amazonaws.com/dragonbrave.com/noa/assets/ex.png")
    center / 54px 54px
    no-repeat;
}

.result-check-icon::after {
  content: none;
}

.final-result-copy {
  min-width: 0;
  text-align: left;
}

.result-label {
  margin: 0 0 6px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 800;
}

.final-noa-wrap,
.noa-final,
.final-kicker {
  display: none;
}

.final-screen h2 {
  margin: 0;
  color: #c92433;
  font-family: var(--sans);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0;
}

.final-screen p {
  margin: 0;
}

.final-screen .final-body {
  margin: 18px 0;
  color: #26334a;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.65;
  text-align: center;
  white-space: pre-line;
}

.final-screen .final-reason {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(221, 64, 82, 0.22);
  background: #fff0f2;
  color: #9e2531;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.55;
  text-align: center;
}

.nokori-walk-stage {
  position: relative;
  display: grid;
  place-items: center;
  margin: 16px 0 14px;
  pointer-events: none;
  z-index: 80;
}

.nokori-walk-frame {
  position: relative;
  width: 104px;
  height: 104px;
  animation: nokoriWalkBob 1s steps(2, end) infinite;
}

.nokori-walk-frame.is-inside-sequence {
  width: 128px;
  height: 128px;
  animation: none;
}

.nokori-step {
  position: fixed;
  left: var(--nokori-left, 50vw);
  top: var(--nokori-top, 50vh);
  display: block;
  width: 92px;
  height: 98px;
  object-fit: contain;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center;
  filter: drop-shadow(0 8px 10px rgba(25, 45, 70, 0.16));
  z-index: 120;
  transition:
    transform 460ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 260ms ease;
}

.nokori-step.is-inside-sequence {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 128px;
  height: 128px;
  filter: none;
  z-index: 1;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 180ms ease;
}

.nokori-step.is-gone {
  opacity: 0;
}

.nokori-palm {
  position: fixed;
  left: 50vw;
  top: 50vh;
  display: block;
  width: 128px;
  height: 128px;
  max-width: none;
  object-fit: contain;
  opacity: 1;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(2);
  transform-origin: center;
  z-index: 2147483647;
  transition:
    transform 620ms cubic-bezier(0.2, 0.9, 0.18, 1),
    opacity 240ms ease;
}

.nokori-palm[hidden] {
  display: none;
}

.nokori-palm.is-gone {
  opacity: 0;
}

.score-panel {
  margin-top: 20px;
  border: 1px solid #efd9dc;
  background: #ffffff;
  text-align: center;
  overflow: hidden;
}

.final-screen .score-label {
  padding-top: 18px;
  color: #26334a;
  font-family: var(--mono);
  font-size: 0.98rem;
  font-weight: 800;
}

.final-screen .human-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 2px 0 0;
  color: #c92433;
  font-family: var(--sans);
  font-weight: 800;
}

#humanScoreValue {
  font-size: 4.6rem;
  line-height: 0.98;
}

.score-denominator {
  color: #26334a;
  font-size: 1.28rem;
  font-weight: 600;
}

.final-screen .final-judgement {
  margin-top: 18px;
  padding-bottom: 4px;
  color: #26334a;
  font-family: var(--mono);
  font-size: 1.04rem;
  font-weight: 800;
}

.final-screen .releaser-number {
  display: inline-block;
  margin: 12px 0 10px;
  padding: 7px 11px;
  border: 1px solid rgba(201, 36, 51, 0.2);
  background: #fff7f8;
  color: #9e2531;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.final-screen .final-note {
  margin-top: 18px;
  padding: 13px 14px;
  border-top: 1px solid rgba(221, 64, 82, 0.2);
  background: #fff0f2;
  color: #9e2531;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: pre-line;
}

.world-stats {
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(221, 64, 82, 0.18);
  background: #fff6f7;
  color: #8d2630;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.65;
  text-align: left;
}

.world-stats p + p {
  margin-top: 3px;
}

.phone-shell.is-final.is-final-contaminated {
  background: #170608;
  color: #ffe9ec;
}

.phone-shell.is-final.is-final-contaminated .vault-intro h1 {
  color: #f2c9ce;
}

.phone-shell.is-final.is-final-contaminated .final-result-card {
  border-color: rgba(139, 24, 33, 0.9);
  background:
    linear-gradient(180deg, rgba(58, 13, 18, 0.98), rgba(24, 6, 9, 0.98) 66%),
    #1a0708;
  box-shadow:
    0 18px 50px rgba(61, 5, 10, 0.48),
    inset 0 0 0 1px rgba(255, 190, 198, 0.08);
}

.phone-shell.is-final.is-final-contaminated .result-check-icon {
  background-color: rgba(255, 226, 230, 0.08);
  filter: saturate(0.9) brightness(0.92);
}

.phone-shell.is-final.is-final-contaminated .result-label,
.phone-shell.is-final.is-final-contaminated .final-screen .score-label,
.phone-shell.is-final.is-final-contaminated .score-denominator,
.phone-shell.is-final.is-final-contaminated .final-screen .final-judgement {
  color: #ffe5e8;
}

.phone-shell.is-final.is-final-contaminated .final-screen h2 {
  color: #ff8d98;
}

.phone-shell.is-final.is-final-contaminated .final-screen .final-body {
  color: #f7d7db;
}

.phone-shell.is-final.is-final-contaminated .final-screen .final-reason {
  border-color: rgba(255, 142, 153, 0.22);
  background: rgba(95, 19, 27, 0.66);
  color: #ffd9de;
}

.phone-shell.is-final.is-final-contaminated .score-panel {
  border-color: rgba(148, 33, 43, 0.76);
  background: rgba(31, 7, 10, 0.9);
  box-shadow: inset 0 0 34px rgba(120, 17, 27, 0.18);
}

.phone-shell.is-final.is-final-contaminated .final-screen .human-score {
  color: #ff5d6a;
}

.phone-shell.is-final.is-final-contaminated .final-screen .releaser-number {
  border-color: rgba(255, 132, 145, 0.28);
  background: rgba(91, 16, 24, 0.58);
  color: #ffd2d8;
}

.phone-shell.is-final.is-final-contaminated .final-screen .final-note {
  border-top-color: rgba(255, 132, 145, 0.22);
  background: rgba(91, 16, 24, 0.78);
  color: #ffd2d8;
}

.phone-shell.is-final.is-final-contaminated .world-stats {
  border-color: rgba(169, 44, 56, 0.58);
  background: rgba(42, 8, 12, 0.92);
  color: #ffcbd1;
}

.phone-shell.is-final.is-final-contaminated .site-footer {
  color: #b77d84;
}

.phone-shell.is-final.is-final-contaminated .language-select {
  border-color: rgba(255, 170, 179, 0.38);
  background: #23090d;
  color: #ffdce0;
}

/* footer */
.site-footer {
  margin-top: 26px;
  padding: 0 6px;
  color: var(--muted);
  text-align: center;
  font-family: var(--mono);
}

.phone-shell.is-final .site-footer {
  color: var(--muted);
}

.phone-shell.is-final.is-final-contaminated .site-footer {
  color: #b77d84;
}

.session-line {
  margin: 7px 0 0;
  font-size: 0.64rem;
  line-height: 1.45;
}

.session-line {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* animations */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

@keyframes softGlow {
  0% { box-shadow: var(--shadow); }
  45% { box-shadow: 0 0 0 5px rgba(45, 118, 220, 0.14), 0 22px 56px rgba(45, 118, 220, 0.22); }
  100% { box-shadow: var(--shadow); }
}

@keyframes noaPop {
  0% { transform: translate(38px, -50%) rotate(12deg) scale(0.78); }
  70% { transform: translate(-4px, -50%) rotate(-2deg) scale(1.05); }
  100% { transform: translate(0, -50%) rotate(4deg) scale(1); }
}

@keyframes noaWobble {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  35% { translate: 0 -2px; rotate: -3deg; }
  70% { translate: 0 1px; rotate: 3deg; }
}

@keyframes nokoriWalkBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* responsive */
@media (min-width: 720px) {
  body {
    display: grid;
    place-items: center;
    padding: 16px;
  }

  .phone-shell {
    min-height: calc(100svh - 32px);
    border: 1px solid rgba(145, 170, 204, 0.3);
    border-radius: 0;
    box-shadow: 0 28px 80px rgba(40, 70, 110, 0.2);
  }
}

@media (max-width: 374px) {
  .phone-shell {
    padding-inline: 10px;
  }

  .verification-card {
    padding: 18px 14px;
    gap: 12px;
  }

  .check-control {
    width: 60px;
    height: 60px;
  }

  .verification-title {
    font-size: 1.42rem;
  }

  .puzzle-card {
    padding: 14px;
  }

  .puzzle-instruction {
    margin: -14px -14px 14px;
    padding: 16px 14px;
  }

  .puzzle-grid {
    gap: 5px;
  }

  .primary-button,
  .ghost-button {
    min-height: 48px;
    font-size: 0.92rem;
  }

  .final-result-card {
    padding: 14px;
  }

  .final-result-head {
    grid-template-columns: 64px 1fr;
    gap: 12px;
  }

  .result-check-icon {
    width: 58px;
    height: 58px;
    background-size: 48px 48px;
  }

  .final-screen h2 {
    font-size: 1.18rem;
  }

  #humanScoreValue {
    font-size: 3.9rem;
  }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

}
