@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #06090E;
  --bg-2: #0A0F16;
  --panel: rgba(17, 24, 33, .74);
  --panel-solid: #101720;
  --ink: #E9F1FB;
  --ink-2: #9AA9BC;
  --ink-3: #5D6C80;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --cyan: #5EE7FF;
  --cyan-2: #2AB6D4;
  --cyan-deep: #0C3D49;
  --gold: #FFC24B;
  --red: #FF5C6C;
  --green: #62F0B0;
  --violet: #A78BFA;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 32px -24px rgba(0, 0, 0, .8);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .4), 0 36px 60px -36px rgba(0, 0, 0, .9);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, .35), 0 60px 110px -55px rgba(0, 0, 0, .95);
  --glow-cyan: 0 0 0 1px rgba(94, 231, 255, .35), 0 0 26px -6px rgba(94, 231, 255, .5);
  --radius: 18px;
  --ease: cubic-bezier(.2, .75, .25, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; color-scheme: dark; }
body {
  background:
    radial-gradient(900px 520px at 78% -10%, rgba(42, 182, 212, .18) 0%, rgba(42, 182, 212, 0) 60%),
    radial-gradient(760px 520px at 6% 18%, rgba(120, 90, 220, .12) 0%, rgba(120, 90, 220, 0) 62%),
    radial-gradient(1000px 700px at 50% 120%, rgba(20, 70, 90, .25) 0%, rgba(20, 70, 90, 0) 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 200, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 200, 255, .045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 20%, transparent 75%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .035; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='.55'/></svg>");
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
img, canvas { max-width: 100%; }
::selection { background: rgba(94, 231, 255, .28); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .14); border-radius: 99px;
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(94, 231, 255, .3); background-clip: content-box; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

#app { position: relative; z-index: 2; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 28px 84px; }

h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 500; letter-spacing: -.03em; }
p { margin: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-size: 10px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--cyan);
  margin: 0 0 14px;
}
.eyebrow::before {
  content: ""; width: 16px; height: 1px; background: currentColor; opacity: .7;
  box-shadow: 0 0 8px currentColor;
}
.muted { color: var(--ink-3); }
.lede { color: var(--ink-2); font-size: 17px; line-height: 1.66; max-width: 56ch; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 26px;
  max-width: 1180px; width: 100%; margin: 0 auto;
  padding: 18px 28px 14px;
  background: linear-gradient(to bottom, rgba(6, 9, 14, .92) 60%, rgba(6, 9, 14, 0));
  backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { position: relative; width: 30px; height: 30px; display: inline-block; }
.brand-mark i {
  position: absolute; width: 11px; height: 11px; border-radius: 3px;
  transform: rotate(45deg);
  background: linear-gradient(145deg, #8CF2FF, var(--cyan-2) 55%, #0B4F60);
  box-shadow: 0 0 10px rgba(94, 231, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.brand-mark i:nth-child(1) { left: 1px; top: 5px; }
.brand-mark i:nth-child(2) { right: 1px; top: 7px; opacity: .8; }
.brand-mark i:nth-child(3) { left: 9px; bottom: 1px; opacity: .65; }
.brand-name { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.top-nav { display: flex; gap: 2px; margin-left: 10px; }
.top-nav a {
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ink-2);
  transition: color .18s var(--ease), background .18s var(--ease), box-shadow .18s;
}
.top-nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.top-nav a.on {
  color: #04131A; background: linear-gradient(180deg, #8CF2FF, #4FD6F2);
  box-shadow: 0 0 22px -6px rgba(94, 231, 255, .8);
}
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; background: transparent; cursor: pointer;
  border-radius: 999px; height: 36px; min-width: 36px; padding: 0 11px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  transition: background .18s, color .18s, border-color .18s;
}
.icon-btn:hover { background: rgba(94, 231, 255, .08); color: var(--cyan); }
.icon-btn:active { transform: translateY(1px); }
.ic { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.profile {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  border-radius: 999px; padding: 5px 14px 5px 5px; font-size: 12.5px; font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.profile:hover { border-color: rgba(94, 231, 255, .35); transform: translateY(-1px); }
.avatar {
  position: relative; width: 27px; height: 27px; border-radius: 8px;
  background: linear-gradient(145deg, #8CF2FF, var(--cyan-2) 55%, #0B4F60);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 14px -2px rgba(94, 231, 255, .6);
}
.avatar::after {
  content: ""; position: absolute; inset: 6px; border-radius: 3px;
  background: rgba(4, 19, 26, .55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.pname { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .035); color: var(--ink);
  padding: 11px 20px; border-radius: 12px; font-size: 13.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: transform .16s var(--ease), background .18s, border-color .18s, box-shadow .18s;
}
.btn:hover { background: rgba(255, 255, 255, .07); border-color: rgba(94, 231, 255, .35); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(180deg, #8CF2FF, #4FD6F2);
  border-color: transparent; color: #04131A; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(94, 231, 255, .35), 0 14px 30px -14px rgba(94, 231, 255, .65);
}
.btn.primary:hover { background: linear-gradient(180deg, #A6F6FF, #5FE0FA); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(255, 255, 255, .05); }
.btn.big { padding: 14px 26px; border-radius: 14px; font-size: 14.5px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.02fr .98fr; gap: 48px;
  align-items: center; padding: 58px 0 44px;
}
.hero h1 {
  font-size: clamp(48px, 6.4vw, 86px); line-height: .94; letter-spacing: -.045em;
  margin: 0 0 24px; font-weight: 500;
}
.hero h1 em {
  font-style: normal; font-size: .8em;
  background: linear-gradient(92deg, #9BF4FF, var(--cyan) 38%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 42px rgba(94, 231, 255, .25);
}
.hero .lede { font-size: 17px; max-width: 42ch; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 34px 0 18px; }
.micro {
  font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3);
}
.hero-art { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 6px; }
.hero-art::before {
  content: ""; position: absolute; inset: -12% -8% -18%;
  background: radial-gradient(closest-side, rgba(94, 231, 255, .16), transparent 72%);
  pointer-events: none;
}
.hero-art #hero-canvas {
  position: relative; border-radius: 22px;
  border: 1px solid rgba(94, 231, 255, .18);
  background: #0A0F16;
  box-shadow: var(--shadow-lg), 0 0 60px -18px rgba(94, 231, 255, .45);
  animation: boardIn .8s var(--ease) both;
}
@keyframes boardIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.float-coin {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #FFF3C8, var(--gold) 58%, #9A6210);
  box-shadow: 0 0 14px rgba(255, 194, 75, .7);
  animation: bob 4.4s ease-in-out infinite;
}
.float-coin.c1 { left: 4%; top: 12%; }
.float-coin.c2 { right: 2%; top: 38%; animation-delay: -1.4s; }
.float-coin.c3 { left: 12%; bottom: 8%; animation-delay: -2.6s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 30px 0 10px; }
.feature {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); backdrop-filter: blur(10px);
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.feature:hover { transform: translateY(-3px); border-color: rgba(94, 231, 255, .28); box-shadow: var(--shadow-md), 0 0 30px -14px rgba(94, 231, 255, .45); }
.feature h3 { font-size: 19px; margin-bottom: 7px; letter-spacing: -.02em; }
.feature p { color: var(--ink-2); font-size: 13.5px; line-height: 1.62; }
.f-icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(94, 231, 255, .16), rgba(94, 231, 255, .04));
  color: var(--cyan); border: 1px solid rgba(94, 231, 255, .22); margin-bottom: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.f-icon .ic { width: 19px; height: 19px; }

.continue-strip { padding-top: 28px; }
.continue-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: linear-gradient(135deg, rgba(24, 40, 52, .9), rgba(10, 15, 22, .92));
  border: 1px solid rgba(94, 231, 255, .18);
  color: var(--ink); border-radius: 20px; padding: 26px 30px;
  box-shadow: var(--shadow-lg), 0 0 50px -30px rgba(94, 231, 255, .5);
}
.continue-card::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px;
  border-radius: 50%; background: radial-gradient(circle, rgba(94, 231, 255, .2), transparent 65%);
}
.continue-card .eyebrow { color: var(--cyan); }
.continue-card h3 { font-size: 24px; letter-spacing: -.02em; }
.continue-card .muted { color: var(--ink-3); font-size: 12.5px; }

/* ---------- page head ---------- */
.page-head { padding: 48px 0 30px; }
.page-head h1 { font-size: clamp(40px, 5.2vw, 64px); margin-bottom: 12px; letter-spacing: -.035em; line-height: 1.02; }
.page-head.compact { padding-bottom: 18px; }

/* ---------- campaign roadmap ---------- */
.roadmap { position: relative; margin: 14px 0 10px; }
.road-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.road-path {
  fill: none; stroke: rgba(94, 231, 255, .22); stroke-width: 2;
  stroke-dasharray: 5 10; stroke-linecap: round;
}
.road-path.done {
  stroke: rgba(94, 231, 255, .75); stroke-dasharray: none;
  filter: drop-shadow(0 0 5px rgba(94, 231, 255, .55));
}
.chapter-mark { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; }
.chapter-mark span {
  display: block; font-size: 9.5px; font-weight: 600; letter-spacing: .24em;
  text-transform: uppercase; color: var(--cyan);
}
.chapter-mark em {
  display: block; font-family: var(--display); font-style: normal; font-size: 21px;
  letter-spacing: -.02em; color: var(--ink);
}
.road-node { position: absolute; width: 56px; height: 56px; transform: translate(-50%, -50%); z-index: 2; }
.node-badge {
  display: grid; place-items: center; width: 56px; height: 56px;
  border-radius: 15px; border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  font-family: var(--display); font-size: 17px; color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  transition: transform .16s var(--ease), border-color .16s, box-shadow .16s;
}
.road-node:hover .node-badge { transform: translateY(-2px); border-color: rgba(94, 231, 255, .55); }
.road-node.cleared .node-badge {
  background: linear-gradient(160deg, #7CF3FF, #2AB6D4);
  border-color: transparent; color: #04131A; font-weight: 600;
  box-shadow: 0 0 24px -8px rgba(94, 231, 255, .85);
}
.road-node.cleared .node-badge::after {
  content: "✓"; position: absolute; right: -5px; bottom: -5px;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px;
  background: var(--green); color: #04131A; border: 2px solid var(--bg);
}
.road-node.next .node-badge {
  border-color: rgba(94, 231, 255, .8); color: var(--ink);
  animation: nodePulse 2.2s ease-in-out infinite;
}
.road-node.next .node-label b { color: var(--cyan); }
@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(94, 231, 255, .06), 0 0 24px -8px rgba(94, 231, 255, .6); }
  50% { box-shadow: 0 0 0 10px rgba(94, 231, 255, .03), 0 0 34px -4px rgba(94, 231, 255, .9); }
}
.node-label {
  position: absolute; top: 62px; left: 50%; transform: translateX(-50%);
  width: 168px; text-align: center; font-size: 10.5px; color: var(--ink-3);
  pointer-events: none;
}
.node-label b {
  display: block; font-size: 12px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.node-label em { font-style: normal; letter-spacing: .02em; }

/* ---------- campaign list ---------- */
.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(304px, 1fr)); gap: 12px; }
.level-card {
  display: flex; align-items: center; gap: 15px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 15px 17px; backdrop-filter: blur(8px);
  transition: border-color .2s, transform .2s var(--ease), box-shadow .2s, background .2s;
}
.level-card:hover {
  border-color: rgba(94, 231, 255, .3); transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 26px -16px rgba(94, 231, 255, .6);
}
.lv-no {
  width: 42px; height: 42px; flex: none; border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  font-family: var(--display); font-size: 16px; color: var(--ink-2);
}
.level-card.cleared .lv-no { background: rgba(98, 240, 176, .1); color: var(--green); border-color: rgba(98, 240, 176, .25); }
.lv-body { min-width: 0; flex: 1; }
.lv-body h3 { font-size: 16.5px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-body p { font-size: 11.5px; margin-top: 3px; letter-spacing: .02em; }
.lv-side { display: flex; align-items: center; gap: 8px; }
.stamp { color: var(--green); font-size: 14px; }
.rate {
  font-size: 10.5px; font-weight: 500; letter-spacing: .04em; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px;
  background: rgba(255, 255, 255, .02);
}
.curated-head { padding: 50px 0 20px; }
.curated-head h2 { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 4px; }
.curated-head .muted { font-size: 13px; }

/* ---------- plaza ---------- */
.plaza-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 24px; }
.tabs {
  display: inline-flex; background: rgba(255, 255, 255, .04); border-radius: 999px; padding: 4px;
  border: 1px solid var(--line);
}
.tabs button {
  border: 0; background: transparent; padding: 8px 16px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap;
  transition: background .18s, color .18s, box-shadow .18s;
}
.tabs button.on { background: rgba(94, 231, 255, .14); color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(94, 231, 255, .25); }
.search {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03); border-radius: 11px;
  padding: 11px 15px; font-size: 13px; outline: none; min-width: 230px;
  transition: border-color .18s, box-shadow .18s;
}
.search::placeholder { color: var(--ink-3); }
.search:focus { border-color: rgba(94, 231, 255, .5); box-shadow: 0 0 0 3px rgba(94, 231, 255, .1); }
.plaza-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(242px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-sm); backdrop-filter: blur(8px);
  transition: transform .22s var(--ease), box-shadow .22s, border-color .22s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(94, 231, 255, .3); box-shadow: var(--shadow-md), 0 0 34px -18px rgba(94, 231, 255, .55); }
.thumb {
  position: relative; overflow: hidden; display: grid; place-items: center; padding: 16px;
  min-height: 156px;
  pointer-events: none;
  background: radial-gradient(120% 120% at 30% 0%, #101822 0%, #0A0F16 100%);
  border-bottom: 1px solid var(--line);
}
.thumb canvas { border-radius: 8px; max-height: 150px; width: auto; transition: transform .35s var(--ease); }
.card:hover .thumb canvas { transform: scale(1.035); }
.card-body { padding: 15px 17px 17px; }
.card-body h3 { font-size: 18px; font-weight: 500; letter-spacing: -.015em; margin-bottom: 3px; }
.by { font-size: 11.5px; color: var(--ink-3); }
.badge {
  background: rgba(255, 194, 75, .12); color: var(--gold); border: 1px solid rgba(255, 194, 75, .25);
  border-radius: 999px; padding: 1px 8px; font-size: 9px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; vertical-align: 1px;
}
.card-stats {
  display: flex; gap: 14px; font-size: 11.5px; font-weight: 500; color: var(--ink-2);
  margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line);
}
.card-stats span { display: inline-flex; align-items: center; gap: 5px; }
.card-stats .ic { width: 13px; height: 13px; opacity: .6; }
.skeleton {
  min-height: 230px; border-radius: 18px;
  background: linear-gradient(100deg, rgba(255,255,255,.03) 30%, rgba(94,231,255,.08) 50%, rgba(255,255,255,.03) 70%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.empty, .loading { color: var(--ink-3); padding: 48px 0; font-size: 15px; }
.empty a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.empty-page { padding: 80px 0; }
.empty-page h1 { font-size: 42px; margin-bottom: 8px; }

/* ---------- my rooms ---------- */
.mine-page { padding: 30px 0 80px; }
.mine-page > .eyebrow { margin-bottom: 6px; }
.mine-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.mine-head h1 { margin: 0; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.03em; }
/* Two cards per row, same density as the plaza: the old single-column list
   showed four rooms per screen, this shows eight. */
.mine-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mine-card {
  display: flex; flex-direction: column;
  padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--panel); backdrop-filter: blur(8px);
}
.mine-card.official { border-color: rgba(255, 194, 75, .32); }
.mine-card header { display: flex; align-items: flex-start; gap: 8px; }
.mine-card h2 {
  margin: 0; font-family: var(--display); font-size: 15.5px; letter-spacing: -.01em;
  line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mine-chip {
  margin-left: auto; flex: none; font-size: 8px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
  border: 1px solid rgba(94, 231, 255, .4); color: var(--cyan);
}
.mine-chip.off { color: var(--gold); border-color: rgba(255, 194, 75, .5); }
.mine-meta { margin: 6px 0 0; font-size: 10.5px; color: var(--ink-3); }
.mine-stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 9px 0 0; font-size: 8.5px; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }
.mine-stats b { display: block; font-family: var(--display); font-size: 14px; color: var(--ink); letter-spacing: 0; text-transform: none; }
.mine-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }
.mine-actions .btn { font-size: 10px; padding: 6px 10px; }
.mine-lock { font-size: 8.5px; color: var(--ink-3); }
.mine-success {
  display: flex; flex-direction: column; gap: 3px; margin: 0 0 16px;
  padding: 14px 16px; border-radius: 14px;
  border: 1px solid rgba(98, 240, 176, .45);
  background: linear-gradient(140deg, rgba(98, 240, 176, .16), rgba(10, 18, 24, .85));
  transition: opacity .6s ease;
}
.mine-success.settled { opacity: .72; }
.mine-success b { font-family: var(--display); font-size: 17px; color: var(--green); }
.mine-success span { font-size: 13px; color: var(--ink); }
.mine-success em { font-style: normal; font-size: 10px; color: var(--ink-3); }
.mine-empty { padding: 30px; text-align: center; border: 1px dashed var(--line); border-radius: 14px; }
.mine-empty p { color: var(--ink-3); margin: 0 0 12px; }

/* ---------- play ---------- */
.play { display: flex; flex-direction: column; min-height: calc(100vh - 78px); padding-top: 8px; }
.play-top { display: flex; align-items: center; gap: 16px; padding: 6px 0 14px; }
.play-meta { flex: 1; min-width: 0; }
.play-meta h1 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.025em; line-height: 1.06; }
.play-meta p { font-size: 12px; color: var(--ink-3); margin-top: 4px; letter-spacing: .02em; }
.hud { display: flex; gap: 8px; }
.hud-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 14px; text-align: right; min-width: 82px; backdrop-filter: blur(8px);
}
.hud-item span {
  display: block; font-size: 8.5px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-3);
}
.hud-item b {
  font-family: var(--display); font-size: 19px; font-weight: 500;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--ink);
}
.hud-item.pop { animation: hudPop .55s var(--ease); }
@keyframes hudPop {
  0% { transform: scale(1); }
  35% {
    transform: scale(1.12); border-color: rgba(255, 194, 75, .7);
    box-shadow: 0 0 30px -8px rgba(255, 194, 75, .85);
  }
  100% { transform: scale(1); }
}
.legend {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  padding: 4px 2px 10px; font-size: 11px; color: var(--ink-3); letter-spacing: .04em;
}
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.lg { width: 12px; height: 12px; display: inline-block; border-radius: 3px; }
.lg.player { background: linear-gradient(145deg, #FFFFFF, #B9F4FF 55%, #2AB6D4); border-radius: 3px; box-shadow: 0 0 8px rgba(94, 231, 255, .8); }
.lg.coin { background: radial-gradient(circle at 35% 30%, #FFF3C8, #FFC24B 60%, #9A6210); border-radius: 2px; transform: rotate(45deg); box-shadow: 0 0 8px rgba(255, 194, 75, .7); }
.lg.spike { background: var(--red); clip-path: polygon(50% 0, 100% 100%, 0 100%); box-shadow: 0 0 8px rgba(255, 92, 108, .7); }
.lg.pit { background: #000; border: 1px solid rgba(255, 92, 108, .55); border-radius: 50%; }
.lg.ice { background: rgba(94, 231, 255, .28); border: 1px solid rgba(94, 231, 255, .6); }
.lg.oneway {
  background: linear-gradient(145deg, #7CF3FF, #1D8AA4); color: #04131A;
  display: grid; place-items: center; font-size: 9px; font-weight: 700;
  border-radius: 3px; box-shadow: 0 0 8px rgba(94, 231, 255, .7);
}
.lg.crate { background: linear-gradient(145deg, #B07B46, #6E4523); border: 1px solid rgba(255, 255, 255, .28); box-shadow: 0 0 6px rgba(176, 123, 70, .5); }
.lg.key { background: radial-gradient(circle at 35% 35%, #FFF3C8, #E0A63A 62%, #7A4A00); border-radius: 50%; box-shadow: 0 0 6px rgba(255, 200, 80, .65); }
.lg.door { background: linear-gradient(180deg, #E3B04A, #8A5A12); border-radius: 2px 2px 0 0; }
.lg.portal { background: radial-gradient(circle, #F1C6FF 0 24%, #9B5CFF 45%, #3A1A66 72%); border-radius: 50%; box-shadow: 0 0 7px rgba(155, 92, 255, .7); }
.lg.spring { background: repeating-linear-gradient(180deg, #C9D4DC 0 2px, #5A6B76 2px 4px); border-radius: 2px; }
.lg.plate { background: #7C8C96; border: 1px solid #B7C6CF; border-radius: 2px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .18); }
.lg.gate { background: repeating-linear-gradient(90deg, #A66BFF 0 2px, #2A1046 2px 4px); border-radius: 2px; }
.lg.tgate { background: repeating-linear-gradient(90deg, #FF9BE0 0 2px, #3A1030 2px 4px); border-radius: 2px; }
.lg.brick { background: repeating-linear-gradient(0deg, #B86A4B 0 5px, #6E3A2A 5px 6px), repeating-linear-gradient(90deg, transparent 0 5px, #6E3A2A 5px 6px); border-radius: 1px; }
.lg.lock { background: #7A4A00; border: 2px solid #FFD36A; border-radius: 50%; }
.lg.crumble { background: #8A6A4A; border: 1px dashed #E3C9A8; border-radius: 2px; }
.lg.belt { background: repeating-linear-gradient(45deg, #2AB6D4 0 3px, #0A4A5A 3px 6px); border-radius: 2px; }
.lg.steps { background: #C9D4DC; clip-path: polygon(0 100%, 0 58%, 34% 58%, 34% 32%, 67% 32%, 67% 0, 100% 0, 100% 100%); }
.lg.groundspike { background: #E8EDF2; clip-path: polygon(50% 0, 62% 70%, 75% 30%, 88% 100%, 12% 100%, 25% 30%, 38% 70%); }
.lg.riser { background: linear-gradient(180deg, #B8A8D8, #4A4458 60%); border-radius: 2px; box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.lg.gravity { background: radial-gradient(circle, #C4B5FD, #6D28D9 70%); border-radius: 50%; box-shadow: 0 0 6px rgba(139, 92, 246, .7); }
.lg.fog { background: radial-gradient(circle, rgba(220, 240, 246, .9), rgba(220, 240, 246, .08)); border-radius: 50%; }
.lg.ghost { background: rgba(160, 230, 200, .22); border: 1px dashed rgba(160, 230, 200, .8); border-radius: 2px; }

.lg.laser { background: linear-gradient(90deg, #FF2D4A, #FF8A98, #FF2D4A); border-radius: 50%; box-shadow: 0 0 7px rgba(255, 45, 74, .85); }
.board-wrap {
  flex: 1; min-height: 380px; display: grid; place-items: center;
  border-radius: 24px; overflow: hidden;
  box-shadow: 0 40px 110px -60px rgba(95, 224, 222, .55);
}
.board-wrap canvas { display: block; touch-action: none; animation: boardIn .55s var(--ease) both; }
.play-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0 6px; }
.play-actions { display: flex; gap: 6px; }
.play-actions .icon-btn { border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.icon-btn.liked { color: var(--red); border-color: rgba(255, 92, 108, .3); background: rgba(255, 92, 108, .1); }
.icon-btn.liked .ic { fill: currentColor; }
.dpad { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 44px); gap: 5px; }
.dpad button {
  display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .035); border-radius: 11px;
  cursor: pointer; color: var(--ink-2);
  transition: background .15s, transform .12s, color .15s, border-color .15s;
}
.dpad button:hover { background: rgba(94, 231, 255, .08); color: var(--cyan); border-color: rgba(94, 231, 255, .3); }
.dpad button:active { transform: scale(.96); }
.dpad button .ic { width: 17px; height: 17px; }
.dpad button[data-dir="U"] { grid-column: 2; grid-row: 1; }
.dpad button[data-dir="L"] { grid-column: 1; grid-row: 2; }
.dpad button[data-dir="D"] { grid-column: 2; grid-row: 2; }
.dpad button[data-dir="R"] { grid-column: 3; grid-row: 2; }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px;
  background: rgba(3, 6, 10, .72);
  backdrop-filter: blur(10px) saturate(.8);
  animation: fade .2s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal-card {
  position: relative;
  background: linear-gradient(180deg, #111925, #0B1118);
  border-radius: 22px; padding: 34px; width: min(470px, 100%);
  border: 1px solid rgba(94, 231, 255, .16);
  box-shadow: var(--shadow-lg), 0 0 60px -24px rgba(94, 231, 255, .4);
  animation: pop .3s var(--ease);
}
@keyframes pop { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.modal-card h2 { font-size: 36px; line-height: 1.05; margin-bottom: 18px; letter-spacing: -.03em; }
.modal-card .muted { font-size: 13px; margin-bottom: 18px; color: var(--ink-3); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.win-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.win-stats > div {
  background: rgba(255, 255, 255, .035); border: 1px solid var(--line);
  border-radius: 13px; padding: 12px 14px;
}
.win-stats span {
  display: block; font-size: 8.5px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-3);
}
.win-stats b { font-family: var(--display); font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.rank-line { margin-top: 16px; font-size: 12.5px; color: var(--ink-2); }
.rank-line b { color: var(--cyan); }
.board { margin: 14px 0 0; padding: 0; list-style: none; }
.board li {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: 12.5px;
}
.board b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.board span { color: var(--ink-3); font-size: 10.5px; font-family: var(--display); }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--ink-2); }
.field .search { width: 100%; }
.modal .win-mark {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, rgba(94, 231, 255, .28), rgba(94, 231, 255, .06));
  color: var(--cyan); border: 1px solid rgba(94, 231, 255, .45); margin-bottom: 16px;
  box-shadow: 0 0 26px -4px rgba(94, 231, 255, .55);
}
.win-mark .ic { width: 22px; height: 22px; stroke-width: 2.2; }

/* ---------- editor ---------- */
.editor-wrap { display: grid; grid-template-columns: 236px minmax(0, 1fr) 256px; gap: 22px; align-items: start; }
.ed-side, .ed-help {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; backdrop-filter: blur(10px); box-shadow: var(--shadow-sm);
}
.ed-help p { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.ed-help ul { margin: 12px 0; padding-left: 18px; font-size: 12px; color: var(--ink-2); }
.ed-help li { margin-bottom: 6px; }
.pal-group { margin-bottom: 18px; }
.pal-name {
  font-size: 9px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 9px;
}
.pal-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.pal-tile {
  position: relative; aspect-ratio: 1; border-radius: 9px; border: 1px solid var(--line);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); overflow: hidden; padding: 0;
  transition: transform .15s var(--ease), box-shadow .15s, border-color .15s;
}
.pal-tile:hover { transform: translateY(-1px); border-color: rgba(94, 231, 255, .4); box-shadow: 0 0 18px -8px rgba(94, 231, 255, .5); }
.pal-tile em {
  position: absolute; left: 0; right: 0; bottom: 0; font-style: normal;
  font-size: 8px; background: rgba(6, 9, 14, .85); color: var(--ink-2);
  text-align: center; padding: 3px 0; transform: translateY(100%); transition: transform .16s var(--ease);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pal-tile:hover em { transform: translateY(0); }
.pal-tile.on { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(94, 231, 255, .25), 0 0 20px -6px rgba(94, 231, 255, .6); }
.pal-tile > span { font-size: 14px; font-weight: 600; }
.ed-main {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; backdrop-filter: blur(10px); box-shadow: var(--shadow-sm);
}
.ed-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.ed-title {
  flex: 1; min-width: 180px; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; font-family: var(--display); font-size: 19px; background: rgba(255, 255, 255, .03);
  outline: none; transition: border-color .18s, box-shadow .18s;
}
.ed-title:focus { border-color: rgba(94, 231, 255, .5); box-shadow: 0 0 0 3px rgba(94, 231, 255, .1); }
.ed-size { display: flex; gap: 9px; font-size: 10.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .08em; }
.ed-size label { display: inline-flex; align-items: center; gap: 6px; }
.ed-size input {
  width: 54px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 6px;
  background: rgba(255, 255, 255, .03); text-align: center; font-family: var(--display); font-size: 14px;
}
.ed-grid {
  display: grid; gap: 2px; background: rgba(255, 255, 255, .04); padding: 3px; border-radius: 11px;
  user-select: none; touch-action: none; border: 1px solid var(--line);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .5);
}
.ed-board {
  position: relative; height: clamp(260px, 44vh, 460px); border-radius: 12px; overflow: hidden;
  background: #041018; border: 1px solid var(--line); touch-action: none; cursor: crosshair;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .5);
}
.ed-board canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.ed-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ed-side-head .eyebrow { margin-bottom: 0; }
.ed-back { font-size: 10px; padding: 4px 9px; }
.ed-pal-note { margin-top: 12px; font-size: 10px; line-height: 1.55; color: var(--ink-3); }
.ed-live {
  margin-left: auto; font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink-3); white-space: nowrap; transition: color .2s, border-color .2s, background .2s;
}
.ed-live.ok { color: var(--green); border-color: rgba(61, 220, 151, .45); background: rgba(61, 220, 151, .08); }
.ed-live.bad { color: var(--red); border-color: rgba(255, 92, 108, .45); background: rgba(255, 92, 108, .08); }
.ed-live.busy { color: var(--cyan); }
.btn.on { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 0 2px rgba(94, 231, 255, .2); }
.ed-cell {
  position: relative; aspect-ratio: 1; border-radius: 3px; background: #0E141C;
  display: grid; place-items: center; font-size: 11px; color: var(--ink-2); cursor: crosshair;
  transition: filter .1s;
}
.ed-cell:hover { filter: brightness(1.5); }
.ed-cell > span { pointer-events: none; font-size: 11px; color: var(--ink-2); }
.ed-tools { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; }
.ed-status { margin-top: 12px; font-size: 12px; color: var(--ink-3); min-height: 20px; }
.ed-status.ok { color: var(--green); }
.ed-status.bad { color: var(--red); }
.ed-status.busy { color: var(--cyan); }

/* dark tile visuals (palette + grid) */
.ter-floor { background: #0E141C; }
.ter-wall { background: linear-gradient(#243142 0 18%, #0A0E14 18%); box-shadow: inset 0 0 0 1px rgba(94, 231, 255, .18); }
.ter-ice { background: linear-gradient(150deg, rgba(94, 231, 255, .3), rgba(42, 182, 212, .12)); box-shadow: inset 0 0 0 1px rgba(94, 231, 255, .45); }
.ter-spike { background: #0E141C; }
.ter-spike::after { content: "▲"; position: absolute; font-size: 13px; color: var(--red); line-height: 1; text-shadow: 0 0 6px rgba(255, 92, 108, .8); }
.ter-pit { background: radial-gradient(circle at 50% 50%, #000 0 34%, #0E141C 37%); box-shadow: inset 0 0 0 1px rgba(255, 92, 108, .25); }
.ter-crumble { background: #131A24; }
.ter-crumble::after {
  content: ""; position: absolute; inset: 10%;
  background:
    linear-gradient(112deg, transparent 48.2%, rgba(255, 92, 108, .65) 48.6% 49.4%, transparent 49.8%),
    linear-gradient(64deg, transparent 43.4%, rgba(255, 92, 108, .35) 43.8% 44.4%, transparent 44.8%);
}
.it-coin::after, .it-start::after, .it-box::after, .it-door::after, .it-key::after { content: ""; position: absolute; }
.it-coin::after {
  width: 42%; height: 42%; border-radius: 14%; transform: rotate(45deg);
  background: radial-gradient(circle at 35% 30%, #FFF3C8, #FFC24B 60%, #9A6210);
  box-shadow: 0 0 10px rgba(255, 194, 75, .8);
}
.it-start::after { width: 50%; height: 50%; border-radius: 4px; border: 2px dashed rgba(94, 231, 255, .55); transform: rotate(45deg); }
.it-box { background: linear-gradient(150deg, #4A5A6B, #2A3540); box-shadow: inset 0 0 0 1px #1F2A34; }
.it-box::before {
  content: ""; position: absolute; inset: 22%;
  background:
    linear-gradient(to top right, transparent 46%, rgba(94, 231, 255, .6) 47% 53%, transparent 54%),
    linear-gradient(to top left, transparent 46%, rgba(94, 231, 255, .6) 47% 53%, transparent 54%);
}
.it-box::after { display: none; }
.it-door::after { inset: 18%; border-radius: 3px; background: linear-gradient(150deg, #5A7085, #2E3D4B); box-shadow: inset 0 0 0 1px rgba(94, 231, 255, .5); }
.it-key::after { width: 30%; height: 30%; border-radius: 50%; border: 2px solid var(--gold); box-shadow: 0 0 8px rgba(255, 194, 75, .6); }
.me-belt { background: #131A24; }
.me-portal { background: radial-gradient(circle, #0E141C 38%, var(--cyan) 40% 52%, #0E141C 54%); }
.me-spring { background: #0E141C; }
.me-spring::after { content: "≈"; position: absolute; color: var(--ink-3); font-size: 14px; }
.me-plate { background: #0E141C; }
.me-plate::after { content: ""; position: absolute; inset: 25% 20%; border-radius: 3px; background: #2A3540; box-shadow: inset 0 0 0 1px rgba(94, 231, 255, .3); }
.me-gate { background: repeating-linear-gradient(90deg, #4A5A6B 0 14%, #0E141C 14% 25%); }
.me-brick {
  background: #3A2A24;
  background-image: linear-gradient(rgba(255, 92, 108, .25) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 92, 108, .25) 1px, transparent 1px);
  background-size: 100% 25%, 25% 100%;
}
.me-lock { background: #0E141C; }
.me-oneway {
  background: linear-gradient(160deg, #0D4651, #071E26);
  box-shadow: inset 0 0 0 1px rgba(94, 231, 255, .55);
  color: var(--cyan);
}
.ed-cell.me-oneway > span { color: var(--cyan); }
.me-heavy {
  background: linear-gradient(160deg, #3A4A56, #1A242C);
  box-shadow: inset 0 0 0 2px rgba(255, 194, 75, .55), inset 0 0 0 6px rgba(0, 0, 0, .25);
}
.me-lever {
  background: linear-gradient(160deg, #28505B, #0E2028);
  box-shadow: inset 0 0 0 1px rgba(255, 194, 75, .55);
  color: var(--gold);
}
.me-lever::before {
  content: ""; position: absolute; left: 50%; bottom: 16%; width: 30%; height: 8%;
  transform: translateX(-50%); border-radius: 3px; background: #2A3540;
  box-shadow: inset 0 0 0 1px rgba(255, 194, 75, .4);
}
.me-lever::after {
  content: ""; position: absolute; left: 50%; bottom: 22%; width: 5%; height: 34%;
  border-radius: 3px; background: linear-gradient(#FFD98A, #9A6210);
  transform-origin: bottom center; transform: translateX(-50%) rotate(26deg);
  box-shadow: 0 0 8px rgba(255, 194, 75, .5);
}
.me-tgate {
  background: repeating-linear-gradient(90deg, #6A4FA8 0 14%, #0E141C 14% 25%);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .5);
}
.ter-crack {
  background: linear-gradient(150deg, #A8ECF7, #6FC9DA);
  color: #1D5A66;
}
.me-tramp {
  background: radial-gradient(circle, #7CF3FF 0 28%, #1D8AA4 30% 46%, #0E141C 48%);
  box-shadow: inset 0 0 0 1px rgba(94, 231, 255, .55);
}
.me-lock::after { content: ""; position: absolute; width: 34%; height: 26%; top: 44%; border-radius: 2px; background: var(--gold); box-shadow: 0 0 8px rgba(255, 194, 75, .5); }
.me-lock::before {
  content: ""; position: absolute; width: 22%; height: 16%; top: 30%;
  border: 2px solid var(--gold); border-bottom: 0; border-radius: 8px 8px 0 0;
}
.tool-erase { background: repeating-linear-gradient(45deg, #0E141C 0 6px, #16202B 6px 12px); }
@media (hover: none) {
  .pal-tile em { transform: translateY(0); }
  .pal-tile > span { transform: translateY(-6px); }
}

/* test modal */
.modal.test { padding: 12px; }
.test-card { width: min(920px, 100%); height: min(92vh, 820px); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.test-head { display: flex; align-items: flex-start; justify-content: space-between; }
.test-head h2 { font-size: 28px; margin: 0; }
.test-board { flex: 1; min-height: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .03); border-radius: 14px; border: 1px solid var(--line); overflow: hidden; }
.test-board canvas { display: block; max-width: 100%; max-height: 100%; }
.test-foot { display: flex; justify-content: space-between; align-items: center; flex: none; }
@media (max-width: 680px) {
  .modal.test { padding: 0; }
  .test-card { width: 100%; height: 100dvh; max-height: none; border-radius: 0; padding: 12px; gap: 9px; }
  .test-head h2 { font-size: 20px; }
  .test-board { min-height: 0; }
}
.hud-line { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: rgba(10, 15, 22, .96); color: var(--ink); padding: 12px 20px; border-radius: 999px;
  font-size: 12.5px; z-index: 200; border: 1px solid rgba(94, 231, 255, .25);
  box-shadow: var(--shadow-lg), 0 0 26px -10px rgba(94, 231, 255, .5);
  animation: toastIn .3s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

.foot {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  max-width: 1180px; width: 100%; margin: 0 auto; padding: 28px 28px 36px;
  border-top: 1px solid var(--line); color: var(--ink-3); font-size: 11.5px;
}
.foot a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.2); }
.foot a:hover { color: var(--cyan); }

#view.view-enter > * { animation: viewIn .45s var(--ease) both; }
#view.view-enter > *:nth-child(2) { animation-delay: .05s; }
#view.view-enter > *:nth-child(3) { animation-delay: .1s; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .editor-wrap { grid-template-columns: 210px minmax(0, 1fr); }
  .ed-help { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 30px 0 40px; }
  .hero-art { order: -1; }
  .hero-art #hero-canvas { max-height: 300px; }
  .feature-row { grid-template-columns: 1fr; }
  .top { gap: 12px; flex-wrap: wrap; }
  .top-nav { order: 3; width: 100%; overflow-x: auto; margin-left: 0; padding-bottom: 2px; }
  .top-nav a { padding: 7px 13px; }
  .play { min-height: auto; }
  .board-wrap { min-height: 320px; }
  .editor-wrap { grid-template-columns: 1fr; }
  .ed-side { order: 2; }
  .ed-help { order: 3; }
}
@media (max-width: 640px) {
  main { padding: 0 16px 52px; }
  .top { padding: 12px 16px 10px; }
  .brand-name { font-size: 18px; }
  .hero h1 { font-size: 46px; }
  .hero .lede { font-size: 15.5px; }
  .play-top { flex-wrap: wrap; }
  .hud { width: 100%; justify-content: space-between; }
  .hud-item { flex: 1; min-width: 0; text-align: center; }
  .play-bottom { flex-wrap: wrap; justify-content: center; }
  .play-actions { order: 3; width: 100%; justify-content: center; }
  .legend { gap: 12px; font-size: 10.5px; }
  .pal-row { grid-template-columns: repeat(4, 1fr); }
  .level-grid { grid-template-columns: 1fr; }
  .mine-list { grid-template-columns: 1fr; }
  .node-label { width: 116px; font-size: 9.5px; }
  .node-label b { font-size: 10.5px; }
  .node-badge, .road-node { width: 50px; height: 50px; }
  .chapter-mark em { font-size: 18px; }
  .plaza-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .thumb { min-height: 116px; padding: 9px; }
  .card-body { padding: 12px 13px 14px; }
  .card-body h3 { font-size: 16px; }
  .card-stats { gap: 9px; font-size: 10.5px; }
  .modal-card { padding: 24px; border-radius: 18px; }
  .modal-card h2 { font-size: 30px; }
  .foot { flex-direction: column; gap: 6px; padding: 22px 16px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* seamless drop intro inside the real play board */
.play { position: relative; }
.play .play-top, .play .legend, .play .play-bottom { transition: opacity .28s ease; }
.play.intro .play-top, .play.intro .legend, .play.intro .play-bottom { opacity: 0; pointer-events: none; }
.play .intro-hint { display: none; }
.play.intro .intro-hint {
  display: block; position: absolute; left: 0; right: 0; bottom: 74px; z-index: 3;
  text-align: center; font-size: 8px; letter-spacing: .24em; color: rgba(255, 255, 255, .42);
  pointer-events: none;
}
