:root {
  color-scheme: dark;
  --ink: #111722;
  --ink-soft: #202939;
  --paper: #f5f1e8;
  --muted: #9ba4b3;
  --line: rgb(255 255 255 / 12%);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--paper);
  background:
    radial-gradient(circle at 12% 5%, rgb(92 110 139 / 24%), transparent 30rem),
    radial-gradient(circle at 88% 95%, rgb(177 110 68 / 15%), transparent 34rem),
    var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 34px;
}

.hero {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 42px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 76px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  color: #161d28;
  background: #f0bd58;
  border: 1px solid #ffe0a0;
  border-radius: 22px;
  box-shadow: 0 8px 0 #8e5a21, 0 18px 36px rgb(0 0 0 / 28%), inset 0 2px 1px rgb(255 255 255 / 55%);
  font-size: 1.22rem;
  font-weight: 900;
  letter-spacing: -.04em;
  transform: rotate(-3deg);
}

.eyebrow,
.category {
  margin: 0;
  color: #f0bd58;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .17em;
}

h1 {
  margin: 4px 0 5px;
  font-size: clamp(2.35rem, 5vw, 4.6rem);
  line-height: .96;
  letter-spacing: -.055em;
}

.intro {
  margin: 0;
  color: #b8c0cb;
  font-size: 1rem;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 30px;
  perspective: 1200px;
}

.app-card {
  --surface: #f4eee3;
  --edge: #a5835a;
  --accent: #2862df;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  min-height: 360px;
  padding: 22px;
  overflow: hidden;
  color: #161c26;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid rgb(255 255 255 / 75%);
  border-radius: 28px;
  box-shadow: 0 12px 0 var(--edge), 0 25px 48px rgb(0 0 0 / 28%), inset 0 1px 0 rgb(255 255 255 / 75%);
  transform: translateY(0) rotateX(0);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.app-card:hover,
.app-card:focus-visible {
  transform: translateY(-7px) rotateX(1deg);
  box-shadow: 0 17px 0 var(--edge), 0 34px 58px rgb(0 0 0 / 35%), inset 0 1px 0 rgb(255 255 255 / 75%);
}

.app-card:active {
  transform: translateY(7px);
  box-shadow: 0 4px 0 var(--edge), 0 13px 24px rgb(0 0 0 / 24%);
}

.app-card:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 5px;
}

.max-card { --edge: #8aa1c6; --accent: #225fd7; }
.monopoly-card { --surface: #f4e7bf; --edge: #9d6636; --accent: #17614d; }
.gallery-card { --surface: #ece8df; --edge: #77716a; --accent: #383633; }
.canvas-card { --surface: #dedaf8; --edge: #7069a8; --accent: #6c55dc; }

.card-number {
  align-self: start;
  color: rgb(22 28 38 / 36%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .1em;
}

.status {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  color: #245b3a;
  background: #d9eddf;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 750;
}

.status i {
  width: 7px;
  height: 7px;
  background: #2d9a58;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgb(45 154 88 / 15%);
}

.status.building { color: #72550d; background: #f3df9e; }
.status.building i { background: #d09a14; box-shadow: 0 0 0 3px rgb(208 154 20 / 16%); }

.preview {
  position: relative;
  grid-column: 1 / -1;
  height: 150px;
  margin: 18px 0 22px;
  overflow: hidden;
  background: color-mix(in srgb, var(--accent) 11%, white);
  border: 1px solid rgb(22 28 38 / 10%);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 70%);
}

.max-preview { background: linear-gradient(145deg, #edf4ff, #d9e6fb); }
.max-logo {
  position: absolute;
  top: 25px;
  left: 28px;
  padding: 11px 10px;
  color: white;
  background: #111827;
  border-radius: 11px;
  font-size: .83rem;
  font-weight: 900;
}

.practice-grid {
  position: absolute;
  top: 24px;
  right: 86px;
  display: grid;
  place-items: center;
  width: 74px;
  aspect-ratio: 1;
  color: #d94745;
  background:
    linear-gradient(45deg, transparent 49.3%, #ef8d8b 49.5%, #ef8d8b 50.5%, transparent 50.7%),
    linear-gradient(-45deg, transparent 49.3%, #ef8d8b 49.5%, #ef8d8b 50.5%, transparent 50.7%),
    linear-gradient(#ef8d8b, #ef8d8b) center / 100% 1px no-repeat,
    linear-gradient(90deg, #ef8d8b, #ef8d8b) center / 1px 100% no-repeat;
  border: 2px solid #e85855;
  font: 500 2.5rem "STKaiti", "KaiTi", serif;
}

.muted-grid { top: 49px; right: 28px; opacity: .5; transform: scale(.78); }
.pencil { position: absolute; left: 36px; bottom: 27px; width: 116px; height: 10px; background: #f2b736; border-radius: 8px; transform: rotate(-8deg); box-shadow: 0 5px 0 #ad7821; }
.pencil::after { content: ""; position: absolute; right: -14px; border: 5px solid transparent; border-left: 12px solid #d7ad82; }

.monopoly-preview { background: linear-gradient(145deg, #226b59, #104337); }
.monopoly-preview img { position: absolute; left: 50%; top: 50%; width: 116px; transform: translate(-50%, -50%) rotate(-2deg); filter: drop-shadow(0 12px 10px rgb(0 0 0 / 30%)); }
.coin { position: absolute; display: grid; place-items: center; width: 45px; aspect-ratio: 1; color: #6a4811; background: #f1bf4f; border: 3px solid #ffd984; border-radius: 50%; box-shadow: 0 5px 0 #9f6b21; font-weight: 900; }
.coin-one { left: 38px; bottom: 27px; transform: rotate(-8deg); }
.coin-two { right: 40px; top: 23px; transform: rotate(10deg) scale(.82); }
.ticket { position: absolute; right: 34px; bottom: 22px; padding: 9px 12px; color: #2e1d0c; background: #f2d593; border-radius: 6px; box-shadow: 0 5px 0 #9e7139; font: 800 .72rem ui-monospace, monospace; letter-spacing: .1em; transform: rotate(5deg); }

.gallery-preview { background: #dcd7cc; }
.photo { position: absolute; width: 88px; height: 105px; padding: 8px 8px 23px; background: #f8f6f0; border-radius: 3px; box-shadow: 0 8px 18px rgb(0 0 0 / 22%); }
.photo::before { content: ""; display: block; width: 100%; height: 100%; background: linear-gradient(145deg, var(--photo-a), var(--photo-b)); }
.photo-one { --photo-a: #d99056; --photo-b: #497876; left: 15%; top: 24px; transform: rotate(-8deg); }
.photo-two { --photo-a: #edc77d; --photo-b: #768eaa; left: 38%; top: 18px; transform: rotate(3deg); }
.photo-three { --photo-a: #8a9d79; --photo-b: #d8a989; left: 61%; top: 28px; transform: rotate(9deg); }
.gallery-title { position: absolute; right: 24px; bottom: 16px; color: #49453f; font: 500 1.15rem "Songti SC", serif; letter-spacing: .22em; writing-mode: vertical-rl; }

.canvas-preview {
  background-color: #26223c;
  background-image: radial-gradient(rgb(255 255 255 / 20%) 1px, transparent 1px);
  background-size: 17px 17px;
}
.node { position: absolute; z-index: 2; display: grid; place-items: center; width: 82px; height: 48px; color: #f4f1ff; background: #5c4bb2; border: 1px solid #9c8ff1; border-radius: 13px; box-shadow: 0 7px 0 #332b69, 0 12px 20px rgb(0 0 0 / 25%); font-size: .78rem; font-weight: 750; }
.node-text { left: 8%; top: 48px; }
.node-image { left: 41%; top: 23px; background: #9f4f80; border-color: #e595c6; box-shadow: 0 7px 0 #5f2d4d; }
.node-video { right: 7%; top: 71px; background: #2d7d78; border-color: #73c2bc; box-shadow: 0 7px 0 #194a47; }
.canvas-line { position: absolute; z-index: 1; height: 3px; background: #b9adff; border-radius: 99px; transform-origin: left center; }
.line-one { width: 31%; left: 22%; top: 73px; transform: rotate(-12deg); }
.line-two { width: 34%; left: 56%; top: 58px; transform: rotate(14deg); background: #79d2ca; }

.card-copy { align-self: end; min-width: 0; }
.card-copy h2 { margin: 4px 0 7px; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.06; letter-spacing: -.035em; }
.card-copy > p:last-child { margin: 0; color: #626976; font-size: .9rem; line-height: 1.55; }
.category { color: var(--accent); }

.open-label {
  align-self: end;
  justify-self: end;
  margin-left: 14px;
  padding: 10px 12px;
  color: white;
  background: var(--accent);
  border-radius: 13px;
  font-size: .78rem;
  font-weight: 800;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--accent) 68%, black);
}
.open-label b { font-size: 1rem; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 55px;
  padding-top: 18px;
  color: #7f8998;
  border-top: 1px solid var(--line);
  font: 700 .7rem ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .12em;
}

.status-page { display: grid; min-height: 100dvh; place-items: center; padding: 24px; }
.status-panel { width: min(640px, 100%); text-align: center; }
.status-panel .canvas-preview { height: 250px; margin-bottom: 32px; border-radius: 28px; box-shadow: 0 15px 0 #151229, 0 32px 70px rgb(0 0 0 / 35%); }
.status-panel h1 { font-size: clamp(2.4rem, 8vw, 5rem); }
.status-panel p { color: #b8c0cb; line-height: 1.7; }
.back-link { display: inline-block; margin-top: 20px; padding: 13px 18px; color: #161d28; background: #f0bd58; border-radius: 14px; box-shadow: 0 6px 0 #8e5a21; font-weight: 850; text-decoration: none; }
.back-link:active { transform: translateY(4px); box-shadow: 0 2px 0 #8e5a21; }
.back-link:focus-visible { outline: 4px solid white; outline-offset: 4px; }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 28px, 580px); padding-top: 36px; }
  .hero { margin-bottom: 32px; }
  .brand-mark { width: 62px; border-radius: 18px; box-shadow: 0 6px 0 #8e5a21, 0 14px 28px rgb(0 0 0 / 28%); }
  .app-grid { grid-template-columns: 1fr; gap: 27px; }
  .app-card { min-height: 340px; }
  footer { margin-top: 42px; }
}

@media (max-width: 430px) {
  .page-shell { width: calc(100% - 22px); }
  .hero { gap: 15px; }
  .intro { font-size: .9rem; }
  .app-card { padding: 18px; border-radius: 24px; }
  .preview { margin: 15px 0 19px; }
  .card-copy > p:last-child { max-width: 235px; }
  .open-label { padding: 9px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-card { transition: none; }
}
