/* A shared, console-sized stage for setup, battle, and every menu. */
body { background: #080d19; }
.console-holder { height: 100svh; min-height: 240px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.game-console { position: relative; flex: none; }
.game-stage { position: absolute; inset: 0 auto auto 0; transform-origin: top left; isolation: isolate; overflow: hidden; display: grid; grid-template-rows: 76px minmax(0, 1fr) 36px; background: #11182b url('../assets/site/card-board.webp') center/cover; border: 2px solid #b69a59; border-radius: 18px; box-shadow: 0 15px 70px #0009, inset 0 0 45px #0008; }
.game-stage:has(dialog[open])::after { content: ''; position: absolute; inset: 0; background: #050911e8; z-index: 90; pointer-events: none; }
.game-stage .panel { background: linear-gradient(145deg, #172339ed, #0c1427ed); border: 1px solid #d4b46c66; border-radius: 12px; box-shadow: inset 0 0 24px #0005; }
.game-stage .game-header { width: 100%; max-width: none; margin: 0; padding: 8px 24px; gap: 12px; }
.game-stage .brand img { width: 116px; height: 58px; object-fit: contain; margin: 0; }
.game-stage .header-tools { max-width: none; flex-wrap: nowrap; gap: 8px; }
.game-stage .header-tools .plate { min-height: 42px; min-width: auto; padding: 10px 20px; font-size: 12px; }
.game-stage main { width: auto; min-height: 0; margin: 0 22px; }
.game-stage .setup, .game-stage .battle { width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; }
.game-stage .setup { display: grid; grid-template-rows: 138px minmax(0, 1fr) 94px; gap: 12px; }
.game-stage .intro { position: relative; display: grid; grid-template-columns: 300px 1fr 240px; align-items: center; gap: 12px; max-width: none; margin: 0; padding: 12px 22px; text-align: left; }
.game-stage .intro .eyebrow { position: absolute; top: 9px; left: 24px; font-size: 9px; margin: 0; }
.game-stage .intro h1 { margin: 8px 0 0; }
.game-stage .clash-logo { width: 255px; height: 108px; max-height: none; object-fit: contain; }
.game-stage .intro > p:not(.eyebrow) { font-size: 15px; margin: 0; line-height: 1.6; }
.game-stage .bank-line { margin: 0; gap: 8px; }
.game-stage .bank-line > img { width: 42px; height: 42px; }
.game-stage .bank-line p { font-size: 12px; }
.game-stage .bank-line strong { font-size: 24px; }
.game-stage .bank-line span { font-size: 11px; }
.game-stage .setup-grid { min-height: 0; grid-template-columns: 1fr 1fr; gap: 14px; }
.game-stage .setup-section { min-height: 0; padding: 14px 18px; display: grid; grid-template-rows: 16px 34px minmax(0, 1fr) 42px; gap: 4px; }
.game-stage .setup-section .eyebrow { font-size: 9px; margin: 0; }
.game-stage .setup-section h2 { font-size: 26px; margin: 0; }
.game-stage .choice-pair { min-height: 0; gap: 18px; width: 100%; max-width: 450px; margin: 0 auto; }
.game-stage .choice { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 7px; opacity: .78; border: 2px solid transparent; border-radius: 12px; }
.game-stage .choice:hover, .game-stage .choice.selected { opacity: 1; transform: none; }
.game-stage .choice.selected { border-color: #ffe29c; background: #eec87a10; box-shadow: 0 0 15px #ffd98522; }
.choice-portrait { position: relative; display: block; flex: 1; min-height: 0; width: 100%; }
.game-stage .choice-art { width: 100%; height: 100%; aspect-ratio: auto; margin: 0; object-fit: contain; }
.game-stage .choice .frame { display: none; }
.game-stage .choice-caption { flex: none; width: 100%; min-height: 54px; padding: 8px 4px; gap: 2px; background: none; }
.game-stage .choice-caption strong { font-size: 23px; }
.game-stage .choice-caption > span { font-size: 11px; }
.game-stage .deck-preview { justify-self: center; min-height: 36px; margin: 2px 0 0; font-size: 12px; padding: 8px 24px; }
.game-stage .challenge-note { align-self: center; max-width: 430px; margin: 0 auto; font-size: 12px; line-height: 1.4; }
.game-stage .begin-panel { margin: 0; padding: 8px 20px; display: grid; grid-template-columns: 1fr 360px 1fr; align-items: center; gap: 18px; }
.game-stage .begin-panel > p { font-size: 13px; margin: 0; }
.game-stage .begin-panel .small-note { margin: 0; font-size: 11px !important; }
.game-stage .action-button { min-height: 64px; min-width: 0; padding: 18px 28px; font-size: 14px; }
.game-stage .battle { display: grid; grid-template-rows: 70px 164px 66px minmax(0, 1fr) 56px; gap: 9px; }
.game-stage .battle-top { padding: 10px 24px; margin: 0; gap: 10px; }
.game-stage .battle-top h1 { font-size: 28px; }
.game-stage .battle-top .eyebrow { font-size: 9px; margin-bottom: 3px; }
.game-stage .round-stats { gap: 30px; }
.game-stage .round-stats strong { font-size: 26px; }
.game-stage .round-stats span { font-size: 10px; }
.game-stage .gold-stat { padding-left: 40px; }
.game-stage .gold-stat img { width: 36px; height: 36px; }
.game-stage .arena { min-height: 0; grid-template-columns: 1fr .9fr 1fr; gap: 12px; }
.game-stage .fighter { flex-direction: row; padding: 10px 18px; gap: 16px; text-align: left; }
.game-stage .fighter-picture { height: 140px; width: 100px; padding: 0; }
.game-stage .fighter-picture > img:first-child { height: 100%; width: 100%; object-fit: contain; aspect-ratio: auto; }
.game-stage .fighter-picture .frame { display: none; }
.game-stage .fighter-information { width: auto; }
.game-stage .fighter h2 { font-size: 28px; margin-bottom: 8px; }
.game-stage .fighter .eyebrow { font-size: 9px; margin-bottom: 5px; }
.game-stage .health { font-size: 14px; margin-bottom: 5px; }
.game-stage .status-line { font-size: 12px; min-height: 0; }
.game-stage .intent-panel { grid-column: auto; grid-row: auto; min-height: 0; padding: 12px 16px; }
.game-stage .intent-panel .eyebrow { font-size: 9px; margin-bottom: 6px; }
.game-stage .intent-panel h2 { font-size: 25px; margin-bottom: 7px; }
.game-stage .intent-panel > p:not(.eyebrow) { font-size: 13px; }
.game-stage .intent-panel .intent-tip { font-size: 10px !important; margin-top: 7px; }
.game-stage .turn-toolbar { flex-direction: row; margin: 0; gap: 12px; }
.game-stage .turn-message { width: auto; min-height: 58px; font-size: 13px; padding: 10px 20px; }
.game-stage .turn-toolbar .action-button { min-width: 270px; min-height: 60px; font-size: 13px; }
.game-stage .hand-section { min-height: 0; display: grid; grid-template-rows: 27px minmax(0, 1fr); }
.game-stage .hand-heading { margin: 0 4px 4px; align-items: center; gap: 10px; }
.game-stage .hand-heading h2 { font-size: 24px; }
.game-stage .hand-heading p { font-size: 11px; max-width: none; }
.game-stage .hand { flex-wrap: nowrap; min-height: 0; gap: 10px; margin: 0; padding: 6px 5px 5px; justify-content: center; overflow-x: auto; overflow-y: hidden; }
.game-stage .game-card { flex: 0 1 206px; width: 206px; min-width: 150px; max-width: 206px; min-height: 0; padding: 29px 9px 10px; border: 1px solid #ac8a4d; border-radius: 10px; }
.game-stage .game-card .frame { display: none; }
.game-stage .game-card:hover:not(:disabled) { transform: translateY(-4px); }
.game-stage .card-art { height: 0; min-height: 0; flex: 1; width: 100%; margin: 0; object-fit: contain; }
.game-stage .card-title { top: 9px; left: 35px; right: 6px; font-size: 16px; }
.game-stage .card-cost { top: 1px; left: 0; min-width: 35px; min-height: 36px; padding: 7px; font-size: 16px; }
.game-stage .card-copy { flex: none; min-height: 72px; padding: 8px 5px 0; background: none; }
.game-stage .card-copy .card-power { font-size: 11px; margin-bottom: 5px; }
.game-stage .card-copy .card-rule { font-size: 11px; line-height: 1.4; }
.game-stage .empty-hand { align-self: center; padding: 35px; }
.game-stage .battle-bottom { flex-direction: row; align-items: center; margin: 0; gap: 12px; }
.game-stage .deck-tools { width: auto; flex-wrap: nowrap; gap: 8px; }
.game-stage .pile-button { min-width: 155px; padding: 7px 20px; gap: 10px; }
.game-stage .pile-button img { width: 24px; height: 32px; object-fit: contain; }
.game-stage .pile-button > span { font-size: 12px; }
.game-stage .pile-button strong { font-size: 10px; margin-top: 2px; }
.game-stage .deck-tools > #new-duel-button { width: auto; font-size: 12px; }
.game-stage .battle-log { position: relative; padding: 10px 20px; max-width: 36%; width: 360px; font-size: 12px; }
.game-stage .battle-log ol { position: absolute; bottom: 100%; right: 0; z-index: 10; width: 360px; max-height: 240px; margin: 0 0 7px; padding: 18px 18px 18px 34px; background: #0b1427; border: 1px solid #d4b46c; border-radius: 9px; }
.game-stage > footer { width: auto; margin: 0; padding: 0 24px; flex-direction: row; align-items: center; gap: 8px; }
.game-stage > footer p { font-size: 10px; }
.game-stage > footer .plate { min-height: 28px; padding: 5px 18px; font-size: 10px; }
.game-stage .effects-layer, .game-stage .ambient-glitter { position: absolute; inset: 0; }
.game-stage .ambient-glitter { z-index: 0; }
.game-stage .effects-layer { z-index: 80; }
.game-stage .game-dialog { position: fixed; inset: auto; left: var(--console-center-x); top: var(--console-center-y); margin: 0; transform: translate(-50%, -50%) scale(var(--console-scale)); transform-origin: center; width: var(--console-dialog-width); max-width: 1040px; max-height: var(--console-dialog-height); padding: 28px 36px; overflow: auto; border: 1px solid #d4b46c; background: #101b30; font-size: 16px; }
.game-stage .game-dialog::backdrop { background: transparent; }
.game-stage .dialog-heading h2 { font-size: 34px; }
.game-stage .dialog-heading .plate { min-height: 44px; font-size: 13px; padding: 10px 24px; }
.game-stage .rules-copy p { font-size: 16px; line-height: 1.6; }
.game-stage .deck-list { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.game-stage .deck-entry { display: flex; flex-direction: column; padding: 8px; border: 1px solid #8e7645; border-radius: 10px; }
.game-stage .deck-entry > img:first-child { width: 100%; height: 155px; margin: 0; aspect-ratio: auto; object-fit: contain; }
.game-stage .deck-entry .frame { display: none; }
.game-stage .deck-entry .entry-copy { background: none; padding: 10px 3px 3px; }
.game-stage .entry-copy h3 { font-size: 20px; }
.game-stage .entry-copy p { font-size: 12px; }
.game-stage .deck-dialog-note { font-size: 14px; }
.game-stage .result-dialog { width: 620px; }
.game-stage .confirm-dialog { width: 600px; }
.game-stage .result-dialog > p:not(.eyebrow), .game-stage .confirm-dialog > p { font-size: 16px; }
.game-stage .result-actions .plate { font-size: 14px; }

/* A taller version of the same stage keeps portrait phones usable. */
.portrait-console { grid-template-rows: 76px minmax(0, 1fr) 38px; }
.portrait-console .game-header { padding: 8px 14px; }
.portrait-console .brand img { width: 95px; }
.portrait-console .header-tools { gap: 4px; }
.portrait-console .header-tools .plate { font-size: 12px; padding: 12px; min-height: 50px; }
.portrait-console main { margin: 0 12px; }
.portrait-console .setup { grid-template-rows: 124px minmax(0, 1fr) 100px; gap: 10px; }
.portrait-console .intro { grid-template-columns: 210px 1fr; padding: 12px 14px; gap: 6px; }
.portrait-console .intro .eyebrow { display: none; }
.portrait-console .intro h1 { grid-row: 1 / 3; }
.portrait-console .clash-logo { width: 205px; height: 100px; }
.portrait-console .intro > p:not(.eyebrow) { font-size: 13px; }
.portrait-console .bank-line { justify-content: flex-start; }
.portrait-console .bank-line > img { width: 30px; height: 30px; }
.portrait-console .bank-line strong { font-size: 21px; }
.portrait-console .setup-grid { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; gap: 10px; }
.portrait-console .setup-section { padding: 9px 14px; grid-template-rows: 13px 28px minmax(0, 1fr) 36px; gap: 1px; }
.portrait-console .setup-section h2 { font-size: 24px; }
.portrait-console .choice-pair { max-width: 470px; gap: 18px; }
.portrait-console .choice { flex-direction: row; align-items: center; gap: 6px; padding: 4px; }
.portrait-console .choice-portrait { width: 112px; height: 100%; flex: 1; }
.portrait-console .choice-caption { width: 93px; min-height: 0; padding: 4px; }
.portrait-console .choice-caption strong { font-size: 22px; }
.portrait-console .choice-caption > span { font-size: 12px; }
.portrait-console .deck-preview { min-height: 36px; margin: 0; font-size: 13px; }
.portrait-console .challenge-note { font-size: 12px; }
.portrait-console .begin-panel { grid-template-columns: 1fr; gap: 0; padding: 6px 14px; }
.portrait-console .begin-panel > p { font-size: 12px; }
.portrait-console .begin-panel .action-button { min-height: 48px; padding: 12px 20px; width: 360px; justify-self: center; font-size: 15px; }
.portrait-console .begin-panel .small-note { font-size: 10px !important; }
.portrait-console .battle { grid-template-rows: 70px 188px 80px minmax(0, 1fr) 64px; gap: 10px; }
.portrait-console .battle-top { padding: 10px 16px; }
.portrait-console .round-stats { gap: 20px; }
.portrait-console .arena { grid-template-columns: 1fr 1fr; gap: 8px; position: relative; padding-bottom: 74px; }
.portrait-console .fighter { padding: 8px 10px; gap: 8px; }
.portrait-console .fighter-picture { height: 96px; width: 69px; }
.portrait-console .fighter h2 { font-size: 23px; margin-bottom: 5px; }
.portrait-console .health { font-size: 13px; }
.portrait-console .status-line { font-size: 11px; }
.portrait-console .intent-panel { position: absolute; bottom: 0; width: 100%; height: 66px; display: grid; grid-template-columns: 160px 1fr; gap: 0 8px; text-align: left; padding: 8px 15px; }
.portrait-console .intent-panel .eyebrow { grid-column: 1; margin: 0; }
.portrait-console .intent-panel h2 { grid-column: 1; font-size: 20px; margin: 0; }
.portrait-console .intent-panel > #intent-description { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 14px; }
.portrait-console .intent-panel .intent-tip { display: none; }
.portrait-console .turn-toolbar { gap: 8px; }
.portrait-console .turn-message { padding: 9px 14px; font-size: 13px; height: 100%; }
.portrait-console .turn-toolbar .action-button { min-width: 185px; min-height: 70px; padding: 14px 20px; font-size: 14px; }
.portrait-console .hand-section { grid-template-rows: 40px minmax(0, 1fr); }
.portrait-console .hand-heading { gap: 10px; }
.portrait-console .hand-heading h2 { font-size: 25px; white-space: nowrap; }
.portrait-console .hand-heading p { font-size: 12px; line-height: 1.4; }
.portrait-console .hand { justify-content: flex-start; gap: 12px; scroll-snap-type: x mandatory; padding: 5px 4px 10px; }
.portrait-console .game-card { flex: 0 0 230px; min-width: 230px; max-width: 230px; scroll-snap-align: start; padding: 36px 12px 14px; }
.portrait-console .card-title { font-size: 20px; }
.portrait-console .card-cost { font-size: 20px; }
.portrait-console .card-copy { min-height: 110px; }
.portrait-console .card-copy .card-power { font-size: 16px; }
.portrait-console .card-copy .card-rule { font-size: 15px; }
.portrait-console .battle-bottom { gap: 6px; }
.portrait-console .deck-tools { gap: 4px; }
.portrait-console .pile-button { min-width: 148px; padding: 8px 13px; }
.portrait-console .deck-tools > #new-duel-button { padding: 12px; font-size: 12px; }
.portrait-console .battle-log { width: 80px; max-width: none; padding: 8px; font-size: 12px; }
.portrait-console > footer { padding: 0 14px; }
.portrait-console > footer p { max-width: 350px; font-size: 10px; }
.portrait-console .game-dialog { max-width: var(--console-dialog-width); padding: 24px; }
.portrait-console .deck-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portrait-console .deck-entry > img:first-child { height: 200px; }
.portrait-console .entry-copy p { font-size: 15px; }
.portrait-console .rules-copy p { font-size: 18px; }


/* Preserve the original painted ornament without stretching its corners. */
.game-stage .panel {
  position: relative;
  isolation: isolate;
  border-color: transparent;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.game-stage .panel::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border: 16px solid transparent;
  border-image: url('../assets/site/menu-plate.png') 55 150 fill / 16px 44px / 0 stretch;
}
.game-stage .game-dialog { position: fixed; }
.game-stage .game-dialog::before { position: fixed; }
.game-stage .choice {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 54px;
  justify-items: center;
  border: 0;
  padding: 7px;
}
.game-stage .choice.selected { border-color: transparent; box-shadow: none; background: none; }
.game-stage .choice-portrait {
  flex: none;
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 2 / 3;
  margin: auto;
  overflow: hidden;
}
.game-stage .choice .frame, .game-stage .fighter-picture .frame,
.game-stage .game-card .frame, .game-stage .deck-entry .frame {
  display: block;
  object-fit: contain;
}
.game-stage .choice-art {
  position: absolute;
  inset: 15% 8% 17%;
  width: 84%;
  height: 68%;
  object-fit: contain;
}
.game-stage .choice.selected .choice-portrait { filter: drop-shadow(0 0 7px #ffe49b); }
.game-stage .choice-portrait::after {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 5% 13% auto;
  text-align: center;
  font: 16px Georgia, serif;
  color: #fff2d2;
  pointer-events: none;
}
.choice[data-hero='dekino'] .choice-portrait::after { content: 'Dekino'; }
.choice[data-hero='sharkina'] .choice-portrait::after { content: 'Sharkina'; }
.choice[data-rival='alpha'] .choice-portrait::after { content: 'Alpha'; }
.choice[data-rival='zilth'] .choice-portrait::after { content: 'Zilth'; }
.game-stage .fighter-picture { width: auto; aspect-ratio: 2 / 3; }
.game-stage .fighter-picture > img:first-child {
  position: absolute;
  inset: 8% 9%;
  width: 82%;
  height: 84%;
  object-fit: contain;
}
.game-stage .game-card {
  flex: 0 0 auto;
  height: 100%;
  width: auto;
  aspect-ratio: 2 / 3;
  min-width: 0;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.game-stage .card-art {
  position: absolute;
  top: 16%;
  left: 9%;
  width: 82%;
  height: 48%;
  flex: none;
  object-fit: contain;
}
.game-stage .card-title { top: 5%; left: 17%; right: 12%; font-size: 14px; }
.game-stage .card-cost { top: 1%; left: -3%; }
.game-stage .card-copy { position: static; display: contents; }
.game-stage .card-copy .card-power {
  position: absolute;
  z-index: 4;
  bottom: 4.5%;
  left: 12%;
  width: 76%;
  margin: 0;
  font-size: 10px;
  line-height: 1.15;
}
.game-stage .card-copy .card-rule {
  position: absolute;
  z-index: 4;
  top: 65%;
  left: 12%;
  width: 76%;
  max-height: 18%;
  font-size: 11px;
  line-height: 1.3;
  margin: 0;
  color: #fff4dc;
  text-shadow: 0 1px 3px #000;
}
.game-stage .deck-entry { min-height: 290px; aspect-ratio: 2 / 3; padding: 0; border: 0; }
.game-stage .deck-entry > img:first-child {
  position: absolute;
  inset: 16% 9% auto;
  width: 82%;
  height: 45%;
  object-fit: contain;
}
.game-stage .deck-entry .entry-copy { position: static; padding: 0; }
.game-stage .entry-copy h3 { position: absolute; z-index: 4; inset: 5% 12% auto; font-size: 17px; }
.game-stage .entry-copy .entry-count { position: absolute; z-index: 4; inset: auto 10% 4.5%; font-size: 11px; margin: 0; }
.game-stage .entry-copy p:not(.entry-count) { position: absolute; z-index: 4; inset: 64% 12% auto; font-size: 12px; line-height: 1.4; margin: 0; }
.portrait-console .choice { display: flex; flex-direction: row; }
.portrait-console .choice-portrait { flex: none; width: 112px; height: 168px; max-height: 100%; }
.portrait-console .choice-caption { flex: 1; width: auto; }
.portrait-console .fighter-picture { width: 64px; }
.portrait-console .game-card { flex: 0 0 auto; min-width: 0; width: auto; max-width: none; padding: 0; }
.portrait-console .card-title { font-size: 20px; }
.portrait-console .card-copy .card-power { font-size: 14px; }
.portrait-console .card-copy .card-rule { font-size: 16px; }
.portrait-console .deck-entry { min-height: 340px; }
.portrait-console .deck-entry > img:first-child { height: 45%; }
.portrait-console .entry-copy p:not(.entry-count) { font-size: 15px; }

.portrait-console .intent-panel { position: absolute; }

.game-stage .game-card::before, .game-stage .deck-entry::before {
  content: ''; position: absolute; inset: 12% 7%; z-index: -1; background: #0c1729; pointer-events: none;
}
