@font-face {
  font-family: "Press Start 2P";
  src: url("fonts/PressStart2P-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Fusion Pixel";
  src: url("fonts/FusionPixel-zh_hans.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink: #1b1b1b;
  --ink-soft: #3a3a3a;
  --blue: #d43b32;
  --blue-dark: #93241f;
  --cyan: #ef6257;
  --gold: #d43b32;
  --grass: #a5a5a5;
  --paper: #e9e7e1;
  --paper-2: #d2d0ca;
  --white: #f7f6f2;
  --shadow: #111111;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 28px 24px 116px;
  color: var(--ink);
  background: #171717;
  font-family: "Fusion Pixel", "Microsoft YaHei", ui-monospace, monospace;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
}

/* ---------- RPG world ---------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(rgba(0, 0, 0, 0.12) 50%, transparent 50%) 0 0 / 100% 8px,
    linear-gradient(180deg, #2b2b2b 0%, #454545 55%, #252525 100%);
}

.scene-sky {
  position: absolute;
  inset: 0 0 74px;
  opacity: 0.68;
  background-image:
    radial-gradient(circle, #f7f6f2 0 2px, transparent 3px),
    radial-gradient(circle, #d43b32 0 2px, transparent 3px),
    radial-gradient(circle, #929292 0 2px, transparent 3px);
  background-position: 18px 18px, 64px 44px, 112px 12px;
  background-size: 104px 104px, 144px 144px, 190px 190px;
  animation: twinkle 3s steps(2, end) infinite;
}

.scene-sky::before,
.scene-sky::after {
  content: "";
  position: absolute;
  bottom: 18px;
  width: 260px;
  height: 150px;
  opacity: 0.4;
  background:
    linear-gradient(135deg, transparent 49%, #1b1b1b 50%) 0 0 / 80px 80px,
    linear-gradient(45deg, transparent 49%, #1b1b1b 50%) 40px 0 / 80px 80px;
}

.scene-sky::before {
  left: -30px;
}

.scene-sky::after {
  right: -30px;
  transform: scaleX(-1);
}

.scene-qr {
  position: absolute;
  width: 76px;
  height: 76px;
  border: 7px solid rgba(212, 59, 50, 0.42);
  opacity: 0.55;
}

.scene-qr::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 7px solid rgba(247, 246, 242, 0.42);
}

.scene-qr::after {
  content: "";
  position: absolute;
  inset: 27px;
  background: rgba(212, 59, 50, 0.5);
}

.scene-qr--tl { top: 28px; left: 28px; }
.scene-qr--tr { top: 28px; right: 28px; }
.scene-qr--bl { bottom: 104px; left: 28px; opacity: 0.35; }

.scene-blocks {
  position: absolute;
  inset: 0;
}

.scene-blocks i {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 4px solid #111827;
  background: #d43b32;
  box-shadow: inset 4px 4px 0 #ef7168, 5px 5px 0 rgba(0, 0, 0, 0.42);
  animation: float-block 4s steps(6, end) infinite;
}

.scene-blocks i::after {
  content: "?";
  display: grid;
  height: 100%;
  place-items: center;
  color: #f7f6f2;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
}

.scene-blocks i:nth-child(1) { top: 18%; left: 6%; }
.scene-blocks i:nth-child(2) { top: 33%; right: 7%; animation-delay: -.5s; }
.scene-blocks i:nth-child(3) { top: 57%; left: 3%; animation-delay: -1s; }
.scene-blocks i:nth-child(4) { top: 61%; right: 4%; animation-delay: -1.5s; }
.scene-blocks i:nth-child(5) { top: 9%; left: 28%; animation-delay: -2s; }
.scene-blocks i:nth-child(6) { top: 12%; right: 27%; animation-delay: -2.5s; }
.scene-blocks i:nth-child(7) { top: 48%; left: 12%; animation-delay: -3s; }
.scene-blocks i:nth-child(8) { top: 48%; right: 13%; animation-delay: -3.5s; }

.scene-path {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scene-path::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 5px dashed rgba(247, 246, 242, 0.52);
}

.scene-path span {
  position: relative;
  width: 15px;
  height: 15px;
  border: 3px solid #141820;
  background: var(--white);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.32);
  animation: coin 1.2s steps(4, end) infinite;
}

.scene-path span:nth-child(2n) {
  animation-delay: -.35s;
  background: var(--blue);
}

.scene-flag {
  position: absolute;
  bottom: 74px;
  width: 6px;
  height: 70px;
  background: var(--white);
  box-shadow: 4px 0 0 var(--shadow);
}

.scene-flag b {
  position: absolute;
  left: 6px;
  top: 4px;
  width: 30px;
  height: 22px;
  border: 4px solid var(--shadow);
  background: var(--blue);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.scene-flag--1 { left: 12%; }
.scene-flag--2 { left: 50%; }
.scene-flag--2 b { background: var(--gold); }
.scene-flag--3 { right: 12%; }
.scene-flag--3 b { background: var(--grass); }

.scene-ground {
  position: absolute;
  inset: auto 0 0;
  height: 76px;
  border-top: 6px solid var(--shadow);
  background:
    linear-gradient(90deg, rgba(255,255,255,.12) 50%, transparent 50%) 0 0 / 40px 16px,
    linear-gradient(90deg, #d43b32 50%, #a82b25 50%) 0 0 / 56px 16px,
    linear-gradient(90deg, #555 50%, #3d3d3d 50%) 0 16px / 56px 60px;
}

.scene-ground::after {
  content: "STAGE 01  •  DEVICE GATE";
  position: absolute;
  left: 50%;
  top: -34px;
  transform: translateX(-50%);
  padding: 7px 10px 5px;
  border: 4px solid var(--shadow);
  background: var(--white);
  color: var(--blue);
  box-shadow: 4px 4px 0 var(--shadow);
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  white-space: nowrap;
}

/* ---------- game window ---------- */
.page {
  position: relative;
  z-index: 2;
  width: min(920px, 100%);
  margin: auto;
}

.panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(330px, 1.1fr);
  grid-template-areas:
    "brand brand"
    "product action"
    "product resources"
    "footer footer";
  gap: 16px 24px;
  padding: 30px;
  border: 6px solid var(--shadow);
  background:
    linear-gradient(rgba(18, 23, 34, 0.035) 1px, transparent 1px) 0 0 / 16px 16px,
    #deddd8;
  box-shadow: 10px 10px 0 var(--shadow);
}

.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 4px solid var(--shadow);
  background: var(--blue);
}

.panel::before { top: 10px; left: 10px; }
.panel::after { right: 10px; bottom: 10px; }

.brand {
  grid-area: brand;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 5px solid var(--shadow);
}

.logo {
  display: inline-grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
}

.logo::before {
  content: "PLAYER 1";
  grid-column: 1 / -1;
  justify-self: start;
  margin-bottom: 8px;
  padding: 5px 8px 3px;
  border: 3px solid var(--shadow);
  background: var(--white);
  color: var(--blue);
  box-shadow: 3px 3px 0 var(--shadow);
  font: 8px/1.4 "Press Start 2P", monospace;
}

.logo-deck {
  display: contents;
}

.logo-play,
.logo-hub {
  padding: 17px 20px 14px;
  border: 5px solid var(--shadow);
  color: var(--white);
  font: clamp(25px, 5vw, 42px)/1 "Press Start 2P", monospace;
  letter-spacing: .02em;
  text-shadow: 4px 4px 0 rgba(0,0,0,.35);
}

.logo-play {
  border-right: 0;
  background: var(--ink-soft);
}

.logo-hub {
  background: var(--blue);
}

.logo-rail {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  color: var(--ink-soft);
  font: 8px/1 "Press Start 2P", monospace;
}

.logo-rail::before { content: "INSERT COIN"; }
.logo-rail::after { content: "START"; color: var(--blue); }

.logo-rail span {
  flex: 1;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--ink-soft) 0 7px, transparent 7px 13px);
}

.subtitle {
  padding: 7px 12px 5px;
  border: 3px solid var(--shadow);
  background: var(--white);
  box-shadow: 3px 3px 0 var(--shadow);
  color: var(--ink-soft);
  font-size: 16px;
  letter-spacing: .12em;
}

.product-wrap {
  grid-area: product;
  align-self: center;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 20px 8px;
  border: 5px solid var(--shadow);
  background:
    radial-gradient(circle at center, rgba(212, 59, 50, .22), transparent 58%),
    #242424;
  box-shadow: inset 0 0 0 5px #555, 6px 6px 0 var(--shadow);
}

.product-wrap::before {
  content: "ITEM  •  USB HUB";
  align-self: start;
  justify-self: start;
  margin: -8px 0 6px 4px;
  color: var(--white);
  font: 8px/1.5 "Press Start 2P", monospace;
}

.hub-svg {
  width: min(410px, 100%);
  height: auto;
  display: block;
  shape-rendering: crispEdges;
  filter: drop-shadow(7px 8px 0 rgba(0,0,0,.35));
  animation: item-float 2.8s steps(8, end) infinite;
}

.actions {
  grid-area: action;
  align-self: end;
}

.jump-card {
  position: relative;
  display: block;
  min-height: 150px;
  padding: 20px 20px 56px;
  border: 5px solid var(--shadow);
  background: var(--white);
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--shadow);
  text-decoration: none;
  transition: transform .08s steps(2, end), box-shadow .08s steps(2, end);
}

.jump-card::before {
  content: "MAIN QUEST";
  position: absolute;
  right: 12px;
  top: 10px;
  color: var(--blue);
  font: 8px/1 "Press Start 2P", monospace;
}

.jump-card:hover {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--shadow);
  background: #edf5ff;
}

.card-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.card-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 4px solid var(--shadow);
  background: var(--blue);
  color: white;
  box-shadow: 4px 4px 0 var(--shadow);
  font: 12px/1 "Press Start 2P", monospace;
}

.jump-label {
  display: block;
  padding-top: 4px;
  font-size: 23px;
  line-height: 1.2;
}

.jump-desc {
  display: block;
  margin-top: 8px;
  color: #526078;
  font-size: 14px;
  line-height: 1.45;
}

.jump-cta {
  position: absolute;
  left: 20px;
  bottom: 16px;
  padding: 7px 10px 5px;
  border: 4px solid var(--shadow);
  background: var(--blue);
  color: var(--white);
  box-shadow: 3px 3px 0 var(--shadow);
  font: 9px/1.4 "Press Start 2P", monospace;
}

.resource-links {
  grid-area: resources;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-self: start;
}

.resource-link {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 4px solid var(--shadow);
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
  text-decoration: none;
}

.resource-link:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--shadow);
  background: #dcecff;
}

.resource-link__icon {
  font-size: 20px;
}

.resource-link__label {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.resource-link__desc {
  display: block;
  margin-top: 4px;
  color: #59677c;
  font-size: 11px;
}

.resource-link__cta {
  grid-column: 1 / -1;
  padding: 5px 8px 4px;
  border: 3px solid var(--shadow);
  background: var(--blue);
  color: white;
  text-align: center;
  font: 8px/1.4 "Press Start 2P", monospace;
}

.footer {
  grid-area: footer;
  padding-top: 14px;
  border-top: 4px dashed #7d7764;
  color: #615f59;
  text-align: center;
  font-size: 12px;
  letter-spacing: .08em;
}

/* ---------- announcement dialog ---------- */
.notice-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.notice-modal.is-hidden {
  display: none;
}

.notice-modal.is-closing {
  opacity: 0;
  transition: opacity .18s steps(3, end);
}

.notice-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 20, .8);
}

.notice-modal__panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 22px;
  border: 6px solid var(--shadow);
  background:
    linear-gradient(rgba(18, 23, 34, .035) 1px, transparent 1px) 0 0 / 14px 14px,
    var(--paper);
  box-shadow: 10px 10px 0 var(--shadow);
}

.notice-modal__badge {
  display: inline-block;
  padding: 7px 10px 5px;
  border: 4px solid var(--shadow);
  background: var(--blue);
  color: var(--white);
  box-shadow: 3px 3px 0 var(--shadow);
  font-size: 13px;
}

.notice-modal__title {
  margin: 16px 0 8px;
  padding-bottom: 10px;
  border-bottom: 4px solid var(--shadow);
  color: var(--blue-dark);
  font-size: 23px;
  line-height: 1.3;
}

.notice-modal__lead {
  margin-bottom: 12px;
  color: #5c6270;
  font-size: 13px;
}

.notice-modal__lead strong {
  color: var(--ink);
}

.notice-modal__body {
  padding: 13px;
  border: 4px solid var(--shadow);
  background: var(--white);
  box-shadow: 4px 4px 0 var(--shadow);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.notice-modal__body p {
  margin-bottom: 8px;
}

.notice-modal__body ul {
  padding-left: 1.2em;
}

.notice-modal__body li + li {
  margin-top: 5px;
}

.notice-modal__links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.notice-modal__links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px;
  border: 4px solid var(--shadow);
  background: #e7effc;
  color: var(--blue-dark);
  box-shadow: 4px 4px 0 var(--shadow);
  text-decoration: none;
}

.notice-modal__qr {
  margin-top: 14px;
  padding: 12px;
  border: 4px solid var(--shadow);
  background: white;
  box-shadow: 4px 4px 0 var(--shadow);
  text-align: center;
}

.notice-modal__qr img {
  display: block;
  width: 128px;
  height: 128px;
  margin: auto;
  image-rendering: pixelated;
}

.notice-modal__qr-label {
  margin-top: 8px;
  font-size: 14px;
}

.notice-modal__qr-hint,
.notice-modal__hint {
  margin-top: 5px;
  color: #606878;
  font-size: 12px;
  line-height: 1.5;
}

.notice-modal__hint {
  margin-top: 12px;
  text-align: center;
}

.notice-modal__btn {
  width: 100%;
  margin-top: 13px;
  padding: 13px 16px 11px;
  border: 5px solid var(--shadow);
  background: var(--blue);
  color: white;
  box-shadow: 5px 5px 0 var(--shadow);
  cursor: pointer;
  font: 16px/1.3 "Fusion Pixel", monospace;
}

.notice-modal__btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--shadow);
  background: var(--blue-dark);
}

@keyframes twinkle {
  50% { opacity: .42; }
}

@keyframes float-block {
  50% { transform: translateY(-8px); }
}

@keyframes coin {
  50% { transform: translateY(-5px) scaleX(.55); }
}

@keyframes item-float {
  50% { transform: translateY(-6px); }
}

@media (max-width: 760px) {
  body {
    padding: 16px 14px 100px;
  }

  .scene-qr,
  .scene-flag--1,
  .scene-flag--3,
  .scene-blocks i:nth-child(n+5) {
    display: none;
  }

  .panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "product"
      "action"
      "resources"
      "footer";
    padding: 18px;
    border-width: 5px;
    box-shadow: 7px 7px 0 var(--shadow);
  }

  .logo-play,
  .logo-hub {
    padding: 13px 12px 11px;
    border-width: 4px;
    font-size: clamp(20px, 8vw, 31px);
  }

  .product-wrap {
    min-height: 190px;
    padding: 10px 5px;
  }

  .hub-svg {
    width: min(380px, 100%);
  }

  .resource-links,
  .notice-modal__links {
    grid-template-columns: 1fr;
  }

  .notice-modal {
    padding: 12px;
  }

  .notice-modal__panel {
    padding: 16px;
    border-width: 5px;
  }

  .notice-modal__title {
    font-size: 20px;
  }
}

@media (max-height: 720px) and (min-width: 761px) {
  body {
    align-items: flex-start;
  }

  .panel {
    padding: 20px 24px;
  }

  .brand {
    padding-bottom: 10px;
  }

  .logo-play,
  .logo-hub {
    padding: 12px 16px 10px;
    font-size: 29px;
  }

  .product-wrap {
    min-height: 180px;
  }

  .hub-svg {
    width: min(350px, 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene-sky,
  .scene-blocks i,
  .scene-path span,
  .hub-svg {
    animation: none;
  }
}
