:root {
  color-scheme: dark;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #edf5ff;
  background: #090f22;
  --bg: #090f22;
  --panel: #121f3b;
  --inset: #0d1832;
  --border: #2b4771;
  --muted: #adc0dd;
  --gold: #ffd38f;
  --teal: #91e6ff;
  --blue-panel: #172e52;
  --blue-hover: #224773;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(ellipse at 55% 7%, #1a315d, var(--bg) 58%); min-height: 100vh; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; text-decoration: none; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }

.topbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; min-height: 70px; padding: 0 max(28px, calc((100vw - 1440px) / 2)); border-bottom: 1px solid var(--border); background: #0b1530; }
.brand { display: inline-flex; align-items: center; gap: 13px; font-size: .76rem; font-weight: 770; letter-spacing: .19em; width: fit-content; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #99764b; background: #2f2a20; border-radius: 6px; }
.brand-icon i { width: 11px; height: 11px; transform: rotate(45deg); border: 2px solid var(--gold); box-shadow: inset 0 0 0 2px #2f2a20, inset 0 0 0 5px #d29354; }
nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 3px 8px; }
nav button { background: transparent; border: 0; color: var(--muted); border-radius: 6px; padding: 10px 15px; font-size: .86rem; white-space: nowrap; }
nav button:hover, nav .nav-active { background: #1b3860; color: #c5f6ff; }
.account { justify-self: end; display: flex; align-items: center; gap: 10px; font-size: .86rem; }
.account span { max-width: 13ch; overflow: hidden; text-overflow: ellipsis; }
.wallet { display: flex; align-items: center; gap: 4px; padding: 4px 7px; border: 1px solid #305586; border-radius: 6px; color: #c4f4ff; background: #142b4e; }
.wallet img { display: block; }
.wallet strong { font: 700 .75rem Consolas, monospace; white-space: nowrap; }
.outline { background: var(--blue-panel); border: 1px solid var(--border); border-radius: 6px; padding: 8px 14px; }
.outline:hover { background: var(--blue-hover); }

.shell { width: min(1440px, calc(100% - 56px)); margin: 0 auto; outline: none; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 34px 0 24px; }
.eyebrow, .mono, .coordinates, .foot, kbd { font-family: Consolas, 'Liberation Mono', monospace; }
.eyebrow { color: var(--gold); font-size: .69rem; letter-spacing: .14em; font-weight: 650; }
.eyebrow span { display: inline-block; width: 6px; height: 6px; margin: 0 5px 1px 2px; transform: rotate(45deg); background: var(--gold); }
h1 { margin: 7px 0 0; font-size: clamp(2rem, 4vw, 3.6rem); letter-spacing: -.055em; font-weight: 700; line-height: 1.05; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr); }

.sidebar { display: grid; gap: 14px; }
.panel { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); min-width: 0; }
.sidebar .panel { padding: 15px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 12px; }
.section-head h2 { font-size: .95rem; letter-spacing: -.012em; }
.section-head .mono { font-size: .64rem; color: var(--muted); white-space: nowrap; }
.symbol { color: #c4a879; font-size: 1.05rem; line-height: 1; }
.meter { height: 5px; border-radius: 3px; background: #283b58 url('/art/hud-meter-track.png') center / 100% 100% no-repeat; overflow: hidden; }
.meter span { display: block; width: 0; height: 100%; mask: url('/art/hud-meter-fill.png') center / 100% 100% no-repeat; transition: width 170ms ease; }
.gold { background: #edbd75; }
.teal { background: #8bd3ab; }
.blue { background: #8bb4d8; }
.pink { background: #e8999f; }
.creature-portrait { position: relative; display: grid; place-items: center; flex: 0 0 auto; border-radius: 5px; background: #202d26; overflow: hidden; }
.creature-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.creature-portrait:has(img) .creature-initial { visibility: hidden; }
.creature-initial { color: #afd0bd; font: bold .75rem Consolas, monospace; }
.digimon-types { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; margin-top: 4px; font-size: .65rem; }
.digimon-types .game-icon { width: 22px; border: 1px solid #788d7b67; padding: 1px; border-radius: 50%; background: #121b17; }
.member-stat { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 3px 8px; margin-top: 7px; color: #adbbb2; font-size: .68rem; }
.member-stat .meter { grid-column: 1 / -1; }
.stat-value { min-width: 0; color: #e0e9df; text-align: right; font-size: .72rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.field { overflow: hidden; }
.field-head { display: grid; grid-template-columns: minmax(0, 1fr) fit-content(56%); align-items: center; gap: 10px; padding: 15px 19px; }
.field-head h2 { margin-top: 4px; font-size: 1.22rem; letter-spacing: -.035em; overflow-wrap: anywhere; }
.coordinates { color: #a9b7ac; font-size: .68rem; white-space: nowrap; }
.location { display: grid; justify-items: end; gap: 5px; min-width: 0; }
.field-location { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; }
.field-location:has(#retreat[hidden]) { gap: 0; }
#retreat { grid-column: 2; }
#zone-name { display: inline-flex; align-items: center; gap: 5px; min-width: 0; text-align: right; overflow-wrap: anywhere; }
#zone-name .game-icon { width: 19px; flex: 0 0 auto; }
#zone-name { color: var(--teal); font-size: .76rem; text-align: right; }
.map-stage { --world-width: min(100cqw, calc(max(310px, 100svh - 370px) * 527 / 392)); position: relative; container-type: inline-size; border-block: 1px solid var(--border); background: #0c152a; }
#world { --world-columns: 11; --world-rows: 8; display: block; width: var(--world-width); height: calc(var(--world-width) * (var(--world-rows) * 45 + 32) / (var(--world-columns) * 45 + 32) + 52px); margin-inline: auto; touch-action: pan-y; }
.map-marker { position: absolute; right: calc((100cqw - var(--world-width)) / 2 + 13px); top: 64px; pointer-events: none; display: flex; gap: 7px; align-items: center; color: #bbc6ae; font-size: .73rem; }
.map-marker span { font-size: 1rem; }
.nearby-alert { position: absolute; top: 64px; left: 50%; translate: -50% 0; width: max-content; max-width: 75%; padding: 6px 12px; border: 1px solid #d29172; border-radius: 6px; color: #ffe0c6; background: #362624; font-size: .8rem; font-weight: 700; }
.field-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 19px; }
.field-actions:not(:has(> button:not([hidden]), .message:not(:empty))) { display: none; }
.field-actions .message { flex-basis: 100%; margin: 0; }

.journal li { color: #bcc8be; line-height: 1.5; font-size: .84rem; }
.primary { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid #ffd694; border-radius: 6px; background: var(--gold); padding: 10px 12px; color: #201b14; font-size: .86rem; font-weight: 750; min-height: 40px; }
.primary:hover:not(:disabled) { background: #f9d59c; }
.quiet { border: 0; background: none; color: var(--teal); padding: 9px 0 2px; font-size: .78rem; text-align: left; }
.quiet:hover { text-decoration: underline; }
.message:empty { display: none; }
.message { margin-top: 8px; color: #f1b0a1; font-size: .78rem; }
.control { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 32px; font-size: .73rem; color: #c4cdc5; }
.control + .control { border-top: 1px solid #303b34; padding-top: 5px; margin-top: 4px; }
kbd { display: inline-grid; place-items: center; min-width: 18px; height: 19px; padding: 0 3px; color: #c8edff; border: 1px solid #3e628f; border-radius: 4px; background: #1a3358; font-size: .7rem; }
#touch { display: none; }
@media (max-width: 730px), (pointer: coarse), (orientation: landscape) and (max-height: 540px) {
  .field-actions:has(#touch:not([hidden])) { display: flex; }
  #touch:not([hidden]) { display: grid; grid-template-columns: repeat(3, minmax(44px, 1fr)); gap: 4px; width: min(100%, 230px); margin-inline: auto; }
  #touch [data-direction="right"] { grid-column: 3; }
  #touch button { min-height: 44px; padding: 0; border: 1px solid #3a5676; border-radius: 6px; background: #1a3152; touch-action: manipulation; }
  #world { touch-action: manipulation; }
}
.journal ol { display: grid; gap: 7px; list-style: none; padding: 0; margin: 0; }
.journal li { border-left: 2px solid #70877a; padding-left: 8px; font-size: .73rem; }
.journal li.empty { border: 0; padding: 0; color: var(--muted); }
.foot { display: flex; justify-content: space-between; padding: 15px 0 24px; color: #99a89d; font-size: .7rem; }

.combat {
  --hud-light: #a3e8e0;
  --hud-gold: #f6d086;
  --hud-ink: #0a1726;
  padding: 0;
}
.battle-timeline { --queue-step: 32px; position: absolute; z-index: 5; top: 50%; right: 17px; translate: 0 -50%; display: flex; flex-direction: column-reverse; align-items: center; gap: 7px; width: 58px; isolation: isolate; pointer-events: none; }
.battle-timeline::before { content: ''; position: absolute; z-index: -1; inset: 8px 19px 18px auto; width: 21px; border-right: 1px solid #81bfcc70; border-radius: 0 90% 90% 0 / 0 55% 45% 0; }
#timeline-current { display: grid; place-items: center; width: 48px; height: 48px; }
#timeline-next { display: flex; flex-direction: column-reverse; align-items: center; gap: 5px; margin: 0; padding: 0; list-style: none; }
#timeline-next li:nth-child(1) { translate: 7px; }
#timeline-next li:nth-child(2) { translate: 10px; }
#timeline-next li:nth-child(3) { translate: 10px; }
#timeline-next li:nth-child(4) { translate: 6px; }
#timeline-next li:nth-child(5) { translate: 1px; }
.timeline-portrait { --turn-color: #8ce2cf; display: grid; width: var(--queue-step); height: var(--queue-step); border: 1px solid var(--turn-color); border-radius: 9px 3px; padding: 2px; background: #10293cf2; box-shadow: 0 2px 9px #070e21ba; }
.timeline-portrait[data-side="enemies"] { --turn-color: #e8a5bd; background: #35263eee; }
#timeline-current .timeline-portrait { width: 44px; height: 44px; border-width: 2px; border-radius: 13px 4px; background-color: #174f56; box-shadow: 0 0 0 2px #0b192e, 0 0 0 3px #96e6dca0, 0 0 16px #79d6df61; }
#timeline-current .timeline-portrait[data-side="enemies"] { background-color: #592e45; box-shadow: 0 0 0 2px #1c1429, 0 0 0 3px #e8a5bd85, 0 0 16px #df79a561; }
.timeline-portrait .creature-portrait { width: 100%; height: 100%; background: transparent; }
.timeline-exit { position: absolute; pointer-events: none; }
.arena { position: relative; isolation: isolate; background: var(--panel); }
.battlefield {
  position: relative;
  isolation: isolate;
  overflow: clip;
  min-width: 0;
  min-height: clamp(480px, 44vw, 565px);
  background-color: #172948;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.battlefield {
  /* Every slot is anchored at the Digimon's feet. Slots 1–3 are middle, back and front. */
  --ally-1-x: 34%; --ally-1-y: 61%;
  --ally-2-x: 19%; --ally-2-y: 50%;
  --ally-3-x: clamp(26%, min(208px, 27%) + 72px, 33%); --ally-3-y: 72%;
  --enemy-1-x: 66%; --enemy-1-y: 61%;
  --enemy-2-x: 81%; --enemy-2-y: 50%;
  --enemy-3-x: clamp(67%, 100% - min(208px, 27%) - 72px, 74%); --enemy-3-y: 72%;
}
.battlefield[data-scene="training"] {
  --ally-1-x: 36%; --ally-1-y: 59%;
  --ally-2-x: 23%; --ally-2-y: 47%;
  --ally-3-x: 26%; --ally-3-y: 71%;
  --enemy-1-x: 64%; --enemy-1-y: 59%;
  --enemy-2-x: 77%; --enemy-2-y: 47%;
  --enemy-3-x: 74%; --enemy-3-y: 71%;
  background-color: #223c39;
}
.formation { position: absolute; inset: 0 0 var(--arena-hud-space, 0px); width: var(--arena-play-width, 100%);
  margin-inline: auto; pointer-events: none; }
#ally-line > .fighter:nth-child(1) { --slot-x: var(--ally-1-x); --slot-y: var(--ally-1-y); }
#ally-line > .fighter:nth-child(2) { --slot-x: var(--ally-2-x); --slot-y: var(--ally-2-y); }
#ally-line > .fighter:nth-child(3) { --slot-x: var(--ally-3-x); --slot-y: var(--ally-3-y); }
#enemy-line > .fighter:nth-child(1) { --slot-x: var(--enemy-1-x); --slot-y: var(--enemy-1-y); }
#enemy-line > .fighter:nth-child(2) { --slot-x: var(--enemy-2-x); --slot-y: var(--enemy-2-y); }
#enemy-line > .fighter:nth-child(3) { --slot-x: var(--enemy-3-x); --slot-y: var(--enemy-3-y); }
.formation > .fighter:nth-child(1) { --slot-inset: var(--arena-inset-1, 0px); }
.formation > .fighter:nth-child(2) { --slot-inset: var(--arena-inset-2, 0px); }
.formation > .fighter:nth-child(3) { --slot-inset: var(--arena-inset-3, 0px); }
.formation > .fighter { left: clamp(var(--slot-inset), var(--slot-x), 100% - var(--slot-inset));
  top: clamp(min(var(--arena-ground-start, 0px), 71%), var(--slot-y), var(--arena-ground-end, 100%)); }
.fighter { position: absolute; display: grid; grid-template: max-content / max-content; width: 0; height: 0; align-content: end; justify-content: center; }
.fighter:nth-child(2) { --fighter-depth: 1; }
.fighter:nth-child(1) { --fighter-depth: 2; }
.fighter:nth-child(3) { --fighter-depth: 3; }
.fighter .battle-sprite, .arena:has(#battle-timeline:not([hidden])) .fighter, .battlefield[data-entering] .fighter { z-index: var(--fighter-depth); }
.battlefield[data-entering] :is(#battle-party, #battle-speed) { visibility: hidden; }
.battlefield[data-entering] .fighter-trigger { pointer-events: none; }
.battlefield[data-entering="loading"] .fighter { visibility: hidden; }
.battlefield[data-entering] :is(.target-frame, .fighter-vitals, .fighter-meters) { display: none; }
.fighter-trigger { position: relative; display: grid; place-items: end center; min-width: 44px; min-height: 44px; padding: 0 2px; border: 0; background: transparent; cursor: default; pointer-events: auto; -webkit-tap-highlight-color: transparent; }
.fighter-trigger:focus-visible { outline: none; }
.fighter-portrait, .fighter-model { position: relative; display: grid; place-items: end center; }
.target-frame { position: absolute; z-index: 4; left: 50%; top: 50%; width: var(--target-width, 72px); height: var(--target-height, 72px);
  translate: -50% -50%; pointer-events: none; visibility: hidden; filter: drop-shadow(0 1px 2px #081427); }
.fighter-trigger[aria-pressed="true"] .target-frame { visibility: visible; animation: target-lock calc(.28s * var(--battle-factor, 1)) cubic-bezier(.18,.75,.3,1) both; }
@keyframes target-lock {
  0% { transform: translateY(-6px); opacity: .28; }
  58% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.fighter-vitals { position: absolute; z-index: 5; inset: 0; visibility: hidden; pointer-events: none; }
.arena:has(#battle-timeline:not([hidden])) .fighter-vitals { display: none; }
.fighter:not(.down):has(.fighter-trigger[aria-pressed="true"]) .fighter-vitals,
.combat:not([data-aiming]) .fighter:not(.down) .fighter-trigger:focus-visible .fighter-vitals { visibility: visible; }
@media (hover: hover) {
  .fighter:not(.down) .fighter-trigger:hover .fighter-vitals { visibility: visible; }
}
.fighter-nameplate { position: absolute; bottom: calc(100% + 5px); left: 50%; translate: -50%; display: grid; gap: 3px; padding: 4px 7px; border-radius: 5px; color: #f0f8ff; background: #15283baf; font: 650 .78rem/1.25 system-ui; white-space: nowrap; }
.fighter-nameplate .digimon-types { justify-content: flex-end; gap: 4px; margin: 0; }
.fighter-nameplate .game-icon { width: 22px; padding: 2px; background: #182c40; }
.fighter:has(.fighter-action) .fighter-nameplate { visibility: hidden; }
.fighter-meters { position: absolute; top: calc(100% + 5px); left: 50%; translate: -50%; display: grid; grid-template-columns: 76px; gap: 3px; }
.fighter-meters canvas { display: block; inline-size: 76px; block-size: 10px; }
.fighter[data-damage-bar] .fighter-hp { visibility: hidden; }
.combat-badge { display: inline-flex; align-items: center; justify-content: center; gap: 3px; padding: 3px 6px; border-radius: 4px; background: #12253bd6; color: #edf7ff; font: 700 .68rem/1.2 system-ui; }
.combat-badge .game-icon, .combat-badge .catalog-icon { flex: none; width: 14px; height: 14px; }
.fighter-matchup { justify-self: center; white-space: nowrap; }
.combat-badge[data-modifier="advantage"] { color: #a4f4c9; }
.combat-badge[data-modifier="disadvantage"] { color: #ddd2fc; }
.fighter-action {
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 10px);
  left: 50%;
  translate: -50%;
  width: max-content;
  max-width: min(174px, 42vw);
  overflow-wrap: anywhere;
  text-align: center;
  pointer-events: none;
  animation: fighter-action calc(.64s * var(--battle-factor, 1)) ease-out both;
}
@keyframes fighter-action { 0% { opacity: 0; transform: translateY(4px); } 18%, 78% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-3px); } }
.battle-sprite { position: relative; display: block; width: var(--sprite-width, 64px); height: var(--sprite-height, 64px); }
.sprite-art { position: absolute; inset: 0; pointer-events: none; }
.sprite-art canvas { position: absolute; width: auto; height: auto; image-rendering: pixelated; }
.sprite-thumbnail > span { position: relative; display: block; overflow: hidden; }
.creature-portrait.sprite-thumbnail img { position: absolute; height: auto; max-width: none; max-height: none; object-fit: fill; image-rendering: pixelated; }
.sprite-art .creature-portrait { width: 100%; height: 100%; background: transparent; }
.battle-sprite:not([data-atlas])[data-motion="faint"] .sprite-art { animation: sprite-fallback-faint calc(.48s * var(--battle-factor, 1)) ease both; }
.battle-sprite[data-motion="down"] .sprite-art { opacity: .65; filter: grayscale(1); }
@keyframes sprite-fallback-faint { to { transform: translateY(9%) rotate(-12deg); filter: grayscale(1); opacity: .65; } }
.battle-states { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; margin-top: 7px; }
.battle-states:empty { display: none; }
.battle-states span { padding: 2px 4px; border: 1px solid; border-radius: 4px; font: .62rem Consolas, monospace; white-space: nowrap; }
.battle-states .positive { color: #b8edca; background: #243d31; border-color: #456a55; }
.battle-states .negative { color: #ffd1c5; background: #45282c; border-color: #875452; }
.fighter-trigger:disabled { cursor: default; opacity: 1; }
#combat-health { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
#combat-effects { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.battle-projectile { position: absolute; width: var(--shot-size); height: var(--shot-size); translate: -50% -50%; pointer-events: none;
  background: var(--shot-texture) left top / contain no-repeat; filter: drop-shadow(0 0 5px var(--shot-color)) drop-shadow(0 0 10px var(--shot-color)); }
.battle-projectile[data-atlas] { background: none; filter: none; }
.battle-projectile canvas { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.combat-feedback-stack { position: absolute; display: grid; justify-items: center; gap: 4px; max-width: min(156px, 48vw); }
.combat-feedback { --feedback-color: #ffd799; --feedback-travel: -14px; --feedback-pop: 1.12; display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 2px 4px; color: var(--feedback-color); font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 2px 2px #050a1de8; animation: combat-feedback calc(.64s * var(--battle-factor, 1)) ease-out both; }
.combat-feedback strong { font-size: clamp(1rem, 4vw, 1.55rem); line-height: 1; -webkit-text-stroke: 2px #09142e; paint-order: stroke fill; }
.combat-feedback > span { font-size: .66rem; }
.combat-feedback[data-effect="critical"] { --feedback-color: #ffec87; --feedback-travel: -19px; --feedback-pop: 1.27; }
.combat-feedback[data-effect="heal"] { --feedback-color: #96fac0; --feedback-travel: -20px; }
.combat-feedback[data-effect="restore"] { --feedback-color: #9ee9ff; --feedback-travel: -20px; }
.combat-feedback:is([data-effect="buff"], [data-effect="debuff"]) { --feedback-color: #d3f3ad; --feedback-pop: 1.05; align-items: center; padding: 2px 6px; border: 1px solid #6d9484; border-radius: 5px; background: #142847f5; }
.combat-feedback[data-effect="debuff"] { --feedback-color: #f0b6ff; --feedback-travel: -7px; border-color: #9a6ec6; }
.combat-feedback .game-icon { width: 13px; }
.combat-modifiers { display: flex; justify-content: center; flex-wrap: wrap; gap: 3px; width: 100%; }
.combat-modifier { color: #f0b6ff; white-space: nowrap; text-shadow: none; }
.combat-modifier[data-modifier="critical"] { color: #ffde86; }
.combat-modifier[data-modifier="advantage"] { color: #a4f4c9; animation: favorable-feedback calc(.38s * var(--battle-factor, 1)) ease-out both; }
.combat-modifier[data-modifier="disadvantage"] { color: #ddd2fc; animation: resisted-feedback calc(.38s * var(--battle-factor, 1)) ease-out both; }
@keyframes combat-feedback { 0% { opacity: 0; scale: .82; } 20% { opacity: 1; scale: var(--feedback-pop); } 36%, 76% { opacity: 1; scale: 1; } 100% { opacity: 0; translate: 0 var(--feedback-travel); } }
@keyframes favorable-feedback { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@keyframes resisted-feedback { from { opacity: 0; translate: 0 -6px; } to { opacity: 1; translate: 0 0; } }
.portrait-level { position: absolute; z-index: 1; bottom: 0; right: 0; min-width: 16px; text-align: center; border: 1px solid #7d8d81; background: #151d19; border-radius: 3px; padding: 1px 3px; color: #f4e2c2; font: 700 .64rem Consolas, monospace; }
.order[data-element="fire"] strong { color: #ffc183; }
.order[data-element="machine"] strong { color: #a8e1db; }
.order[data-element="nature"] strong { color: #b8e3ab; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.command-panel, .target-controls { position: absolute; z-index: 6; left: clamp(12px, 3vw, 40px); bottom: 18px; }
.command-panel { width: min(calc(100% - 32px), 350px); }
.command-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 34px; padding: 0 7px 4px; border-bottom: 1px solid #91b7cd3d; }
.command-head h4 { margin: 0; color: #e3f7ff; font-size: .86rem; }
.command-panel[data-menu="root"] h4 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.command-panel[data-menu="root"] .command-head { justify-content: start; min-height: 0; border: 0; padding: 0 0 5px; }
.command-panel[data-menu="root"] .command-head:not(:has(button:not([hidden]))) { display: none; }
.command-actions { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 3px 9px; }
:is(.command-actions button, #target-back, #battle-speed, #battle-inspect) { min-height: 30px; padding: 4px 7px; border: 0; border-radius: 5px; color: #cfe6ef; background: #102439b0; white-space: nowrap; font-size: .72rem; }
:is(.command-actions button, #target-back, #battle-speed, #battle-inspect):hover { color: #fff0c9; background: #203c51; }
.command-list-head { display: flex; justify-content: space-between; padding: 3px 9px; color: #b9d1dd; background: #142c3ce6; font: 650 .65rem system-ui; }
.orders { display: grid; gap: 3px; }
.orders:is([data-menu="battle"], [data-menu="items"]) { max-height: min(105px, 22dvh); overflow-y: auto; overscroll-behavior: contain; }
.orders .form-note { padding: 9px; background: #0c1d30; }
.order { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 7px; min-height: 36px; padding: 4px 8px; border: 0; border-inline-start: 2px solid transparent; border-radius: 4px; color: #eafaff; background: linear-gradient(90deg, #152b42e6, #14293c70); text-align: left; }
.order[data-preview]:not([aria-disabled], :disabled) { border-inline-start-color: #d6be91; color: #fff2d2; background: linear-gradient(90deg, #35474eea, #24394970); }
.order[aria-disabled="true"] { cursor: default; }
.order[aria-disabled="true"] .order-label { opacity: .66; }
.order[aria-disabled="true"][data-preview] { border-inline-start-color: #91b7cd66; background: #243949a0; }
.order:focus-visible { outline: 1px solid #abcbdacc; outline-offset: -2px; }
.order-label { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; align-items: center; gap: 7px; font-size: .83rem; }
.order-label strong { overflow-wrap: anywhere; line-height: 1.15; }
.order-label .order-icon { width: 22px; height: 22px; }
.order .order-metric { grid-column: 4; color: #ceeef2; font: 700 .74rem monospace; white-space: nowrap; text-align: right; }
.order .attack-effectiveness { grid-column: 3; width: 18px; }
.orders[data-menu="root"] { width: min(190px, 100%); gap: 3px; }
.orders[data-menu="root"] .order { min-height: 35px; padding-inline: 10px 15px; }
.orders[data-menu="root"] .order-label strong { font-weight: 650; }
.orders[data-menu="root"] .order-icon { opacity: .86; }
.command-detail { min-height: 1.2em; margin: 4px 0 0; padding: 4px 8px; color: #c2d8e5; background: linear-gradient(90deg, #101d30a3, transparent); font-size: .71rem; line-height: 1.4; }
.command-detail:empty { display: none; }
.command-panel[data-menu="root"] .command-detail { width: fit-content; max-width: 100%; }
.command-panel:is([data-menu="battle"], [data-menu="items"]) .command-detail { display: block; block-size: 42px; overflow-y: auto; }
.target-controls { left: 50%; translate: -50%; display: grid; justify-items: center; gap: 5px; padding: 9px clamp(12px, 4vw, 52px); width: max-content; max-width: calc(100% - 24px); text-align: center; background: linear-gradient(90deg, transparent, #07182ee6 24% 76%, transparent); }
#target-title { color: #f3f8ff; font-size: .95rem; font-weight: 750; }
#target-skill { display: flex; align-items: center; justify-content: center; gap: 6px; color: #bcd9ef; font-size: .81rem; }
#target-skill .game-icon { width: 17px; }
#target-back { min-width: 64px; min-height: 40px; }
#back-exploration { width: fit-content; justify-content: center; }
#battle-speed { position: absolute; z-index: 4; top: 13px; right: 16px; min-width: 36px; font-variant-numeric: tabular-nums; }
#battle-party { position: absolute; z-index: 4; right: 17px; bottom: 15px; width: min(208px, 27%); display: grid; gap: 4px; }
.battle-party-member { display: grid; grid-template-columns: 29px minmax(0, 1fr); gap: 5px; align-items: center; min-width: 0; padding: 4px 8px; border-radius: 5px; background: linear-gradient(105deg, #14283a80, #182f4470); }
.battle-party-member[data-current] { background: linear-gradient(105deg, #29404f9e, #213e5785); }
.battle-party-member[data-down] { opacity: .6; }
.battle-party-member > .creature-portrait { width: 29px; height: 29px; background: #122939; }
.battle-party-stats { min-width: 0; }
.battle-party-name { display: flex; align-items: center; gap: 5px; color: #e6f4fc; font-size: .73rem; }
.battle-party-level { display: inline-flex; align-items: center; gap: 2px; color: #e2f4b3; font-variant-numeric: tabular-nums; }
.battle-level-mark { width: 14px; height: auto; }
.battle-party-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.battle-party-member .member-stat { grid-template-columns: 13px minmax(0, 1fr) 12ch; gap: 3px; align-items: center; margin: 0; color: #b7d4e4; font-size: .55rem; }
.battle-party-member .stat-value { grid-column: 3; overflow: hidden; color: #effaff; font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.battle-party-member .member-stat .meter { grid-row: 1; grid-column: 2; height: 4px; }
.battle-party-member .battle-states { justify-content: start; margin-top: 2px; }
.battle-party-member .battle-states span { padding: 1px 3px; font-size: .54rem; }
.game-icon { display: block; width: 22px; height: auto; aspect-ratio: 1; }
.move-details, .catalog-matchups strong { display: flex; align-items: center; gap: 5px; }
.move-details .game-icon, .catalog-matchups .game-icon { width: 17px; flex: 0 0 auto; }
.battle-result { --result-color: #ffe098; --result-bg: #322e1d; position: fixed; inset: 50% auto auto 50%; translate: -50% -50%; z-index: 7; display: grid; align-content: center; justify-items: center; gap: 6px; width: min(620px, calc(100vw - 26px)); min-height: 185px; padding: 18px; border: 1px solid var(--result-color); border-radius: 10px; color: var(--result-color); background: radial-gradient(ellipse, var(--result-bg), #141b16); box-shadow: 0 8px 40px #000a, 0 0 0 100vmax #090e0bb7; pointer-events: none; animation: battle-result calc(.38s * var(--battle-factor, 1)) ease-out both; }
.battle-result[data-outcome="loss"] { --result-color: #ffb7a8; --result-bg: #52282be8; }
.battle-result .game-icon { width: 42px; }
.battle-result strong { font-size: clamp(1.8rem, 6vw, 3.5rem); line-height: 1.08; }
.battle-result span { font-size: .94rem; }
@keyframes battle-result { from { opacity: 0; scale: .92; } to { opacity: 1; scale: 1; } }
.battle-victory { width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: auto; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #f1fbff; --victory-accent: #69e2ff; }
.battle-victory[data-boss] { --victory-accent: #ffdd85; }
.battle-victory[open] { animation: victory-enter calc(.42s * var(--battle-factor, 1)) ease-out both; }
.battle-victory::backdrop { background: radial-gradient(ellipse at 50% 40%, #102c4b9c, #040917eb 80%); }
.victory-heading { display: grid; justify-items: center; gap: 5px; padding: 4px 12px 19px; text-align: center; background: url('/art/victory-strip.png') center bottom / 100% auto no-repeat; }
.victory-emblem { display: block; width: clamp(104px, 30vw, 180px); max-height: 27dvh; object-fit: contain; filter: drop-shadow(0 0 20px #27bff572); animation: victory-medal calc(.65s * var(--battle-factor, 1)) ease-out both; }
.victory-heading h2 { margin: 0; color: var(--victory-accent); font-size: clamp(2.25rem, 9vw, 4.25rem); line-height: .98; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 3px #051326, 0 0 18px #66d5fa62; }
.victory-heading p { margin: 3px 0; color: #ebf6ff; font-size: .88rem; }
.victory-value { color: #e1f6ff; font: 800 clamp(.8rem, 4vw, 1.25rem) Consolas, monospace; }
.victory-actions { display: flex; justify-content: center; padding: 13px 12px 9px; }
#back-exploration { border-radius: 3px; border-color: #a4d8ff; color: #edf8ff; background: linear-gradient(103deg, #112d55, #24568c); }
#back-exploration:hover { background: #2a6198; }
#reward-message { margin: 0 16px 10px; }
@keyframes victory-enter { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes victory-medal { from { opacity: .3; scale: .72; } 60% { scale: 1.1; } to { opacity: 1; scale: 1; } }
.retreat-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: end; margin-top: 16px; }
.retreat-actions button { width: auto; min-height: 42px; justify-content: center; }
#evolution-result { width: min(600px, calc(100% - 22px)); max-height: calc(100dvh - 20px); padding: clamp(12px, 3vw, 24px);
  border: 1px solid #507785; border-top: 2px solid #8ee1db; border-radius: 4px 16px 4px 14px;
  background: radial-gradient(ellipse at 79% 44%, #203c51, #101c2f 75%);
  color: #eaf8fc; box-shadow: 0 18px 75px #020711ab; overflow: auto; }
#evolution-result[open] { display: grid; gap: 10px; animation: game-window-reveal .25s ease-out both; }
#evolution-result::backdrop { background: #050915c7; }
.evolution-result-header { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid #60a8ac5e; }
.evolution-result-header img { width: 27px; height: 28px; object-fit: contain; image-rendering: pixelated; }
.evolution-result-header h2 { margin: 0; color: #c7f1e9; font-size: clamp(1.1rem, 4vw, 1.55rem); }
.evolution-result-flow { display: grid; grid-template-columns: minmax(0, .85fr) 24px minmax(0, 1.35fr); align-items: center; gap: 7px; }
.evolution-result-flow > .game-icon { width: 24px; height: 24px; }
.evolution-origins { display: grid; justify-items: center; gap: 4px; }
.evolution-result-origin { display: grid; width: min(100%, 154px); justify-items: center; padding: 4px; gap: 3px;
  background: #13293bbd; border: 1px solid #6e9eae53; border-radius: 5px; text-align: center; }
.evolution-result-origin .creature-portrait { display: grid; place-items: center; width: 49px; height: 49px; background: transparent; }
.evolution-result-origin strong { font-size: .76rem; overflow-wrap: anywhere; }
.evolution-result-origin small, .evolution-identity > span { color: #b3d0df; font-size: .71rem; }
.evolution-plus { color: #7ec8ce; font-weight: 750; }
.evolution-hero { position: relative; isolation: isolate; text-align: center; }
.evolution-pedestal { position: relative; display: grid; place-items: center; height: clamp(112px, 27dvh, 210px);
  background: radial-gradient(ellipse at center, #5aced238, transparent 64%); overflow: hidden; }
.evolution-pedestal::before, .evolution-pedestal::after { content: ''; position: absolute; pointer-events: none; }
.evolution-pedestal::before { inset: 4%; z-index: -1; background: url('/art/partner-rune.png') center / contain no-repeat; opacity: .74; }
.evolution-pedestal::after { inset: 0; background: radial-gradient(ellipse at center, #defcfd9c, transparent 58%);
  animation: evolution-light .62s ease-in both; }
.evolution-pedestal .battle-sprite { filter: drop-shadow(0 9px 9px #081322bb); }
.evolution-identity { display: grid; justify-items: center; gap: 3px; }
.evolution-identity strong { color: #ffdfa2; font-size: clamp(1rem, 4vw, 1.65rem); line-height: 1.12; overflow-wrap: anywhere; }
#evolution-result:not([data-revealed]) :is(.evolution-hero .battle-sprite, .evolution-identity, .evolution-details) { visibility: hidden; }
#evolution-result[data-revealed] :is(.evolution-identity, .evolution-details, .evolution-hero .battle-sprite) { animation: evolution-arrive .42s ease-out both; }
.evolution-details { display: grid; grid-template-columns: 1fr 1fr minmax(0, 2.3fr); gap: 4px;
  padding-block: 8px; border-block: 1px solid #60a8ac5e; }
.evolution-details > div { display: grid; align-content: center; gap: 3px; min-width: 0; padding: 6px;
  background: #15283a; text-align: center; border-radius: 3px; }
.evolution-details span { color: #a3c4d2; font-size: .69rem; }
.evolution-details strong { font-size: .83rem; overflow-wrap: anywhere; }
#evolution-continue { justify-self: end; min-width: 117px; }
@keyframes evolution-light { 0% { opacity: .2; scale: .54; } 75% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1.22; } }
@keyframes evolution-arrive { from { opacity: 0; translate: 0 5px; } }
@media (prefers-reduced-motion: reduce) {
  #evolution-result[open], #evolution-result[data-revealed] :is(.evolution-identity, .evolution-details, .battle-sprite) { animation: none; }
  .evolution-pedestal::after { display: none; }
}
#retreat { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 6px; }
.training-instruction { position: absolute; z-index: 9; inset: 12px auto auto 50%; translate: -50% 0; width: max-content; max-width: min(72%, 340px);
  padding: 6px 13px; border-bottom: 1px solid #d5b47893; background: #0b1a2aed; color: #fff0cc; text-align: center;
  font-size: .82rem; pointer-events: none; }
.training-instruction p { margin: 3px 0 0; color: #c8d8e5; font-size: .73rem; }
.map-stage .training-instruction { top: 48px; }
#training-spotlight { position: absolute; inset: 0; z-index: 8; overflow: hidden; pointer-events: none; }
#training-spotlight > div { position: absolute; border-radius: 7px; box-shadow: 0 0 0 140vmax #040a17ac, inset 0 0 0 1px #f4cd84a6; }
#combat[data-aiming] #training-spotlight > div { border-radius: 50%; box-shadow: 0 0 0 140vmax #040a17ac; }
#combat[data-aiming] .target-controls { z-index: 9; }
:is(#touch button, #back-exploration)[data-guided]:not(:disabled) { outline: 2px solid #e8c47d; outline-offset: 1px; }

dialog { position: relative; width: min(400px, calc(100% - 24px)); padding: 26px; border: 1px solid #466b9a; border-radius: 12px; color: inherit; background: var(--panel); box-shadow: 0 24px 100px #0009; }
dialog::backdrop { background: #070e20cc; }
dialog h2 { margin: 7px 30px 16px 0; line-height: 1.1; }
.dialog-close { position: absolute; right: 13px; top: 13px; padding: 4px 9px; }
form { display: grid; gap: 12px; }
form label { display: grid; gap: 5px; color: #c5cfc7; font-size: .82rem; }
form input, form select { width: 100%; color: inherit; border: 1px solid var(--border); border-radius: 5px; padding: 9px 10px; background: var(--inset); font: inherit; }
#controls-dialog { width: min(495px, calc(100% - 24px)); }
#controls-dialog h3 { margin-top: 12px; font-size: .9rem; color: var(--gold); }
#controls-dialog .control > :last-child { text-align: right; }
#inventory-dialog { width: min(850px, calc(100% - 24px)); }
:is(#digimon-dialog, #storage-dialog) { width: min(756px, calc(100% - 24px)); }
:is(#digimon-dialog, #storage-dialog)[open], #catalog-dialog[open], #tutorial-dialog[open] { display: flex; flex-direction: column; height: min(570px, calc(100dvh - 24px)); max-height: calc(100dvh - 24px); overflow: hidden; }
:is(#digimon-dialog, #storage-dialog)[open] { height: min(710px, calc(100dvh - 24px)); }
#roster-window { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.digimon-layout { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; flex: 1; min-height: 0; }
.roster-panel, .digimon-profile { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--inset); }
.roster-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 11px; }
.digimon-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 112px), 1fr)); align-content: start; gap: 6px; overflow: auto; min-height: 0; overscroll-behavior: contain; }
.storage-search { display: grid; gap: 4px; margin-bottom: 8px; font-size: .76rem; color: #c7d2ca; }
.storage-search input { width: 100%; min-width: 0; color: inherit; padding: 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 5px; }
#digimon-detail { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.digimon-roster-entry { display: grid; min-width: 0; gap: 4px; justify-items: center; text-align: center; padding: 6px; border-radius: 6px; border: 1px solid #33578b; background: linear-gradient(150deg, #234a78, #142742); }
.digimon-roster-entry[aria-pressed="true"] { border-color: var(--gold); background: #263d62; }
.digimon-roster-entry .creature-portrait { width: 54px; height: 54px; background: #122745; }
.digimon-roster-entry strong { display: block; font-size: .8rem; overflow-wrap: anywhere; }
.digimon-roster-entry small { display: block; margin-top: 2px; font-size: .67rem; }
.digimon-status-layout { display: grid; grid-template-columns: minmax(110px, .9fr) minmax(0, 1.1fr); gap: 13px; align-items: stretch; padding: 10px; border: 1px solid #325583; border-radius: 8px; background: linear-gradient(120deg, #173458, #142443); }
.digimon-figure { position: relative; display: grid; min-height: 156px; place-items: center; border: 1px solid #39668f; border-radius: 7px; background: radial-gradient(ellipse, #234c79, #101d3c 80%); overflow: hidden; }
.digimon-figure::before { content: ''; position: absolute; inset: 8px; border: 1px solid #7ad9ff3b; border-radius: 5px; background-image: linear-gradient(#7ad9ff20 1px, transparent 1px), linear-gradient(90deg, #7ad9ff20 1px, transparent 1px); background-size: 16px 16px; }
.digimon-stats h3 { margin-top: 3px; font-size: clamp(1.12rem, 3vw, 1.55rem); overflow-wrap: anywhere; }
.digimon-level { display: block; margin-top: 6px; color: var(--gold); font: .8rem Consolas, monospace; }
.digimon-attributes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 9px 0; }
.digimon-attributes div { padding: 5px; border: 1px solid #365980; border-radius: 5px; background: #0e1e3a; }
.digimon-attributes dt { color: var(--muted); font-size: .65rem; overflow-wrap: anywhere; }
.digimon-attributes dd { margin: 3px 0 0; color: #e8f2e9; font: bold .83rem Consolas, monospace; }
.digimon-stats .outline { text-align: left; font-size: .75rem; }
.digimon-stats > .form-note { margin-top: 5px; }
.digimon-moves h3, .digimon-evolution h3 { font-size: 1rem; }
.digimon-moves .topic-tabs { margin-block: 8px; }
.digimon-move { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; margin-block: 3px; padding: 6px 8px; border-radius: 5px; border: 1px solid var(--border); background: var(--blue-panel); font-size: .76rem; }
.digimon-move .mono { color: var(--teal); font-size: .69rem; }
.digimon-move p { grid-column: 1 / -1; }
.digimon-move .skill-art { width: 31px; height: 29px; object-fit: contain; }
.evolution-flow { display: grid; grid-template-columns: minmax(100px, .36fr) minmax(0, 1fr); gap: 20px; margin: 10px 2px 10px 0; }
.evolution-origin { align-self: start; display: grid; justify-items: center; gap: 5px; padding: 10px 6px;
  border: 1px solid #4c8294; border-radius: 5px; background: radial-gradient(ellipse at 50% 48%, #28546b, #142a42 80%);
  text-align: center; }
.evolution-origin strong, .evolution-form strong { overflow-wrap: anywhere; }
.evolution-origin small, .evolution-origin > span:last-child { color: #b8cedb; font-size: .74rem; }
.evolution-origin .creature-portrait { width: 64px; height: 64px; background: transparent; }
.evolution-route { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; position: relative; }
.evolution-form { position: relative; min-height: 65px; min-width: 0; display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border: 1px solid #355772; border-radius: 5px; background: linear-gradient(95deg, #1b374e, #132638); font-size: .8rem; }
.evolution-form::before { content: ''; position: absolute; top: 50%; left: -11px; width: 10px; border-top: 1px solid #4b8196; }
.evolution-form:first-child::before { left: -21px; width: 20px; }
.evolution-form::after { content: ''; position: absolute; inset: -8px auto -1px -11px; border-left: 1px solid #4b8196; }
.evolution-form:first-child::after { top: 50%; }
.evolution-form:last-child::after { bottom: 50%; }
.evolution-form[data-ready="true"] { border-color: #76bcb0; }
.evolution-form .creature-portrait { width: 46px; height: 46px; margin: 0; flex: 0 0 auto; background: transparent; }
.evolution-form-details { flex: 1; min-width: 0; }
.evolution-form button { padding: 6px 8px; font-size: .72rem; }
.evolution-form button:not(:disabled) { color: #d3f9ee; border-color: #72ada4; }
.evolution-requirements { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; color: #f2d7a6; font-size: .66rem; }
.evolution-requirements > span { padding: 2px 5px; border-radius: 3px; background: #0f2031; border: 1px solid #bd9f635c; }
.evolution-requirements > [data-met="true"] { color: #a8e7d0; border-color: #66a99885; }
.evolution-requirements > [data-met="true"]::before { content: '✓ '; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 580px) {
  .evolution-flow { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .evolution-origin { position: relative; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; justify-items: start;
    text-align: start; padding: 7px 9px; }
  .evolution-origin .creature-portrait { width: 58px; height: 58px; grid-row: 1 / 3; grid-column: 1; }
  .evolution-origin small { align-self: end; }
  .evolution-origin strong { grid-column: 2; align-self: start; }
  .evolution-origin > span:last-child { grid-column: 3; grid-row: 1 / 3; }
  .evolution-origin::after { content: ''; position: absolute; bottom: -14px; left: 14px; height: 13px; border-left: 1px solid #4b8196; }
  .evolution-route { margin-left: 24px; }
  .evolution-form:first-child::after { top: -1px; }
  .evolution-form:first-child::before { left: -11px; width: 10px; }
}
.evolution-controls { display: grid; gap: 7px; }
.evolution-controls .primary { width: fit-content; }
.roster-swap { display: grid; gap: 5px; margin: 0 0 8px; font-size: .75rem; }
.roster-swap select { min-width: 0; padding: 5px; border: 1px solid #435247; border-radius: 4px; background: #202e27; color: inherit; font: inherit; }
@media (min-width: 650px) {
  #storage-dialog[open] { height: min(590px, calc(100dvh - 24px)); }
  #storage-dialog .digimon-layout { grid-template-columns: minmax(186px, 1fr) minmax(0, 2.2fr); grid-template-rows: minmax(0, 1fr); }
  #storage-dialog .roster-panel { grid-area: 1 / 1; }
  #storage-dialog .digimon-profile { grid-area: 1 / 2; }
  #storage-dialog .digimon-roster { grid-template-columns: minmax(0, 1fr); }
  #storage-dialog .digimon-roster-entry { grid-template-columns: 38px minmax(0, 1fr); align-items: center; justify-items: start; gap: 8px; text-align: left; }
  #storage-dialog .digimon-roster-entry .creature-portrait { width: 38px; height: 38px; }
}
#digimon-message, #inventory-message { color: #c8e5d5; }
#digimon-message[data-error], #inventory-message[data-error] { color: #f1b0a1; }
.inventory-layout { display: grid; grid-template-columns: minmax(160px, .9fr) minmax(0, 1.6fr); gap: 12px; }
.inventory-section, .inventory-detail { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--inset); }
.inventory-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.inventory-heading h3, .inventory-detail h3, .character-summary h3 { font-size: .91rem; }
.inventory-heading .mono { color: var(--gold); font-size: .71rem; white-space: nowrap; }
.inventory-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)); gap: 6px; margin-top: 9px; max-height: 33vh; overflow: auto; }
.inventory-entry { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 6px; align-items: center; text-align: left; padding: 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--blue-panel); }
.inventory-entry .catalog-icon { grid-row: 1 / 3; }
.inventory-entry strong { font-size: .72rem; overflow-wrap: anywhere; }
.inventory-entry .mono { color: #b2d5c3; font-size: .68rem; }
.inventory-entry[aria-pressed="true"] { border-color: var(--gold); background: var(--blue-hover); }
.inventory-detail { margin-top: 12px; font-size: .8rem; }
.inventory-detail p { margin-top: 5px; }
.inventory-detail ul { margin-block: 6px 0; padding-left: 20px; color: #d6dfd8; }
.inventory-item-heading { display: flex; align-items: center; gap: 8px; }
.inventory-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 9px; }
#character-dialog { width: min(1060px, calc(100% - 24px)); }
#character-dialog[open] { display: flex; flex-direction: column; overflow: hidden; max-height: calc(100dvh - 24px); }
#character-form { display: flex; flex-direction: column; min-height: 0; }
.character-layout { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
#character-form .character-layout { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.character-board, .character-library { min-width: 0; padding: 13px; border: 1px solid #638ba132; border-radius: 8px; background: #0b1c2c78; }
.character-section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.character-section-head h3 { font-size: .93rem; }
#character-parts-count { color: #aebfb4; font-size: .7rem; white-space: nowrap; }
.character-preview, .profile-identity {
  display: grid; justify-items: center; align-content: center; gap: 9px; padding: 14px; border-radius: 5px;
  background: radial-gradient(ellipse at center, #254a60, transparent 72%), #0c2031; color: #e1f1f9;
  text-align: center; overflow-wrap: anywhere;
}
.tamer-portrait, .compact-portrait { position: relative; flex: none; aspect-ratio: 1; }
.tamer-portrait { width: 77px; height: 77px; isolation: isolate; }
.tamer-portrait::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: url('/art/partner-rune.png') center / contain no-repeat;
  filter: drop-shadow(0 0 5px #8addfc7f); animation: field-rune-turn 29s linear infinite;
}
:is(.tamer-portrait, .compact-portrait) img { position: absolute; inset: 13%; width: 74%; height: 74%; object-fit: contain; image-rendering: pixelated; }
:is(.tamer-portrait, .compact-portrait) .custom-tamer-portrait { object-fit: cover; image-rendering: auto; border-radius: 50%; }
#profile-dialog { width: min(600px, calc(100% - 24px)); max-height: calc(100dvh - 22px);
  padding: clamp(12px, 3vw, 24px); background: linear-gradient(144deg,#173044,#101f32 70%); border-top: 2px solid #9dd6dd; }
#profile-title { padding-inline-end: 34px; }
.account-tabs { margin: 0 0 10px; padding-bottom: 5px; border-bottom: 1px solid #557b8d70; }
.account-settings-panel, .account-forms { display: grid; gap: 8px; }
#account-identity { grid-template-columns: minmax(92px, .48fr) minmax(0, 1fr); align-items: start; }
.account-settings-card { display: grid; gap: 7px; min-width: 0; padding: 10px; border: 1px solid #597a9069;
  border-radius: 6px; background: #112235; }
.account-settings-card label { display: grid; gap: 4px; min-width: 0; color: #c9e1ef; font-size: .79rem; }
.account-settings-card input { width: 100%; min-width: 0; }
.account-settings-card button { justify-self: start; min-height: 34px; font-size: .77rem; }
#rename-price { display: inline-flex; margin-inline-start: 5px; color: #ead2ff; }
#profile-message:empty { display: none; }
#profile-message:not([data-error]) { color: #a8e6c6; }
#profile-message[data-error] { color: #ffc2b3; }
@media (max-width: 460px) {
  #account-identity { grid-template-columns: minmax(0, 1fr); }
  .profile-identity { grid-template-columns: 77px minmax(0, 1fr); align-items: center; justify-items: start; text-align: start; }
}
.character-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.character-slot, .character-part { display: flex; width: 100%; min-width: 0; gap: 8px; align-items: center; text-align: left; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; background: var(--blue-panel); }
.character-slot:hover, .character-part:hover { border-color: #8cab95; }
.character-slot[aria-pressed="true"], .character-part[aria-pressed="true"] { border-color: #af8d5b; background: #2c2b21; }
.character-row-name { display: grid; flex: 1 1 auto; min-width: 0; gap: 2px; }
.character-row-name small { color: #aabbb1; font-size: .69rem; }
.character-row-name strong { font-size: .8rem; line-height: 1.18; overflow-wrap: anywhere; }
.character-part-icon { flex: 0 0 33px; height: 33px; display: grid; place-items: center; border-radius: 5px;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--gear-accent, #88a8bd) 22%, #0d2031), #0d2031); }
.character-part-icon .catalog-icon { width: 27px; height: 27px; border: 0; background: none; }
.character-chip { flex-shrink: 0; padding: 3px 6px; border: 1px solid #436d5d; border-radius: 5px; background: #1f382c; color: #c0e2ca; font-size: .66rem; line-height: 1.2; white-space: nowrap; }
.character-chip[data-staged="true"] { border-color: #8c7049; background: #352b20; color: #f4d39c; }
.character-summary { margin-top: 11px; padding-top: 9px; border-top: 1px solid #3b5146; }
.character-summary dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 7px 0 0; }
.character-summary dl > div { min-width: 0; padding: 5px 7px; border-radius: 5px; background: var(--blue-panel); }
.character-summary dt { color: #b5c7bb; font-size: .69rem; }
.character-summary dd { margin: 3px 0 0; color: #f2d39d; font-size: .86rem; font-weight: 700; }
.character-summary dd[data-error="true"] { color: #ffb4a2; }
.character-filters { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.character-filters .filter-button {
  padding: 6px 8px; border: 1px solid transparent; border-radius: 4px;
  color: #cae1ee; font-size: .75rem; background: #172b40;
}
.character-filters .filter-button[aria-pressed="true"] { color: #ffe1ab; border-color: #946f4394; background: #34323a; }
.character-parts { display: grid; gap: 5px; max-height: min(330px, 42vh); margin: 0; padding: 2px; overflow: auto; list-style: none; }
.character-part-detail { margin-top: 9px; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--blue-panel); }
.character-detail-title { display: flex; gap: 8px; align-items: center; }
.character-detail-title h4 { margin: 0; font-size: .92rem; overflow-wrap: anywhere; }
.character-part-detail p { margin-top: 7px; color: #c7d5cc; font-size: .78rem; line-height: 1.35; }
.character-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }
.character-actions .primary, .character-actions .outline { width: auto; min-height: 36px; font-size: .79rem; }
.character-actions #character-message { flex: 1 1 190px; margin: 0; color: #c8e5d5; }
.character-actions #character-message[data-error="true"] { color: #f1b0a1; }
@media (max-width: 730px) {
  .character-layout { grid-template-columns: minmax(0, 1fr); }
  .character-parts { max-height: 42dvh; }
  .character-actions { position: sticky; bottom: -10px; z-index: 1; padding: 7px 0; border-top: 1px solid #4a5b50; background: #1b2620; }
}
@media (max-width: 390px) {
  #character-dialog { padding: 16px 12px; }
  .character-board, .character-library { padding: 9px; }
  .character-slot { padding-inline: 5px; gap: 4px; }
}
#npc-dialog { width: min(500px, calc(100% - 25px)); }
#npc-dialog.connector { width: min(790px, calc(100% - 24px)); max-height: calc(100dvh - 18px);
  padding: clamp(12px, 3vw, 24px); background: linear-gradient(145deg,#173148,#102135 72%); border-top: 2px solid #97d6de; }
#npc-content > p { color: var(--muted); font-size: .87rem; line-height: 1.5; }
.domain-filters { display: grid; grid-template-columns: minmax(75px, 2fr) minmax(69px, .75fr) minmax(73px, 1fr); gap: 6px; margin-bottom: 5px; }
.domain-filters label { min-width: 0; display: grid; gap: 4px; font-size: .76rem; color: #b6c8d6; }
.domain-filters :is(input, select) {
  min-width: 0; width: 100%; min-height: 36px; color: #e1eef8; font: inherit;
  border: 1px solid #638ba155; border-radius: 4px; padding: 5px 7px; background: var(--inset);
}
.domain-count { margin-bottom: 6px; color: #b4cad5; font-size: .75rem; }
.domain-workspace { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.domain-workspace.domain-guided { grid-template-columns: minmax(0, 1fr); }
.domain-guided .domain-list { display: none; }
.domain-list { display: grid; gap: 3px; align-content: start; min-width: 0; max-height: min(58dvh, 460px);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 4px; background: #102235; border: 1px solid #4d778b6a; border-radius: 7px; }
.domain-summary {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 7px; align-items: center; text-align: start; min-width: 0;
  padding: 6px; background: #172e43; border: 1px solid transparent; border-radius: 5px;
}
.domain-summary:is(:hover,[aria-pressed="true"]) { background: #224758; border-color: #81c3c98f; }
.domain-summary .game-icon { width: 21px; }
.domain-identity { display: grid; gap: 2px; min-width: 0; font-size: .83rem; overflow-wrap: anywhere; }
.domain-access, .domain-identity > span { color: #b8d4e1; font-size: .77rem; }
.domain-entry-body { min-width: 0; display: grid; gap: 9px; padding: 11px; font-size: .8rem; border: 1px solid #4d778b6a;
  border-radius: 7px; background: linear-gradient(145deg, #1c3a50, #122437 70%); overflow-wrap: anywhere; }
.domain-entry-body h3 { display: flex; align-items: center; gap: 6px; }
.domain-entry-body h3 canvas { flex: none; width: 20px; }
.domain-entry-body h4 { margin: 0; color: #b9d5e1; }
.domain-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; color: #c5dde9; }
.domain-meta span { display: inline-flex; align-items: center; gap: 4px; }
.domain-meta .catalog-icon { width: 18px; height: 18px; border: 0; background: transparent; }
.domain-conditions { display: grid; gap: 5px; padding-left: 16px; margin: 0; color: #c0d5e3; }
.domain-conditions [data-effect="negative"] { color: #ffb1aa; }
.domain-conditions [data-effect="positive"] { color: #a9ebc9; }
.domain-entry-body .primary { justify-self: start; width: auto; min-height: 38px; padding: 7px 16px; }
@media (max-width: 575px) and (orientation: portrait) {
  .domain-workspace { grid-template-columns: minmax(0, 1fr); }
  .domain-list { max-height: min(31dvh, 250px); }
}
.form-note { color: var(--muted); font-size: .76rem; }
#catalog-dialog { width: min(960px, calc(100% - 24px)); }
#catalog-dialog[open] { height: min(630px, calc(100dvh - 24px)); }
#catalog-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.catalog-filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.catalog-filters label { min-width: 0; display: grid; gap: 4px; font-size: .77rem; color: #c7d2ca; }
.catalog-filters :is(input, select) { min-width: 0; width: 100%; padding: 8px 9px; background: var(--inset); border: 1px solid var(--border); border-radius: 5px; font: inherit; color: inherit; }
.catalog-layout { display: grid; grid-template-columns: minmax(155px, .8fr) minmax(0, 2fr); gap: 12px; flex: 1; min-height: 0; }
.catalog-index { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 7px; border: 1px solid var(--border); border-radius: 8px; background: var(--inset); }
.catalog-count { padding: 2px 4px 7px; color: #a8c3b0; font: .73rem Consolas, monospace; }
.catalog-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; align-content: start; padding: 1px 4px; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.catalog-row { display: flex; align-items: center; text-align: left; min-height: 55px; gap: 8px; padding: 5px 8px; background: var(--blue-panel); border: 1px solid var(--border); border-radius: 6px; }
.catalog-row:is(:hover,[aria-pressed="true"]) { border-color: #c19a66; }
.catalog-row .creature-portrait { width: 43px; height: 43px; background: var(--inset); }
.catalog-row strong { display: block; font-size: .84rem; overflow-wrap: anywhere; }
.catalog-row small { display: block; font-size: .69rem; color: var(--muted); }
.catalog-row > span:nth-child(2) { min-width: 0; }
.catalog-row :is(strong, small) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catalog-row > .game-icon { width: 17px; margin-inline-start: auto; flex: 0 0 auto; }
.catalog-detail { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 8px; border-radius: 8px; background: var(--inset); border: 1px solid var(--border); }
.catalog-heading { display: flex; gap: 16px; align-items: center; padding: 12px; border-radius: 7px; background: linear-gradient(110deg, #23477a, #162846 66%); }
.catalog-figure { flex: 0 0 auto; display: grid; justify-items: center; gap: 5px; min-width: 108px; padding: 6px; border-radius: 7px; border: 1px solid #426da0; background: radial-gradient(ellipse at 50% 75%, #305987, #132648 75%); }
.catalog-heading h3 { margin: 3px 0; font-size: clamp(1.23rem, 3vw, 2.1rem); overflow-wrap: anywhere; color: #f7e7ca; letter-spacing: -.035em; }
.catalog-tabs { flex-shrink: 0; margin-top: 9px; }
.catalog-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.catalog-section { padding: 8px; }
.catalog-section h4 { margin: 5px 0 8px; font-size: .86rem; }
.catalog-identity, .catalog-growth { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 83px), 1fr)); gap: 5px; margin: 0 0 12px; }
.catalog-identity > div, .catalog-growth > div { padding: 7px; background: #223329; border: 1px solid #3a4f41; border-radius: 5px; }
.catalog-identity dt, .catalog-growth dt { color: #b3c3b8; font-size: .7rem; }
.catalog-identity dd, .catalog-growth dd { margin: 5px 0 0; font-size: .82rem; font-weight: 650; overflow-wrap: anywhere; }
.catalog-growth dd { color: var(--gold); }
.catalog-growth dd small { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; }
.catalog-matchups { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; margin-bottom: 7px; border: 1px solid #3a4f41; border-radius: 5px; font-size: .78rem; }
.catalog-matchups > span { flex-basis: 100%; color: #b6c7ba; }
.catalog-matchups .weakness { color: #ffb39e; }
.catalog-matchups .resistance { color: #a9e8bc; }
.catalog-move { padding: 9px; margin-bottom: 7px; border: 1px solid #3a4f41; border-radius: 5px; background: #1b2921; }
.catalog-move div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px; font-size: .82rem; }
.catalog-move div > span { color: var(--gold); }
.catalog-move p, .catalog-move > small { display: block; margin-top: 4px; font-size: .76rem; color: var(--muted); }
.catalog-icon { width: 28px; height: 28px; flex-shrink: 0; image-rendering: pixelated; background: #182821; border: 1px solid #435247; border-radius: 4px; }
.energy-alert { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 7px; z-index: 4; background: #100807dc; color: #ffdbd0; text-align: center; }
.energy-alert span { color: #ffa18b; font: bold .75rem Consolas, monospace; letter-spacing: .09em; }
.energy-alert strong { font-size: clamp(1.35rem, 4vw, 2.75rem); }
.notices { position: fixed; inset: max(12px, env(safe-area-inset-top)) 0 auto; width: min(388px, calc(100% - 30px));
  max-height: none; overflow: visible; margin: 0 auto; padding: 0; color: #f1f5fa; background: none; border: 0; pointer-events: none; }
.notices:popover-open { display: grid; gap: 6px; }
.notice { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px;
  padding: 6px 7px 6px 8px; border: 1px solid #6683978c; border-radius: 27px; background: #101b28f5;
  box-shadow: 0 8px 22px #03091085; animation: game-content-reveal .22s ease-out both; }
.notice-medallion { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #224458; }
.notice-medallion :is(.catalog-icon, .game-icon) { width: 22px; height: 22px; object-fit: contain; }
.notice-copy h2 { margin: 0 0 2px; color: #bad7e8; font-size: .69rem; font-weight: 600; }
.notice ul { display: flex; flex-wrap: wrap; column-gap: 11px; row-gap: 3px; padding: 0; margin: 0; list-style: none; }
.notice li { display: flex; align-items: center; gap: 4px; overflow-wrap: anywhere; font-size: .76rem; }
.notice li img { width: 14px; height: 14px; object-fit: contain; }
.notice-dismiss { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0;
  border-radius: 50%; background: #2a394a; color: #f2f6fd; font: 500 1.15rem/1 system-ui; pointer-events: auto; }
.notice-dismiss:hover { background: #3e5770; }

@media (max-width: 1040px) {
  .shell { width: calc(100% - 32px); }
  .sidebar .panel { padding: 11px; }
}
@media (max-width: 730px) {
  .topbar { gap: 4px; padding-inline: 12px; }
  .brand { gap: 6px; font-size: .6rem; letter-spacing: .07em; }
  .brand-icon { width: 22px; height: 22px; }
  nav { gap: 0; }
  nav button { padding: 7px; font-size: .75rem; }
  .account { gap: 4px; }
  .account span { max-width: 8ch; }
  .account .outline { padding: 6px; font-size: .75rem; }
  .shell { width: calc(100% - 20px); }
  .intro { padding: 14px 0 12px; }
  .field { grid-column: 1 / -1; grid-row: 1; }
  .field-head { padding: 10px 12px; gap: 7px; }
}
@media (max-width: 950px) {
  .topbar { grid-template-columns: 1fr auto; row-gap: 0; }
  .topbar nav { grid-row: 2; grid-column: 1 / -1; justify-content: center; flex-wrap: wrap; }
  .topbar .account { grid-column: 2; grid-row: 1; }
}
@media (max-width: 540px) {
  #digimon-dialog, #storage-dialog, #catalog-dialog, #tutorial-dialog { padding: 16px; }
  .digimon-layout { grid-template-rows: minmax(0, 1.7fr) minmax(0, 1fr); gap: 7px; }
  .roster-panel, .digimon-profile { padding: 8px; }
  .digimon-roster { grid-template-columns: repeat(auto-fill, minmax(min(100%, 74px), 1fr)); }
  .digimon-roster-entry .creature-portrait { width: 41px; height: 41px; }
  .digimon-status-layout { grid-template-columns: minmax(min(47%, 110px), .9fr) minmax(0, 1.1fr); gap: 8px; }
  .digimon-figure { min-height: 125px; }
  .digimon-attributes div { padding-inline: 3px; }
  .digimon-attributes dt { font-size: .59rem; }
  .inventory-layout { grid-template-columns: 1fr; }
  .inventory-list { max-height: 20vh; }
  .catalog-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: fit-content(29%) minmax(0, 1fr); gap: 7px; }
  .catalog-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr)); }
  .catalog-filters label:first-child { grid-column: 1 / -1; }
  .catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-row .creature-portrait { width: 32px; height: 32px; }
  .catalog-row { min-height: 44px; padding: 4px; gap: 5px; }
  .catalog-heading { padding: 6px; gap: 7px; }
  .topbar { grid-template-columns: 1fr auto; row-gap: 0; }
  .topbar nav { grid-row: 2; grid-column: 1 / -1; justify-content: center; }
  .topbar .account { grid-column: 2; grid-row: 1; }
}
@media (pointer: coarse) {
  :is(.catalog-filters, .storage-search, .domain-filters) :is(input, select) { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .battle-sprite:not([data-atlas])[data-motion="faint"] .sprite-art { animation: none; }
  .meter span { transition: none; }
  .fighter-trigger[aria-pressed="true"] .target-frame,
  .battle-result { animation: none; }
  .fighter-action, .combat-feedback, .combat-modifier[data-modifier], .battle-victory[open], .victory-emblem { animation: none; }
}

.item-tooltip { --tip-accent: #8cbed4; position: fixed; inset: auto; z-index: 5; width: max-content;
  max-width: min(275px, calc(100vw - 16px)); margin: 0; padding: 8px 11px;
  border: 1px solid #44667e; border-left: 3px solid var(--tip-accent); border-radius: 3px 7px 7px 3px;
  color: #d3e4ef; background: linear-gradient(135deg, #1b3448, #0b1b2b 78%); box-shadow: 0 9px 26px #0009;
  font-size: .77rem; line-height: 1.35; pointer-events: none; }
.item-tooltip[data-rarity="uncommon"] { --tip-accent: #92d7b2; }
.item-tooltip[data-rarity="rare"] { --tip-accent: #b7a3ed; }
.item-tooltip[data-rarity="epic"] { --tip-accent: #f0c884; }
.item-tooltip:popover-open { display: grid; gap: 5px; animation: game-content-reveal .12s ease-out both; }
.item-tooltip.action-tooltip { padding: 5px 9px; border-width: 1px; border-radius: 5px; color: #e1f4fb; }
.item-tip-heading { display: flex; align-items: center; gap: 6px; color: #edf6fe; }
.item-tip-heading .catalog-icon { width: 24px; height: 24px; object-fit: contain; }
.item-tip-heading .game-icon { width: 16px; height: 16px; }
.item-tip-rarity { color: var(--tip-accent); font-size: .7rem; font-weight: 720; }
.item-tooltip > small { padding-bottom: 4px; border-bottom: 1px solid #52728b52; color: var(--tip-accent); font-size: .69rem; }
.item-tooltip ul { display: grid; gap: 3px; margin: 1px 0 0; padding-left: 15px; }
.item-tooltip li::marker { color: var(--tip-accent); }
.item-tip-stats { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; margin: 2px 0 0; }
.item-tip-stats dd { margin: 0; color: var(--tip-accent); font-weight: 700; text-align: end; }
#tutorial-dialog { width: min(620px, calc(100% - 24px)); }
#tutorial-dialog[open] { height: min(460px, calc(100dvh - 24px)); }
#training-exit { align-self: flex-start; margin-top: 9px; }
.topic-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.topic-tabs button { min-height: 34px; }
.tutorial-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 3px; }
.tutorial-note { padding: 12px; margin-top: 14px; border: 1px solid #5d6b57; background: #223128; border-radius: 7px; }
.tutorial-note p { margin-top: 4px; color: #bccbc1; line-height: 1.52; }
#missions-dialog { width: min(800px, calc(100% - 24px)); max-height: calc(100dvh - 24px); }
.tutorial-steps { display: grid; gap: 13px; margin: 15px 0 20px; padding-inline-start: 22px; }
.tutorial-steps li::marker { color: #efc483; font-weight: 700; }
.tutorial-steps p { margin: 4px 0 0; color: #bccbc1; line-height: 1.52; }
.mission-periods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px;
  border: 1px solid #4b6c835c; border-radius: 7px; background: #0c1a29; }
.mission-tab { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; padding: 4px;
  border: 1px solid transparent; border-radius: 4px; color: #bfd5e2; background: transparent; font-size: .8rem; }
.mission-tab:hover { color: #edf7fb; }
.mission-tab[aria-pressed="true"] { color: #d9f9f6; background: #203d4e; border-color: #689a9b75; box-shadow: inset 0 -2px #8cdacc; }
.mission-count { min-width: 16px; padding-inline: 3px; border-radius: 9px; background: #c1e7a4; color: #152b29;
  text-align: center; font-size: .67rem; }
.mission-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 13px; margin: 10px 0; padding: 8px 10px;
  color: #bbd0db; font-size: .75rem; background: #162b3a; border-radius: 5px; }
.mission-completion, .mission-markers, .mission-renewal { display: flex; align-items: center; gap: 5px; }
.mission-completion strong { color: #e1efee; }
.mission-markers i { width: 8px; height: 4px; border-radius: 2px; background: #425d72; }
.mission-markers i[data-complete] { background: #adebbc; }
.mission-renewal { margin-inline-start: auto; white-space: nowrap; }
.mission-renewal .game-icon { width: 16px; height: 16px; }
.mission-ready { color: #d8eca8; }
.mission-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mission-card { display: grid; grid-template-rows: auto 1fr auto auto; align-items: start; gap: 9px; min-width: 0;
  padding: 11px; border: 1px solid #45657984; border-top: 2px solid #619dab; border-radius: 6px;
  background: radial-gradient(ellipse at 10% 0%, #284b5e, transparent 64%), #152838;
  animation: game-content-reveal .22s var(--mission-delay, 0ms) ease-out both; }
.mission-card[data-status="ready"] { --progress-color: #d1e69b; border-color: #a4bf81; background: radial-gradient(ellipse at 10% 0%, #355248, transparent 68%), #1b3031; }
.mission-card[data-status="claimed"] { border-top-color: #608b7c; }
.mission-card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mission-icon { display: grid; place-items: center; flex: none; width: 37px; height: 37px; border: 1px solid #5a8294;
  border-radius: 6px; background: #102739; }
.mission-icon .game-icon { width: 22px; }
.mission-objective, .mission-payout { display: grid; gap: 5px; min-width: 0; }
.mission-progress { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.mission-card h3 { margin: 0; font-size: .92rem; }
.mission-objective p { color: #b7ccd7; font-size: .75rem; line-height: 1.4; }
.mission-progress .mono { color: #c0d8e7; font-size: .74rem; white-space: nowrap; }
.mission-payout { min-height: 65px; align-content: start; border-top: 1px solid #648b9a44; padding-top: 7px; }
.mission-value { display: flex; flex-wrap: wrap; gap: 4px; color: #e2f0f5; font-size: .72rem; }
.mission-value > span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 5px; border-radius: 4px; background: #0d1e2c; }
.mission-value .catalog-icon { flex: none; width: 15px; height: 15px; object-fit: contain; }
.mission-card button { width: auto; justify-content: center; padding: 4px 8px; border-color: #b3d28f; min-height: 30px;
  background: #d4e9a1; font-size: .75rem; }
.mission-card button:hover:not(:disabled) { background: #e4f5b8; }
.mission-state { border-radius: 4px; padding: 3px 6px; background: #0f2536; color: #bfdae8; font-size: .69rem; }
.mission-card[data-status="ready"] .mission-state { background: #293d2b; color: #e0f1ac; }
.mission-claim-location { color: #d8eca8; font-size: .73rem; }
@media (max-width: 640px) {
  .mission-list { grid-template-columns: minmax(0, 1fr); }
  .mission-card { grid-template: auto auto auto / minmax(0, 1fr) auto; gap: 6px 8px; padding: 8px 9px; }
  .mission-card-head { grid-column: 2; grid-row: 1; flex-direction: column; align-items: end; gap: 3px; }
  .mission-objective { grid-column: 1; grid-row: 1; align-self: center; }
  .mission-icon { width: 32px; height: 32px; }
  .mission-progress, .mission-payout { grid-column: 1 / -1; }
  .mission-payout { grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: 0; padding-top: 5px; }
  .mission-renewal { margin-inline-start: 0; }
}
[data-status="claimed"] .mission-state { color: #a5e3bd; }
.shell:has(.battle-field) { padding-top: 18px; }
.shell:has(.battle-field) .intro { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.battle-field .field-head { display: none; }
.battle-field .field { border: 0; border-radius: 0; background: transparent; }

@media (max-width: 730px), (orientation: landscape) and (max-height: 540px), (pointer: coarse) and (max-width: 1100px) {
  body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    overflow: hidden;
  }
  .topbar { padding: 3px 8px; min-height: 0; gap: 2px 6px; }
  .topbar nav { justify-content: safe center; flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .topbar nav button { padding: 7px 9px; font-size: .75rem; }
  .shell, .shell:has(.battle-field) { display: grid; width: 100%; min-height: 0; padding: 0; }
  .shell .intro, .shell .foot { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .workspace { min-height: 0; }
  .field { display: flex; flex-direction: column; min-height: 0; border: 0; border-radius: 0; }
  .field-head { flex: 0 0 auto; min-height: 45px; padding: 4px 10px; }
  .field-head .eyebrow { display: none; }
  .field-head h2 { margin: 0; font-size: .94rem; }
  .location { gap: 2px; }
  #retreat { padding: 5px 8px; }
  .map-stage { --world-width: 100cqw; flex: 1 1 0; min-height: 0; }
  #world { --world-fit: 1; --world-columns: 8; --world-rows: 7; width: 100%; height: 100%; }
  .field-actions { flex: 0 0 auto; padding: 6px 8px; }
  #touch:not([hidden]) { width: min(100%, 196px); }
  .combat, .arena { flex: 1 1 0; min-height: 0; }
  .combat { display: flex; }
  .battlefield {
    --arena-hud-space: clamp(170px, 34%, 230px);
    --lane-step: max(clamp(36px, 9vw, 54px), var(--tallest-fighter, 64px) * .36);
    --back-y: min(max(56%, var(--tallest-fighter, 64px) + 42px), 72%);
    --middle-gap: max(32%, var(--widest-fighter, 64px) + 12px);
    --outer-inset: max(18%, var(--widest-fighter, 64px) / 2 + 6px);
    --front-inset: var(--outer-inset);
    height: 100%;
    min-height: 0;
  }
  .battlefield[data-scene] {
    --ally-1-x: calc(50% - var(--middle-gap) / 2); --ally-1-y: calc(var(--back-y) + var(--lane-step));
    --ally-2-x: var(--outer-inset); --ally-2-y: var(--back-y);
    --ally-3-x: var(--front-inset); --ally-3-y: min(calc(var(--back-y) + 2 * var(--lane-step)), 97%);
    --enemy-1-x: calc(50% + var(--middle-gap) / 2); --enemy-1-y: var(--ally-1-y);
    --enemy-2-x: calc(100% - var(--outer-inset)); --enemy-2-y: var(--ally-2-y);
    --enemy-3-x: calc(100% - var(--front-inset)); --enemy-3-y: var(--ally-3-y);
  }
  #enemy-line > .fighter:nth-child(2) .fighter-nameplate { left: calc(50% - 28px); }
  .command-panel { left: 9px; bottom: 9px; width: min(calc(53% - 15px), 270px); }
  .command-head { padding-inline: 2px; gap: 4px; }
  .command-actions { gap: 3px; }
  .command-detail { padding-inline: 4px; }
  .target-controls { bottom: 9px; }
  .order, .orders[data-menu="root"] .order { min-height: 39px; padding-inline: 6px; }
  .order-label { gap: 4px; font-size: .76rem; }
  .orders:is([data-menu="battle"], [data-menu="items"]) { max-height: min(118px, 20dvh); }
  #battle-party { bottom: 9px; right: 8px; width: min(180px, 43%); }
  .battle-party-member { grid-template-columns: 19px minmax(0, 1fr); gap: 3px; padding: 2px 4px; }
  .battle-party-member > .creature-portrait { width: 19px; height: 19px; }
  .battle-party-name { font-size: .64rem; }
  .battle-party-member .member-stat { line-height: 1.25; }
  .battle-party-member .stat-value { font-size: .54rem; }
  #battle-speed { top: 7px; right: 8px; min-width: 42px; min-height: 36px; }

}

@media (max-width: 420px) {
  #world { --world-columns: 7; }
}

@media (max-width: 540px) {
  .account #username { display: none; }
  .battle-timeline { --queue-step: 24px; width: 35px; top: 43%; right: 7px; }
  #timeline-next { gap: 4px; }
  #timeline-next li:nth-child(n) { translate: 3px; }
  #timeline-current { height: 35px; width: 35px; }
  #timeline-current .timeline-portrait { width: 31px; height: 31px; }
  .combat[data-aiming] #battle-party { bottom: 105px; }
}

@media (orientation: landscape) and (max-height: 540px), (orientation: landscape) and (max-width: 730px), (orientation: landscape) and (pointer: coarse) and (max-width: 1100px) {
  .topbar { grid-template: auto / auto minmax(0, 1fr) auto; min-height: 41px; }
  .topbar .brand { font-size: 0; gap: 0; }
  .topbar .brand-icon { width: 25px; height: 25px; }
  .topbar nav { grid-area: 1 / 2; }
  .topbar .account { grid-area: 1 / 3; gap: 5px; }
  .topbar .account #username { display: none; }
  .topbar .account .outline { padding: 5px 8px; }
  .workspace:not(.battle-field) .field {
    display: grid;
    grid-template: auto auto minmax(0, 1fr) / minmax(0, 1fr) auto;
  }
  .field-head { grid-column: 1 / -1; }
  .field-head { min-height: 37px; }
  .map-stage { grid-area: 3 / 1; }
  #world { --world-columns: 11; }
  .field-actions {
    grid-area: 3 / 2;
    align-content: center;
    justify-content: center;
    width: clamp(146px, 19vw, 200px);
    border-left: 1px solid var(--border);
    background: #101d35;
  }
  .battlefield {
    --arena-hud-space: clamp(94px, 29%, 116px);
    --lane-step: clamp(24px, 8dvh, 43px);
    --back-y: max(46%, min(var(--tallest-fighter, 64px) + 34px, 66%));
    --middle-gap: max(29%, var(--widest-fighter, 64px) + 10px);
    --outer-inset: 25%;
    --front-inset: 34%;
  }
  .command-panel { width: min(29%, 245px); }
  .orders:is([data-menu="battle"], [data-menu="items"]) { max-height: clamp(40px, 21dvh, 105px); }
  .order, .orders[data-menu="root"] .order { min-height: 34px; }
  .target-controls { max-width: 29%; }
  #battle-party { width: min(23%, 200px); }
  .battle-timeline { --queue-step: 26px; top: 7px; left: 50%; translate: -50% 0; flex-direction: row; width: max-content; }
  .battle-timeline::before { inset: auto 8px 8px; width: auto; border: 0; border-bottom: 1px solid #81bfcc70; border-radius: 0; }
  #timeline-next { flex-direction: row; }
  #timeline-next li:nth-child(n) { translate: none; }
  #timeline-current { width: 34px; height: 34px; }
  #timeline-current .timeline-portrait { width: 32px; height: 32px; }
}

@media (orientation: landscape) and (max-height: 540px) {
  .victory-emblem { max-height: 18dvh; }
  .victory-heading { padding-bottom: 10px; }
  .victory-heading h2 { font-size: 2.35rem; }
}

:is(#catalog-dialog, #digimon-dialog)[open] {
  padding: clamp(12px, 3vw, 24px);
  border: 1px solid #516d8d;
  border-radius: 5px;
  background: linear-gradient(135deg, #19324c, #0b1627 67%);
}
:is(#catalog-title, #digimon-title) { margin: 0 42px 15px 0; color: #f9e4b8; letter-spacing: -.025em; }
:is(#catalog-dialog, #digimon-dialog) .filter-button, .catalog-back {
  border: 1px solid #38536f; border-radius: 3px; padding: 6px 10px; min-height: 34px; background: #111f32;
  color: #d1e3ef; font-size: .77rem; font-weight: 650;
}
:is(#catalog-dialog, #digimon-dialog) .filter-button[aria-pressed="true"] {
  color: #fff0c9; border-color: #be9965; background: #2e3642;
}

#catalog-content[data-view="entry"] .catalog-filters { display: none; }
#catalog-dialog .catalog-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
#catalog-dialog .catalog-index { padding: 0; border: 0; background: transparent; }
#catalog-dialog .catalog-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 126px), 1fr)); gap: 8px; padding: 5px; }
.catalog-count { color: #b9d2e3; }
#catalog-dialog .catalog-row {
  display: grid; position: relative; justify-items: center; align-content: start; gap: 5px; min-width: 0; min-height: 113px;
  padding: 8px 5px; border-radius: 3px; border-color: #395975; text-align: center;
  background: radial-gradient(ellipse at 50% 55%, #315675, #152b40 68%);
}
#catalog-dialog .catalog-row:is(:hover, [aria-pressed="true"]) { border-color: #e4bf7e; background-color: #243f53; }
#catalog-dialog .catalog-row .creature-portrait { width: 55px; height: 55px; background: #0e1d304f; }
#catalog-dialog .catalog-row > span:nth-child(2) { display: block; max-width: 100%; }
#catalog-dialog .catalog-row > .game-icon { position: absolute; top: 6px; right: 5px; }
#catalog-dialog .catalog-detail { border: 0; padding: 0; background: transparent; }
.catalog-back { align-self: flex-start; margin: 0 0 8px; }
.catalog-heading { border: 1px solid #486885; border-radius: 4px; background: linear-gradient(115deg, #254462, #14253c 70%); }
.catalog-figure { background: radial-gradient(ellipse at bottom, #335775, #152438); }
:is(.catalog-identity, .catalog-growth) > div { border-color: #36516a; background: #132941; }

#digimon-dialog .digimon-layout { display: flex; flex-direction: column; gap: 12px; }
#digimon-dialog[open] {
  --partner-space: calc(100dvh - 24px);
  min-height: min(480px, var(--partner-space)); max-height: min(600px, var(--partner-space)); height: 73dvh;
}
#digimon-dialog #digimon-detail { scrollbar-gutter: stable; }
#digimon-dialog .digimon-profile { flex: 1; border: 0; padding: 0; background: transparent; }
#digimon-dialog .roster-panel { flex: 0 0 auto; border: 0; padding: 0; background: transparent; }
#digimon-dialog .digimon-roster { display: flex; overflow-x: auto; padding: 4px 3px; }
#digimon-dialog .digimon-roster-entry { flex: 0 0 clamp(98px, 25vw, 126px); border-radius: 4px; }
#digimon-dialog .digimon-roster-entry .creature-portrait { width: 50px; height: 50px; }
.digimon-roster-entry[aria-pressed="true"] { border-color: #f3c37e; box-shadow: inset 0 -3px #d6ac71; }
.digimon-status-layout {
  border-color: #496b8b; border-radius: 4px; gap: clamp(8px, 2vw, 18px); padding: clamp(7px, 2vw, 14px);
  background: linear-gradient(145deg, #1b3b58, #102439 69%);
}
.digimon-figure {
  isolation: isolate; border-color: #3b617c; border-radius: 4px; min-height: 150px;
  background: radial-gradient(ellipse at 50% 58%, #30617c, #0d2135 80%);
}
.digimon-figure::before {
  inset: 50% auto auto 50%; width: min(84%, 190px); aspect-ratio: 1; translate: -50% -50%; z-index: -1;
  border: 0; background: url('/art/tamer-halo.png') center / contain no-repeat; opacity: .8;
}
.digimon-figure .digimon-dp { position: relative; padding: 4px 8px; background: #0b1a2c; border-bottom: 1px solid #987e50; }
.digimon-heading { padding-bottom: 6px; border-bottom: 1px solid #4d6a7c8c; }
.digimon-vitals .member-stat .meter { height: 6px; }
.digimon-vitals .member-stat:is([data-stat="hp"], [data-stat="mp"], [data-stat="exp"]) .meter {
  border-radius: 2px; background: #091827 url('/art/hud-meter-track.png') center / 100% 100% no-repeat;
}
.digimon-attributes div { border-radius: 3px; }
.partner-technique { width: 100%; min-height: 45px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid #4a6c8a; border-radius: 3px; color: #ddecf7;
  text-align: left; background: #102237; }
.partner-technique small, .partner-technique strong { display: block; }
.partner-technique small { color: #a5c5d9; font-size: .66rem; }
.partner-technique strong, .partner-technique .mono { font-size: .75rem; }
.partner-technique :is(.game-icon, .skill-art) { width: 26px; height: 26px; object-fit: contain; }
.digimon-move-results { margin-top: 8px; }
.digimon-move { border-radius: 3px; }

@media (max-width: 540px) {
  #catalog-dialog .catalog-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 92px), 1fr)); gap: 5px; }
  #catalog-dialog .catalog-row strong { font-size: .73rem; }
  #catalog-dialog .catalog-row .creature-portrait { width: 48px; height: 48px; }
  #catalog-dialog .catalog-heading { gap: 8px; padding: 7px; }
  .digimon-status-layout { grid-template-columns: minmax(100px, 1fr) minmax(0, 1.25fr); }
}
@media (max-width: 385px) {
  #digimon-dialog .digimon-status-layout { grid-template-columns: minmax(0, 1fr); }
  #digimon-dialog .digimon-figure { min-height: 134px; }
}

#tutorial-dialog[open]:has(#starter-eggs:not([hidden])) { height: fit-content; }
#starter-eggs { min-height: 0; overflow: auto; text-align: center; }
.egg-preview { display: grid; place-items: center; min-height: 118px; padding: 8px; border-block: 1px solid #5dbeea45;
  background: radial-gradient(ellipse at 50% 82%, #226298, transparent 68%), #0b1932; color: #c2d9ee; }
.egg-model { display: grid; justify-items: center; gap: 5px; color: #e9f6ff; }
.egg-model-stage { display: grid; place-items: end center; height: var(--egg-model-height); }
.egg-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-block: 12px; }
.egg-choice { display: grid; place-items: center; gap: 5px; padding: 8px 3px; background: #172d4e; border: 1px solid #476a91;
  color: #e7f5ff; font-size: .78rem; }
.egg-choice img { width: min(100%, 61px); height: 66px; object-fit: contain; }
.egg-choice[aria-pressed="true"] { border-color: #ffdf88; background: #214770; box-shadow: inset 0 -3px #edbe6b; }
#hatch-starter, #tutorial-connector { width: fit-content; margin-inline: auto; }
.digimon-dp { display: inline-flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 7px;
  font-size: .73rem; color: #e8dfc7; }
.dp-stars { color: #ffcb68; letter-spacing: .13em; white-space: nowrap; }
.digimon-figure:has(.digimon-dp) { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.digimon-roster-entry .digimon-dp { justify-content: start; font-size: .64rem; }
.dna-preview { display: grid; justify-items: start; gap: 8px; margin-top: 10px; }
.dna-preview .creature-portrait { width: 55px; height: 55px; }

.battle-victory { --victory-accent: #ffe3a1; width: min(680px, calc(100% - 20px)); }
.battle-victory::backdrop { background: radial-gradient(ellipse at center 35%, #182a45c7, #030614ee 78%); }
.victory-heading { position: relative; isolation: isolate; gap: 4px; padding: 9px 12px 12px;
  background: radial-gradient(ellipse at 50% 38%, #af643e58, transparent 65%); }
.victory-heading::before { content: ''; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background: url('/art/victory-strip.png') center bottom / 100% 55% no-repeat; }
.victory-emblem { width: clamp(72px, 20vw, 128px); max-height: 16dvh; }
.victory-heading h2 { color: #ffeaa9; font-size: clamp(2.3rem, 10vw, 4.6rem); letter-spacing: .045em;
  -webkit-text-stroke: 2px #542c25; paint-order: stroke fill; text-shadow: 0 4px #784822, 0 0 22px #efaa5c83; }
#victory-party { display: flex; justify-content: center; gap: clamp(5px, 3vw, 18px); margin: 7px 0 0; padding: 0; list-style: none; }
.victory-finisher { display: grid; justify-items: center; gap: 3px; width: clamp(70px, 25vw, 125px); min-width: 0; color: #f8e6c2; font-size: .7rem; }
.victory-finisher .creature-portrait { width: clamp(33px, 9vw, 54px); height: clamp(33px, 9vw, 54px);
  border-bottom: 1px solid #ecba7180; background: radial-gradient(ellipse at bottom, #90643b88, transparent 75%); }
.victory-finisher > span:last-child { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#back-exploration { border-color: #f2cf88; color: #21180b; background: linear-gradient(112deg, #f4c673, #ffe5a7); }
#back-exploration:hover { background: #ffe6ab; }
#back-exploration:focus-visible { outline-color: #affaff; }
@media (orientation: landscape) and (max-height: 540px) {
  .victory-heading { gap: 3px; padding-block: 3px 6px; }
  .victory-heading h2 { font-size: 2.25rem; }
  .victory-emblem { max-height: 42px; }
  #victory-party { margin-top: 4px; }
  .victory-finisher .creature-portrait { width: 34px; height: 34px; }
  .victory-actions { padding-block: 7px; }
}

body {
  display: block; height: 100dvh; min-height: 0; overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.topbar, .shell .intro, .shell .foot, .field-head, .map-marker, .field-actions {
  position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; overflow: hidden; clip-path: inset(50%);
}
.shell, .shell:has(.battle-field) {
  display: block; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0;
}
.workspace, .workspace:not(.battle-field) .field, .battle-field .field, .map-stage, .combat, .arena, .battlefield {
  display: block; width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0;
}
.map-stage, .arena { position: relative; }
#world { --world-fit: 1; display: block; width: 100%; height: 100%; touch-action: manipulation; }
#arena-background, .scene-hud { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scene-hud { z-index: 12; }
#arena-background { z-index: 0; }
#scene-loading {
  position: fixed; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; gap: 12px;
  background: radial-gradient(ellipse at center, #16314b, #071226 72%); color: #e5f4ff; padding: 20px; text-align: center;
}
#scene-loading img { width: min(110px, 28vw); max-height: 17dvh; object-fit: contain; }
#scene-loading strong { font-size: clamp(1.25rem, 5vw, 2rem); color: #ffe0a0; }
#scene-loading progress { width: min(220px, 72vw); accent-color: #72cfec; }
.topbar:focus-within {
  position: fixed; inset: 4px auto auto 4px; z-index: 15; display: flex; flex-wrap: wrap;
  width: min(720px, calc(100% - 8px)); height: auto; padding: 7px; overflow: auto; clip-path: none;
}
.digimon-dp { flex-wrap: nowrap; }
.digimon-figure .digimon-dp { background: none; border: 0; gap: 10px; }
.dp-stars {
  display: inline-flex; align-items: center; gap: 2px; border: 0; border-radius: 3px; padding: 3px;
  background: #0b1a2cba; color: #ffe2a2; letter-spacing: normal;
}
.dp-stars img { width: 12px; height: 12px; object-fit: contain; pointer-events: none; }
.digimon-figure .dp-stars img { width: 16px; height: 16px; }
.dp-value { white-space: nowrap; color: #fff2cb; font-variant-numeric: tabular-nums; }
@media (orientation: landscape) and (max-height: 540px) {
  #digimon-dialog .digimon-layout { flex-direction: row; }
  #digimon-dialog .roster-panel { order: -1; flex-basis: 114px; }
  #digimon-dialog .digimon-roster { display: grid; grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  #digimon-dialog .digimon-roster-entry .creature-portrait { width: 38px; height: 38px; }
  #digimon-dialog .digimon-figure { min-height: 144px; }
  .battlefield[data-scene] {
    --outer-inset: max(17%, var(--widest-fighter, 64px) / 2 + 20px);
    --front-inset: 28%;
    --arena-hud-space: clamp(73px, 23dvh, 115px);
    --back-y: min(max(44%, var(--tallest-fighter, 64px) + 15px), 66%);
  }
}

.arrival {
  position: relative; isolation: isolate; display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 370px);
  gap: clamp(20px, 5vw, 92px); padding: clamp(20px, 7vw, 110px);
  width: 100%; height: 100%; overflow: auto; background: #1c1227;
}
.arrival-art, .arrival::after { position: absolute; inset: 0; pointer-events: none; }
.arrival-art {
  z-index: -2; background: url('/art/arrival-sky.webp') center 55% / cover no-repeat;
  position: fixed; animation: arrival-drift 24s ease-in-out infinite alternate;
}
.arrival::after {
  content: ''; position: fixed; z-index: -1;
  background: linear-gradient(100deg, #160d238c, transparent 46%, #120f25bf 100%), linear-gradient(0deg, #130f25b3, transparent 50%);
}
.arrival-brand { align-self: end; margin-bottom: clamp(12px, 9vh, 120px); max-width: 640px; }
.arrival-panel {
  padding: clamp(16px, 3vw, 30px); border: 1px solid #ffc98157; border-radius: 8px;
  background: #131627ef; box-shadow: 0 16px 42px #180f28a0;
}
.arrival-modes { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid #bfc2cf26; }
.arrival-modes button {
  padding: 9px 12px; color: #c7c9d7; background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
}
.arrival-modes button[aria-pressed="true"] { color: #ffdda1; border-color: #f9c983; }
.arrival-panel form { display: grid; gap: 10px; }
.arrival-panel label { display: grid; gap: 4px; color: #e0dce7; font-size: .85rem; }
.arrival-panel input {
  width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #979ab058; border-radius: 4px;
  background: #101122; color: #fff4e5; font: inherit; font-size: 1rem;
}
.arrival-panel .message { margin: 0; color: #ffd3bd; }
.arrival-panel .message:empty, #profile-message:empty { display: none; }
.arrival-install { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-top: 9px;
  min-height: 39px; padding: 5px; border: 1px solid #8295b04f; border-radius: 4px; background: #20283e; color: #dfedf9; font-size: .83rem; }
.arrival-install:hover { border-color: #98c0d7; background: #26364d; }
.arrival-install .game-icon { width: 20px; }
#downloads-dialog { width: min(600px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: clamp(15px, 3vw, 24px);
  border-radius: 8px; background: linear-gradient(140deg, #1c344c, #111b30 72%); }
#downloads-dialog h2 { color: #ffe6b9; }
.download-platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.download-platform { min-width: 0; padding: 12px; border: 1px solid #537f9d6e; border-radius: 5px; background: #112336; }
.download-platform h3 { margin-bottom: 6px; color: #f0f6fc; font-size: 1rem; }
.download-platform p, .download-platform ol { color: #c3d7e4; font-size: .84rem; line-height: 1.45; }
.download-platform ol { padding-inline-start: 1.3rem; margin: 5px 0 0; }
.download-platform li + li { margin-top: 4px; }
.download-platform a { display: inline-block; margin-top: 10px; text-decoration: none; }
@media (max-width: 540px) { .download-platforms { grid-template-columns: 1fr; gap: 8px; } }
@keyframes arrival-drift {
  from { transform: scale(1.02); }
  to { transform: translate(-1%, -1.25%) scale(1.12); }
}
@media (max-width: 680px) and (orientation: portrait) {
  .arrival {
    grid-template-columns: minmax(0, 440px); grid-template-rows: minmax(130px, 1fr) auto; justify-content: center;
    align-items: end; gap: 14px; padding: 20px 16px max(24px, 6dvh);
  }
  .arrival-brand { margin: 0; }
  .arrival-art { background-position: center 45%; }
  .arrival::after { background: linear-gradient(0deg, #130f25c9, transparent 80%); }
}
@media (orientation: landscape) and (max-height: 540px) {
  .arrival { padding: 12px clamp(16px, 5vw, 48px); gap: 13px; }
  .arrival-brand { align-self: center; margin: 0; }
  .arrival-panel { padding: 12px 16px; }
  .arrival-modes { margin-bottom: 8px; }
  .arrival-panel form { gap: 6px; }
  #profile-dialog, #character-dialog { padding-block: 14px; }
  .character-preview { grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-items: start; padding: 7px 12px; text-align: start; }
  .character-parts { max-height: min(122px, 29dvh); }
}
@media (prefers-reduced-motion: reduce) {
  .arrival-art { animation: none; }
}

.battle-tools {
  position: absolute; z-index: 6; top: 13px; right: 16px;
  display: flex; align-items: center; gap: 6px;
}
.battle-tools #battle-speed { position: static; }
#battle-inspect {
  display: none; place-items: center; min-width: 42px; min-height: 36px;
}
#battle-inspect .game-icon { width: 18px; height: 18px; }
#battle-inspect[aria-pressed="true"] { background: #203c51; }
.battlefield[data-entering] .battle-tools { visibility: hidden; }

@media (pointer: coarse), (hover: none), (max-width: 730px) {
  #battle-inspect { display: grid; }
  .battle-tools #battle-speed { min-width: 42px; min-height: 36px; }
  .battle-tools { top: 7px; right: 8px; }
  .battlefield .fighter:not(.down) .fighter-trigger .fighter-vitals { visibility: hidden; }
  .battlefield[data-show-inspection]:not([data-entering]) .fighter:not(.down) .fighter-trigger .fighter-vitals { display: block; visibility: visible; }
}
@media (max-width: 730px) and (orientation: portrait) {
  .battlefield[data-scene] {
    --arena-hud-space: clamp(95px, 20dvh, 168px);
    --back-y: min(max(62%, var(--tallest-fighter, 64px) + 42px), 76%);
    --front-inset: 27%;
  }
}
@media (orientation: landscape) and (max-height: 540px) {
  .battlefield[data-scene] {
    --arena-hud-space: clamp(50px, 15dvh, 81px);
    --back-y: min(max(56%, var(--tallest-fighter, 64px) + 22px), 68%);
  }
}

#reward.battle-victory {
  width: min(440px, calc(100% - 28px)); padding: 15px 18px; border: 1px solid #5a819675;
  border-radius: 8px; background: #132638f2; box-shadow: 0 12px 32px #07121d66;
}
#reward::backdrop { background: rgb(0 0 0 / 72%); }
#reward .victory-heading {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 2px 10px; justify-items: start;
  padding: 0 0 10px; text-align: start; border-bottom: 1px solid #63849655; background: none;
}
#reward .victory-heading::before { content: none; }
#reward .victory-emblem { width: 36px; grid-row: span 2; align-self: center; filter: none; }
#reward .victory-heading h2 {
  margin: 0; color: #f1dcaa; font-size: 1.45rem; line-height: 1.08;
  font-weight: 750; text-transform: none; text-shadow: none; letter-spacing: normal;
}
#reward .victory-heading p { color: #bbcbd8; margin: 0; font-size: .79rem; }
#reward #victory-party { display: grid; justify-content: stretch; gap: 5px; margin: 9px 0; }
#reward .victory-finisher { display: flex; align-items: center; gap: 7px; width: auto; color: #e5f3fb; }
#reward .victory-finisher .creature-portrait { width: 32px; height: 32px; }
#reward .victory-member-copy { width: 100%; min-width: 0; }
.victory-member-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 7px; }
.victory-member-heading .victory-value { margin-left: auto; color: #f3dba0; }
.victory-finisher .member-stat { grid-template-columns: auto 1fr auto; font-size: .69rem; }
.victory-finisher .member-stat .meter { grid-row: 1; grid-column: 2; }
.victory-finisher .member-stat .stat-value { grid-row: 1; grid-column: 3; }
#reward .victory-finisher strong, #reward .victory-finisher small { display: block; }
#reward .victory-finisher small { color: #aec8d3; font-size: .69rem; }
.victory-member-level { font-variant-numeric: tabular-nums; }
#reward .victory-level-up:not([hidden]) { display: inline-block; padding: 1px 5px; border-radius: 3px; background: #33544d;
  color: #d9f4ac; font-size: .68rem; }
#reward .victory-value { font-size: .8rem; }
#reward .victory-actions { justify-content: end; padding: 7px 0 0; }
#battle-result[data-outcome="loss"] {
  width: min(370px, calc(100% - 28px)); min-height: 0; grid-template-columns: 29px minmax(0, 1fr);
  justify-items: start; gap: 3px 10px; padding: 13px; border: 1px solid #ae858270; border-radius: 7px;
  background: #203040ed; box-shadow: 0 0 0 100vmax #0b121b45; color: #f2d6d2;
}
#battle-result[data-outcome="loss"] .game-icon { grid-row: span 3; align-self: center; width: 27px; }
#battle-result[data-outcome="loss"] strong { font-size: 1.22rem; }
#battle-result[data-outcome="loss"] :is(span, small) { color: #ccd9e0; font-size: .79rem; }

#online-population { display: flex; align-items: center; gap: 7px; margin: 12px 0 0; color: #e1f8de; font-size: .83rem; }
#online-population::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #9ce4a6; box-shadow: 0 0 9px #9ce4a66e; }
@media (max-width: 680px) and (orientation: portrait) {
  .arrival { gap: 10px; padding: 15px 16px max(12px, 3dvh); }
  #online-population { margin-top: 9px; }
  .arrival-panel { padding: 11px 14px 14px; background: #151c2be6; }
  .arrival-modes { margin-bottom: 8px; }
  .arrival-panel form { gap: 8px; }
}

.partner-identity { display: flex; align-items: center; gap: 8px; }
.digimon-figure { position: relative; padding-bottom: 32px; }
.digimon-figure .digimon-dp { position: absolute; bottom: 8px; left: 50%; translate: -50% 0; }
.digimon-dp .dp-stars, .digimon-dp .dp-stars:hover { background: transparent; box-shadow: none; }

#catalog-content .catalog-filters { grid-template-columns: minmax(105px, 1.3fr) minmax(145px, .9fr) auto; align-items: end; }
#catalog-content .catalog-filters label:first-child { grid-column: auto; }
#catalog-title { display: flex; align-items: center; gap: 7px; }
#catalog-title img { width: 31px; height: 28px; object-fit: contain; }
.catalog-attributes { display: flex; align-items: center; gap: 3px; min-width: 0; }
.catalog-attributes button {
  display: inline-grid; place-items: center; min-width: 34px; min-height: 36px; padding: 4px;
  background: #10253b; border: 1px solid transparent; border-radius: 5px; color: #c8d8e7; font-size: .8rem;
}
.catalog-attributes button[aria-pressed="true"] { background: #263e51; border-color: #b39b69; color: #ffe4ab; }
.catalog-attributes .game-icon { width: 23px; }
#catalog-dialog .catalog-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 139px), 1fr)); }
#catalog-dialog .catalog-row { min-height: 125px; }
#catalog-dialog .catalog-row .creature-portrait { width: 70px; height: 70px; background: transparent; }
.catalog-entry-layout {
  flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(140px, .64fr) minmax(0, 1.36fr);
  gap: 13px; overflow: auto; padding: 1px;
}
.catalog-dossier { min-width: 0; display: flex; flex-direction: column; }
#catalog-dialog .catalog-heading { border: 0; border-left: 2px solid #5bbbc8; border-radius: 0; background: #20395288; }
.catalog-rank { color: #acc4d5; font-size: .8rem; }
#catalog-dialog .catalog-figure {
  position: sticky; align-self: start; top: 0; place-items: center;
  min-width: 0; min-height: min(300px, 55dvh); border: 1px solid #577e965a; padding: 12px; overflow: hidden;
  background: url('/art/tamer-halo.png') center / min(68%, 170px) auto no-repeat, radial-gradient(ellipse, #255170, #102337 72%);
}
#catalog-dialog .catalog-figure .battle-sprite { filter: drop-shadow(0 3px 4px #0b1428); scale: 1.25; }
.catalog-loading-portrait { width: 74px; height: 74px; background: transparent; }
.catalog-animation { position: absolute; inset: auto 8px 8px auto; display: grid; place-items: center; width: 44px; height: 44px;
  padding: 0; border-radius: 7px; border: 1px solid #5892ae; background: #142b43; }
.catalog-animation .game-icon { width: 21px; }
.catalog-animation:hover { background: #244a65; }
.catalog-animation[aria-disabled="true"] { opacity: .6; cursor: default; }
.catalog-dossier .catalog-body { overflow: visible; }
.catalog-dossier .catalog-section { padding: 10px 0; }
.catalog-evolution h4 { border-bottom: 1px solid #50798d70; padding-bottom: 5px; color: #d8e9f4; }
.catalog-evolution-portraits { display: flex; flex-wrap: wrap; gap: 7px; margin: 6px 0 16px; padding: 0; list-style: none; }
.catalog-evolution-portraits li { display: flex; align-items: center; gap: 3px; }
.catalog-evolution-portrait { display: grid; width: 53px; height: 53px; place-items: center; padding: 0; border-radius: 5px;
  border: 1px solid transparent; background: radial-gradient(ellipse at 50% 85%, #264861, #13283a 70%); }
.catalog-evolution-portrait:hover, .catalog-evolution-portrait:focus-visible { border-color: #88bacd; }
.catalog-evolution-portrait .creature-portrait { width: 45px; height: 45px; background: transparent; }
.catalog-route-plus { color: #a9ccdc; font-size: .69rem; }
.catalog-dossier :is(.catalog-identity, .catalog-growth) > div { border: 0; border-bottom: 1px solid #5c7c9b70; border-radius: 0; background: #1b314780; }
@media (max-width: 580px) and (orientation: portrait) {
  #catalog-content .catalog-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .catalog-attributes { grid-column: 1 / -1; }
  #catalog-dialog .catalog-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 116px), 1fr)); }
  #catalog-dialog .catalog-row { min-height: 106px; }
  #catalog-dialog .catalog-row .creature-portrait { width: 58px; height: 58px; }
  .catalog-entry-layout { display: flex; flex-direction: column; }
  #catalog-dialog .catalog-figure { position: relative; width: 100%; min-height: 155px; background-size: 115px, auto; }
  #catalog-dialog .catalog-figure .battle-sprite { scale: 1; }
  .catalog-loading-portrait { width: 57px; height: 57px; }
}

#scene-loading {
  gap: 7px; background: radial-gradient(ellipse at center, #233d4e, #101c2a 66%); font-size: .84rem;
}
.scene-walker {
  width: 96px; height: 61px; margin-bottom: 5px; image-rendering: pixelated;
  background: url('/battle-sprites/agumon.webp?v=4') -576px -61px no-repeat;
  animation: agumon-walk 812.5ms step-end infinite;
}
/* The 13 walk frames start after the 13 idle frames in the 7-column combat atlas. */
@keyframes agumon-walk {
  0% { background-position: -576px -61px; }
  7.6923% { background-position: 0 -122px; }
  15.3846% { background-position: -96px -122px; }
  23.0769% { background-position: -192px -122px; }
  30.7692% { background-position: -288px -122px; }
  38.4615% { background-position: -384px -122px; }
  46.1538% { background-position: -480px -122px; }
  53.8462% { background-position: -576px -122px; }
  61.5385% { background-position: 0 -183px; }
  69.2308% { background-position: -96px -183px; }
  76.9231% { background-position: -192px -183px; }
  84.6154% { background-position: -288px -183px; }
  92.3077%, 100% { background-position: -384px -183px; }
}
#scene-loading progress { appearance: none; width: min(144px, 58vw); height: 4px; border: 0; border-radius: 6px; background: #304759; overflow: hidden; }
#scene-loading progress::-webkit-progress-bar { background: #304759; }
#scene-loading progress::-webkit-progress-value { background: #a4e3e9; }
#scene-loading progress::-moz-progress-bar { background: #a4e3e9; }
@media (prefers-reduced-motion: reduce) { .scene-walker { animation: none; } }

#battle-party { width: min(186px, 44%); }
.battle-party-member, .battle-party-member[data-current] {
  grid-template-columns: 24px minmax(0, 1fr);
  padding: 4px 6px; border-radius: 4px; background: #0c1c2d88;
}
.battle-party-member[data-current] { background: #163349a6; }
.battle-party-member > .creature-portrait { width: 24px; height: 24px; background: transparent; }
.battle-party-member .member-stat { gap: 3px; grid-template-columns: 13px minmax(0, 1fr) auto; }
.battle-party-member .member-stat .meter { height: 3px; }
.battle-party-name { font-weight: 550; }
.battle-party-member .battle-states { margin-top: 0; }

.service-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.service-tabs button { min-height: 32px; padding: 4px 8px; border: 0; border-radius: 4px; color: #bcd3e4; background: #16293d; font-size: .8rem; }
.service-tabs button[aria-pressed="true"] { color: #ffe4ab; box-shadow: inset 0 -2px #dfbb79; background: #233b4d; }
:is(#trade-dialog, #playtime-dialog) { width: min(560px, calc(100% - 20px)); max-height: calc(100dvh - 20px); }
.service-header { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 12px; padding-right: 35px; }
.service-header :is(output, #trade-balance) { color: #e4cd99; font: 700 .85rem ui-monospace, monospace; }
#trade-tabs { margin-bottom: 9px; }
#trade-content :is(input, select) {
  min-width: 0; width: 100%; min-height: 34px; color: #e1eef8; font: inherit; font-size: .88rem;
  border: 1px solid #4d677b; border-radius: 4px; padding: 5px; background: #102437;
}
.trade-list, #playtime-tiers, .dna-history { list-style: none; padding: 0; margin: 7px 0; }
#playtime-tiers small { color: #adc6d6; font-size: .73rem; }
#playtime-tiers .catalog-icon { width: 25px; height: 25px; }
.trade-filters { display: flex; flex-wrap: wrap; gap: 5px; align-items: end; }
.trade-filters label, .trade-publish label { display: grid; gap: 3px; color: #bdd4e1; font-size: .77rem; }
.trade-filters label { flex: 1 1 130px; }
.trade-filters:empty { display: none; }
.trade-publish { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.trade-publish > :first-child, .trade-publish output, .trade-publish button { grid-column: 1 / -1; }
.trade-publish output { color: #ddcb9f; font-size: .8rem; }
#playtime-tiers li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 8px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid #658ca447;
}
#playtime-tiers li > span:nth-child(2) { display: grid; gap: 2px; }
#playtime-tiers progress { grid-column: 2 / -1; width: 100%; height: 5px; accent-color: #9acfc0; }
#playtime-tiers button { font-size: .75rem; padding: 5px 8px; }
#trade-message:empty, #playtime-message:empty { display: none; }
:is(#trade-message, #playtime-message):not([data-error]) { color: #a9ddc0; }
.dna-history { display: grid; gap: 6px; }
.dna-history li { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.dna-history li > span { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; padding: 6px; background: #1a3449; border-radius: 5px; }
.dna-history .creature-portrait { grid-row: span 2; width: 31px; height: 31px; }
.dna-history :is(strong, small) { overflow-wrap: anywhere; }
@media (max-width: 460px) {
  #trade-content :is(input, select) { font-size: 1rem; }
}

#world-avatars { position: absolute; inset: 0; clip-path: inset(52px 0 0); pointer-events: none; }
#world-avatars img { position: absolute; translate: -50% -50%; object-fit: cover; border-radius: 26%; }
#world-inspection { --map-card-accent: #a1d7ff; position: absolute; z-index: 8; top: 0; left: 0; width: min(220px, calc(100% - 12px));
  overflow: hidden; pointer-events: none; color: #e8f5fb; background: #102334f5;
  border: 1px solid #5e839875; border-top: 2px solid var(--map-card-accent); border-radius: 6px; box-shadow: 0 7px 20px #050d19a8; }
#world-inspection[data-tone="self"] { --map-card-accent: #a5fae0; }
#world-inspection[data-tone="peaceful"] { --map-card-accent: #d2aff5; }
#world-inspection[data-tone="aggressive"] { --map-card-accent: #ffae99; }
#world-inspection[data-tone="boss"] { --map-card-accent: #f9cc83; }
.world-inspection-head { display: flex; align-items: center; gap: 6px; min-height: 29px; padding: 3px 8px;
  border-bottom: 1px solid #7098ab55; color: var(--map-card-accent); background: #1b3548; font-size: .75rem; }
.world-inspection-head > .game-icon { width: 17px; height: 17px; }
.world-inspection-count { margin-inline-start: auto; padding: 1px 5px; border-radius: 3px; background: #0e2437; font: 700 .7rem ui-monospace, monospace; }
.world-inspection-list { display: grid; padding: 3px 7px; margin: 0; list-style: none; }
.world-inspection-list li { display: flex; align-items: center; gap: 7px; min-height: 37px; padding: 3px 0; }
.world-inspection-list li + li { border-top: 1px solid #61849b40; }
.world-inspection-list :is(.world-inspection-avatar, .creature-portrait) { flex: none; width: 28px; height: 28px;
  border-radius: 5px; border: 0; background: #1b374c; object-fit: cover; }
.world-inspection-identity { display: grid; gap: 2px; flex: 1; min-width: 0; font-size: .78rem; line-height: 1.1; }
.world-inspection-identity strong, .world-inspection-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.world-inspection-identity small, .world-inspection-more { color: #b6cdd9; font-size: .69rem; }
.world-inspection-types { display: flex; gap: 2px; flex: none; }
.world-inspection-types .game-icon { display: block; width: 15px; height: 15px; }
.world-inspection-more { margin: 0; padding: 2px 8px 5px; }

.game-window-title { display: flex; align-items: center; gap: 8px; }
.game-window-title img { width: 31px; height: 29px; object-fit: contain; }
.game-progress {
  display: block; width: 100%; height: 6px; border: 0; border-radius: 4px; appearance: none;
  overflow: hidden; color: var(--progress-color, #8bdfce); background: #0b1725;
}
.game-progress::-webkit-progress-bar { background: #0b1725; }
.game-progress::-webkit-progress-value { background: linear-gradient(90deg, #4c8897, var(--progress-color, #8bdfce)); }
.game-progress::-moz-progress-bar { background: var(--progress-color, #8bdfce); }

:is(#inventory-dialog, #character-dialog, #playtime-dialog, #missions-dialog, #player-dialog, #cash-shop-dialog) {
  --window-frame: #648594;
  --window-accent: #afe3db;
  padding: clamp(14px, 3vw, 24px); border: 1px solid var(--window-frame); border-top: 2px solid var(--window-accent);
  border-radius: 5px 5px 13px 5px; color: #e6f2f4;
  background: linear-gradient(145deg, #192e3d, #102030 47%, #0d1929);
  box-shadow: 0 14px 50px #04090ea6; scrollbar-width: thin; scrollbar-color: #446478 transparent;
}
:is(#inventory-dialog, #character-dialog, #playtime-dialog, #missions-dialog, #player-dialog, #cash-shop-dialog)[open] {
  animation: game-window-reveal .23s cubic-bezier(.19,.64,.29,1) both;
}
:is(#inventory-dialog, #character-dialog, #playtime-dialog, #chat-dialog) .dialog-close {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid #7595a76c; border-radius: 3px 5px; background: #122738; color: #d6e8ef;
}
:is(#inventory-dialog, #character-dialog, #playtime-dialog, #chat-dialog) .dialog-close:hover {
  background: #315265; color: #fff3cf;
}
@keyframes game-window-reveal {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes game-content-reveal {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

#inventory-dialog { --window-accent: #edc88a; --window-frame: #77684f; width: min(865px, calc(100% - 20px)); }
#inventory-title { color: #f6d9a8; margin-bottom: 12px; }
#inventory-dialog .inventory-layout { grid-template-columns: minmax(0, 1.8fr) minmax(210px, 1fr); gap: 13px; }
#inventory-dialog :is(.inventory-section, .inventory-detail) {
  border: 0; border-radius: 0; margin: 0; padding: 0; background: transparent; min-height: 0;
}
#inventory-dialog .inventory-section { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
#inventory-filters { padding-block: 2px 6px; border-bottom: 1px solid #796e5366; gap: 3px; }
#inventory-filters button { background: #192c3a; padding: 5px 8px; min-height: 30px; }
#inventory-filters button[aria-pressed="true"] { color: #ffe4b0; background: #37382f; }
#inventory-dialog .inventory-list {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 81px), 1fr)); align-content: start; gap: 5px;
  margin-top: 7px; padding: 2px; scrollbar-width: thin; scrollbar-color: #74664e transparent;
}
#inventory-dialog #stash-list { max-height: min(42dvh, 340px); }
#inventory-dialog .inventory-entry {
  position: relative; grid-template: minmax(33px, 1.3fr) minmax(20px, auto) / minmax(0, 1fr);
  justify-items: center; gap: 3px; padding: 7px 5px 3px; min-height: 72px; text-align: center;
  border: 1px solid #466074; border-radius: 4px; color: #e3edf4;
  background: radial-gradient(ellipse at 50% 43%, var(--rarity-glow, #2a485d), var(--rarity-base, #192e40) 68%, #172736);
  animation: game-content-reveal .22s ease-out var(--slot-delay, 0ms) both;
}
#inventory-dialog .inventory-entry:hover { border-color: #a5bfcb; background-color: #254157; }
#inventory-dialog .inventory-entry[aria-pressed="true"] {
  border-color: #ffe7b3; box-shadow: inset 0 0 13px #f7c78246;
}
:is(.inventory-entry, .inventory-showcase)[data-rarity="uncommon"] { --rarity-glow: #31664c; --rarity-base: #1d3937; }
:is(.inventory-entry, .inventory-showcase)[data-rarity="rare"] { --rarity-glow: #54416f; --rarity-base: #2d274c; }
:is(.inventory-entry, .inventory-showcase)[data-rarity="epic"] { --rarity-glow: #7b5a35; --rarity-base: #3f312c; }
#inventory-dialog .inventory-entry[aria-pressed="true"]::after {
  content: ''; position: absolute; inset: 1px; pointer-events: none;
  background: url('/art/slot-outline.png') center / 100% 100% no-repeat; opacity: .28;
}
#inventory-dialog .inventory-entry .catalog-icon { grid-row: 1; width: 32px; height: 32px; padding: 0; border: 0; background: transparent; object-fit: contain; }
#inventory-dialog .inventory-entry strong { font: 640 .68rem/1.2 system-ui; }
.inventory-amount {
  position: absolute; right: 3px; top: 3px; border-radius: 2px; padding: 1px 3px;
  color: #fff0d0; background: #101d2ae9; font: 700 .63rem ui-monospace, monospace;
}
#inventory-dialog #inventory-detail { border-left: 1px solid #617b8961; padding-left: 12px; }
.inventory-showcase {
  position: relative; display: grid; place-items: center; min-height: 106px; margin: 0 0 9px;
  background: radial-gradient(ellipse at 50% 70%, var(--rarity-glow, #355365), transparent 75%), var(--rarity-base, #101f2d);
  border-block: 1px solid #55717d7a; overflow: hidden;
}
.inventory-showcase::before {
  content: ''; position: absolute; inset: 18% 28%; opacity: .36;
  background: url('/art/dex-pedestal.png') center / contain no-repeat;
  animation: field-rune-turn 20s linear infinite;
}
@keyframes field-rune-turn { to { rotate: 360deg; } }
.inventory-showcase .catalog-icon {
  z-index: 1; width: 55px; height: 55px; padding: 0; object-fit: contain; border: 0; background: transparent;
  filter: drop-shadow(0 6px 5px #07121995); animation: game-content-reveal .26s ease-out both;
}
.inventory-showcase .inventory-amount { z-index: 1; top: auto; right: 8px; bottom: 5px; }
.inventory-tags { color: #c4af86; font-size: .72rem; }
.inventory-empty { color: #97abba; text-align: center; margin: 20px auto; }
#inventory-dialog .inventory-controls > button { background: #594735; color: #fff1ce; border-color: #967344; }
.inventory-belt { margin-top: 13px; padding: 9px 9px 5px; background: #0c1824b0; border-top: 1px solid #897957a8; }
.inventory-belt .inventory-heading { margin: 0; }
#loadout-capacity { display: flex; gap: 3px; margin: 5px 0; }
#loadout-capacity span { width: 19px; height: 4px; background: #263b49; border-radius: 1px; }
#loadout-capacity span[data-filled] { background: #e6b878; }
#inventory-dialog #loadout-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 82px), 88px)); max-height: 22dvh; }
#inventory-dialog #loadout-list .form-note { grid-column: 1 / -1; padding: 5px 0 5px 30px; background: url('/art/slot-empty.png') left center / 22px no-repeat; }
#inventory-message:empty { display: none; }

#character-dialog { width: min(894px, calc(100% - 20px)); }
#character-title { color: #c7eae6; margin-bottom: 10px; }
.tamer-profile {
  --rank-color: #dde4ec; position: relative; display: grid; flex: 0 0 auto; grid-template-columns: 77px minmax(0, 1fr);
  gap: 13px; align-items: center; margin-bottom: 10px; padding: 10px 13px;
  border: 1px solid #7a9ca379; border-left: 3px solid var(--rank-color); border-radius: 5px;
  background: linear-gradient(95deg, #142d40f2, #11283be6 60%, #11283bcd), var(--rank-art) center / 100% 100% no-repeat, #122839;
  background-blend-mode: normal, luminosity;
}
.tamer-profile[data-rank="2"] { --rank-color: #b4e58b; }
.tamer-profile[data-rank="3"] { --rank-color: #80d9ff; }
.tamer-profile[data-rank="4"] { --rank-color: #cdb1ff; }
.tamer-profile[data-rank="5"] { --rank-color: #ffadd3; }
.tamer-profile[data-rank="6"] { --rank-color: #ffbf94; }
.tamer-profile[data-rank="7"] { --rank-color: #ffe092; }
.tamer-profile[data-rank="8"] { --rank-color: #ffa598; }
.tamer-identity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; margin-bottom: 7px; overflow-wrap: anywhere; }
.tamer-identity strong { color: #eff7fb; font-size: clamp(1.05rem, 2.8vw, 1.45rem); }
.tamer-identity span { color: var(--rank-color); font-size: .79rem; }
#tamer-level { font: 700 .78rem ui-monospace, monospace; }
.tamer-grade { display: grid; gap: 2px; }
#tamer-rank { color: #f4d6a0; font-size: .76rem; font-weight: 650; }
#tamer-tracks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.tamer-progress-line > div { display: flex; flex-wrap: wrap; gap: 2px 7px; justify-content: space-between; margin: 0 0 4px; }
.tamer-progress-line strong { color: #d6e9ef; font-size: .74rem; }
.tamer-progress-line small { color: #bdd3dc; font-size: .68rem; }
.tamer-progress-line:last-child progress { --progress-color: var(--rank-color); }
#character-dialog .character-layout { grid-template-columns: minmax(190px, .85fr) minmax(0, 1.15fr); gap: 11px; }
#character-dialog :is(.character-board, .character-library) { padding: 9px; border: 0; border-top: 1px solid #547a8e8c; border-radius: 0; background: transparent; }
#character-dialog .character-slots { gap: 5px; }
#character-dialog :is(.character-slot, .character-part, .character-part-detail) { border-color: #56728949; border-radius: 3px; background: #182f41; }
#character-dialog :is(.character-slot, .character-part)[aria-pressed="true"] { border-color: #8ac1bc; background: #264248; }
#character-dialog [data-rarity="common"] { --gear-accent: #b4ccdb; }
#character-dialog [data-rarity="uncommon"] { --gear-accent: #92d7b2; }
#character-dialog [data-rarity="rare"] { --gear-accent: #c2aff5; }
#character-dialog :is(.character-slot, .character-part, .character-part-detail)[data-rarity] {
  box-shadow: inset 2px 0 color-mix(in srgb, var(--gear-accent) 65%, transparent);
}
#character-dialog .character-rarity { color: var(--gear-accent); }
#character-dialog .character-summary dl > div { background: #142a3b; }
#character-dialog .character-actions { border-top: 1px solid #486d7d9a; padding-top: 8px; background: transparent; }

#playtime-dialog { --window-accent: #d1e9a8; --window-frame: #658774; width: min(660px, calc(100% - 20px)); }
.playtime-header { display: grid; grid-template-columns: 57px minmax(0, 1fr); gap: 10px; align-items: center; padding: 4px 31px 10px 0; }
.playtime-header img { width: 55px; height: 53px; object-fit: contain; filter: drop-shadow(0 5px 8px #042a26); }
#playtime-title { color: #f0e9a8; margin: 0 0 6px; }
.time-readout { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 7px; margin-bottom: 4px; color: #cbe4da; font-size: .76rem; }
#playtime-duration { color: #eaf3bd; font: 700 .94rem ui-monospace, monospace; }
#playtime-track { height: 7px; --progress-color: #d3e999; }
#playtime-tiers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 4px 0 10px; }
#playtime-tiers li {
  display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 6px;
  color: #dfedea; border: 1px solid #436765; border-radius: 5px; padding: 8px;
  background: linear-gradient(178deg, #28434a, #142933); animation: game-content-reveal .23s ease-out var(--reward-delay) both;
}
#playtime-tiers li[data-status="ready"] {
  border-color: #d1da8b; background: radial-gradient(ellipse at top, #657a4e, #213b3c 77%);
}
#playtime-tiers li[data-status="claimed"] { border-color: #6aa991; }
.playtime-medallion { display: grid; place-items: center; align-self: center; width: 44px; height: 44px; border: 1px solid #c4dad57a; border-radius: 50%; background: #142b39; }
#playtime-tiers .playtime-medallion .catalog-icon { width: 28px; height: 28px; border: 0; background: transparent; }
.playtime-prize { display: grid; justify-items: center; gap: 3px; text-align: center; }
.playtime-prize strong { color: #f0edb4; font: 700 .88rem ui-monospace, monospace; }
.playtime-bits { display: flex; align-items: center; gap: 3px; color: #b0dafa; font-size: .71rem; }
#playtime-tiers .playtime-bits .catalog-icon { width: 15px; height: 15px; border: 0; background: transparent; }
.playtime-actions { display: grid; min-height: 43px; justify-items: stretch; align-content: end; gap: 3px; text-align: center; }
#playtime-tiers [data-status="ready"] button { color: #142025; background: #d9ea96; border-color: #c0e69c; font-weight: 750; }
.playtime-status:empty { display: none; }
.playtime-reset { text-align: center; }

#chat-dialog {
  position: fixed; inset: calc(var(--chat-top, 7px) + 47px) var(--chat-dock, 8px) auto auto; z-index: 19;
  width: min(435px, calc(100% - 2 * var(--chat-dock, 8px))); margin: 0; padding: 0; overflow: hidden;
  height: min(255px, max(130px, calc(100dvh - var(--chat-top, 7px) - var(--chat-keyboard, 0px) - 58px)));
  border: 0; border-radius: 2px 8px 2px 2px;
  color: #e9f4ff; background: linear-gradient(155deg, #0e1b2de8, #0a1425c9);
  box-shadow: inset 0 0 0 1px #547c9f73, 0 9px 20px #03081270;
}
#chat-dialog[open] {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; animation: chat-dock-in .18s ease-out both;
}
@keyframes chat-dock-in { from { opacity: 0; translate: 0 -5px; } }
#chat-dialog[data-side="left"] { right: auto; left: var(--chat-dock); }
#chat-shortcut { position: fixed; z-index: 20; top: var(--chat-top, 7px); right: calc(var(--chat-dock, 8px) + 50px);
  display: grid; place-items: center; width: 44px; height: 42px; padding: 6px; border-radius: 8px; border: 1px solid #6f93a773;
  background: #102540db;
}
#chat-shortcut[data-side="left"] { right: auto; left: calc(var(--chat-dock) + 50px); }
#chat-shortcut:hover, #chat-shortcut[aria-expanded="true"] { background: #24526c; }
#chat-shortcut .game-icon { width: 25px; height: 25px; }
#chat-unread { position: absolute; inset: -4px -5px auto auto; min-width: 18px; padding: 2px 4px; border: 1px solid #213144;
  border-radius: 9px; background: #ffc981; color: #25212b; font: 800 .67rem system-ui; text-align: center; }
#chat-channels button[data-unread]::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 5px;
  border-radius: 50%; background: #ffc981; vertical-align: middle; }
.chat-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-inline: 9px;
  border-bottom: 1px solid #608cac63; background: linear-gradient(90deg, #152b46, #13233b 56%, #172e49); }
#chat-channels { display: flex; gap: 3px; }
#chat-channels button { min-height: 32px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 0 9px;
  background: none; color: #aac7dc; font-size: .78rem; }
#chat-channels button[aria-pressed="true"] { color: #dbf4ff; border-bottom-color: #81d8f6; background: #31587966; }
#chat-online { color: #a3e1b9; font: .68rem ui-monospace, monospace; white-space: nowrap; }
#chat-online::before { content: '●'; margin-right: 4px; }
#chat-log { list-style: none; margin: 0; padding: 7px 10px; overflow: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #567b99 transparent; }
#chat-log:empty::before { content: 'Nenhuma mensagem neste canal.'; color: #9ab1c6; font-size: .78rem; }
#chat-log li { display: grid; grid-template-columns: 3.1em minmax(0, 1fr); align-items: baseline; padding: 4px 0;
  column-gap: 7px; font-size: .8rem; line-height: 1.4; color: #dce9f3; overflow-wrap: anywhere;
  animation: game-content-reveal .14s ease-out both;
}
#chat-log time { color: #94adc5; font: .69rem ui-monospace, monospace; }
.chat-author { display: inline; padding: 0; border: 0; background: transparent; color: #9adeff; font: inherit; font-weight: 750;
  text-align: left; overflow-wrap: anywhere; }
.chat-author::after { content: ':'; color: #7e99b2; }
button.chat-author:hover, button.chat-author:focus-visible { color: white; text-decoration: underline; }
[data-mine] .chat-author { color: #9be6c2; }
#chat-log li[data-system] { color: #ffe0a3; }
[data-system] .chat-author { color: #ffca78; }
#chat-message { grid-row: 3; margin-inline: 9px; color: #f4ceae; font-size: .75rem; }
#chat-message:empty { display: none; }
#chat-form { grid-row: 4; display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: stretch;
  border-top: 1px solid #608cac63; background: #101e33; }
#chat-form input { min-width: 0; width: 100%; border: 0; border-radius: 0; background: none; font-size: 1rem; }
#chat-form input:focus-visible { outline-offset: -3px; }
#chat-form button { display: grid; place-items: center; min-height: 40px; padding: 0; border: 0; border-radius: 0; background: #203d57; }
#chat-form button:hover { background: #305774; }
#chat-form button .game-icon { width: 23px; height: 23px; }

#player-dialog { width: min(410px, calc(100% - 24px)); max-height: calc(100dvh - 24px); }
#player-title { font-size: 1.06rem; color: #b5d5e3; }
.player-identity { display: flex; gap: 12px; align-items: center; padding: 0 0 9px; margin-bottom: 10px;
  border-bottom: 1px solid #5274876b; }
.player-identity h3 { font-size: 1.22rem; overflow-wrap: anywhere; }
.tagged-player .podium-icon { width: 1em; height: 1em; margin-inline-end: 5px; vertical-align: -.1em; }
.player-identity p { margin-top: 4px; color: #b6d5e8; font-size: .8rem; }
#player-info > h3 { font-size: .86rem; color: #c8dce8; }
.player-party { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 7px 0 0; padding: 0; list-style: none; }
.player-party li { position: relative; min-width: 0; display: grid; justify-items: center; align-content: start; gap: 4px; padding: 7px 3px; text-align: center;
  border: 0; border-bottom: 1px solid #4d708886; border-radius: 4px; background: #172e4066; font-size: .75rem; overflow-wrap: anywhere; }
.player-party li .creature-portrait { width: 44px; height: 44px; background: transparent; }
.player-party-stage { position: relative; width: 100%; height: 56px; overflow: hidden; }
.player-party-stage .battle-sprite { position: absolute; left: 50%; bottom: 3px; transform-origin: center bottom;
  transform: translateX(-50%) scale(var(--player-sprite-scale, .85)); }
.player-party-stage .sprite-art .creature-portrait { width: 100%; height: 100%; }
.player-party li > .podium-icon { position: absolute; top: 4px; right: 4px; z-index: 1; width: 19px; height: 19px; }
.player-party small { color: #afcdda; }

#cash-shop-dialog, #trade-dialog[data-counter="shop"] { --window-accent: #d9b9f2; width: min(740px, calc(100% - 24px)); max-height: calc(100dvh - 24px); }
#trade-dialog[data-counter="shop"] { --window-accent: #98e2cd; padding: clamp(12px, 3vw, 24px); border-color: #496e80;
  border-top-color: var(--window-accent); background: linear-gradient(141deg, #172d42, #101e30 64%); }
#trade-dialog[data-counter="shop"] .service-header, .shop-header { display: flex; align-items: center; justify-content: space-between;
  gap: 7px 12px; flex-wrap: wrap; padding-inline-end: 38px; }
#trade-dialog[data-counter="shop"] h2, .shop-header h2 { margin: 0; color: var(--window-accent); }
#trade-dialog[data-counter="shop"] #trade-tabs { justify-content: start; margin-top: 8px; }
#cash-shop-title { color: var(--window-accent); }
#cash-shop-dialog .shop-header { padding-inline-end: 0; }
.shop-header-controls { display: flex; align-items: center; gap: 7px; margin-inline-start: auto; }
.shop-header-controls > .dialog-close { position: static; flex: none; }
#cash-shop-wallet { display: flex; align-items: center; gap: 5px; width: fit-content; color: #f0dcff;
  padding: 4px 8px; border: 1px solid #8975ac79; border-radius: 4px; background: #24233b; }
#cash-shop-wallet img { width: 24px; height: 24px; object-fit: contain; }
#shop-currencies { margin-top: 10px; padding-bottom: 7px; border-bottom: 1px solid #4e668767; }
#shop-currencies + .cash-filters { margin-top: 8px; }
.shop-display { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(185px, 1fr); gap: 11px; margin-top: 9px; }
.shop-shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 5px;
  max-height: min(450px, 63dvh); overflow: auto; padding: 2px 4px 2px 2px; scrollbar-width: thin; }
.shop-product { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 0;
  min-height: 94px; padding: 7px 4px; color: #e6eefb; text-align: center;
  background: linear-gradient(#213951, #182c40); border: 1px solid #526d876e; border-radius: 5px 8px 5px 5px; }
.shop-product[aria-pressed="true"] { border-color: var(--window-accent); background: linear-gradient(#30465c, #1c344b); }
.shop-product > * { flex-shrink: 0; }
.shop-product strong { max-width: 100%; font-size: .76rem; line-height: 1.25; overflow-wrap: anywhere; }
.shop-product-timed { min-height: 110px; padding-top: 23px; }
.shop-stock { position: absolute; top: 5px; left: 5px; padding: 2px 5px; border-radius: 4px;
  color: #d1f2ee; background: #101f30; font: 700 .67rem/1.15 ui-monospace, monospace; }
.shop-stock[data-empty] { color: #ffb6aa; }
.shop-offer-time { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
  color: #ffe3b8; font: 650 .67rem/1.2 ui-monospace, monospace; }
.shop-display .catalog-icon { border: 0; background: transparent; object-fit: contain; width: 35px; height: 35px; }
.shop-display .shop-offer-time .catalog-icon { width: 13px; height: 13px; }
.shop-detail { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 8px 11px;
  border-left: 1px solid #5372898c; background: #101e2e60; border-radius: 0 6px 6px 0; }
.shop-display-icon { display: grid; place-items: center; min-height: 75px; padding: 6px;
  background: radial-gradient(ellipse, #547f9b65, transparent 74%); }
.shop-display-icon[data-rarity="rare"] { background: radial-gradient(ellipse, #8e68b465, transparent 74%); }
.shop-display-icon .catalog-icon { width: 58px; height: 58px; }
.shop-detail h3 { color: var(--window-accent); font-size: 1rem; }
.shop-detail-info { display: grid; align-content: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.shop-detail :is(small, p), .shop-empty { color: #b8cedd; font-size: .78rem; }
.shop-detail .item-batch { grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 5px; }
.shop-detail .item-batch-units { grid-template-columns: auto minmax(44px, 58px); align-items: center; gap: 8px; justify-self: start; }
.currency-value { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; white-space: nowrap; }
.currency-value > img.catalog-icon { flex: none; width: 1.15em; height: 1.15em; border: 0; background: transparent; object-fit: contain; }
#trade-balance .currency-value > img { width: 19px; height: 19px; }
.shop-header + .cash-filters { margin-top: 9px; }
@media (max-width: 540px) and (orientation: portrait) {
  .shop-display { grid-template-columns: minmax(0, 1fr); }
  .shop-shelf { max-height: min(32dvh, 245px); }
  .shop-detail { border-left: 0; border-top: 1px solid #5372898c; grid-template-columns: 63px minmax(0, 1fr); }
  .shop-display-icon { min-height: 57px; }
  .shop-display-icon .catalog-icon { width: 48px; height: 48px; }
  .shop-detail .item-batch { grid-column: 1 / -1; }
}
.item-batch { display: grid; grid-template-columns: minmax(31px, 44px) minmax(0, 1fr); align-items: end; gap: 4px; }
.item-batch-units { display: grid; gap: 2px; min-width: 0; font-size: .66rem; color: #b9d0dc; }
.item-batch-units > span { line-height: 1; }
.item-batch input { width: 100%; min-width: 0; padding: 3px; text-align: center; font-size: .84rem; appearance: textfield; }
.item-batch input::-webkit-inner-spin-button, .item-batch input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.item-batch button { min-height: 34px; padding: 4px 6px; justify-content: center; }
.item-batch-total { grid-column: 1 / -1; justify-self: end; font-size: .75rem; color: #ffdea4; }
.item-batch button.item-batch-purchase { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 10px; padding-inline: 9px; min-width: 0; }
.item-batch-purchase .item-batch-total { display: inline-flex; min-width: 0; }
#hatch-slots .item-batch { grid-template-columns: minmax(25px, 36px) minmax(0, 1fr); width: min(100%, 132px); }
#hatch-slots .item-batch button { padding-inline: 2px; }
.hatch-stock-item .item-batch { flex: none; }
.hatch-stock-item .item-batch-units > span { font-size: inherit; }
.inventory-controls .item-batch { min-width: min(155px, 100%); }
.inventory-target:disabled { opacity: .5; }
:is(#cash-shop-message, #player-message, #missions-message):empty { display: none; }
#redeem-form { margin-top: 10px; padding-top: 8px; border-top: 1px solid #5a857966; }
#redeem-form label { color: #d4eadb; font-size: .79rem; font-weight: 675; }
#redeem-form > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
#redeem-form input { flex: 1 1 140px; width: auto; min-width: 0; min-height: 38px; }
#redeem-form button { min-height: 38px; }

.inventory-targets { display: grid; gap: 6px; width: 100%; margin-top: 3px; padding: 7px 0; border-block: 1px solid #4c748890; }
.inventory-targets > strong { font-size: .8rem; color: #d1ecf7; }
.inventory-target-list { display: grid; gap: 4px; max-height: min(27dvh, 200px); overflow-y: auto; }
.inventory-target { display: flex; align-items: center; gap: 5px; min-height: 42px; padding: 3px 7px;
  border: 1px solid #547e97a3; border-radius: 4px; background: #1a3349; text-align: left; font-size: .75rem; }
.inventory-target:hover { border-color: #a1ccdf; background: #274966; }
.inventory-target .creature-portrait { width: 34px; height: 34px; flex: none; background: transparent; }
.inventory-target small { display: block; color: #b3cede; }
.inventory-targets .quiet { justify-self: start; padding: 6px 7px; }
#target-skill .catalog-icon { width: 21px; height: 21px; object-fit: contain; }

@media (max-width: 590px) and (orientation: portrait) {
  :is(#inventory-dialog, #character-dialog, #playtime-dialog, #chat-dialog) .dialog-close { width: 38px; height: 38px; }
  #inventory-dialog .inventory-layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #inventory-filters { flex-wrap: nowrap; overflow: auto; }
  #inventory-filters button { flex: 1 0 auto; min-height: 32px; padding-inline: 5px; font-size: .71rem; }
  #inventory-dialog #stash-list { max-height: min(39dvh, 305px); }
  #inventory-dialog #inventory-detail { padding: 7px 0 0; border-left: 0; border-top: 1px solid #617b8961; min-height: 52px; }
  .inventory-showcase { float: left; width: 58px; min-height: 57px; margin: 1px 8px 4px 0; }
  .inventory-showcase .catalog-icon { width: 34px; height: 34px; }
  .inventory-showcase .inventory-amount { right: 1px; bottom: 1px; }
  .inventory-controls { clear: both; }
  #inventory-dialog .inventory-belt { margin-top: 8px; }
  #character-dialog .character-layout, #tamer-tracks { grid-template-columns: minmax(0, 1fr); }
  #tamer-profile { gap: 8px; padding: 6px; }
  #playtime-tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .playtime-header { grid-template-columns: 44px minmax(0, 1fr); }
  .playtime-header { padding-right: 35px; }
  #playtime-title { font-size: clamp(1rem, 4.9vw, 1.25rem); }
  .playtime-header img { width: 42px; height: 42px; }
}
@media (orientation: landscape) and (max-height: 540px) {
  #tamer-profile { margin-bottom: 6px; padding: 5px 10px; }
  #inventory-dialog #stash-list { max-height: 40dvh; }
  .playtime-header { padding-bottom: 5px; }
  #playtime-tiers li { padding-block: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .notice, .mission-card, .item-tooltip:popover-open, :is(#missions-dialog, #player-dialog, #cash-shop-dialog)[open] { animation: none; }
  :is(#inventory-dialog, #character-dialog, #playtime-dialog, #chat-dialog)[open],
  #inventory-dialog .inventory-entry, .inventory-showcase::before, .inventory-showcase .catalog-icon,
  .tamer-portrait::before, #playtime-tiers li, #chat-dialog #chat-log li { animation: none; }
}

.notice-copy p { font-size: .82rem; overflow-wrap: anywhere; }
.combat-feedback[data-effect="miss"] strong { color: #ddebf4; font-size: 1.1rem; }
.catalog-evolution-portrait[aria-current="true"] { border-color: #799cab; }

.domain-result { position: fixed; z-index: 11; inset: max(74px, 16%) auto auto 50%; translate: -50% 0;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 5px 11px; width: min(410px, calc(100% - 30px));
  padding: 11px 16px; color: #dfedf8; border: 1px solid #81b7c08c; border-left: 3px solid #a5eadb; border-radius: 5px;
  background: linear-gradient(118deg, #1b3a4d, #0d1f2e 77%); box-shadow: 0 6px 27px #070b1799;
  pointer-events: none; animation: game-window-reveal .28s ease-out both; }
.domain-emblem { width: 53px; height: 40px; object-fit: contain; grid-row: span 2; }
.domain-heading { display: grid; gap: 3px; }
.domain-heading span { color: #a8dbd6; font-size: .75rem; }
.domain-heading strong { font-size: 1.16rem; }
.domain-exp { grid-column: 2; display: flex; align-items: center; gap: 6px; color: #d4eda3; font-size: .74rem; }
.domain-exp .catalog-icon { width: 16px; height: 16px; object-fit: contain; }

#hatch-dialog { width: min(746px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  border: 1px solid #496d7a; border-radius: 4px 14px 4px 14px; padding: clamp(13px, 3vw, 24px);
  background: radial-gradient(ellipse at 26% 0, #234858, transparent 58%), #0e1c2b; scrollbar-width: thin; }
#hatch-dialog[open] { animation: game-window-reveal .25s ease-out both; }
.hatch-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 10px;
  padding: 0 34px 12px 0; }
#hatch-title { margin: 0; color: #d2f7e0; }
#hatch-dialog .catalog-icon, #hatch-reveal .catalog-icon, .egg-choice .catalog-icon { border: 0; background: transparent; }
#hatch-accelerators { display: flex; align-items: center; gap: 5px; color: #ffdb9f; font-size: .78rem; }
#hatch-accelerators .catalog-icon { width: 21px; height: 21px; }
.hatch-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 7px 0;
  border-top: 1px solid #6b9cad5c; }
.hatch-section-heading h3 { font-size: .88rem; color: #d4ebe9; }
#hatch-capacity { color: #a5c9d6; font-size: .72rem; }
#hatch-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(5px, 1.5vw, 10px);
  padding: 0; margin: 0 0 15px; list-style: none; }
#hatch-slots li { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 7px clamp(4px, 1.4vw, 11px);
  min-width: 0; min-height: 156px; border-radius: 3px 11px 3px 3px;
  background: linear-gradient(180deg, #213e4d, #142635 74%); box-shadow: inset 0 0 0 1px #567a8b86;
  text-align: center; font-size: .76rem; }
.hatch-pod { position: relative; display: grid; place-items: center; isolation: isolate; width: 100%; height: 64px;
  background: radial-gradient(ellipse at center, #8be9c043, transparent 63%); }
.hatch-pod::after { content: ''; position: absolute; z-index: -1; inset: auto 0 9px; margin-inline: auto; width: min(77%, 70px);
  height: 13px; border: 1px solid #85d8b5a8; border-bottom: 2px solid #a4ecd1; border-radius: 50%; background: #395e67bc; }
#hatch-slots .hatch-pod .catalog-icon { width: 38px; height: 42px; object-fit: contain; margin-bottom: 8px;
  animation: hatch-bob 2.6s ease-in-out infinite; }
#hatch-slots li:nth-child(2) .catalog-icon { animation-delay: -.8s; }
#hatch-slots li:nth-child(3) .catalog-icon { animation-delay: -1.5s; }
#hatch-slots li > span { color: #adcbd7; }
#hatch-slots .hatch-empty { align-content: center; background: #101f2b; box-shadow: inset 0 0 0 1px #355263; }
.hatch-empty .hatch-pod { background: none; }
.hatch-empty .hatch-pod::after { opacity: .25; }
.hatch-empty .hatch-pod .game-icon { opacity: .52; width: 25px; height: 25px; }
#hatch-slots li[data-ready] { box-shadow: inset 0 0 0 1px #abebbc; }
#hatch-slots progress { appearance: none; width: 100%; max-width: 150px; height: 4px; margin-block: 2px;
  border: 0; border-radius: 4px; background: #0c1d2b; color: #8ee6ae; overflow: hidden; }
#hatch-slots progress::-webkit-progress-bar { background: #0c1d2b; }
#hatch-slots progress::-webkit-progress-value { background: linear-gradient(90deg, #55aab1, #a9eab6); }
#hatch-slots progress::-moz-progress-bar { background: linear-gradient(90deg, #55aab1, #a9eab6); }
#hatch-slots time { color: #c4f5cc; font: .71rem ui-monospace, monospace; }
#hatch-slots button, .hatch-stock-item button { min-height: 34px; padding: 3px 6px; font-size: .73rem; }
#hatch-slots [data-action="hatch-collect"] { background: #b1eabf; color: #153024; border-color: #d4f5db; font-weight: 750; }
#hatch-slots [data-action="hatch-collect"]:disabled { opacity: .48; }
#hatch-stock { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 6px; }
.hatch-stock-item { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 5px 7px; background: #38597333;
  border-bottom: 1px solid #516e8659; }
.hatch-stock-item .catalog-icon { width: 32px; height: 32px; object-fit: contain; flex: none; }
.hatch-stock-item span { flex: 1; font-size: .78rem; }
.hatch-stock-item small { display: block; color: #bad2db; }
.hatch-footer:has(button:not([hidden]), .message:not(:empty)) { margin-top: 9px; }
#hatch-reveal { width: min(350px, calc(100% - 26px)); overflow: hidden; padding: 12px 20px 15px;
  color: #dcf7ec; text-align: center; border: 1px solid #93e0c4; border-radius: 5px 16px 5px 16px;
  background: radial-gradient(ellipse at 50% 36%, #244658, #101e31 68%); }
#hatch-reveal[open] { display: grid; justify-items: center; animation: game-window-reveal .22s ease-out both; }
#hatch-reveal:focus { outline: none; }
#hatch-reveal::backdrop { background: #050b14c9; }
#hatch-reveal h2 { margin: 0; font-size: 1rem; }
.hatch-reveal-stage { display: grid; grid-template: 1fr / 1fr; place-items: center; width: 100%; height: clamp(94px, 27dvh, 143px);
  background: radial-gradient(ellipse at center, #83edb744, transparent 57%); isolation: isolate; }
.hatch-reveal-stage::before, .hatch-reveal-stage::after { content: ''; grid-area: 1 / 1; z-index: -1; border: 1px solid #a8f0d18a;
  width: 90px; aspect-ratio: 1; border-radius: 50%; }
.hatch-reveal-stage::before { background: url('/art/dex-pedestal.png') center / contain no-repeat; }
.hatch-reveal-stage::after { width: 102px; border-style: dashed; opacity: .55; }
#hatch-reveal-egg, #hatch-reveal-model { grid-area: 1 / 1; }
#hatch-reveal-egg .catalog-icon { width: 72px; height: 80px; object-fit: contain; }
#hatch-reveal-egg { animation: hatch-crack .96s both; }
#hatch-reveal-model { display: none; }
#hatch-reveal[data-revealed] #hatch-reveal-model { display: grid; place-items: center; animation: hatch-born .38s ease-out both; }
#hatch-reveal[data-revealed] #hatch-reveal-egg { display: none; }
#hatch-reveal[data-revealed] .hatch-reveal-stage::after { animation: hatch-ring .56s ease-out both; }
#hatch-reveal[data-rare] { border-color: #ffd79a; }
#hatch-reveal[data-rare] .hatch-reveal-copy strong { color: #ffdd9b; }
.hatch-reveal-copy { display: grid; gap: 3px; min-height: 39px; }
.hatch-reveal-copy strong { font-size: 1.18rem; }
.hatch-reveal-copy span { color: #aecbd8; font-size: .79rem; }
#hatch-reveal-close { margin-top: 6px; padding: 5px 13px; }
@keyframes hatch-bob { 50% { translate: 0 -5px; } }
@keyframes hatch-crack {
  0%, 22% { rotate: 0deg; }
  34%, 59% { rotate: -11deg; }
  46%, 70% { rotate: 11deg; }
  80% { rotate: 0deg; filter: brightness(2); }
  100% { scale: 1.2; filter: brightness(3); opacity: .25; }
}
@keyframes hatch-born { from { opacity: 0; translate: 0 7px; filter: brightness(1.9); } }
@keyframes hatch-ring { from { opacity: 1; scale: .8; } to { opacity: .5; scale: 1.13; } }
@media (prefers-reduced-motion: reduce) {
  #chat-dialog[open], #hatch-dialog[open], #hatch-reveal[open], #hatch-reveal-egg, #hatch-slots .hatch-pod .catalog-icon,
  #hatch-reveal[data-revealed] #hatch-reveal-model, #hatch-reveal[data-revealed] .hatch-reveal-stage::after { animation: none; }
}
#hatch-message:empty, #password-message:empty, #oauth-message:empty { display: none; }
#account-security h3, #account-security summary { font-size: .83rem; color: #c4e3e8; }
#account-security summary { cursor: pointer; }
#password-form { display: grid; gap: 8px; margin-top: 8px; }
#password-form label, .cash-filters label { display: grid; gap: 4px; font-size: .77rem; color: #c4dbe6; }
#auth-providers, #account-providers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
#auth-providers:empty { display: none; }
.provider-link, .provider-linked { display: inline-flex; align-items: center; min-height: 33px; padding: 4px 8px;
  border: 1px solid #477b90; border-radius: 4px; color: #ddf2fc; background: #203d52; text-decoration: none; font-size: .78rem; }
.provider-linked { color: #b0e9c9; }
.cash-filters { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 7px; margin-bottom: 9px; }
.cash-filters :is(input, select) { width: 100%; min-height: 36px; min-width: 0; border: 1px solid #60718b; border-radius: 4px;
  padding-inline: 7px; color: #dfedf8; background: #111d2d; }

#trade-dialog[data-counter="market"] { width: min(815px, calc(100% - 24px)); padding: clamp(12px, 3vw, 24px);
  background: linear-gradient(138deg, #203742, #102430 65%); border: 1px solid #77b5ae; border-top: 2px solid #b9dfbd; border-radius: 7px; }
#trade-dialog[data-counter="market"] .service-header { justify-content: space-between; padding-right: 44px; }
#trade-dialog[data-counter="market"] h2 { color: #d7ecbf; }
#trade-dialog[data-counter="market"] #trade-tabs { justify-content: start; border-block: 1px solid #739d9c53; padding: 6px 0; margin-bottom: 8px; }
#trade-dialog[data-counter="market"] #trade-tabs [aria-pressed="true"] { color: #d3f7db; background: #305246; box-shadow: inset 0 -2px #a4d7a2; }
#trade-dialog .market-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 142px), 1fr)); gap: 7px; }
.market-card { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 8px; border: 1px solid #608e895e;
  border-radius: 5px; background: #17313c; }
.market-card-art { position: relative; min-height: 55px; display: grid; place-items: center; background: radial-gradient(ellipse, #3c675d9c, transparent 73%); }
.market-card-art img, .market-publish-preview img { width: 42px; height: 42px; object-fit: contain; }
.market-card-art span { position: absolute; bottom: 3px; right: 4px; font-size: .73rem; color: #dbe5bb; }
.market-card h3 { font-size: .82rem; }
.market-card small { color: #adced0; font-size: .71rem; overflow-wrap: anywhere; }
.market-total { display: flex; gap: 4px; align-items: center; margin-top: 4px; color: #ffe3a4; font-size: .8rem; }
.market-total img { width: 16px; height: 16px; object-fit: contain; }
.market-card button { min-height: 37px; margin-top: 3px; padding: 3px 5px; font-size: .72rem; }
.market-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 8px; padding: 19px 10px; color: #bcd6d8; font-size: .84rem; }
.market-publish-layout { display: grid; grid-template-columns: minmax(100px, .5fr) minmax(0, 1fr); gap: 9px; align-items: start; }
.market-publish-preview { display: grid; justify-items: center; gap: 6px; padding: 11px 6px; text-align: center;
  border: 1px solid #60948878; border-radius: 4px; background: radial-gradient(ellipse, #2c5259, #192f40); font-size: .79rem; }

.arrival { grid-template-columns: minmax(0, 1.35fr) minmax(280px, 355px); align-items: center; gap: min(8vw, 95px);
  padding: max(18px, 6vh) max(20px, 9vw); background: #081829; }
.arrival-art { background-image: url('/art/arena-terrace.png'); background-position: center 44%; image-rendering: auto; }
.arrival::after { background: linear-gradient(90deg, #071020c7 0%, #101b324f 55%, #071626bb), linear-gradient(0deg, #071020d9, transparent 75%); }
.arrival-brand { align-self: center; margin: 0; }
.arrival-brand h1 { margin: 0; }
.arrival-brand h1 img { display: block; width: 100%; max-height: 46dvh; object-fit: contain;
  filter: drop-shadow(0 10px 18px #030713a8); }
.arrival-panel { position: relative; padding: clamp(14px, 2.6vw, 27px); border: 1px solid #81c8cf87; border-top: 2px solid #94d8d7;
  border-radius: 6px 6px 14px 6px; background: linear-gradient(143deg, #172e42f5, #0c192cf5 80%); box-shadow: 0 16px 48px #050e1eaf; }
.arrival-modes { margin-bottom: 12px; gap: 6px; }
.arrival-modes button { padding: 8px 10px; }
.arrival-modes button[aria-pressed="true"] { color: #bdece7; border-color: #94d8d7; }
.arrival-panel label { color: #d3e4ee; }
.arrival-panel input { background: #0a182c; border-color: #59829e7d; }
.arrival-panel #auth-submit { justify-content: center; }
.arrival-install { color: #a8d9e8; border: 0; background: transparent; }
.arrival-install:hover { background: #243e57; }
@media (max-width: 680px) and (orientation: portrait) {
  .arrival { grid-template-columns: minmax(0, 440px); grid-template-rows: minmax(115px, 1fr) auto;
    gap: 12px; padding: 17px 15px max(18px, env(safe-area-inset-bottom)); }
  .arrival-brand { align-self: end; }
  .arrival-brand h1 img { width: min(100%, 340px); margin-inline: auto; }
  .arrival-art { background-position: center 35%; }
  .arrival-panel { padding: 13px 14px; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .arrival { gap: 17px; padding: 10px clamp(15px, 6vw, 50px); }
  #hatch-slots li { min-height: 88px; }
}
@media (prefers-reduced-motion: reduce) { .domain-result { animation: none; } }

#community-dialog { width: min(694px, calc(100% - 24px)); min-height: min(540px, calc(100dvh - 20px)); max-height: min(760px, calc(100dvh - 20px));
  padding: clamp(12px, 3vw, 23px); border: 1px solid #58798e; border-top: 2px solid #94dada;
  border-radius: 5px 12px 5px 12px; background: linear-gradient(141deg,#172f43,#101e31 65%); scrollbar-width: thin; }
#community-dialog[open] { display: flex; flex-direction: column; overflow: hidden; animation: game-window-reveal .22s ease-out both; }
#community-title { padding-right: 36px; color: #d1edf0; }
#community-tabs { justify-content: start; gap: 5px; margin-bottom: 10px; border-bottom: 1px solid #567c8d70; }
#community-content { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px;
  min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-gutter: stable; }
#community-content > button { justify-self: start; }
:is(#community-content, #guild-content) h3 { color: #d0e8f2; font-size: .9rem; }
:is(#community-message, #guild-message):empty, .profile-community-actions:empty { display: none; }
:is(#community-message, #guild-message):not([data-error]) { color: #a2dfc6; }
:is(#community-message, #guild-message, #player-message)[data-error] { color: #ffb7a6; }
.community-note { color: #f5d0a4; font-size: .82rem; }
.community-form { display: flex; align-items: stretch; gap: 6px; }
.community-form input { flex: 1; width: 0; min-width: 0; }
.community-form button, .community-actions button { min-height: 34px; padding: 4px 8px; font-size: .76rem; }
.community-rows, .guild-missions { display: grid; gap: 4px; padding: 0; margin: 0; list-style: none; }
.community-rows > li { display: flex; justify-content: space-between; align-items: center; gap: 6px 12px; min-width: 0;
  padding: 6px 8px; border: 1px solid #4a677d66; border-radius: 4px; background: #13283a; }
.community-rows > li > div:not(.community-actions) { display: grid; justify-items: start; min-width: 0; gap: 2px; }
.community-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; }
#guild-content select { min-height: 34px; max-width: 100%; padding: 4px 6px; border: 1px solid #527388;
  border-radius: 4px; background: #132438; color: #d5edf3; font: inherit; font-size: .76rem; }
.community-player { max-width: 100%; min-width: 0; color: #b3e7f5; background: transparent; border: 0;
  padding: 4px 0; text-align: left; font-weight: 700; overflow-wrap: anywhere; }
.community-player:is(:hover,:focus-visible) { color: #d9f6ff; text-decoration: underline; }
.community-actions.profile-community-actions { margin: 14px 0 0; justify-content: center; gap: 6px; }
.profile-community-actions .profile-icon-action { position: relative; display: grid; place-items: center; width: 42px; height: 42px;
  padding: 0; border-radius: 7px; }
.profile-icon-action img { display: block; width: 22px; height: 22px; object-fit: contain; }
.profile-self { color: #a9c4d3; font-size: .74rem; }
.community-rows small { display: block; color: #abc6d8; font-size: .7rem; overflow-wrap: anywhere; }
#guild-dialog { --guild-accent: #9de1cf; width: min(890px, calc(100% - 24px)); height: min(680px, calc(100dvh - 20px));
  padding: clamp(12px, 3vw, 24px); border: 1px solid #5c8290; border-top: 2px solid var(--guild-accent);
  border-radius: 6px 12px 6px 12px; background: linear-gradient(142deg,#173343,#101e2d 66%); }
#guild-dialog[open] { display: flex; flex-direction: column; overflow: hidden; animation: game-window-reveal .22s ease-out both; }
#guild-title { padding-inline-end: 35px; color: var(--guild-accent); }
#guild-title .game-icon { width: 25px; height: 25px; }
#guild-header { flex: none; }
#guild-content { flex: 1; min-height: 0; padding-inline-end: 5px; overflow: auto; scrollbar-width: thin; scrollbar-gutter: stable; }
.guild-banner { display: grid; grid-template-columns: 64px minmax(0,1fr) minmax(125px, 38%); align-items: center; gap: 8px 13px;
  padding: 10px 13px; background: radial-gradient(ellipse at 12% 100%, #62a8ab30, transparent 66%), linear-gradient(105deg,#1c3c50,#14293c 80%);
  border: 1px solid #59979f85; border-inline-start: 3px solid var(--guild-accent); border-radius: 5px; }
.guild-banner .guild-avatar { width: 64px; box-shadow: 0 0 12px #69d8ce3a; }
.guild-banner h3 { overflow-wrap: anywhere; font-size: clamp(1.05rem, 2.8vw, 1.42rem); color: #e6f7fa; }
.guild-banner span, .guild-banner small { font-size: .72rem; color: #b7d6dd; }
.guild-tabs { justify-content: start; flex-wrap: wrap; gap: 4px; margin: 8px 0 5px; padding-block-end: 5px; border-bottom: 1px solid #557b8d70; }
.guild-tabs button { padding: 6px 9px; font-size: .78rem; }
.guild-entrance { display: grid; gap: 10px; }
.guild-entry-restriction { display: flex; align-items: center; gap: 7px; padding: 8px 10px;
  background: #26363e; border: 1px solid #92845a6b; border-radius: 5px; }
.guild-entry-restriction .game-icon { width: 18px; height: 18px; flex: none; }
.guild-entry-invitations { display: grid; gap: 7px; }
.guild-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.guild-settings-card, .guild-settings-membership { display: grid; align-content: start; gap: 8px; min-width: 0; }
.guild-settings-card { padding: 10px; border: 1px solid #4a677d66; border-radius: 6px; background: #13283a; }
.guild-disband { display: grid; margin-block: 4px 8px; padding: 9px 10px; border: 1px solid #b274696e;
  color: #ffc4b8; border-radius: 5px; background: #432b31a3; }
.guild-disband summary { cursor: pointer; font-size: .84rem; font-weight: 700; }
.guild-disband p { margin: 8px 0; font-size: .78rem; line-height: 1.4; }
.guild-disband-confirm { border-color: #c0867b; background: #65383f; }
.guild-announcement { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 4px 8px;
  padding: 9px 11px; border: 1px solid #ad9b6579; border-radius: 6px; background: linear-gradient(110deg, #303a3d, #182e40 75%); }
.guild-announcement > .game-icon { width: 23px; height: 23px; }
#guild-content .guild-announcement h3 { color: #ffe1a5; }
.guild-announcement p { grid-column: 2; font-size: .8rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.guild-announcement-form { display: grid; gap: 6px; padding: 9px; border: 1px solid #4a677d66; border-radius: 6px; }
.guild-announcement-form label { display: grid; gap: 5px; color: #d0e8f2; font-size: .85rem; font-weight: 700; }
.guild-announcement-form textarea { resize: vertical; width: 100%; min-height: 60px; padding: 7px; font: inherit; font-weight: 400;
  color: inherit; background: var(--inset); border: 1px solid #527388; border-radius: 5px; }
.guild-avatar { display: grid; place-items: center; width: 50px; background: #112839; border: 1px solid #7db6bf8a; border-radius: 50%; }
.guild-avatar img { inset: 5%; width: 90%; height: 90%; }
.guild-create { display: grid; grid-template-columns: minmax(0, 1fr) minmax(145px, .55fr); gap: 12px;
  min-width: 0; border: 1px solid #557b8d70; border-top: 2px solid var(--guild-accent); border-radius: 6px;
  background: linear-gradient(125deg, #19374a, #122839 60%); padding: 13px; }
.guild-create > h3 { grid-column: 1 / -1; }
.guild-create-fields { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px; }
.guild-create-fields label { display: grid; align-content: start; gap: 4px; min-width: 0; color: #d6e8f1; font-size: .78rem; }
.guild-create-fields input { width: 100%; min-width: 0; }
.guild-create-fields small { font-size: .67rem; }
.guild-create-emblems { grid-column: 1; display: grid; gap: 6px; align-content: start; }
.guild-create-emblems h4 { font-size: .78rem; color: #d6e8f1; }
.guild-create-preview { grid-column: 2; grid-row: 2 / span 2; display: grid; align-content: center; justify-items: center; gap: 9px;
  min-width: 0; padding: 10px; border-radius: 6px; text-align: center; background: radial-gradient(ellipse, #2b5264, #102737 78%); }
.guild-create-preview strong { overflow-wrap: anywhere; color: #eff8fa; font-size: .84rem; }
.guild-create-preview .guild-avatar { width: 72px; }
.guild-create-submit { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; justify-content: end;
  border-top: 1px solid #658b9c58; padding-top: 9px; }
.guild-create-submit button { display: flex; align-items: center; gap: 9px; }
.guild-emblem-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 52px)); gap: 5px; }
.guild-emblem-picker button { display: grid; place-items: center; padding: 3px; background: #162d41; }
.guild-emblem-picker button[aria-pressed="true"] { border-color: #9be9df; background: #2a4e5d; box-shadow: inset 0 -2px #9bf2e2; }
.guild-emblem-picker img { display: block; width: 100%; max-width: 42px; aspect-ratio: 1; object-fit: contain; }
.guild-avatar .game-icon { width: 58%; height: auto; }
.community-subtabs { width: fit-content; padding: 2px; border: 1px solid #557b8d4d; border-radius: 6px; background: #0f1d2d; }
.community-subtabs button { background: transparent; }
.guild-panel { display: grid; gap: 8px; padding-top: 4px; }
.guild-panel > button { justify-self: start; }
.guild-xp { --progress-color: var(--guild-accent); display: grid; gap: 4px; }
.guild-xp progress, .guild-missions progress { display: block; width: 100%; height: 6px; accent-color: #a5e2c4; }
.guild-mission-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.guild-mission-heading small { color: #abc8d4; font-size: .74rem; }
.guild-missions { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px),1fr)); gap: 7px; }
.guild-missions li { display: grid; grid-template-columns: 35px minmax(0, 1fr) auto; align-items: center; gap: 7px 9px;
  padding: 9px; border: 1px solid #54758773; border-radius: 7px; background: linear-gradient(115deg, #1c394b, #14283a 72%); }
.guild-missions li[data-complete] { background: linear-gradient(115deg, #245145, #142f37 75%); border-color: #76b69a94; }
.guild-mission-mark { display: grid; grid-row: 1 / 3; place-items: center; align-self: start; width: 35px; height: 35px;
  border: 1px solid #74aeb57d; border-radius: 8px; background: #132736; }
.guild-mission-mark canvas { width: 24px; height: 24px; }
.guild-mission-objective { grid-column: 2 / -1; min-width: 0; }
.guild-mission-objective h4 { margin: 0; font-size: .82rem; }
.guild-mission-objective p { margin: 3px 0 0; color: #b2ccd8; font-size: .72rem; line-height: 1.3; }
.guild-mission-progress { display: grid; grid-template-columns: minmax(20px, 1fr) auto; gap: 5px; align-items: center; }
.guild-mission-progress small { color: #c5e7de; font-size: .69rem; }
.guild-mission-reward { display: inline-flex; align-items: center; gap: 4px; color: #ffe3a7; font-size: .72rem; white-space: nowrap; }
.guild-mission-reward img { width: 18px; height: 18px; border: 0; background: transparent; object-fit: contain; }
.guild-invite-panel { display: grid; gap: 7px; padding: 10px; margin-bottom: 3px; border: 1px solid #4a677d66;
  border-radius: 6px; background: #0e1d2b6b; }
.guild-invite-results:empty { display: none; }
.guild-invite-list button { min-height: 32px; padding: 4px 8px; font-size: .76rem; }
.guild-members > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 7px 9px; }
.community-rows > li > div.guild-member-identity { display: flex; align-items: center; gap: 8px; }
.guild-member-avatar { width: 41px; flex: none; background: #102233; border-radius: 50%; border: 1px solid #52788f82; }
.guild-member-avatar img { inset: 6%; width: 88%; height: 88%; }
.guild-member-who { min-width: 0; }
.guild-member-who .community-player { padding-block: 2px; }
.guild-presence { display: flex; align-items: center; gap: 4px; margin-top: 2px; color: #abc5d2; }
.guild-presence::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: #7d95a5; }
.guild-presence[data-online] { color: #a8ebcd; }
.guild-presence[data-online]::before { background: #95e6bc; }
.community-rows > li > div.guild-member-contribution { justify-items: end; text-align: right; }
.guild-member-contribution strong { color: #f7d997; font-size: .8rem; white-space: nowrap; }
.guild-members > li > .community-actions { grid-column: 1 / -1; border-top: 1px solid #55768845; padding-top: 5px; }
.guild-roles { display: grid; gap: 6px; padding: 10px; border: 1px solid #4a677d66; border-radius: 6px; }
.guild-avatar-form { display: grid; align-items: start; grid-template-columns: 50px minmax(0,1fr); gap: 10px; padding: 10px;
  background: #0f21324d; border: 1px solid #4a677d66; border-radius: 6px; }
.guild-avatar-fields, .guild-avatar-fields label { display: grid; gap: 5px; min-width: 0; }
.guild-avatar-fields label { color: #bdd4e1; font-size: .78rem; }
.guild-avatar-fields input { width: 100%; min-width: 0; }
.guild-avatar-fields > button { justify-self: start; padding: 5px 8px; }
.playtime-currencies { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 7px; font-size: .73rem; }
.guild-avatar-fields .community-actions { justify-content: start; }
.ranking-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.ranking-count { white-space: nowrap; color: #afc9d6; font: .74rem ui-monospace, monospace; }
.ranking-rows { padding: 0; margin: 0; max-height: min(510px, max(100px, calc(100dvh - 192px))); overflow-y: auto;
  scrollbar-width: thin; scrollbar-gutter: stable; list-style: none; border-block: 1px solid #4a677d80; }
.ranking-rows > li { display: grid; grid-template-columns: 29px 36px minmax(0,1fr) auto; align-items: center; gap: 8px;
  min-height: 50px; padding: 5px 7px; border-bottom: 1px solid #4a677d42; background: #122639; }
.ranking-rows > li:nth-child(even) { background: #152b3e; }
.ranking-rows > li:last-child { border-bottom: 0; }
.ranking-position { color: #a8c9d2; text-align: center; font: 700 .82rem ui-monospace, monospace; }
.podium-icon { display: inline-block; width: 22px; height: 22px; object-fit: contain; }
.ranking-position .podium-icon { display: block; margin-inline: auto; }
.ranking-identity { display: grid; justify-items: start; min-width: 0; font-size: .84rem; line-height: 1.2; overflow-wrap: anywhere; }
.ranking-identity .community-player { padding-block: 2px; }
.ranking-identity > strong + .community-player { font-size: .72rem; }
.ranking-stats { display: grid; justify-items: end; gap: 2px; text-align: right; }
.player-tamer-rank { display: block; margin-top: 2px; color: #f4d6a0; }
.friend-rows, .application-rows { max-height: none; overflow: visible; scrollbar-gutter: auto; }
.ranking-rows:is(.friend-rows, .application-rows) > li { grid-template-columns: 36px minmax(0, 1fr) auto; }
.ranking-rows:is(.friend-rows, .application-rows) > li:has(.friend-actions) { grid-template-columns: 36px minmax(0, 1fr) auto auto; }
.friend-rows .friend-actions, .application-rows .friend-actions { justify-content: end; }
.friend-actions .profile-icon-action { display: grid; place-items: center; width: 34px; min-height: 34px; padding: 0; }
.friend-actions .profile-icon-action img { width: 17px; height: 17px; }
.ranking-level { color: #f5dbac; font-size: .75rem; white-space: nowrap; }
.ranking-rows small { color: #aec8d6; font-size: .7rem; }
.ranking-rows small.guild-presence[data-online] { color: #a8ebcd; }
:is(.mission-reset, .playtime-reset, .guild-mission-reset)[role="timer"] { font-variant-numeric: tabular-nums; }
.ranking-rows :is(.creature-portrait,.compact-portrait) { width: 36px; height: 36px; }
.ranking-avatar, .ranking-rows .creature-portrait { background: transparent; }
.ranking-avatar img { inset: 4%; width: 92%; height: 92%; }
@media (max-width: 530px) {
  #community-tabs button { padding-inline: 6px; font-size: .75rem; }
  .community-rows > li { flex-wrap: wrap; }
  .community-actions { justify-content: start; }
  .ranking-rows > li { grid-template-columns: 23px 36px minmax(0,1fr) auto; column-gap: 6px; }
  .ranking-rows:is(.friend-rows, .application-rows) > li:has(.friend-actions) { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .friend-rows .friend-actions, .application-rows .friend-actions { grid-column: 2 / -1; }
  .guild-banner { grid-template-columns: 44px minmax(0,1fr); gap: 7px 10px; }
  .guild-banner .guild-avatar { width: 44px; }
  .guild-banner .guild-xp { grid-column: 2; }
  .guild-settings-grid { grid-template-columns: minmax(0, 1fr); }
  .guild-create { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .guild-create-preview { grid-column: 1; grid-row: auto; grid-template-columns: auto minmax(0, 1fr); align-items: center;
    justify-items: start; text-align: start; }
  .guild-create-preview .guild-avatar { width: 43px; }
  .guild-tabs button { padding-inline: 5px; font-size: .73rem; }
}
@media (max-width: 400px) {
  .guild-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { :is(#community-dialog, #guild-dialog)[open] { animation: none; } }
