/* =====================================================================
   Pawan's portfolio home screen. Everything is scoped under #home so the
   game's own styles and HUD are untouched; while the home is open the game
   UI layer (#ui) is hidden and restored the moment PLAY is pressed.
   ===================================================================== */
body.home-on #ui {
  visibility: hidden;
}
body.home-on #intro {
  display: none;
}

#home {
  --canvas: #f4efe2;
  --canvas2: #fbf8ef;
  --ink: #1f1d2b;
  --ink2: #3b3848;
  --muted: #66626f;
  --red: #d6452f;
  --red2: #b8392a;
  --teal: #1f9a8a;
  --gold: #f2c230;
  --sky: #2f7fd1;
  --hl: #fff4c9;
  --pixel: "Press Start 2P", "DM Sans", monospace;
  --body: "DM Sans", system-ui, sans-serif;
  --brush: "Caveat Brush", "Kalam", cursive;
  position: fixed;
  inset: 0;
  z-index: 20;
  color: var(--ink);
  font-family: var(--body);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
#home.leaving {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}
#home[hidden] {
  display: none;
}
#home *,
#home *::before,
#home *::after {
  box-sizing: border-box;
}
#home button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
#home a {
  color: inherit;
}
#home :focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
}
#home .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* the live game world behind, softened so the duo and menu read first */
#home .h-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(38% 48% at 32% 60%, rgba(251, 248, 239, 0.62), rgba(251, 248, 239, 0.25) 60%, rgba(251, 248, 239, 0) 100%),
    radial-gradient(120% 90% at 30% 55%, rgba(244, 239, 226, 0.1) 30%, rgba(244, 239, 226, 0.55) 75%, rgba(244, 239, 226, 0.85) 100%),
    linear-gradient(180deg, rgba(244, 239, 226, 0.35), rgba(244, 239, 226, 0) 22%, rgba(244, 239, 226, 0) 70%, rgba(244, 239, 226, 0.6));
  -webkit-backdrop-filter: blur(5px) saturate(0.92);
  backdrop-filter: blur(5px) saturate(0.92);
}
@media (max-width: 900px), (orientation: portrait) {
  #home .h-scrim {
    background:
      radial-gradient(70% 34% at 50% 30%, rgba(251, 248, 239, 0.6), rgba(251, 248, 239, 0) 100%),
      linear-gradient(180deg, rgba(244, 239, 226, 0.3), rgba(244, 239, 226, 0.15) 40%, rgba(244, 239, 226, 0.75) 60%, rgba(244, 239, 226, 0.92));
  }
}
#home .h-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: radial-gradient(rgba(31, 29, 43, 0.08) 1px, transparent 1.2px);
  background-size: 6px 6px;
  mix-blend-mode: multiply;
}

/* ---------- layout ---------- */
#home .h-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    "top top"
    "stage menu"
    "dialog menu"
    "foot foot";
  column-gap: clamp(16px, 3vw, 48px);
  padding: max(18px, env(safe-area-inset-top)) max(clamp(16px, 3vw, 44px), env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom))
    max(clamp(16px, 3vw, 44px), env(safe-area-inset-left));
}
#home .h-top {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 2;
}
#home .h-stage {
  grid-area: stage;
  position: relative;
  min-height: 0;
  margin: 0 -2vw -40px 0;
}
#home .h-stage .stage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  touch-action: pan-y;
  animation: h-fade 0.9s ease both;
}
#home .h-menu {
  grid-area: menu;
  align-self: center;
  position: relative;
  z-index: 2;
}
#home .h-dialog {
  grid-area: dialog;
  position: relative;
  z-index: 2;
  margin-bottom: 8px;
}
#home .h-foot {
  grid-area: foot;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink2);
  opacity: 0.75;
  text-align: center;
  padding-top: 6px;
  position: relative;
  z-index: 2;
}

/* ---------- brand + tools ---------- */
#home .h-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
#home .h-brand > div {
  min-width: 0;
  overflow: hidden;
}
#home .h-ball {
  flex: none;
  width: 38px;
  height: 38px;
  display: block;
  filter: drop-shadow(2px 2px 0 var(--ink));
}
#home .h-brand h1 {
  font-family: var(--brush);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 0.9;
  margin: 0;
  white-space: nowrap;
}
#home .h-brand small {
  display: block;
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.08em;
  margin-top: 6px;
  color: var(--ink2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#home .h-tools {
  display: flex;
  gap: 8px;
  flex: none;
}
#home .h-chip {
  font-family: var(--pixel) !important;
  font-size: 9px !important;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  min-height: 40px;
  border: 2.5px solid var(--ink);
  background: var(--canvas2);
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
}
#home .h-chip:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
  background: #fff;
}
#home .h-chip:active {
  transform: translate(1px, 1px);
  box-shadow: 0 0 0 var(--ink);
}
#home .h-chip[aria-pressed="false"] {
  color: var(--muted);
}

/* ---------- Pokémon-style boxes ---------- */
#home .pk-box {
  background: var(--canvas2);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow:
    inset 0 0 0 3px var(--canvas2),
    inset 0 0 0 5px rgba(31, 154, 138, 0.55),
    4px 4px 0 var(--ink);
}
#home .pk-box.red {
  box-shadow:
    inset 0 0 0 3px var(--canvas2),
    inset 0 0 0 5px rgba(214, 69, 47, 0.5),
    4px 4px 0 var(--ink);
}

/* ---------- main menu ---------- */
#home .h-menu .pk-box {
  padding: 14px 10px 10px;
}
#home .h-menu .h-menu-title {
  font-family: var(--pixel);
  font-size: 9px;
  color: var(--red);
  letter-spacing: 0.1em;
  padding: 2px 12px 10px;
  display: flex;
  justify-content: space-between;
}
#home .h-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
#home .h-item {
  width: 100%;
  display: grid;
  grid-template-columns: 18px 34px 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  position: relative;
  transition: background 0.12s;
}
#home .h-item .cur {
  font-size: 13px;
  color: var(--red);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.12s, transform 0.12s;
  font-family: var(--pixel);
}
#home .h-item .ico {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}
#home .h-item .ico svg {
  width: 30px;
  height: 30px;
}
#home .h-item b {
  display: block;
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.06em;
}
#home .h-item small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 5px;
  font-weight: 500;
}
#home .h-item.sel {
  background: var(--hl);
}
#home .h-item.sel .cur {
  opacity: 1;
  transform: none;
  animation: h-nudge 0.9s steps(2) infinite;
}
#home .h-item.h-play {
  background: var(--red);
  color: #fff;
  margin-bottom: 6px;
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  min-height: 62px;
}
#home .h-item.h-play small {
  color: rgba(255, 255, 255, 0.86);
}
#home .h-item.h-play .cur {
  color: #fff;
}
#home .h-item.h-play.sel {
  background: #e4513a;
}
#home .h-item.h-play:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
#home .h-item.h-play[aria-disabled="true"] {
  background: #c9a29a;
  cursor: progress;
}
#home .h-item.h-play .ld {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  background: var(--gold);
  border-radius: 0 0 0 6px;
  transition: width 0.3s;
}
#home .h-desc {
  margin: 10px 4px 0;
  padding: 10px 12px;
  min-height: 52px;
  font-size: 12px;
  line-height: 1.5;
  border-top: 2px dashed rgba(31, 29, 43, 0.18);
  color: var(--ink2);
}
#home .h-keys {
  margin: 8px 4px 0;
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1.9;
  color: var(--muted);
  letter-spacing: 0.05em;
}
body.touch .h-keys {
  display: none;
}

/* ---------- dialog ---------- */
#home .h-dialog .pk-box {
  padding: 16px 22px 18px;
  position: relative;
  max-width: 760px;
}
#home .h-dialog p {
  margin: 0;
  font-family: var(--pixel);
  font-size: clamp(10px, 1.05vw, 12.5px);
  line-height: 2;
  min-height: 4em;
  letter-spacing: 0.02em;
}
#home .h-dialog .who {
  position: absolute;
  top: -14px;
  left: 18px;
  background: var(--ink);
  color: var(--canvas2);
  font-family: var(--pixel);
  font-size: 8px;
  padding: 6px 9px 5px;
  border-radius: 6px;
  letter-spacing: 0.08em;
}
#home .h-dialog .nxt {
  position: absolute;
  right: 16px;
  bottom: 10px;
  color: var(--red);
  font-size: 12px;
  animation: h-bob 0.8s steps(2) infinite;
}
#home .h-dialog .pk-box {
  cursor: pointer;
}

/* ---------- loader ---------- */
#home .h-load {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity 0.5s;
  pointer-events: none;
}
#home .h-load.done {
  opacity: 0;
}
#home .h-load .spin {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid var(--ink);
  background: linear-gradient(var(--red) 0 45%, var(--ink) 45% 55%, var(--canvas2) 55%);
  position: relative;
  animation: h-wobble 1.1s ease-in-out infinite;
  box-shadow: 3px 3px 0 var(--ink);
}
#home .h-load .spin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--canvas2);
  border: 4px solid var(--ink);
  transform: translate(-50%, -50%);
}
#home .h-load .bar {
  width: min(260px, 60%);
  height: 14px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--canvas2);
  overflow: hidden;
}
#home .h-load .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(90deg, #58c058 0 8px, #48a848 8px 16px);
  transition: width 0.25s;
}
#home .h-load .txt {
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 0.06em;
  background: var(--canvas2);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 7px 10px 6px;
}

/* ---------- sheets (sections) ---------- */
#home .h-sheet {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) max(clamp(12px, 3vw, 40px), env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom))
    max(clamp(12px, 3vw, 40px), env(safe-area-inset-left));
  background: rgba(244, 239, 226, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: h-sheet-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
}
#home .h-sheet[hidden] {
  display: none;
}
#home .h-sheet.out {
  animation: h-sheet-out 0.2s ease both;
}
#home .h-sheet > .pk-box {
  flex: 0 1 auto;
  max-height: 100%;
  margin: auto !important;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
}
#home .h-sh-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px 20px;
  border-bottom: 3px solid var(--ink);
  background: var(--canvas);
  border-radius: 9px 9px 0 0;
  flex: none;
}
#home .h-sh-head h2 {
  margin: 0;
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(12px, 1.4vw, 16px);
  letter-spacing: 0.06em;
  flex: 1;
  min-width: 0;
}
#home .h-sh-head h2 small {
  display: block;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  margin-top: 6px;
}
#home .h-back {
  font-family: var(--pixel) !important;
  font-size: 10px !important;
  padding: 10px 14px;
  min-height: 44px;
  border: 2.5px solid var(--ink);
  border-radius: 22px;
  background: var(--canvas2);
  box-shadow: 2px 2px 0 var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
#home .h-back .k {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--canvas2);
  display: grid;
  place-items: center;
  font-size: 9px;
}
#home .h-back:hover {
  background: #fff;
}
#home .h-sh-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  -webkit-user-select: text;
  user-select: text;
}

/* ---------- TEAM: party ---------- */
#home .party {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: stretch;
}
#home .party .col {
  display: grid;
  gap: 14px;
  align-content: start;
}
#home .slot {
  position: relative;
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 132px;
  padding: 14px 16px 14px 12px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: visible;
}
#home .slot::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 11px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  pointer-events: none;
}
#home .slot:hover,
#home .slot.sel {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
#home .slot.sel {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
#home .slot.lead {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  min-height: 100%;
  padding: 18px 18px 20px;
}
#home .slot .pm {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
}
#home .slot.lead .pm {
  width: min(230px, 100%);
  height: 230px;
}
#home .slot .pm img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 0 rgba(31, 29, 43, 0.25));
  animation: h-idle 2.6s ease-in-out infinite;
}
#home .slot .pm .ph {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: linear-gradient(var(--red) 0 45%, var(--ink) 45% 55%, var(--canvas2) 55%);
  animation: h-wobble 1.1s ease-in-out infinite;
}
#home .slot .logo {
  position: absolute;
  right: -10px;
  top: -12px;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--canvas2);
  border: 3px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  display: grid;
  place-items: center;
  animation: h-float 3s ease-in-out infinite;
  z-index: 1;
}
#home .slot .logo svg {
  width: 32px;
  height: 32px;
}
#home .slot.lead .logo {
  right: 14px;
  top: 14px;
  width: 60px;
  height: 60px;
}
#home .slot .info,
#home .slot .nm {
  display: block;
  min-width: 0;
}
#home .sum-mon .pm {
  position: absolute;
  inset: 0;
  display: block;
}
#home .sum-top .acts svg {
  flex: none;
}
#home .slot .nm {
  font-family: var(--pixel);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-shadow: 2px 2px 0 rgba(31, 29, 43, 0.45);
  line-height: 1.4;
}
#home .slot.lead .nm {
  font-size: 16px;
  margin-top: 6px;
}
#home .slot .sub {
  font-family: var(--pixel);
  font-size: 8px;
  margin-top: 8px;
  opacity: 0.92;
  letter-spacing: 0.04em;
}
#home .slot .tl {
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 8px;
  line-height: 1.4;
  opacity: 0.95;
}
#home .hp {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--pixel);
  font-size: 7px;
  max-width: 260px;
}
#home .slot.lead .hp {
  margin: 12px auto 0;
  width: 100%;
}
#home .hp .b {
  flex: 1;
  height: 9px;
  border-radius: 6px;
  background: rgba(31, 29, 43, 0.55);
  border: 2px solid var(--ink);
  overflow: hidden;
}
#home .hp .b i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(#78e078, #48b048);
}
#home .hp em {
  font-style: normal;
  color: var(--hl);
}
#home .party-pc {
  margin-top: 22px;
}
#home .party-pc h3,
#home .sum h3,
#home .tc-time h3,
#home .map-info h3,
#home .gear h3 {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
  color: var(--red);
}
#home .pc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
#home .pc-card {
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: var(--canvas2);
  padding: 12px 12px 10px;
  box-shadow: 2px 2px 0 var(--ink);
  display: grid;
  gap: 6px;
}
#home .pc-card b {
  font-size: 14px;
}
#home .pc-card span {
  font-size: 12px;
  color: var(--muted);
}
#home .pc-card .lk {
  display: flex;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}
#home .pc-card .lk a {
  text-decoration: none;
  border-bottom: 2px solid var(--teal);
}
#home .pc-card .lk a:hover {
  color: var(--teal);
}
#home .party-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 14px;
}

/* ---------- TEAM: summary card ---------- */
#home .sum-wrap {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  padding: max(14px, env(safe-area-inset-top)) max(clamp(12px, 3vw, 40px), env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom))
    max(clamp(12px, 3vw, 40px), env(safe-area-inset-left));
}
#home .sum-wrap[hidden] {
  display: none;
}
#home .sum {
  --c1: #2f7fd1;
  --c2: #6ed3ff;
  position: relative;
  flex: 1;
  max-width: 1180px;
  margin: 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: h-card-in 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.08) both;
}
#home .sum.swap .sum-top > :not(.sum-mon),
#home .sum.swap .sum-body {
  animation: h-fade 0.28s ease both;
}
#home .sum.out {
  animation: h-card-out 0.22s ease both;
}
#home .sum-top {
  position: relative;
  padding: 18px 220px 18px 22px;
  background: linear-gradient(120deg, var(--c1), var(--c2));
  color: #fff;
  border-bottom: 3px solid var(--ink);
  border-radius: 9px 9px 0 0;
  min-height: 150px;
  flex: none;
}
#home .sum-top .tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
#home .sum-top .tabs span {
  font-family: var(--pixel);
  font-size: 8px;
  padding: 6px 8px 5px;
  border-radius: 6px;
  background: rgba(31, 29, 43, 0.35);
  letter-spacing: 0.06em;
}
#home .sum-top h2 {
  margin: 0;
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(16px, 2.2vw, 24px);
  text-shadow: 3px 3px 0 rgba(31, 29, 43, 0.45);
  letter-spacing: 0.03em;
  line-height: 1.35;
}
#home .sum-top p {
  margin: 10px 0 0;
  font-size: 15px;
  font-weight: 500;
  max-width: 640px;
  line-height: 1.45;
}
#home .sum-top .acts {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
#home .btn-pk {
  font-family: var(--pixel) !important;
  font-size: 9.5px !important;
  letter-spacing: 0.05em;
  text-decoration: none;
  padding: 12px 14px 11px;
  min-height: 44px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: var(--canvas2);
  color: var(--ink) !important;
  box-shadow: 3px 3px 0 var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.1s, box-shadow 0.1s;
}
#home .btn-pk:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
#home .btn-pk:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}
#home .btn-pk.go {
  background: var(--gold);
}
#home .btn-pk.red {
  background: var(--red);
  color: #fff !important;
}
#home .sum-mon {
  position: absolute;
  right: 18px;
  top: 14px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 62%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.35) 55%, rgba(255, 255, 255, 0) 70%);
  z-index: 2;
}
#home .sum-mon .portrait-canvas,
#home .sum-mon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#home .sum-mon .portrait-canvas {
  animation: h-fade 0.35s ease both;
}
#home .sum-mon .tag {
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--pixel);
  font-size: 8px;
  background: var(--canvas2);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 5px 7px 4px;
  z-index: 3;
}
#home .sum-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 22px;
  align-content: start;
  -webkit-user-select: text;
  user-select: text;
}
#home .sum-body section + section {
  margin-top: 0;
}
#home .sum-desc {
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 12px;
}
#home .sum-role {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink2);
  background: var(--hl);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 18px;
}
#home .sum-role b {
  font-family: var(--pixel);
  font-size: 8px;
  font-weight: 400;
  margin-right: 6px;
  color: var(--red);
}
#home .types {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}
#home .type {
  font-family: var(--pixel);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--t);
  border: 2px solid var(--ink);
  border-radius: 7px;
  padding: 6px 8px 5px;
  text-shadow: 1px 1px 0 rgba(31, 29, 43, 0.5);
  white-space: nowrap;
}
#home .moves {
  display: grid;
  gap: 8px;
}
#home .move {
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  box-shadow: 2px 2px 0 var(--ink);
}
#home .move b {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.04em;
}
#home .move .type {
  font-size: 7px;
  padding: 4px 6px 3px;
}
#home .move p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink2);
}
#home .arch {
  display: grid;
  gap: 0;
  counter-reset: a;
}
#home .arch-node {
  position: relative;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  padding: 9px 12px 9px 44px;
  box-shadow: 2px 2px 0 var(--ink);
}
#home .arch-node::before {
  counter-increment: a;
  content: counter(a);
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c1, var(--sky));
  color: #fff;
  font-family: var(--pixel);
  font-size: 8px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
}
#home .arch-node b {
  display: block;
  font-size: 13.5px;
}
#home .arch-node span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
#home .arch-arrow {
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
}
#home .stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}
#home .stat {
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--canvas);
  padding: 8px 10px;
  min-width: 0;
}
#home .stat span {
  display: block;
  font-family: var(--pixel);
  font-size: 7px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
#home .stat b {
  display: block;
  font-size: 15px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
#home .sum-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}
#home .sum-foot {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 3px solid var(--ink);
  background: var(--canvas);
  border-radius: 0 0 9px 9px;
}
#home .sum-foot .dots {
  display: flex;
  gap: 8px;
}
#home .sum-foot .dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--canvas2);
}
#home .sum-foot .dots i.on {
  background: var(--red);
}
#home .fly {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  object-fit: contain;
  transition: all 0.55s cubic-bezier(0.3, 0.9, 0.25, 1);
  filter: drop-shadow(0 8px 0 rgba(31, 29, 43, 0.25));
}

/* ---------- JOURNEY: trainer card ---------- */
#home .tc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
#home .tcard {
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: linear-gradient(160deg, #f9d77a, #f2b84a 60%, #e59a3a);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 14px;
  position: relative;
  overflow: hidden;
}
#home .tcard::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 24px solid rgba(255, 255, 255, 0.18);
  pointer-events: none;
}
#home .tcard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--pixel);
  font-size: 9px;
  padding: 4px 4px 12px;
  letter-spacing: 0.06em;
}
#home .tcard-in {
  background: var(--canvas2);
  border: 3px solid var(--ink);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
  padding: 14px;
  position: relative;
  z-index: 1;
}
#home .tcard dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  align-content: start;
}
#home .tcard dt {
  font-family: var(--pixel);
  font-size: 8px;
  color: var(--muted);
  padding-top: 3px;
  letter-spacing: 0.04em;
}
#home .tcard dd {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 2px dotted rgba(31, 29, 43, 0.3);
  padding-bottom: 6px;
  min-width: 0;
  overflow-wrap: anywhere;
}
#home .tcard .ava {
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: linear-gradient(#bfe3f0, #e9f4ee);
  aspect-ratio: 8 / 9;
  overflow: hidden;
  display: grid;
  place-items: end center;
}
#home .tcard .ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#home .badges {
  margin-top: 12px;
  background: var(--canvas2);
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 12px;
  position: relative;
  z-index: 1;
}
#home .badges .lbl {
  font-family: var(--pixel);
  font-size: 8px;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: 0.06em;
}
#home .badges ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
#home .badges li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--pixel);
  font-size: 7.5px;
  letter-spacing: 0.03em;
  min-width: 0;
}
#home .badge {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: radial-gradient(circle at 35% 30%, #fff 0 12%, var(--b) 13%);
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 12px;
  font-family: var(--body);
  box-shadow: 1px 1px 0 var(--ink);
}
#home .tc-about {
  font-size: 14px;
  line-height: 1.6;
  margin: 16px 2px 0;
}
#home .chapters {
  display: grid;
  gap: 14px;
}
#home .chap {
  position: relative;
  padding: 16px 16px 14px;
}
#home .chap .ch {
  font-family: var(--pixel);
  font-size: 8px;
  color: var(--red);
  letter-spacing: 0.08em;
}
#home .chap h4 {
  margin: 8px 0 2px;
  font-size: 17px;
}
#home .chap .org {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
#home .chap .when {
  position: absolute;
  right: 14px;
  top: 14px;
  font-family: var(--pixel);
  font-size: 8px;
  background: var(--ink);
  color: var(--canvas2);
  border-radius: 6px;
  padding: 5px 7px 4px;
}
#home .chap p {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
}

/* ---------- SKILLS: region map ---------- */
#home .map {
  position: relative;
  border: 3px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  background: #9fd38c;
  box-shadow: 4px 4px 0 var(--ink);
  aspect-ratio: 16 / 8;
  min-height: 260px;
}
#home .map svg.land {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#home .town {
  position: absolute;
  transform: translate(-50%, -100%);
  border: 0;
  background: none;
  padding: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  z-index: 2;
}
#home .town .roof {
  width: 54px;
  height: 46px;
  display: block;
  filter: drop-shadow(2px 2px 0 var(--ink));
  transition: transform 0.15s;
}
#home .town:hover .roof,
#home .town.on .roof {
  transform: translateY(-4px) scale(1.06);
}
#home .town .lbl {
  font-family: var(--pixel);
  font-size: 7.5px;
  background: var(--canvas2);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 5px 6px 4px;
  white-space: nowrap;
  letter-spacing: 0.03em;
}
#home .town.on .lbl {
  background: var(--gold);
}
#home .walker {
  position: absolute;
  z-index: 3;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -100%);
  pointer-events: none;
  transition: margin 0.25s ease;
}
#home .walker .bodyw {
  width: 100%;
  height: 100%;
  display: block;
}
#home .walker.walking .bodyw {
  animation: h-walk 0.28s steps(2) infinite;
}
#home .sk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
  gap: 18px;
  align-items: start;
}
#home .map-side {
  display: grid;
  gap: 12px;
}
#home .map-ctrl {
  grid-template-columns: 1fr 1fr;
}
#home .map-ctrl .btn-pk {
  justify-content: center;
}
#home .map-info {
  padding: 16px 18px;
  min-height: 140px;
}
#home .map-info h4 {
  margin: 0 0 4px;
  font-size: 18px;
}
#home .map-info .kind {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
#home .map-ctrl {
  display: grid;
  gap: 10px;
}
#home .map-all {
  margin-top: 22px;
}
#home .map-all ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
#home .map-all li {
  font-size: 13px;
  line-height: 1.55;
  border-left: 4px solid var(--t);
  padding-left: 10px;
}
#home .map-all li b {
  display: block;
  font-size: 13.5px;
}

/* ---------- CONTACT: Poké Gear ---------- */
#home .gear {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 22px;
  align-items: start;
}
#home .gear-dev {
  border: 3px solid var(--ink);
  border-radius: 26px;
  background: linear-gradient(160deg, #3f7fd8, #2a5db3);
  padding: 18px;
  box-shadow: 5px 5px 0 var(--ink);
}
#home .gear-scr {
  background: #d8f0c8;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 16px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.45);
}
#home .gear-scr .hd {
  font-family: var(--pixel);
  font-size: 9px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  letter-spacing: 0.06em;
}
#home .gear-links {
  display: grid;
  gap: 10px;
}
#home .gear-link {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  background: var(--canvas2);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 56px;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
}
#home .gear-link:hover,
#home .gear-link:focus-visible {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
  background: #fff;
}
#home .gear-link .gi {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  background: var(--gb, var(--teal));
  color: #fff;
}
#home .gear-link .gi svg {
  width: 22px;
  height: 22px;
}
#home .gear-link b {
  display: block;
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.05em;
}
#home .gear-link span {
  display: block;
  font-size: 13px;
  margin-top: 5px;
  color: var(--ink2);
  overflow-wrap: anywhere;
}
#home .gear-link .ar {
  font-family: var(--pixel);
  font-size: 10px;
  color: var(--red);
}
#home .gear-btns {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
}
#home .gear-btns i {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: #1f3f7a;
}
#home .gear-btns i:first-child {
  background: var(--red);
}
#home .mail {
  padding: 18px;
}
#home .mail form {
  display: grid;
  gap: 12px;
}
#home .mail label {
  display: grid;
  gap: 6px;
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.05em;
}
#home .mail input,
#home .mail textarea {
  font: 500 15px var(--body);
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  -webkit-user-select: text;
  user-select: text;
  width: 100%;
}
#home .mail textarea {
  min-height: 120px;
  resize: vertical;
}
#home .mail input:focus,
#home .mail textarea:focus {
  outline: 3px solid var(--sky);
  outline-offset: 1px;
}
#home .mail .hp-trap {
  position: absolute;
  left: -9999px;
}
#home .mail .row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
#home .mail .msg {
  font-family: var(--pixel);
  font-size: 9px;
  line-height: 1.8;
  color: var(--teal);
  min-height: 1.8em;
}
#home .mail .msg.err {
  color: var(--red);
}
#home .tz {
  margin: 14px 2px 0;
  font-size: 13px;
  color: var(--ink2);
}

/* ---------- CLASSIC VIEW ---------- */
#home .classic .h-sh-body {
  padding: clamp(18px, 4vw, 48px);
  background: #fff;
}
#home .cv {
  max-width: 820px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.6;
  color: #1f1d2b;
}
#home .cv h1 {
  font-size: clamp(30px, 5vw, 42px);
  margin: 0;
  line-height: 1.1;
}
#home .cv .lead {
  font-size: 17px;
  color: #3b3848;
  margin: 6px 0 14px;
}
#home .cv h2 {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin: 34px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid #eee8da;
}
#home .cv h3 {
  font-size: 18px;
  margin: 0;
}
#home .cv .meta {
  color: #66626f;
  font-size: 14px;
}
#home .cv .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-weight: 700;
  margin-bottom: 14px;
}
#home .cv .links a,
#home .cv a {
  color: #1d6fb8;
}
#home .cv .proj,
#home .cv .job {
  margin-bottom: 22px;
}
#home .cv ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
#home .cv .stack {
  color: #3b3848;
  font-size: 14px;
  margin-top: 6px;
}
#home .cv .skills dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0;
}
#home .cv .skills dt {
  font-weight: 700;
}
#home .cv .skills dd {
  margin: 0;
}
#home .cv .fine {
  margin-top: 40px;
  font-size: 12px;
  color: #66626f;
}

/* ---------- keyframes ---------- */
@keyframes h-fade {
  from {
    opacity: 0;
  }
}
@keyframes h-nudge {
  50% {
    transform: translateX(3px);
  }
}
@keyframes h-bob {
  50% {
    transform: translateY(3px);
  }
}
@keyframes h-wobble {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-14deg);
  }
  75% {
    transform: rotate(14deg);
  }
}
@keyframes h-float {
  50% {
    transform: translateY(-6px) rotate(-4deg);
  }
}
@keyframes h-idle {
  50% {
    transform: translateY(-4px) scale(1.01, 0.99);
  }
}
@keyframes h-walk {
  50% {
    transform: translateY(-3px);
  }
}
@keyframes h-sheet-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
}
@keyframes h-sheet-out {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes h-card-in {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.96);
  }
}
@keyframes h-card-out {
  to {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

/* ---------- responsive: tablets / portrait / phones ---------- */
@media (max-width: 1100px) {
  #home .sum-body {
    grid-template-columns: 1fr;
  }
  #home .tc,
#home .gear {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px), (orientation: portrait) {
  #home {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #home .h-wrap {
    position: relative;
    inset: auto;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  #home .h-scrim {
    position: fixed;
  }
  #home .h-grain {
    position: fixed;
  }
  #home .h-stage {
    flex: 1 0 auto;
    height: max(300px, 44dvh);
    margin: -6px -16px -26px;
  }
  #home .h-dialog {
    margin-bottom: 4px;
  }
  #home .h-dialog .pk-box {
    max-width: none;
  }
  #home .h-menu {
    align-self: stretch;
  }
  #home .h-menu ul {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  #home .h-menu li:first-child {
    grid-column: 1 / -1;
  }
  #home .h-item {
    grid-template-columns: 12px 30px 1fr;
    gap: 6px;
    padding: 10px 8px;
    min-height: 60px;
    border: 2px solid rgba(31, 29, 43, 0.18);
  }
  #home .h-item.h-play {
    margin-bottom: 0;
  }
  #home .h-item b {
    font-size: 11px;
  }
  #home .h-item small {
    font-size: 11px;
  }
  #home .h-desc {
    display: none;
  }
  #home .h-keys {
    display: none;
  }
  #home .party {
    grid-template-columns: 1fr;
  }
  #home .slot.lead {
    grid-template-columns: 112px 1fr;
    justify-items: start;
    text-align: left;
    padding: 14px 16px 14px 12px;
  }
  #home .slot.lead .pm {
    width: 112px;
    height: 112px;
  }
  #home .slot.lead .nm {
    font-size: 13px;
    margin-top: 0;
  }
  #home .slot.lead .hp {
    margin: 10px 0 0;
  }
  #home .slot.lead .logo {
    right: -10px;
    top: -12px;
    width: 50px;
    height: 50px;
  }
  #home .sum-top {
    padding: 16px 16px 16px;
    padding-right: 150px;
    min-height: 140px;
  }
  #home .sum-mon {
    width: 132px;
    height: 132px;
    right: 8px;
    top: 10px;
  }
  #home .sum-top p {
    font-size: 13.5px;
  }
  #home .sk {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  #home .h-tools .lbl {
    display: none;
  }
  #home .sum-top .tabs span + span {
    display: none;
  }
  #home .town .lbl .w1 {
    display: none;
  }
  #home .town .roof {
    width: 44px;
    height: 38px;
  }
  #home .h-tools {
    gap: 6px;
  }
  #home .h-chip {
    padding: 8px 9px;
    font-size: 8px !important;
    min-height: 44px;
  }
  #home .h-brand {
    gap: 9px;
  }
  #home .h-ball {
    width: 32px;
    height: 32px;
  }
  #home .h-brand h1 {
    font-size: 25px;
  }
  #home .h-brand small {
    font-size: 6.5px;
  }
  #home .h-sheet,
#home .sum-wrap {
    padding-left: 8px;
    padding-right: 8px;
  }
  #home .h-sh-body,
#home .sum-body {
    padding: 14px;
  }
  #home .h-back .t {
    display: none;
  }
  #home .sum-top {
    padding-right: 16px;
    padding-top: 128px;
  }
  #home .sum-mon {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    top: 4px;
    width: 120px;
    height: 120px;
  }
  #home .sum-top .tabs {
    position: absolute;
    left: 12px;
    top: 12px;
    flex-direction: column;
  }
  #home .stats {
    grid-template-columns: 1fr 1fr 1fr;
  }
  #home .stat b {
    font-size: 13px;
  }
  #home .tcard-in {
    grid-template-columns: 1fr 100px;
  }
  #home .badges ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #home .map {
    aspect-ratio: auto;
    height: 300px;
  }
  #home .slot {
    grid-template-columns: 92px 1fr;
  }
  #home .slot .pm,
#home .slot.lead .pm {
    width: 92px;
    height: 92px;
  }
}
@media (max-height: 640px) and (min-width: 901px) and (orientation: landscape) {
  #home .h-item {
    min-height: 44px;
    padding: 6px 10px;
  }
  #home .h-item small {
    display: none;
  }
  #home .h-desc {
    display: none;
  }
  #home .h-dialog p {
    min-height: 2em;
    line-height: 1.8;
  }
}
@media (prefers-reduced-motion: reduce) {
  #home *,
#home *::before,
#home *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- landscape phones: duo left, compact menu right, no scrolling ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  #home {
    overflow: hidden;
  }
  #home .h-wrap {
    position: absolute;
    inset: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "top top"
      "stage menu"
      "foot foot";
    gap: 4px 14px;
    padding-top: max(8px, env(safe-area-inset-top));
  }
  #home .h-dialog {
    display: none;
  }
  #home .h-stage {
    height: auto;
    margin: -4px 0 -10px;
  }
  #home .h-menu {
    align-self: center;
  }
  #home .h-menu .pk-box {
    padding: 8px 8px 8px;
  }
  #home .h-menu .h-menu-title {
    padding: 0 8px 6px;
    font-size: 8px;
  }
  #home .h-menu ul {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  #home .h-item {
    grid-template-columns: 10px 26px 1fr;
    min-height: 46px;
    padding: 6px 6px;
  }
  #home .h-item.h-play {
    min-height: 48px;
  }
  #home .h-item .ico,
  #home .h-item .ico svg {
    width: 26px;
    height: 26px;
  }
  #home .h-item b {
    font-size: 10px;
  }
  #home .h-item small {
    display: none;
  }
  #home .h-item.h-play small {
    display: block;
    font-size: 10px;
    margin-top: 3px;
  }
  #home .h-foot {
    font-size: 8.5px;
    padding-top: 0;
  }
  #home .h-scrim {
    background:
      radial-gradient(40% 60% at 32% 55%, rgba(251, 248, 239, 0.6), rgba(251, 248, 239, 0) 100%),
      linear-gradient(90deg, rgba(244, 239, 226, 0.1), rgba(244, 239, 226, 0.1) 55%, rgba(244, 239, 226, 0.75));
  }
}

/* ---------- SKILLS: pixel-art overworld ---------- */
#home .pmap {
  position: relative;
  height: clamp(320px, 60vh, 560px);
  border: 3px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  background: #1f4226;
  box-shadow:
    inset 0 0 0 3px #fbf8ef,
    4px 4px 0 var(--ink);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
#home .pm-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: pointer;
}
#home .pm-loc {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 0.06em;
  background: var(--canvas2);
  border: 3px solid var(--ink);
  border-radius: 8px;
  padding: 10px 14px 9px;
  box-shadow:
    inset 0 0 0 2px var(--canvas2),
    inset 0 0 0 4px rgba(31, 154, 138, 0.5),
    2px 2px 0 var(--ink);
  transform: translateY(-160%);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  pointer-events: none;
}
#home .pm-loc.show {
  transform: none;
}
#home .pm-say {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  padding: 14px 40px 14px 18px;
  cursor: pointer;
}
#home .pm-say[hidden] {
  display: none;
}
#home .pm-say p {
  margin: 0;
  font-family: var(--pixel);
  font-size: 10px;
  line-height: 2;
  letter-spacing: 0.02em;
}
#home .pm-say .nxt {
  position: absolute;
  right: 14px;
  bottom: 10px;
  color: var(--red);
  font-size: 12px;
  animation: h-bob 0.8s steps(2) infinite;
}
#home .pm-pad,
#home .pm-a {
  display: none;
}
#home .pm-pad {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 126px;
  height: 126px;
}
#home .pm-pad button {
  position: absolute;
  width: 42px;
  height: 42px;
  border: 3px solid var(--ink);
  border-radius: 9px;
  background: rgba(251, 248, 239, 0.88);
  color: var(--ink);
  font-size: 13px;
  box-shadow: 2px 2px 0 var(--ink);
  touch-action: none;
}
#home .pm-pad [data-d="up"] {
  left: 42px;
  top: 0;
}
#home .pm-pad [data-d="left"] {
  left: 0;
  top: 42px;
}
#home .pm-pad [data-d="right"] {
  left: 84px;
  top: 42px;
}
#home .pm-pad [data-d="down"] {
  left: 42px;
  top: 84px;
}
#home .pm-a {
  position: absolute;
  left: 14px;
  bottom: 30px;
  z-index: 2;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--red);
  color: #fff;
  font-family: var(--pixel) !important;
  font-size: 14px !important;
  box-shadow: 2px 2px 0 var(--ink);
}
@media (pointer: coarse) {
  #home .pm-pad,
  #home .pm-a {
    display: block;
  }
}
#home .map-help {
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 2;
  color: var(--muted);
  margin: 2px 2px 0;
  letter-spacing: 0.04em;
}
@media (max-width: 560px) {
  #home .pmap {
    height: 340px;
  }
  #home .pm-say p {
    font-size: 9px;
  }
}
