/* A one-screen card table. Information dialogs scroll independently. */
:root {
  color-scheme: light;
  --page: #d8e2eb;
  --ink: #172a3d;
  --muted: #687b8d;
  --line: #bfccd8;
  --accent: #f36740;
  --pet: #f36740;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body {
  height: 100svh;
  height: 100dvh;
  display: grid;
  grid-template-rows: 60px minmax(0, 1fr);
  padding-top: env(safe-area-inset-top);
  background: linear-gradient(135deg, #e1e8ef 0%, #d0dce7 100%);
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; border: 0; color: inherit; }
button:disabled { cursor: not-allowed; }
button:focus-visible, a:focus-visible { outline: 3px solid #2b79bb; outline-offset: 2px; }
button { transition: background .15s, border-color .15s, transform .15s; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
button svg { pointer-events: none; }
[hidden] { display: none !important; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Points and three compact information entrances. */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 max(22px, calc((100vw - 1080px) / 2));
  border-bottom: 1px solid var(--line);
  background: #e8eff5ed;
  min-width: 0;
}
.brand, .header-actions, .wallet, .main-nav { display: flex; align-items: center; }
.brand { gap: 9px; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 34px; border-radius: 8px 8px 8px 2px; color: #fff; background: var(--ink); transform: rotate(-4deg); }
.brand-mark svg { width: 22px; height: 22px; fill: currentColor; stroke-width: 0; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: .4px; white-space: nowrap; }
.header-actions { gap: 24px; min-width: 0; }
.wallet { gap: 7px; white-space: nowrap; }
.wallet svg { width: 21px; height: 21px; color: #df8d27; }
.wallet strong { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.wallet > span { font-size: 12px; color: var(--muted); }
.main-nav { gap: 4px; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 7px; background: transparent; color: #6a7c8d; }
.icon-button:hover { color: var(--ink); background: #dfe9f1; }

/* The four rows never leave the viewport. */
.app-main {
  width: min(1120px, 100%);
  height: min(100%, 740px);
  min-height: 0;
  justify-self: center;
  align-self: center;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 132px 82px 94px;
  gap: 12px;
  padding: 12px 20px 16px;
}
.app-main > section { min-width: 0; min-height: 0; }
.arena-card { display: grid; grid-template-rows: 38px minmax(0, 1fr); border: 1px solid #263d50; border-radius: 14px; overflow: hidden; background: #162b3f; box-shadow: 0 8px 24px #19344815; }
.arena-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 0 14px; color: #e7eef5; background: #102236; border-bottom: 1px solid #ffffff0c; }
.arena-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; }
.arena-label > svg { color: #f58b5e; width: 17px; height: 17px; }
.arena-toolbar .icon-button { height: 30px; width: 30px; color: #b9cbdc; }
.arena-toolbar .icon-button:hover { background: #ffffff0b; color: #fff; }
.arena-stage {
  --card-width: 188px;
  --caster: #f36740;
  position: relative;
  min-height: 0;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px minmax(0, 1fr);
  grid-template-rows: 24px minmax(0, 1fr) 32px;
  column-gap: 8px;
  padding: 7px 28px 8px;
  background-color: #1b344a;
  background-image: linear-gradient(30deg, #ffffff03 12%, transparent 12.5%, transparent 87%, #ffffff03 87.5%), linear-gradient(150deg, #ffffff03 12%, transparent 12.5%, transparent 87%, #ffffff03 87.5%);
  background-size: 60px 100px;
}
.arena-stage:after { content: ""; position: absolute; inset: 15% 12%; z-index: -1; border: 1px solid #8bbed51b; border-radius: 50%; transform: rotate(-12deg); pointer-events: none; }
.round-pill { grid-column: 1 / -1; grid-row: 1; justify-self: center; align-self: center; color: #b9cbd8; font-size: 12px; letter-spacing: 1px; white-space: nowrap; line-height: 1; }
.fighter {
  --fighter-color: #e58047;
  grid-row: 2;
  align-self: center;
  width: min(100%, var(--card-width));
  height: 100%;
  max-height: calc(var(--card-width) * 1.5);
  min-height: 0;
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--fighter-color);
  border-radius: 10px;
  background: #eaf1f6;
  box-shadow: 0 4px 0 #091b2c, 0 8px 18px #07172845;
  transform-origin: 50% 65%;
  transition: box-shadow .16s;
}
.fighter-player { grid-column: 1; justify-self: end; transform: none; }
.fighter-opponent { grid-column: 3; justify-self: start; transform: none; }
.card-top { position: absolute; top: 0; left: 0; right: 0; height: 31px; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 4px 6px 5px; min-width: 0; background: linear-gradient(#e9f1f7f5, #e9f1f7e8); border-bottom: 1px solid #ffffff7d; }
.card-top > span:first-child { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fighter-owner { font-size: 12px; font-weight: 700; color: #8797a5; }
.pet-sprite { position: absolute; inset: 0; min-height: 0; min-width: 0; overflow: hidden; border-radius: 7px; background: color-mix(in srgb, var(--fighter-color) 16%, #eaf0f6); }
.pet-sprite img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; }
.fighter-health { position: absolute; left: 0; right: 0; bottom: 0; height: 43px; z-index: 3; min-width: 0; padding: 7px 6px 5px; background: linear-gradient(#e9f1f7e8, #e9f1f7f8); border-top: 1px solid #ffffff80; }
.health-numbers { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.health-numbers > span:first-child { color: color-mix(in srgb, var(--fighter-color) 70%, #172a3d); }
.health-numbers > span:last-child { color: #536778; white-space: nowrap; }
.health-track { height: 5px; border-radius: 2px; background: #dce6ed; overflow: hidden; margin-top: 5px; }
.health-fill { width: 100%; height: 100%; background: #53a889; transition: width .12s linear; }
.health-fill.low { background: #e9724d; }
.energy-track { height: 3px; margin-top: 3px; border-radius: 2px; background: #e3e8ed; overflow: hidden; }
.energy-track > div { width: 0; height: 100%; background: #e5b54d; transition: width .12s linear; }
.unknown-opponent { position: absolute; inset: -1px; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; border-radius: 8px; border: 5px solid #eef4f9; outline: 2px solid #9eb9ca; background: repeating-linear-gradient(45deg, #294962 0 9px, #2e506b 9px 18px); box-shadow: inset 0 0 0 2px #b2cbdb66; }
.unknown-opponent > span { color: #c9dce9; letter-spacing: 3px; font-size: 12px; font-weight: 800; }
.card-back-mark { display: grid; place-items: center; width: 66px; height: 66px; border: 1px solid #9fc0d277; transform: rotate(45deg); border-radius: 12px; color: #c8dfec; }
.card-back-mark svg { width: 38px; height: 38px; transform: rotate(-45deg); }
.versus { grid-column: 2; grid-row: 2; align-self: center; justify-self: center; color: #9fb8c9; font-size: 28px; font-weight: 900; font-style: italic; letter-spacing: -2px; }
.result-feedback { grid-column: 1 / -1; grid-row: 3; align-self: end; justify-self: center; display: flex; align-items: center; gap: 5px; color: #fff1ad; border-radius: 6px; padding: 4px 9px; font-size: 16px; font-weight: 800; line-height: 1; background: #ffffff0c; pointer-events: none; }
.result-feedback svg { width: 16px; height: 16px; }
.result-feedback small { font-size: 12px; font-weight: 500; }
.pet-aura, .pet-pedestal { display: none; }

/* Three new cards, six payouts, one entry row. */
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 20px; }
.section-heading h2 { font-size: 14px; font-weight: 750; }
.section-heading > span { font-size: 12px; color: var(--muted); }
.draft-section { display: grid; grid-template-rows: 20px minmax(0, 1fr); gap: 6px; }
.draft-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; min-height: 0; }
.draft-card { --pet: #e58047; min-width: 0; min-height: 0; position: relative; padding: 5px; display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 12px; align-items: center; text-align: left; border: 2px solid var(--line); border-radius: 10px; background: #edf3f7; overflow: hidden; }
.draft-card:hover:not(:disabled) { border-color: var(--pet); }
.draft-card.selected { border-color: var(--pet); box-shadow: 0 0 0 1px color-mix(in srgb, var(--pet) 15%, transparent); }
.draft-card:disabled { cursor: default; }
.draft-card > img { min-height: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; border-radius: 5px; background: color-mix(in srgb, var(--pet) 10%, #edf2f6); }
.draft-info { min-width: 0; }
.draft-info h3 { font-size: 16px; font-weight: 800; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.element-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; line-height: 1.3; color: color-mix(in srgb, var(--pet) 70%, #172a3d); margin-top: 5px; }
.element-tag svg { width: 12px; height: 12px; }
.selection-check { display: none; position: absolute; top: 5px; right: 5px; width: 19px; height: 19px; border-radius: 5px; background: var(--pet); color: #fff; text-align: center; font-size: 13px; line-height: 19px; font-weight: 900; box-shadow: 0 1px 3px #172a3d33; }
.draft-card.selected .selection-check { display: block; }
.evolution-panel { display: grid; grid-template-rows: 20px minmax(0, 1fr); gap: 6px; }
.form-badge { color: #516d84 !important; font-weight: 650; }
.form-badge[data-form=mega] { color: #ad6a17 !important; }
.evolution-options { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; min-height: 0; }
.evolution-options button { min-width: 0; border: 1px solid #cbd9e4; border-radius: 8px; background: #eaf1f6; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; }
.evolution-options strong { font-size: 19px; font-weight: 800; }
.evolution-options small { font-size: 12px; color: var(--muted); }
.evolution-options button.selected { color: #b14f2c; border-color: #f18b67; background: #fff2e9; box-shadow: inset 0 0 0 1px #f18b6722; }
.evolution-options button:disabled { opacity: .65; }
.evolution-options button.selected:disabled { opacity: 1; }
.stake-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: end; gap: 16px; padding-top: 1px; }
.entry-options { display: grid; grid-template-rows: 28px 38px; gap: 5px; }
.entry-topline { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px; min-width: 0; }
.entry-label { font-size: 12px; font-weight: 650; color: var(--muted); }
.stake-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; width: 100%; max-width: 210px; justify-self: end; }
.stake-options button { min-height: 28px; min-width: 28px; padding: 0 2px; border: 1px solid #cbd9e4; border-radius: 5px; background: #eaf1f6; font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
.stake-options button.selected { border-color: #7598b6; background: #ddeaf4; color: #244f70; }
.stake-options button:disabled { opacity: .5; }
.stake-options button.selected:disabled { opacity: .85; }
#stake-input { width: 100%; min-width: 0; height: 38px; padding: 0 9px; border: 1px solid #aebfcd; border-radius: 7px; background: #edf3f7; color: var(--ink); font: inherit; font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; appearance: textfield; }
#stake-input::-webkit-inner-spin-button, #stake-input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
#stake-input:focus-visible { outline: 2px solid #2b79bb; outline-offset: 1px; }
#stake-input[aria-invalid="true"] { border-color: #c7523a; }
#stake-input:disabled { opacity: .65; }
.start-button { min-height: 48px; min-width: 0; padding: 0 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: #fff; box-shadow: 0 3px 0 #bd4c2c; font-size: 16px; font-weight: 800; }
.start-button:hover:not(:disabled) { background: #ea5a33; }
.start-button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #bd4c2c; }
.start-button:disabled { background: #a9b6c1; box-shadow: 0 3px 0 #8398a8; color: #fff; }
.start-button svg { width: 19px; height: 19px; }
#start-stake { font-size: 12px; font-weight: 500; opacity: .8; }

/* Whole-card impacts and brief, text-free skill feedback. */
.damage-layer { position: absolute; inset: 20% 0 0; z-index: 8; display: flex; align-items: flex-start; justify-content: center; pointer-events: none; }
.damage-number { font-size: 29px; font-weight: 900; line-height: 1; color: #fff; text-shadow: 0 2px 0 #a84b39, 0 0 8px #172a3d; animation: damage-pop .18s ease-out both; }
.damage-number.critical { color: #fff0a5; font-size: 34px; }
.damage-number.shield-number { color: #b8e1ff; font-size: 25px; }
.damage-number.shield-number svg { width: 26px; height: 26px; fill: #244f70; }
.fighter.attacking { z-index: 5; animation: card-strike .16s ease-out; }
.fighter-opponent.attacking { animation-name: card-strike-reverse; }
.fighter.hit { animation: card-hit .14s ease-out; }
.fighter.shielding { box-shadow: 0 0 0 3px #94d5fd, 0 0 18px #83cdff; }
.fighter.fainted { filter: grayscale(.7); opacity: .6; }
.arena-stage[data-phase=active] .fighter-opponent .pet-sprite { animation: card-reveal .18s ease-out; }
.battle-projectile { position: absolute; z-index: 7; left: calc(50% - 95px); top: 51%; width: 60px; height: 10px; border-radius: 100%; background: linear-gradient(90deg, transparent, var(--caster), #fff); opacity: 0; pointer-events: none; box-shadow: 0 0 8px var(--caster); }
.battle-projectile.fly { animation: projectile .15s ease-in both; }
.battle-projectile.reverse { left: auto; right: calc(50% - 95px); animation-name: projectile-reverse; }
.arena-stage.ultimate-flash:before, .arena-stage.evolving:before { content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; background: radial-gradient(ellipse at center, #ffe9b040, transparent 72%); animation: power-flash .18s ease-out both; }
.arena-stage.evolving:before { z-index: 1; background: radial-gradient(ellipse at 30% 50%, #b7e9ff38, transparent 60%); }
@keyframes card-strike { 0%,100% { transform: rotate(0deg); } 45% { transform: translate(22px, -5px) rotate(4deg) scale(1.035); } }
@keyframes card-strike-reverse { 0%,100% { transform: rotate(0deg); } 45% { transform: translate(-22px, -5px) rotate(-4deg) scale(1.035); } }
@keyframes card-hit { 0%,100% { filter: none; } 25% { transform: translateX(-4px) rotate(-2deg); filter: brightness(1.35); } 70% { transform: translateX(4px) rotate(2deg); } }
@keyframes card-reveal { from { transform: perspective(600px) rotateY(-75deg); opacity: .3; } to { transform: perspective(600px) rotateY(0); opacity: 1; } }
@keyframes damage-pop { 0% { opacity: 0; transform: translateY(5px) scale(.7); } 25% { opacity: 1; transform: translateY(-3px) scale(1.12); } 100% { opacity: 0; transform: translateY(-25px) scale(1); } }
@keyframes projectile { 0% { opacity: 0; transform: translateX(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateX(140px); } }
@keyframes projectile-reverse { 0% { opacity: 0; transform: translateX(0) scaleX(-1); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateX(-140px) scaleX(-1); } }
@keyframes power-flash { 0%,100% { opacity: 0; } 40% { opacity: 1; } }

/* Modal information is the only scrollable surface. */
.live-status { position: absolute; height: 1px; width: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.toast { position: fixed; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: calc(100vw - 28px); padding: 10px 16px; border-radius: 8px; background: #132a3e; color: #fff; font-size: 14px; text-align: center; z-index: 30; pointer-events: none; box-shadow: 0 4px 18px #172a3d33; }
dialog { width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid #b8cbd9; border-radius: 14px; background: #e9f0f6; color: var(--ink); overflow: auto; box-shadow: 0 20px 70px #10243655; }
dialog::backdrop { background: #0c223dcc; backdrop-filter: blur(4px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--line); background: #edf3f7; position: sticky; top: 0; z-index: 2; }
.dialog-header h2 { font-size: 19px; font-weight: 800; }
.dialog-body { padding: 20px; }
.dialog-intro { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.dex-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dex-card { min-width: 0; border: 1px solid color-mix(in srgb, var(--pet) 40%, var(--line)); padding: 8px; border-radius: 9px; background: #edf3f7; }
.dex-card img { width: 100%; height: 180px; object-fit: cover; border-radius: 5px; }
.dex-card h3 { font-size: 16px; margin-top: 8px; }
.dex-card .element-tag { margin-top: 6px; }
.dex-card p { color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 6px; }
.dex-stat { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 8px; }
.empty-state { padding: 30px 0; text-align: center; }
.empty-state > svg { width: 40px; height: 40px; color: #7397b3; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; }
.empty-state p { font-size: 14px; color: var(--muted); margin-top: 8px; }
.history-summary { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 14px; gap: 10px; }
.history-summary strong { color: #244f70; margin-left: 6px; }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-row { display: flex; align-items: center; gap: 10px; min-width: 0; border: 1px solid var(--line); background: #edf3f7; border-radius: 8px; padding: 10px; }
.history-row img { width: 42px; height: 58px; object-fit: cover; border-radius: 4px; }
.history-detail { min-width: 0; flex: 1; }
.history-detail strong { font-size: 14px; line-height: 1.4; }
.history-detail p { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 3px; }
.history-result { text-align: right; flex-shrink: 0; }
.history-result > span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.history-result strong { font-size: 17px; color: #28815e; }
.history-result.lose strong { color: #c35643; }
.history-result.draw strong { color: #47718e; }
.history-result p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rules-list { display: flex; flex-direction: column; gap: 18px; }
.rule-item h3 { font-size: 16px; margin-bottom: 6px; }
.rule-item p { font-size: 14px; color: #526b80; line-height: 1.7; }
.rules-callout { font-size: 12px; color: #526b80; line-height: 1.7; padding: 12px; border: 1px solid var(--line); background: #edf4fa; border-radius: 7px; margin-top: 18px; }
.form-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.form-rules span { padding: 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; color: var(--muted); }
.form-rules b { display: block; color: var(--ink); font-size: 14px; margin-top: 3px; }

@media (max-width: 600px) {
  body { grid-template-rows: 52px minmax(0, 1fr); }
  .app-header { padding: 0 12px; gap: 8px; }
  .brand { gap: 7px; }
  .brand-name { font-size: 15px; }
  .brand-extra { display: none; }
  .brand-mark { width: 28px; height: 30px; }
  .brand-mark svg { width: 20px; height: 20px; }
  .header-actions { gap: 10px; }
  .wallet { gap: 4px; }
  .wallet strong { font-size: 19px; }
  .wallet svg { width: 18px; height: 18px; }
  .wallet > span { display: none; }
  .main-nav { gap: 0; }
  .icon-button { width: 30px; height: 32px; }
  .icon-button svg { width: 18px; height: 18px; }
  .app-main { height: min(100%, 676px); grid-template-rows: minmax(0, 1fr) 116px 70px 90px; gap: 8px; padding: 8px 12px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .arena-card { grid-template-rows: 34px minmax(0, 1fr); border-radius: 11px; }
  .arena-toolbar { padding: 0 9px; }
  .arena-label { font-size: 14px; gap: 6px; }
  .arena-label > svg { width: 15px; height: 15px; }
  .arena-stage { --card-width: 145px; grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); column-gap: 5px; grid-template-rows: 22px minmax(0, 1fr) 32px; padding: 5px 10px 7px; }
  .round-pill { font-size: 12px; letter-spacing: .6px; }
  .fighter { border-radius: 8px; }
  .card-top { height: 27px; padding: 3px 4px 4px; gap: 3px; }
  .card-top > span:first-child { font-size: 14px; letter-spacing: -.3px; }
  .fighter-owner { font-size: 12px; }
  .health-numbers { font-size: 12px; gap: 2px; }
  .health-track { height: 4px; margin-top: 4px; }
  .health-numbers > span:last-child { font-size: 12px; letter-spacing: -.35px; }
  .health-numbers > span:first-child { font-size: 12px; }
  .versus { font-size: 21px; }
  .unknown-opponent { gap: 13px; border-width: 4px; }
  .card-back-mark { width: 48px; height: 48px; border-radius: 9px; }
  .card-back-mark svg { width: 28px; height: 28px; }
  .result-feedback { font-size: 16px; padding: 4px 8px; }
  .draft-section { grid-template-rows: 18px minmax(0, 1fr); gap: 5px; }
  .section-heading { min-height: 18px; }
  .draft-grid { gap: 7px; }
  .draft-card { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 33px; gap: 3px; padding: 3px; border-radius: 8px; }
  .draft-card > img { border-radius: 4px; }
  .draft-info { padding: 0 2px; }
  .draft-info h3 { font-size: 14px; line-height: 16px; letter-spacing: -.2px; }
  .element-tag { font-size: 12px; margin-top: 0; gap: 2px; line-height: 14px; }
  .element-tag svg { width: 11px; height: 11px; }
  .selection-check { width: 17px; height: 17px; line-height: 17px; font-size: 12px; top: 3px; right: 3px; border-radius: 4px; }
  .evolution-panel { grid-template-rows: 18px minmax(0, 1fr); gap: 5px; }
  .evolution-options { gap: 5px; }
  .evolution-options button { border-radius: 7px; }
  .evolution-options strong { font-size: 18px; }
  .evolution-options small { display: none; }
  .stake-panel { gap: 10px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .entry-options { grid-template-rows: 28px 38px; gap: 5px; }
  #stake-input { font-size: 16px; }
  .start-button { min-height: 43px; padding: 0 8px; font-size: 14px; gap: 5px; }
  .start-button svg { width: 17px; height: 17px; }
  #start-stake { display: none; }
  .damage-number { font-size: 25px; }
  .damage-number.critical { font-size: 28px; }
  .dialog-header { padding: 12px 14px; }
  .dialog-header h2 { font-size: 18px; }
  .dialog-body { padding: 14px; }
  .dex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .dex-card img { height: 155px; }
  .dex-card h3 { font-size: 14px; }
  .history-row { padding: 8px; gap: 7px; }
  .history-row img { width: 32px; height: 45px; }
  .history-result strong { font-size: 16px; }
  .history-result p { display: none; }
}
@media (max-width: 350px) {
  .brand-name { display: none; }
  .app-header { padding: 0 10px; }
  .arena-stage { --card-width: 124px; padding-left: 8px; padding-right: 8px; column-gap: 4px; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr); }
  .fighter-health { padding-left: 1px; padding-right: 1px; }
}
@media (max-height: 660px) {
  body { grid-template-rows: 48px minmax(0, 1fr); }
  .app-main { height: 100%; grid-template-rows: minmax(0, 1fr) 100px 60px 80px; gap: 6px; padding-top: 6px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .arena-card { grid-template-rows: 30px minmax(0, 1fr); }
  .arena-stage { grid-template-rows: 18px minmax(0, 1fr) 32px; padding-top: 3px; padding-bottom: 4px; }
  .arena-toolbar .icon-button { height: 28px; }
  .entry-options { grid-template-rows: 28px 38px; gap: 5px; }
  .start-button { min-height: 39px; }
  .evolution-options strong { font-size: 17px; }
  .unknown-opponent { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; }
  .battle-projectile { display: none; }
}
