:root {
  color-scheme: dark;
  font-family: 'PingFang SC', 'Microsoft YaHei UI', system-ui, sans-serif;
  color: #f2f4eb;
  background: #14221d;
  font-synthesis: none;
  --gold: #f4d187;
  --pale: #f2f4eb;
  --muted: #bdc9bd;
  --mint: #bce4aa;
  --glass: #15231def;
  --surface: #15231d;
  --line: #d8e9d333;
  --divider: #d8e9d320;
  --shadow: 0 8px 28px #0915104d;
  --radius: 14px;
  --numbers: 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { background: #14221d; }
button { color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.game-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  --pad: clamp(16px, 1.9vw, 32px);
  --top: max(var(--pad), env(safe-area-inset-top));
  --bottom: max(var(--pad), env(safe-area-inset-bottom));
  --left: max(var(--pad), env(safe-area-inset-left));
  --right: max(var(--pad), env(safe-area-inset-right));
  --hud-glass: linear-gradient(145deg, #22362bee, #101d19ee 76%);
  --hud-shadow: 0 8px 24px #07140e45, inset 0 1px #f0fbe70d;
  --hud-radius: 13px;
}

.game-frame:fullscreen { width: 100%; height: 100%; }
.game-frame:focus { outline: none; }
#game, .screen-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
#game { display: block; image-rendering: pixelated; }
#game.game-three { image-rendering: auto; touch-action: none; cursor: grab; }
.screen-shade {
  pointer-events: none;
  background: linear-gradient(0deg, #101e1bd9, #101e1b30 17%, transparent 34%),
    radial-gradient(ellipse at 53% 47%, transparent 34%, #152b2360 73%, #10221ed6 100%);
}
.shoulder-view .screen-shade {
  background: linear-gradient(0deg, #101e1999, transparent 24%),
    linear-gradient(180deg, #101e1955, transparent 22%);
}
.hud { position: absolute; z-index: 1; }
.aim-reticle {
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 1px 1px #081510) drop-shadow(0 0 1px #081510);
  --reticle-track: #eefff06b;
}
.aim-reticle::before, .aim-reticle::after {
  position: absolute;
  inset: 0;
  content: '';
  mask: radial-gradient(circle closest-side, transparent 78%, #000 82% 89%, transparent 93%);
}
.aim-reticle::before {
  --stamina-arc: calc(var(--reticle-stamina-level, 100%) / 4);
  background: conic-gradient(from 225deg, #b7efce var(--stamina-arc), var(--reticle-track) 0 25%, transparent 0);
}
.aim-reticle::after {
  --energy-arc-gap: calc(25% - var(--reticle-energy-level, 100%) / 4);
  background: conic-gradient(from 45deg, var(--reticle-track) var(--energy-arc-gap), var(--reticle-energy-color, #f7d188) 0 25%, transparent 0);
}
.aim-center { width: 2px; height: 2px; border-radius: 50%; background: #fcfff1; }
.aim-reticle.aligned .aim-center { width: 3px; height: 3px; border-radius: 0; background: #ffe7aa; transform: rotate(45deg); }

.navigation { top: var(--top); left: var(--left); display: grid; justify-items: start; gap: 12px; pointer-events: none; }
.location { display: flex; align-items: center; gap: 13px; }
.location-name { text-shadow: 0 2px 7px #11251c, 0 1px 3px #11251c; }
.location-name h1 { color: var(--pale); font-size: 22px; line-height: 1.2; font-weight: 750; letter-spacing: .03em; }
.location-name span { display: block; margin-top: 4px; color: #e0e8d7; font-size: 11px; letter-spacing: .11em; }

.minimap {
  position: relative;
  flex: none;
  width: 104px;
  aspect-ratio: 1;
  border: 1px solid #e8efd875;
  border-radius: 50%;
  padding: 4px;
  background: var(--hud-glass);
  box-shadow: var(--hud-shadow);
}
.map-disc { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 50%; border: 1px solid var(--line); background: #264838; }
.map-disc::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 11px 3px #182c27b5; }
.map-world { position: absolute; left: 50%; top: 50%; transform-origin: 0 0; background-size: 100% 100%; }
.map-target { position: absolute; width: 13px; height: 13px; transform: translate(-50%, -50%) rotate(45deg); background: #f5cf77; border: 3px solid #5b4932; }
.map-practice { position: absolute; width: 22px; height: 22px; transform: translate(-50%, -50%); border: 3px solid #ef9863; border-radius: 50%; background: #e47e4a36; }
.map-player {
  position: absolute;
  z-index: 1;
  width: 15px;
  height: 13px;
  left: 50%;
  top: 50%;
  background: #fff6d6;
  clip-path: polygon(100% 50%, 0 100%, 22% 50%, 0 0);
  filter: drop-shadow(0 0 2px #f9e8af);
}
.map-north { position: absolute; top: -5px; left: 50%; transform: translateX(-50%); display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--gold); font: 700 10px/1 var(--numbers); }

.quest, .controls, .utility, .weather-panel, .vitals {
  border: 1px solid var(--line);
  border-radius: var(--hud-radius);
  background: var(--hud-glass);
  box-shadow: var(--hud-shadow);
}
.quest { width: 212px; padding: 10px 11px; }
.controls { width: 158px; min-height: 0; margin-top: 3px; padding: 7px 8px; overflow: auto; scrollbar-width: thin; pointer-events: auto; }
.quest-title { display: flex; align-items: center; gap: 7px; }
.quest-title h2 { font-size: 13px; font-weight: 650; }
.quest-icon { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--gold); background: radial-gradient(circle, var(--gold) 0 2px, transparent 2.5px); }
.training-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 8px 0 0; padding-top: 7px; border-top: 1px solid var(--divider); }
.training-stats > div + div { padding-inline-start: 6px; border-inline-start: 1px solid var(--divider); }
.training-stats dt { color: var(--muted); font-size: 11px; white-space: nowrap; }
.training-stats dd { margin: 2px 0 0; color: var(--pale); font: 700 19px/1.1 var(--numbers); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#training-last { color: var(--gold); }

.speed-panel { margin-top: 7px; border-top: 1px solid var(--divider); }
.speed-panel summary, .weather-panel summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.speed-panel summary::-webkit-details-marker, .weather-panel summary::-webkit-details-marker { display: none; }
.speed-panel summary:focus-visible, .weather-panel summary:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 7px; }
.speed-panel summary::after, .weather-panel summary::after { content: ''; width: 6px; height: 6px; flex: none; border-inline-end: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: translateY(-2px) rotate(45deg); }
.speed-panel summary { min-height: 29px; margin-inline: -5px; padding-inline: 5px; font-size: 11px; }
.speed-panel summary:hover, .weather-panel summary:hover { background: #d5e7d00a; border-radius: 8px; }
.speed-panel summary::after { transform: translateY(2px) rotate(225deg); }
.speed-panel[open] summary::after { transform: translateY(-2px) rotate(45deg); }
.speed-label { margin-inline-end: auto; white-space: nowrap; }
.speed-reading { color: var(--muted); font-size: 11px; white-space: nowrap; }
.speed-reading strong { margin-inline-end: 3px; color: var(--mint); font: 700 16px/1 var(--numbers); font-variant-numeric: tabular-nums; }
.speed-panel-body { position: absolute; z-index: 1; inset: auto -1px calc(100% + 8px); max-height: min(196px, 34dvh); overflow: auto; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--hud-radius); background: var(--surface); box-shadow: var(--hud-shadow); }
.speed-panel-body h3 { margin-bottom: 5px; font-size: 12px; font-weight: 650; }
#speed-chart { display: block; width: 100%; height: auto; }
.speed-timing { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
#render-fps { color: var(--pale); font: 600 12px var(--numbers); font-variant-numeric: tabular-nums; }
.render-info { display: grid; gap: 2px; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
#render-backend { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.right-hud { z-index: 2; inset: var(--top) var(--right) var(--bottom) auto; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.world-tools { flex: none; display: grid; justify-items: end; gap: 7px; }
.world-tools > * { pointer-events: auto; }
.weather-panel { width: 175px; font-size: 12px; }
.weather-panel summary { min-height: 35px; padding: 4px 11px; }
.weather-panel[open] summary::after { transform: translateY(2px) rotate(225deg); }
.weather-panel summary strong { margin-inline-start: auto; color: var(--gold); font-weight: 650; }
.weather-icon { width: 12px; height: 12px; flex: none; border: 1px solid var(--gold); border-radius: 50%; background: radial-gradient(circle, var(--gold) 0 2px, transparent 2.5px); }
.game-frame[data-weather='rain'] .weather-icon { border-color: #a4d9ed; border-radius: 65% 32% 65% 65%; transform: rotate(-35deg); background: #a4d9ed36; }
.game-frame[data-weather='dry'] .weather-icon { border-radius: 3px; border-color: #f3b77d; transform: rotate(45deg); background: #f3b77d30; }
.weather-readings { display: grid; gap: 4px; margin: 0 11px 8px; padding-top: 8px; border-top: 1px solid var(--divider); }
.weather-readings div { display: flex; justify-content: space-between; gap: 5px; color: var(--muted); }
.weather-readings dd { margin: 0; text-align: right; color: var(--pale); }
.weather-mode { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0 11px 9px; color: var(--muted); }
.weather-mode > span { white-space: nowrap; }
.weather-mode select { min-width: 0; min-height: 29px; padding: 2px 4px; background: #233329; color: var(--pale); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font: inherit; }
.game-frame[data-weather='rain'] .screen-shade { background-color: #2347591b; }
.game-frame[data-weather='dry'] .screen-shade { background-color: #d5953a0b; }

.utility { display: flex; align-items: center; gap: 3px; padding: 3px; }
.utility-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
}
.utility-button:hover, .pokedex-toggle:hover, .direction-pad button:active { background: #c8debf1a; }
.pokedex-toggle { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 9px; border: 0; border-radius: 8px; color: var(--pale); background: transparent; font-size: 13px; }
.book-icon { width: 14px; height: 12px; border: 1px solid currentColor; border-radius: 2px; background: linear-gradient(90deg, transparent calc(50% - .5px), currentColor 0 calc(50% + .5px), transparent 0); }
.pokedex-toggle kbd { height: 17px; min-width: 17px; padding-inline: 3px; }
.three-tools { display: flex; gap: 5px; }
.touch-camera-hint { display: none; }
.three-button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 32px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--hud-glass); color: var(--pale); font-size: 12px; white-space: nowrap; }
.three-button::before { content: ''; flex: 0 0 6px; height: 6px; border: 1px solid var(--muted); border-radius: 50%; }
.three-button:hover:not(:disabled), .three-button[aria-pressed='true'] { background: #2d4136; border-color: #dbebd384; }
.three-button[aria-pressed='true']::before { border-color: var(--mint); background: var(--mint); box-shadow: 0 0 8px #aee2a560; }
.three-button:disabled { cursor: default; }
.three-warning { max-width: min(250px, 51vw); padding: 7px 10px; border-radius: 8px; background: var(--glass); font-size: 12px; }
.reset-icon { font: 23px/1 system-ui, sans-serif; }
.fullscreen-icon {
  width: 15px;
  height: 15px;
  --stroke: linear-gradient(currentColor, currentColor);
  background:
    var(--stroke) top left / 5px 1.5px, var(--stroke) top left / 1.5px 5px,
    var(--stroke) top right / 5px 1.5px, var(--stroke) top right / 1.5px 5px,
    var(--stroke) bottom left / 5px 1.5px, var(--stroke) bottom left / 1.5px 5px,
    var(--stroke) bottom right / 5px 1.5px, var(--stroke) bottom right / 1.5px 5px;
  background-repeat: no-repeat;
}

.keyboard-guide { display: grid; gap: 2px; margin: 0; font-size: 11px; line-height: 1.25; }
.keyboard-guide > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 7px; }
.keyboard-guide dt { display: flex; align-items: center; }
.keyboard-guide dd { margin: 0; color: var(--pale); white-space: nowrap; }
#camera-guide { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--divider); color: var(--muted); font-size: 10px; line-height: 1.35; }
.keys { display: flex; gap: 3px; }
kbd { display: inline-grid; place-items: center; height: 20px; min-width: 19px; padding-inline: 4px; border: 1px solid var(--line); border-radius: 4px; background: #b3c9af13; box-shadow: inset 0 -1px #0b1816b8; color: var(--pale); font: 650 11px var(--numbers); }
.keyboard-guide .keys { gap: 2px; }
.keyboard-guide kbd { height: 17px; min-width: 16px; padding-inline: 3px; font-size: 10px; }
.direction-pad { display: none; }

.player-status { z-index: 2; bottom: var(--bottom); left: var(--left); }
.notifications { left: 50%; bottom: calc(var(--bottom) + 62px); transform: translateX(-50%); text-align: center; pointer-events: none; }
.notifications p { width: max-content; max-width: min(39vw, 450px); padding: 6px 11px; color: var(--pale); background: #15231dd9; border: 1px solid var(--divider); border-radius: 8px; font-size: 12px; line-height: 1.5; }
.notifications p:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.vitals { position: relative; width: min(292px, calc(100vw - var(--left) - var(--right))); padding: 8px 10px 1px; --energy-accent: #f7d188; }
.vitals-header { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--divider); }
.vitals-portrait { display: block; width: 35px; height: 35px; flex: none; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: radial-gradient(ellipse at center, color-mix(in srgb, var(--energy-accent) 23%, #243329), #243329 81%); }
.vitals-header h2 { font-size: 16px; font-weight: 750; line-height: 1.2; }
#vitals-type { margin-top: 2px; color: var(--energy-accent); font-size: 10px; }
#seed-heal { margin-inline-start: auto; color: var(--mint); font-size: 11px; font-weight: 700; text-align: end; }
.vital-meters { display: grid; gap: 6px; padding-top: 7px; }
.vital-meter { display: grid; grid-template-columns: 34px minmax(12px, 1fr) 53px 88px; align-items: center; gap: 6px; font-size: 11px; }
.vital-hp { --vital-color: #f39a91; }
.vital-stamina { --vital-color: var(--mint); }
.vital-energy { --vital-color: var(--energy-accent); }
.vitals.healing .vital-hp { --vital-color: var(--mint); }
.vital-heading { display: contents; }
.vital-heading span { grid-area: 1 / 1; white-space: nowrap; }
.vital-heading strong { grid-area: 1 / 3; justify-self: end; color: var(--pale); font: 650 12px/1 var(--numbers); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vital-hp .vital-heading strong { font-size: 13px; }
.vital-recovery { display: flex; align-items: center; gap: 3px; color: var(--muted); font-size: 10px; line-height: 1.2; white-space: nowrap; }
.recovery-bonus { padding: 0 3px; border-radius: 3px; background: #bce4aa21; color: var(--mint); font: 650 10px/1.25 var(--numbers); }
.recovery-bonus[data-negative='true'] { background: #f7bd8526; color: #ffcb9c; }
.vital-meter progress { grid-area: 1 / 2; display: block; appearance: none; width: 100%; height: 4px; border: none; border-radius: 8px; overflow: hidden; color: var(--vital-color); background: #35433a; }
.vital-hp progress { height: 5px; }
.vital-meter progress::-webkit-progress-bar { background: #35433a; }
.vital-meter progress::-webkit-progress-value { border-radius: 8px; background: var(--vital-color); }
.vital-meter progress::-moz-progress-bar { border-radius: 8px; background: var(--vital-color); }

.ability {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  justify-items: end;
  gap: 7px;
  flex: none;
  margin-top: auto;
  --skill-size: 43px;
  --empty-skill-size: 24px;
  --slot-width: 64px;
  --skill-accent: #f7d188;
}
.ability-slots {
  position: relative;
  --ability-pad: 6px;
  display: grid;
  grid-template-columns: repeat(6, var(--slot-width));
  align-content: start;
  gap: 4px;
  max-width: calc(100vw - var(--left) - var(--right));
  padding: var(--ability-pad);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  border: 1px solid transparent;
  border-radius: 13px;
  isolation: isolate;
  pointer-events: auto;
}
.ability-slots::before {
  position: absolute;
  grid-area: 2 / 1 / 3 / -1;
  inset: -4px calc(-1 * var(--ability-pad)) calc(-1 * var(--ability-pad));
  z-index: -1;
  content: '';
  border: 1px solid #daeada35;
  border-radius: 12px;
  background: linear-gradient(154deg, #172923f5, #0e1a18ec 66%, #111d19ed);
  box-shadow: inset 0 1px #f9fff219;
}
.ability-slot {
  display: grid;
  grid-row: 2;
  grid-template-areas: "input" "icon" "caption";
  grid-template-rows: 23px var(--skill-size) 24px;
  align-items: center;
  justify-items: center;
  gap: 3px;
  padding: 3px 1px 4px;
  border: 1px solid transparent;
  border-radius: 8px;
}
.ability-slot:not(.ability-slot-empty) {
  border-color: #cfeddb13;
  background: linear-gradient(105deg, color-mix(in srgb, var(--skill-accent) 12%, #132520), #152421 88%);
}
.ability-slot:not(.ability-slot-empty):has(.ability-button:not(:disabled):is(:hover, :focus-visible)) { border-color: color-mix(in srgb, var(--skill-accent) 42%, #24372e); }
.ability-slot > :is(.mouse-hint, kbd) { grid-area: input; }
.ability-slot > :is(.ability-button, .ability-empty) { grid-area: icon; }
.ability-slot kbd {
  width: 24px;
  height: 22px;
  border: 1px solid #a5bfb756;
  border-radius: 5px;
  background: linear-gradient(#35483f, #1c2d27);
  box-shadow: 0 1px 0 #07110e, inset 0 -2px #112019, inset 0 1px #edf8e619;
  font-size: 13px;
}
.ability-slot-empty kbd { height: 21px; color: #adbfb4; border-color: #a5bfb72b; background: #b8d5c00b; box-shadow: inset 0 -1px #060c0a7f; }
.mouse-hint { position: relative; width: 17px; height: 22px; border: 1px solid #c6ded396; border-radius: 7px 7px 8px 8px; background: linear-gradient(#283b31, #14241e); box-shadow: 0 1px 0 #08130f; }
.mouse-hint::before { content: ''; position: absolute; top: 1px; width: 6px; height: 8px; background: linear-gradient(#effce7, var(--skill-accent)); }
.mouse-hint-left::before { left: 1px; border-radius: 5px 0 1px 1px; }
.mouse-hint-right::before { right: 1px; border-radius: 0 5px 1px 1px; }
.mouse-hint::after { content: ''; position: absolute; top: 10px; inset-inline: 1px; height: 1px; background: #aabaab68; }
.ability-empty { display: grid; place-items: center; width: var(--empty-skill-size); aspect-ratio: 1; border: 1px dashed #a9c9b955; border-radius: 50%; background: #0b171642; }
.ability-empty::before { content: ''; width: 6px; height: 1px; background: #a1beb170; }
.ability-caption { grid-area: caption; display: grid; justify-items: center; gap: 1px; color: var(--pale); font-size: 11px; font-weight: 700; line-height: 1.15; letter-spacing: .02em; white-space: nowrap; }
.ability-caption small { color: var(--muted); font-size: 9px; font-weight: 500; }
.ability-slot-empty .ability-caption { color: #b3c4ba; font-size: 10px; font-weight: 500; }
.skill-energy { grid-area: 1 / 3 / 2 / -1; padding: 4px 7px; border: 1px solid #a5bfb75c; border-radius: 6px; background: #0d1b18f0; --skill-energy-color: #f7d188; }
.skill-energy-label { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; margin-bottom: 5px; color: #c7d7c8; font-size: 11px; }
.skill-energy-label strong { color: var(--skill-energy-color); font: 700 11px/1 var(--numbers); font-variant-numeric: tabular-nums; }
.skill-energy-track { position: relative; display: block; height: 6px; overflow: hidden; border-radius: 1px; background: #52665b80; }
.skill-energy-track::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(5% - 1px), #081615 0 5%); }
.skill-energy-fill, .skill-energy-preview { position: absolute; inset-block: 0; }
.skill-energy-fill { left: 0; width: var(--skill-energy-level, 100%); background: linear-gradient(#fcffdd, var(--skill-energy-color) 32%); }
.skill-energy-preview { left: var(--skill-energy-after-cost, 100%); right: calc(100% - var(--skill-energy-level, 100%)); background: #f8fffd; }
.skill-energy.previewing .skill-energy-preview { animation: skill-energy-pulse .75s ease-in-out infinite alternate; }
.skill-energy.unaffordable .skill-energy-preview { background: #ff8f85; }
@keyframes skill-energy-pulse { from { opacity: .4; } to { opacity: 1; } }
[data-ability] .ability-button { touch-action: none; }
.touch-moves { display: none; }
.ability-button {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--skill-size);
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  isolation: isolate;
  background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--skill-accent) 21%, #223832), #0c1918 78%);
  box-shadow: inset 0 0 0 2px #101d1a, 0 2px 5px #060f0d86;
  touch-action: manipulation;
}
.ability-button:disabled { --skill-accent: #a8b5b2; color: var(--muted); cursor: default; }
.ability-button:not(:disabled, .charging, .depleted) { border-color: color-mix(in srgb, var(--skill-accent) 66%, #365048); box-shadow: inset 0 0 0 2px #101d1a, 0 0 6px color-mix(in srgb, var(--skill-accent) 21%, transparent); }
.ability-button:not(:disabled, .charging, .depleted)::before {
  content: '';
  position: absolute;
  inset: 1px;
  --edge-pixel: linear-gradient(var(--skill-accent), var(--skill-accent));
  background: var(--edge-pixel) center top / 4px 1px, var(--edge-pixel) center bottom / 4px 1px,
    var(--edge-pixel) left center / 1px 4px, var(--edge-pixel) right center / 1px 4px;
  background-repeat: no-repeat;
  opacity: .75;
}
.ability-button:not(:disabled):hover, .ability-button.casting { border-color: var(--skill-accent); }
.ability-button.casting { box-shadow: 0 0 12px color-mix(in srgb, var(--skill-accent) 34%, transparent); }
.ability-ring { position: absolute; z-index: 1; inset: 1px; border-radius: 50%; pointer-events: none; }
.ability-button.charging .ability-ring { background: conic-gradient(transparent var(--charge, 100%), #08131ae6 0); }
.ability-button.refilling .ability-ring {
  background: conic-gradient(var(--skill-accent) var(--charge, 0%), #142923 0);
  mask-image: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
}
.skill-icon {
  width: 24px;
  height: 33px;
  scale: .71;
  --icon-color: var(--skill-accent);
  background: linear-gradient(150deg, color-mix(in srgb, var(--icon-color) 59%, #fff) 4%, var(--icon-color) 62%, color-mix(in srgb, var(--icon-color) 80%, #526c5e));
  clip-path: polygon(54% 0, 94% 0, 64% 38%, 100% 38%, 31% 100%, 44% 58%, 0 58%);
}
#dodge-ability { --skill-accent: #a5d9c3; }
[data-skill='dodge'] .skill-icon { width: 35px; height: 25px; clip-path: polygon(0 18%, 31% 18%, 51% 50%, 31% 82%, 0 82%, 20% 50%, 0 18%, 44% 18%, 76% 18%, 100% 50%, 76% 82%, 44% 82%, 65% 50%, 44% 18%); }
.ability-slot[data-skill='vine'] .skill-icon { clip-path: polygon(100% 5%, 100% 35%, 85% 62%, 54% 74%, 37% 72%, 14% 100%, 0 88%, 24% 65%, 15% 50%, 23% 29%, 53% 12%); }
.ability-slot[data-skill='ember'] .skill-icon { clip-path: polygon(58% 0, 62% 35%, 81% 27%, 97% 58%, 94% 78%, 78% 96%, 51% 100%, 19% 93%, 3% 74%, 9% 53%, 28% 31%, 34% 56%, 48% 36%); }
.ability-slot[data-skill='water'] .skill-icon { clip-path: polygon(50% 0, 66% 25%, 87% 47%, 100% 69%, 92% 87%, 74% 100%, 27% 100%, 8% 87%, 0 69%, 13% 47%, 34% 25%); }
[data-skill='quick-attack'] .skill-icon { width: 37px; height: 26px; clip-path: polygon(0 20%, 57% 20%, 45% 0, 100% 48%, 39% 100%, 52% 68%, 12% 68%, 33% 49%, 0 49%, 18% 35%); }
[data-skill='electro-ball'] .skill-icon {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  clip-path: none;
  background: radial-gradient(circle at 40% 35%, #fffde8 0 13%, var(--icon-color) 25% 42%, #a5a874 56%, var(--icon-color) 68%, #fffde8 75%, transparent 77%);
}
[data-skill='thunder-wave'] .skill-icon {
  width: 33px;
  height: 30px;
  background: linear-gradient(150deg, #fff9cd, var(--icon-color) 64%, #f6aa4c);
  clip-path: polygon(0 46%, 75% 0, 100% 20%, 100% 80%, 75% 100%, 0 54%);
  mask: repeating-radial-gradient(circle at 8% 50%, #000 0 2px, transparent 2.5px 6px, #000 6.5px 8px);
}
[data-skill='thunderbolt'] .skill-icon { position: relative; width: 35px; height: 35px; clip-path: none; background: none; }
[data-skill='thunderbolt'] .skill-icon::before, [data-skill='thunderbolt'] .skill-icon::after {
  position: absolute;
  content: '';
  background: linear-gradient(145deg, #fffce4, var(--icon-color) 55%);
}
[data-skill='thunderbolt'] .skill-icon::before { inset: 0 7px; clip-path: polygon(48% 0%, 100% 0%, 66% 38%, 98% 38%, 29% 100%, 43% 59%, 0 59%); }
[data-skill='thunderbolt'] .skill-icon::after { inset: 9px 1px; clip-path: polygon(0 41%, 22% 11%, 17% 52%, 32% 52%, 8% 84%, 15% 41%, 0 41%, 71% 43%, 99% 10%, 90% 53%, 100% 53%, 77% 87%, 85% 43%, 71% 43%); }
[data-skill='flamethrower'] .skill-icon { width: 38px; height: 27px; clip-path: polygon(0 46%, 31% 20%, 47% 27%, 66% 0, 61% 32%, 74% 31%, 100% 10%, 87% 45%, 100% 66%, 84% 89%, 56% 100%, 22% 83%, 0 65%, 32% 72%, 55% 63%, 64% 47%, 41% 61%, 17% 55%); }
[data-skill='water-jet'] .skill-icon { width: 37px; height: 25px; clip-path: polygon(0 52%, 32% 27%, 61% 27%, 90% 0, 83% 28%, 100% 32%, 82% 57%, 56% 71%, 29% 67%, 0 88%, 16% 69%, 53% 57%, 70% 44%, 40% 47%); }
[data-skill='seed'] .skill-icon { width: 25px; height: 28px; border-radius: 79% 21% 66% 34% / 68% 31% 69% 32%; clip-path: none; transform: rotate(12deg); box-shadow: inset 3px -3px #5d9045; }
[data-skill='flame-charge'] .skill-icon { width: 37px; height: 28px; clip-path: polygon(0 57%, 46% 34%, 37% 12%, 65% 24%, 82% 0, 100% 40%, 90% 74%, 71% 100%, 54% 73%, 36% 88%, 40% 67%); }
[data-skill='will-o-wisp'] .skill-icon { --icon-color: #beadfa; width: 32px; height: 33px; clip-path: polygon(59% 0, 65% 29%, 83% 24%, 79% 45%, 100% 62%, 87% 91%, 61% 100%, 23% 92%, 6% 73%, 27% 49%, 33% 65%, 54% 41%, 46% 26%); }
[data-skill='fire-blast'] .skill-icon { width: 37px; height: 36px; clip-path: polygon(54% 0, 66% 32%, 96% 22%, 81% 50%, 100% 68%, 71% 70%, 80% 100%, 51% 82%, 23% 100%, 31% 68%, 0 70%, 19% 46%, 7% 23%, 39% 32%); }
[data-skill='aqua-jet'] .skill-icon { width: 37px; height: 26px; clip-path: polygon(0 34%, 37% 39%, 70% 15%, 91% 0, 95% 31%, 100% 56%, 77% 72%, 52% 75%, 29% 100%, 34% 69%, 8% 74%, 24% 55%); }
[data-skill='protect'] .skill-icon { width: 31px; height: 34px; clip-path: polygon(50% 0, 93% 16%, 89% 64%, 74% 83%, 50% 100%, 24% 83%, 10% 64%, 7% 16%, 22% 24%, 24% 61%, 50% 84%, 76% 61%, 78% 25%, 50% 15%, 22% 24%, 7% 16%); }
[data-skill='hydro-pump'] .skill-icon { width: 39px; height: 30px; clip-path: polygon(0 39%, 35% 37%, 58% 25%, 62% 5%, 74% 18%, 90% 0, 87% 29%, 100% 39%, 89% 60%, 99% 86%, 71% 78%, 54% 100%, 55% 71%, 33% 63%, 0 62%); }
[data-skill='bullet-seed'] .skill-icon { width: 37px; height: 30px; clip-path: none; background: radial-gradient(ellipse 18% 22% at 22% 69%, var(--icon-color) 84%, transparent 91%), radial-gradient(ellipse 20% 25% at 49% 46%, var(--icon-color) 85%, transparent 93%), radial-gradient(ellipse 20% 25% at 77% 24%, var(--icon-color) 85%, transparent 93%); }
[data-skill='razor-leaf'] .skill-icon { width: 36px; height: 31px; clip-path: polygon(3% 100%, 23% 63%, 15% 39%, 44% 35%, 50% 7%, 100% 0, 89% 51%, 63% 56%, 47% 81%, 29% 71%, 13% 100%); }
[data-skill='solar-beam'] .skill-icon { --icon-color: #f2db7c; width: 37px; height: 35px; clip-path: polygon(47% 0%, 57% 29%, 86% 13%, 70% 42%, 100% 51%, 70% 61%, 87% 90%, 58% 75%, 48% 100%, 38% 75%, 9% 88%, 26% 60%, 0 51%, 28% 42%, 11% 13%, 39% 29%); }
.skill-state { position: absolute; z-index: 2; color: #f7faf5; font: 650 10px/1.1 system-ui, sans-serif; text-shadow: 0 1px 3px #081214; white-space: nowrap; opacity: 0; }
.ability-button.charging .skill-icon { opacity: .44; }
.ability-button.charging .skill-state { font: 750 16px/1 var(--numbers); opacity: 1; }
.ability-button.casting .skill-state { bottom: 3px; opacity: 1; }
.ability-slot[data-skill='bullet-seed'] .ability-button:not(.charging) .skill-state { bottom: 3px; opacity: 1; }
.ability-button.depleted:not(.charging) .skill-icon, .ability-button:disabled .skill-icon { opacity: .67; --icon-color: color-mix(in srgb, var(--skill-accent) 48%, #94aebe); }
.ability-button.shortage:not(.charging, :disabled)::after {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 5px;
  height: 5px;
  content: '';
  border-radius: 1px;
  background: #ff9d93;
  box-shadow: 0 0 7px 2px #e0524fab;
  animation: skill-energy-pulse .9s ease-in-out infinite alternate;
}
@media (prefers-reduced-motion: reduce) {
  .skill-energy.previewing .skill-energy-preview, .ability-button.shortage:not(.charging, :disabled)::after { animation: none; }
}

.pokedex {
  width: min(710px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 24px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--pale);
  background: var(--surface);
  box-shadow: 0 20px 75px #0a1714a8;
}
.pokedex::backdrop { background: #0d1714b5; backdrop-filter: blur(5px); }
.pokedex-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.pokedex-header h2 { color: var(--pale); font-size: clamp(21px, 3vw, 28px); font-weight: 700; }
.pokedex-header p { margin-top: 6px; color: var(--muted); font-size: 13px; }
.pokedex-close { border-color: var(--line); font: 24px/1 system-ui, sans-serif; }
.pokedex-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.pokedex-card { position: relative; display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 10px 12px; min-width: 0; padding: 12px; text-align: left; border: 1px solid var(--line); border-radius: 12px; color: var(--pale); background: #1d2c24; }
.pokedex-card:hover, .pokedex-card[aria-pressed='true'] { border-color: color-mix(in srgb, var(--species-accent) 72%, #35433a); background: #26382c; }
.pokedex-art { display: grid; height: 78px; place-items: center; overflow: hidden; border: 1px solid var(--divider); border-radius: 9px; background: radial-gradient(ellipse at 50% 55%, color-mix(in srgb, var(--species-accent) 24%, #25352a), #26362b); }
.pokedex-portrait { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; filter: drop-shadow(0 2px 1px #14261c70); }
.pokedex-details { display: grid; gap: 4px; min-width: 0; }
.pokedex-number { display: flex; align-items: center; gap: 6px; font: 600 11px var(--numbers); letter-spacing: .065em; color: var(--muted); }
.pokedex-number kbd { height: 15px; min-width: 15px; font-size: 10px; }
.pokedex-details strong { color: var(--pale); font-size: 17px; }
.pokedex-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.pokedex-meta > span:first-child { color: var(--species-accent); }
.pokedex-skill { display: flex; grid-column: 1 / -1; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; padding-top: 8px; border-top: 1px solid var(--divider); color: var(--muted); font-size: 12px; }
.pokedex-skill strong { color: var(--species-accent); }
.pokedex-status { position: absolute; top: 12px; right: 11px; padding: 2px 6px; border-radius: 5px; color: var(--muted); font-size: 11px; }
.pokedex-card[aria-pressed='true'] .pokedex-status { color: var(--species-accent); background: #101d1666; }

@media (pointer: fine) {
  .navigation { gap: 9px; }
  .location { gap: 11px; }
  .location-name h1 { font-size: 20px; }
  .minimap { width: 96px; }
  .quest { width: 192px; padding: 8px 9px; }
  .training-stats { margin-top: 6px; padding-top: 6px; }
  .training-stats dd { font-size: 17px; }
  .right-hud { gap: 7px; }
  .world-tools { gap: 5px; }
  .utility { gap: 2px; padding: 2px; }
  .utility .utility-button { width: 32px; height: 32px; }
  .pokedex-toggle { min-height: 32px; padding-inline: 7px; }
  .three-button { min-height: 29px; padding-inline: 8px; }
  .weather-panel { width: 165px; }
  .weather-panel summary { min-height: 31px; }
  .vitals { width: min(278px, calc(100vw - var(--left) - var(--right))); padding: 6px 9px 1px; }
  .vitals-header { padding-bottom: 5px; }
  .vitals-portrait { width: 31px; height: 31px; }
  .vital-meters { gap: 4px; padding-top: 6px; }
  .speed-panel { margin-top: 5px; }
  .speed-panel summary { min-height: 27px; }
  .ability { --skill-size: 39px; --slot-width: 58px; }
  .ability-slots { --ability-pad: 5px; gap: 3px; }
  .ability-slot { grid-template-rows: 21px var(--skill-size) 22px; gap: 2px; padding-block: 2px 3px; }
  .ability-slot kbd { width: 22px; height: 20px; font-size: 12px; }
  .mouse-hint { width: 16px; height: 20px; }
  .skill-energy { padding-block: 3px; }
  .skill-energy-label { margin-bottom: 4px; }
}

@media (max-width: 760px) {
  .game-frame { --pad: 13px; }
  .navigation { gap: 8px; }
  .location { gap: 9px; }
  .minimap { width: 78px; }
  .location-name h1 { font-size: 17px; }
  .location-name span { margin-top: 3px; font-size: 11px; }
  .quest { width: 184px; padding: 8px; }
  .training-stats { margin-top: 6px; padding-top: 5px; gap: 4px; }
  .training-stats > div + div { padding-inline-start: 4px; }
  .training-stats dt { font-size: 10px; }
  .training-stats dd { font-size: 16px; }
  .weather-panel { width: min(175px, 48vw); }
  .ability { --slot-width: 56px; }
  .vitals { padding-top: 7px; }
  .vitals-portrait { width: 30px; height: 30px; }
}

@media (pointer: coarse) {
  #mouse-look-toggle, .controls { display: none; }
  .touch-camera-hint { display: block; align-self: center; color: var(--pale); font-size: 11px; text-shadow: 0 1px 5px #102018; }
  .pokedex-toggle kbd { display: none; }
  .ability { --skill-size: 44px; }
  .player-status { bottom: calc(var(--bottom) + 101px); }
  .direction-pad { left: var(--left); bottom: var(--bottom); display: grid; grid-template-columns: repeat(3, 44px); gap: 4px; pointer-events: none; }
  .direction-pad button { width: 44px; height: 44px; touch-action: none; pointer-events: auto; border: 1px solid var(--line); border-radius: 10px; color: var(--pale); background: var(--hud-glass); box-shadow: var(--hud-shadow); }
  .direction-pad [data-direction='up'] { grid-area: 1 / 2; }
  .direction-pad [data-direction='left'] { grid-area: 2 / 1; }
  .direction-pad [data-direction='down'] { grid-area: 2 / 2; }
  .direction-pad [data-direction='right'] { grid-area: 2 / 3; }
  .touch-moves { display: flex; gap: 5px; pointer-events: auto; }
  .touch-moves button { min-width: 44px; height: 36px; padding: 0 5px; touch-action: none; border: 1px solid var(--line); border-radius: 8px; background: var(--hud-glass); color: var(--pale); font-size: 12px; }
  .speed-panel summary { min-height: 35px; }
}

@media (max-width: 530px) {
  .location { gap: 7px; }
  .location-name h1 { font-size: 15px; }
  .location-name span { display: none; }
  .minimap { width: 63px; padding: 3px; }
  .quest { width: 166px; }
  .ability { --slot-width: clamp(44px, calc((100vw - var(--left) - var(--right) - 26px) / 6), 56px); }
  .ability-slots { column-gap: 2px; }
  .ability-slot { grid-template-areas: "input" "icon"; grid-template-rows: 20px var(--skill-size); padding-inline: 0; }
  .ability-slot kbd { width: 21px; height: 21px; font-size: 12px; }
  .ability-caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .skill-energy { padding-inline: 4px; }
  .skill-energy-label { font-size: 10px; }
  .skill-energy-label strong { font-size: 10px; }
  .vitals { width: min(278px, calc(100vw - var(--left) - var(--right))); }
  .notifications p { max-width: min(400px, calc(100vw - var(--left) - var(--right))); }
  .pokedex-toggle { gap: 4px; min-height: 34px; padding: 0 6px; font-size: 12px; }
  .pokedex-toggle kbd { display: none; }
  .utility { gap: 1px; }
  .utility .utility-button { width: 30px; height: 34px; }
  .three-button { min-height: 34px; }
  .pokedex { padding: 15px; }
  .pokedex-header { margin-bottom: 12px; }
  .pokedex-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pokedex-card { padding: 8px 10px; gap: 7px 11px; }
  .pokedex-art { height: 67px; }
}

@media (max-width: 700px) and (pointer: fine) {
  .player-status { bottom: calc(var(--bottom) + 128px); }
  .notifications { bottom: calc(var(--bottom) + 283px); }
}

@media (max-width: 550px) and (pointer: coarse) and (orientation: portrait) {
  .touch-moves { min-height: 92px; align-items: end; }
  .player-status { bottom: calc(var(--bottom) + 234px); }
  .notifications { bottom: calc(var(--bottom) + 402px); }
}

@media (max-width: 550px) and (max-height: 830px) and (pointer: coarse) and (orientation: portrait) {
  .player-status { top: calc(var(--top) + 151px); bottom: auto; z-index: 1; }
  .vitals { width: min(257px, calc(100vw - var(--left) - var(--right))); padding-block: 4px 0; }
  .vitals-header { padding-bottom: 3px; }
  .vitals-header h2 { font-size: 14px; }
  .vitals-portrait { width: 23px; height: 23px; }
  #vitals-type { margin-top: 1px; line-height: 1; }
  .vital-meters { gap: 2px; padding-top: 4px; }
  .vital-meter { line-height: 1.15; }
  .speed-panel { margin-top: 4px; }
  .speed-panel summary { min-height: 24px; }
  .notifications { bottom: calc(var(--bottom) + 244px); }
}

@media (max-width: 360px) and (max-height: 830px) and (pointer: coarse) and (orientation: portrait) {
  .player-status { top: calc(var(--top) + 141px); }
}

@media (max-width: 370px) {
  .vitals { padding-inline: 8px; }
  .vital-meter { grid-template-columns: 32px minmax(12px, 1fr) 43px 68px; gap: 4px; font-size: 10px; }
  .vital-heading strong, .vital-hp .vital-heading strong { font-size: 11px; }
  .vital-recovery { gap: 2px; font-size: 9px; }
  .recovery-bonus { font-size: 9px; padding-inline: 2px; }
}

@media (max-width: 305px) {
  .vital-meter { grid-template-columns: 34px minmax(12px, 1fr) 45px; gap: 1px 5px; }
  .vital-recovery { grid-area: 2 / 2 / auto / -1; justify-self: end; }
}

@media (max-width: 360px) {
  .minimap { width: 52px; }
  .location-name h1 { font-size: 14px; }
  .quest { width: 148px; padding-inline: 6px; }
  .training-stats > div + div { padding-inline-start: 3px; }
  .weather-panel { width: 139px; }
  .weather-readings, .weather-mode { margin-inline: 6px; }
  .weather-mode { gap: 4px; }
  .weather-mode select { padding-inline: 2px; }
}

@media (min-width: 701px) and (max-width: 900px) and (pointer: fine) {
  .notifications { bottom: calc(var(--bottom) + 155px); }
}

@media (max-height: 550px) and (min-width: 580px) and (orientation: landscape) {
  .game-frame { --pad: 12px; }
  .navigation { grid-template-columns: auto auto; align-items: center; gap: 8px; }
  .minimap { width: 60px; }
  .location-name span { display: none; }
  .quest { width: 174px; padding: 7px 8px; }
  .ability { --skill-size: 37px; --slot-width: 54px; }
  .ability-slots { --ability-pad: 4px; gap: 2px; }
  .ability-slot { grid-template-rows: 21px var(--skill-size) 24px; padding-block: 1px; }
  .skill-icon { scale: .61; }
  .skill-energy { padding-block: 3px; }
}

@media (max-height: 550px) and (min-width: 580px) and (orientation: landscape) and (pointer: coarse) {
  .ability { --skill-size: 44px; --empty-skill-size: 22px; }
  .ability-slot-empty kbd { width: 20px; height: 20px; font-size: 11px; }
  .touch-moves { position: absolute; right: calc(100% + 8px); bottom: 0; }
  .three-tools { display: none; }
}

@media (max-height: 390px) and (pointer: coarse) and (orientation: landscape) {
  .vitals-header { padding-bottom: 4px; }
  .vitals-portrait { width: 27px; height: 27px; }
  .vital-meters { gap: 4px; }
  .speed-panel { margin-top: 5px; }
  .speed-panel summary { min-height: 31px; }
}

.lobby-open .hud { display: none; }
.camp-lobby {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--pale);
  background:
    linear-gradient(180deg, #0d263968, transparent 54%, #142c226f),
    linear-gradient(105deg, #132f2859, transparent 54%, #102f4266),
    #1b3850 url('./assets/adventure-lobby.webp') center / cover no-repeat;
}
.lobby-shell {
  width: min(100%, 1330px);
  min-height: 100%;
  margin: 0 auto;
  padding: max(clamp(18px, 3.6dvh, 40px), env(safe-area-inset-top)) max(clamp(22px, 7vw, 95px), env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(clamp(22px, 7vw, 95px), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}
.lobby-tools { align-self: flex-end; }
.lobby-library { display: inline-flex; align-items: center; gap: 9px; min-height: 35px; padding: 5px 12px; border: 1px solid #e2f3da55; border-radius: 999px; background: #1432389c; color: #f6f9ea; text-decoration: none; font-size: 12px; font-weight: 650; }
.lobby-library:hover { background: #143238e0; }
.lobby-library:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.lobby-main { display: grid; flex: 1; grid-template-columns: minmax(0, 1fr) minmax(280px, 362px); column-gap: clamp(28px, 7vw, 96px); align-items: center; padding-block: 10px clamp(20px, 5dvh, 48px); }
.lobby-hero { display: grid; justify-items: start; min-width: 0; padding-inline-start: clamp(0px, 2vw, 24px); }
.lobby-hero h2 { color: #fffcef; font-size: clamp(45px, 6.2vw, 93px); line-height: 1.05; font-weight: 800; letter-spacing: .025em; white-space: nowrap; text-shadow: 0 2px 3px #153225a8, 0 8px 26px #102c37ba; }
.lobby-hero p { display: flex; align-items: center; gap: 10px; margin-top: 13px; color: #fcf6dc; font-size: 14px; font-weight: 700; letter-spacing: .17em; text-shadow: 0 1px 8px #102520; }
.lobby-hero p::before { content: ''; width: 21px; height: 2px; background: #f9d685; box-shadow: 0 0 8px #1835278c; }
.lobby-partner { position: relative; isolation: isolate; width: min(85%, 45dvh, 445px); justify-self: center; margin-top: 7px; }
.lobby-partner::before { position: absolute; z-index: -1; inset: auto 13% 1% 9%; height: 14%; content: ''; background: radial-gradient(ellipse closest-side, #16341284, #19320c42 61%, transparent); }
.lobby-partner img { display: block; width: 100%; filter: drop-shadow(0 12px 12px #193d3655); }
.lobby-entry {
  min-width: 0;
  padding: 17px;
  border: 1px solid #dbeddb62;
  border-radius: 22px;
  background: linear-gradient(152deg, #25434bec, #10212aee 74%);
  box-shadow: 0 16px 54px #102c3b6e, inset 0 1px #ffffff16;
  backdrop-filter: blur(14px);
}
.lobby-choices { display: grid; gap: 9px; }
.lobby-option {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 13px;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 6px 14px 6px 10px;
  border: 1px solid #c1e4d040;
  border-radius: 11px;
  background: linear-gradient(120deg, #e5fff416, #e5fff408);
  color: #f4f9f0;
  text-align: start;
  font-size: 16px;
  font-weight: 700;
}
.lobby-option:hover:not(:disabled) { border-color: #dcf4dfa6; background: #d1f2e326; }
.lobby-option-primary { border-color: #ffeab8; color: #25362b; background: linear-gradient(120deg, #ffe79f, #ffd470); box-shadow: inset 0 1px #fff9db, 0 5px 16px #0b1f2966; }
.lobby-option-primary:hover:not(:disabled) { border-color: #ffefc6; background: #ffe69c; }
.lobby-option:disabled { cursor: wait; opacity: .65; }
.lobby-option-icon { position: relative; display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #d4ffe33d; border-radius: 8px; background: #d4ffe315; color: #d4f2dc; }
.lobby-option-primary .lobby-option-icon { border-color: #b3832c40; background: #7d4c1818; color: #3e472e; }
.lobby-icon-play::before { width: 13px; height: 15px; margin-left: 2px; content: ''; background: currentColor; clip-path: polygon(7% 0%, 100% 50%, 7% 100%); }
.lobby-icon-create::before { width: 15px; height: 15px; content: ''; background: linear-gradient(currentColor, currentColor) center / 15px 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 15px no-repeat; border-radius: 1px; }
.lobby-icon-join::before { width: 12px; height: 15px; margin-left: 5px; content: ''; border: 1.5px solid currentColor; border-inline-start: 0; border-radius: 0 2px 2px 0; }
.lobby-icon-join::after { position: absolute; left: 5px; width: 14px; height: 11px; content: ''; background: currentColor; clip-path: polygon(0 42%, 65% 42%, 46% 19%, 57% 4%, 100% 50%, 57% 96%, 46% 81%, 65% 58%, 0 58%); }
.lobby-arrow { display: block; justify-self: center; width: 8px; height: 8px; border-block-start: 1.5px solid currentColor; border-inline-end: 1.5px solid currentColor; transform: rotate(45deg); opacity: .76; }
.lobby-form { display: grid; gap: 12px; }
.lobby-form-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 2px; }
.lobby-form-heading h3 { font-size: 19px; line-height: 1.15; }
.lobby-back { display: grid; width: 36px; height: 36px; place-items: center; padding: 0; border: 1px solid #c1e4d04d; border-radius: 9px; background: #c1e4d010; }
.lobby-back:hover { background: #c1e4d026; }
.lobby-back .lobby-arrow { transform: rotate(225deg); }
.lobby-field { display: grid; gap: 6px; }
.lobby-field label { font-size: 12px; font-weight: 700; color: #e5f2e7; }
.lobby-form input, .manual-copy { width: 100%; min-width: 0; height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--pale); background: #0c242ac7; font: inherit; font-size: 16px; caret-color: var(--gold); }
.lobby-form input::placeholder { color: #a4b2a6; opacity: 1; }
.lobby-form input:focus-visible, .manual-copy:focus-visible { outline: 2px solid #f2d191; outline-offset: 2px; }
.lobby-form input[aria-invalid='true'] { border-color: #f2b395; }
.camp-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; font-size: 14px; font-weight: 700; }
.camp-primary { background: var(--gold); color: #202820; }
.camp-primary:hover { background: #fce0a6; }
.camp-primary > span, .camp-secondary > span { font: 20px/1 system-ui, sans-serif; }
.camp-secondary { border-color: var(--line); color: var(--pale); background: #dae9d114; }
.camp-secondary:hover { background: #dae9d128; border-color: #d8e9d37d; }
.lobby-form button:disabled { cursor: progress; opacity: .55; }
#room-code { font-variant-numeric: tabular-nums; letter-spacing: .12em; }
#room-code::placeholder { font: inherit; letter-spacing: .06em; }
.text-action { padding: 3px 0; border: 0; background: transparent; color: var(--gold); font-size: 13px; }
.text-action:hover { text-decoration: underline; text-underline-offset: 4px; }
.lobby-feedback { padding: 8px 11px; border-inline-start: 2px solid #e6c783; background: #0c201bcc; font-size: 13px; line-height: 1.5; }
.lobby-feedback[data-error='true'] { color: #ffd6be; border-color: #e6a78a; }
.lobby-feedback .text-action { margin-top: 4px; }

.room-toggle { gap: 6px; white-space: nowrap; }
.room-dot { width: 7px; height: 7px; border: 1px solid var(--muted); border-radius: 50%; }
.room-toggle[data-online='true'] .room-dot { border-color: var(--mint); background: var(--mint); }
#room-badge { color: var(--mint); font: 650 12px var(--numbers); font-variant-numeric: tabular-nums; }
.room-dialog { width: min(420px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: auto; padding: clamp(17px, 4vw, 25px); border: 1px solid var(--line); border-radius: 20px; color: var(--pale); background: var(--surface); box-shadow: 0 20px 75px #0a1714a8; }
.room-dialog::backdrop { background: #0d1714b5; backdrop-filter: blur(5px); }
.room-dialog-heading, .members-heading { display: flex; align-items: center; justify-content: space-between; gap: 13px; }
.room-dialog-heading { margin-bottom: 17px; }
.room-dialog-heading h2 { font-size: 23px; }
.room-dialog-heading .utility-button { width: 36px; height: 36px; }
.room-code-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px 12px; padding: 13px 15px; background: #1d2c24; border: 1px solid var(--line); border-radius: 10px; }
.room-code-card > span, .members-heading > span { color: var(--muted); font-size: 12px; }
.room-code-card > strong { grid-column: 1; color: var(--gold); font: 700 clamp(26px, 7vw, 34px)/1.15 var(--numbers); letter-spacing: .09em; }
.room-code-card button { grid-area: 1 / 2 / span 2; min-height: 35px; padding: 6px 9px; font-size: 12px; }
#room-copy-link { width: 100%; margin-top: 10px; }
.manual-copy { margin-top: 8px; font-size: 13px; }
.share-status { color: #e5d39e; font-size: 12px; line-height: 1.5; }
.share-status:not(:empty) { margin-top: 8px; }
.members-heading { margin-top: 21px; }
.members-heading h3 { margin: 0; font-size: 14px; }
.room-members { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
.room-members li { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--divider); font-size: 14px; overflow-wrap: anywhere; }
.room-members li::before { content: ''; flex: 0 0 6px; height: 6px; border-radius: 50%; background: var(--mint); }
.room-members li small { flex-shrink: 0; margin-inline-start: auto; color: var(--gold); font-size: 12px; }
.room-dialog-bottom { display: flex; justify-content: flex-end; margin-top: 12px; }
#room-leave { color: #e7c8af; }
@media (max-width: 720px) {
  .lobby-shell { padding-inline: max(4vw, env(safe-area-inset-left)) max(4vw, env(safe-area-inset-right)); }
  .lobby-main { grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); column-gap: 3vw; }
  .lobby-hero { padding-inline-start: 0; }
}
@media (max-width: 530px) {
  .lobby-main { flex: none; grid-template-columns: minmax(0, 1fr); gap: 12px; width: min(100%, 370px); margin: auto; padding-block: 12px 4px; }
  .lobby-hero { justify-items: center; }
  .lobby-hero h2 { font-size: clamp(38px, 10.6vw, 55px); }
  .lobby-hero p { margin-top: 8px; font-size: 12px; }
  .lobby-partner { width: min(54vw, 24dvh, 200px); }
  .lobby-main:has(.lobby-form:not([hidden])) .lobby-partner { width: min(34vw, 16dvh, 130px); }
  .lobby-entry { padding: 11px; border-radius: 16px; }
  .lobby-option { min-height: 53px; font-size: 15px; }
  .lobby-form { gap: 10px; }
  .camp-lobby { background-position: center, center, 49% center; }
  #room-badge { display: none; }
}
@media (max-height: 505px) and (orientation: landscape) {
  .lobby-shell { padding-block: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-bottom)); }
  .lobby-main { padding-block: 7px; }
  .lobby-entry { padding: 11px; }
  .lobby-hero h2 { font-size: clamp(32px, 6vw, 51px); }
  .lobby-partner { width: min(64%, 42dvh, 305px); }
  .lobby-option { min-height: 48px; }
  .lobby-form { gap: 8px; }
  .lobby-form input { height: 41px; }
  .lobby-form .camp-button { min-height: 42px; }
}
