/* Application-wide visual layer for the lobby, roster, stage picker, match
   HUD, control settings, and cinematic effects. Layout and responsive rules
   live here so HTML and game logic can focus on structure and behavior. */
:root {
  --ink:#111821;
  --navy:#18232f;
  --panel:#202d3a;
  --paper:#f5f3eb;
  --muted:#9eabb7;
  --red:#fa493b;
  --gold:#ffca55;
  --violet:#a879ff;
  --cyan:#55e5ff;
  --pink:#ff63b5;
  --line:rgba(255,255,255,.13);
  --green:#63d9a0
}
* {
  box-sizing:border-box
}
body {
  margin:0;
  background:#111821;
  color:var(--paper);
  font-family:'DM Sans',sans-serif;
  min-height:100vh;
  background-image:radial-gradient(ellipse at 12% 26%,#a879ff20 0,transparent 32%),radial-gradient(ellipse at 88% 14%,#35dfff18 0,transparent 34%),radial-gradient(ellipse at 50% -10%,#293b4c 0,transparent 42%),linear-gradient(130deg,rgba(255,255,255,.018) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.018) 50%,rgba(255,255,255,.018) 75%,transparent 75%);
  background-size:auto,auto,auto,18px 18px
}
button,input {
  font:inherit
}
button {
  cursor:pointer
}
.shell {
  max-width:1500px;
  margin:auto;
  padding:20px clamp(16px,3vw,44px) 40px
}
.topbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:4px 0 20px;
  border-bottom:1px solid var(--line)
}
.brand {
  display:flex;
  align-items:center;
  gap:12px
}
.brandmark {
  width:43px;
  height:43px;
  display:grid;
  place-items:center;
  background:var(--gold);
  color:#19222b;
  border-radius:50%;
  font-size:25px;
  box-shadow:0 3px 0 #b67d24
}
.brandname {
  font-family:'Barlow Condensed',sans-serif;
  font-weight:900;
  font-size:20px;
  letter-spacing:.04em;
  line-height:.95
}
.brandname span {
  display:block;
  color:var(--gold);
  font-size:12px;
  letter-spacing:.2em;
  margin-top:5px
}
.topright {
  display:flex;
  align-items:center;
  gap:10px;
  font-size:12px;
  color:var(--muted)
}
.online-dot {
  width:8px;
  height:8px;
  border-radius:50%;
  background:#657584
}
.online-dot.live {
  background:var(--green);
  box-shadow:0 0 10px #63d9a0
}
.step-tag {
  border:1px solid var(--line);
  border-radius:100px;
  padding:7px 11px;
  color:#d9e0e4;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:10px
}
.screen {
  display:none
}
.screen.active {
  display:block
}
.welcome {
  max-width:830px;
  margin:clamp(52px,10vh,110px) auto 0;
  text-align:center
}
.eyebrow {
  color:var(--gold);
  font-size:11px;
  letter-spacing:.24em;
  text-transform:uppercase;
  font-weight:800
}
.welcome h1 {
  font-family:'Barlow Condensed',sans-serif;
  font-size:clamp(54px,9vw,106px);
  line-height:.84;
  text-transform:uppercase;
  margin:15px 0 18px;
  font-weight:900;
  letter-spacing:-.025em
}
.welcome h1 em {
  font-style:normal;
  color:var(--gold);
  text-shadow:0 4px 0 #8e6223
}
.welcome p {
  color:#b5c0c9;
  line-height:1.6;
  max-width:520px;
  margin:0 auto 30px;
  font-size:14px
}
.lobby-actions {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  text-align:left
}
.lobby-card {
  background:linear-gradient(145deg,#34304a,#202d3d 58%,#182b37);
  border:1px solid color-mix(in srgb,var(--violet) 32%,var(--line));
  padding:22px;
  border-radius:15px;
  box-shadow:0 12px 28px #080d1370
}
.lobby-card h2 {
  font-family:'Barlow Condensed',sans-serif;
  text-transform:uppercase;
  font-size:23px;
  margin:0 0 5px
}
.lobby-card p {
  margin:0 0 16px;
  font-size:12px;
  color:var(--muted)
}
.field-label {
  display:block;
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:10px;
  font-weight:800;
  color:#adb8c1;
  margin:0 0 7px
}
.text-field {
  width:100%;
  height:44px;
  border:1px solid #485766;
  background:#131c25;
  color:#fff;
  border-radius:8px;
  padding:0 13px;
  outline:none
}
.text-field:focus {
  border-color:var(--cyan);
  box-shadow:0 0 0 3px #55e5ff2b,0 0 18px #55e5ff30
}
.btn {
  border:0;
  border-radius:8px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:11px;
  min-height:43px;
  padding:0 17px;
  transition:transform .15s,filter .15s
}
.btn:hover {
  transform:translateY(-2px);
  filter:brightness(1.14) saturate(1.15);
  box-shadow:0 0 18px #a879ff55
}
.btn:disabled {
  opacity:.4;
  cursor:not-allowed;
  transform:none
}
.btn-gold {
  background:linear-gradient(110deg,#ffe06d,#ffb33f 52%,#ff8b62);
  color:#1a2229;
  box-shadow:0 3px 0 #a97825
}
.btn-dark {
  color:#f4f2e9;
  background:linear-gradient(110deg,#364d63,#39405c 58%,#4b3560);
  border:1px solid #7d79a5
}
.lobby-card .btn {
  margin-top:11px;
  width:100%
}
.notice {
  margin:16px auto 0;
  min-height:22px;
  color:#ff958b;
  font-size:12px
}
.smallprint {
  font-size:10px;
  color:#72808d;
  margin-top:18px
}
.game-top {
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  padding:19px 0 15px;
  gap:15px
}
.game-title {
  font:900 30px/.9 'Barlow Condensed',sans-serif;
  text-transform:uppercase;
  letter-spacing:.02em
}
.game-title small {
  display:block;
  font:700 9px 'DM Sans',sans-serif;
  color:var(--gold);
  letter-spacing:.2em;
  margin-top:6px
}
.room-pill {
  border:1px solid #485562;
  background:#1b2630;
  border-radius:8px;
  padding:7px 12px;
  text-align:center
}
.room-pill span {
  display:block;
  color:#9aa7b1;
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.16em;
  font-weight:800
}
.room-pill strong {
  font:800 19px 'Barlow Condensed',sans-serif;
  letter-spacing:.2em;
  color:var(--gold)
}
.game-actions {
  justify-self:end;
  display:flex;
  gap:8px
}
.icon-btn {
  border:1px solid var(--line);
  background:#1c2833;
  color:#c1cbd2;
  border-radius:7px;
  padding:9px 11px;
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.05em
}
.icon-btn:hover {
  border-color:#8493a0;
  color:white
}
.player-strip {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-bottom:12px
}
.player-slot {
  position:relative;
  background:#202c37;
  border:1px solid #344350;
  border-radius:9px;
  min-height:76px;
  padding:10px 10px 9px 48px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  overflow:hidden
}
.player-slot:before {
  content:attr(data-number);
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:37px;
  display:grid;
  place-items:center;
  background:var(--pcolor);
  font:900 22px 'Barlow Condensed',sans-serif;
  color:white;
  text-shadow:0 1px 2px #111
}
.player-slot .ps-name {
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.player-slot .ps-duck {
  font-size:10px;
  color:#aeb9c2;
  margin-top:4px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.player-slot.me {
  outline:2px solid var(--pcolor);
  outline-offset:1px
}
.player-slot.empty {
  opacity:.58
}
.player-slot.offline {
  opacity:.45;
  filter:grayscale(1)
}
.selector-stage {
  display:grid;
  grid-template-columns:minmax(0,1fr) 280px;
  gap:12px;
  align-items:stretch
}
.roster-panel,.details-panel {
  background:#1c2732;
  border:1px solid #34424e;
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 12px 28px #080d1340
}
.roster-head {
  padding:13px 15px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  gap:12px
}
.roster-heading {
  min-width:max-content
}
.roster-heading h2 {
  font:900 21px/.9 'Barlow Condensed',sans-serif;
  text-transform:uppercase;
  margin:0
}
.roster-heading span {
  font-size:9px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.12em
}
.search-wrap {
  position:relative;
  flex:1
}
.search-wrap:before {
  content:'⌕';
  position:absolute;
  left:12px;
  top:7px;
  color:#93a0ab;
  font-size:22px;
  line-height:1
}
.search {
  width:100%;
  height:37px;
  border:1px solid #435261;
  border-radius:7px;
  background:#111a23;
  color:#fff;
  padding:0 34px 0 37px;
  font-size:12px;
  outline:none
}
.search:focus {
  border-color:#e7b94f
}
.clear-search {
  position:absolute;
  right:8px;
  top:7px;
  border:0;
  background:none;
  color:#9ba8b2;
  font-size:18px;
  line-height:20px;
  display:none
}
.clear-search.show {
  display:block
}
.count {
  color:#9ba7b0;
  font-size:10px;
  white-space:nowrap
}
.roster-scroll {
  height:min(56vh,540px);
  min-height:320px;
  overflow:auto;
  padding:11px;
  scrollbar-color:#4b5965 #1c2732
}
.duck-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(110px,1fr));
  gap:8px
}
.duck-card {
  --card-accent:#687c8b;
  position:relative;
  min-width:0;
  min-height:130px;
  border:1px solid #3d4a56;
  border-radius:8px;
  background:#263440;
  padding:6px 6px 8px;
  text-align:center;
  color:white;
  overflow:hidden;
  transition:border .12s,transform .12s,background .12s;
  cursor:pointer
}
.duck-card:hover {
  transform:translateY(-2px);
  border-color:#f0c257;
  background:#2b3b48
}
.duck-card.selected {
  border-color:var(--card-accent);
  box-shadow:inset 0 0 0 1px var(--card-accent),0 0 12px color-mix(in srgb,var(--card-accent) 20%,transparent)
}
.duck-card.unavailable {
  filter:grayscale(.75);
  opacity:.48;
  cursor:not-allowed
}
.duck-card.unavailable:hover {
  transform:none;
  border-color:#3d4a56;
  background:#263440
}
.duck-art {
  height:85px;
  width:100%;
  display:grid;
  place-items:center;
  position:relative
}
.duck-art svg {
  height:84px;
  width:88px;
  overflow:visible;
  filter:drop-shadow(0 4px 2px #10182088)
}
.duck-name {
  font:700 11px/1.1 'DM Sans',sans-serif;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.selected-ribbon {
  position:absolute;
  left:-2px;
  right:-2px;
  top:5px;
  font-size:8px;
  text-transform:uppercase;
  letter-spacing:.05em;
  font-weight:900;
  color:#121a20;
  background:var(--card-accent);
  padding:3px 0;
  display:none
}
.duck-card.selected .selected-ribbon {
  display:block
}
.unavailable-tag {
  position:absolute;
  right:4px;
  top:5px;
  font-size:8px;
  background:#17212b;
  color:#ff9f98;
  border-radius:3px;
  padding:3px 4px;
  font-weight:800;
  text-transform:uppercase
}
.details-panel {
  padding:17px;
  display:flex;
  flex-direction:column;
  min-height:390px
}
.details-top {
  display:flex;
  align-items:center;
  justify-content:space-between
}
.details-kicker {
  color:var(--gold);
  text-transform:uppercase;
  letter-spacing:.17em;
  font-size:9px;
  font-weight:800
}
.detail-art {
  height:170px;
  margin:4px 0 5px;
  display:grid;
  place-items:center;
  background:radial-gradient(ellipse,#425462 0,transparent 65%)
}
.detail-art svg {
  width:164px;
  height:150px;
  filter:drop-shadow(0 8px 4px #0a1118)
}
.detail-name {
  font:900 29px/.9 'Barlow Condensed',sans-serif;
  text-transform:uppercase;
  margin:0 0 5px
}
.detail-creator {
  color:#a8b5be;
  font-size:10px;
  margin-bottom:8px
}
.detail-bio {
  color:#c5cdd1;
  font-size:10px;
  line-height:1.45;
  max-height:62px;
  overflow:auto;
  margin:0 0 11px
}
.stat-row {
  margin:7px 0
}
.stat-label [title] {
  cursor:help;
  text-decoration:underline dotted #91a4b5;
  text-underline-offset:3px
}
.stat-info {
  color:#91a4b5;
  font-size:10px;
  font-style:normal;
  text-decoration:none
}
.stat-label {
  display:flex;
  justify-content:space-between;
  color:#d5dce0;
  text-transform:uppercase;
  font-size:9px;
  font-weight:800;
  letter-spacing:.08em;
  margin-bottom:4px
}
.stat-label b {
  color:#fff;
  font:800 11px 'Barlow Condensed',sans-serif
}
.meter {
  height:6px;
  background:#101820;
  border-radius:8px;
  overflow:hidden
}
.meter i {
  display:block;
  height:100%;
  width:0;
  background:linear-gradient(90deg,#45b7d0,#f9c455);
  border-radius:8px
}
.stats .meter-health,.stats .meter-focus {
  height:10px;
  border:1px solid #ffffff55;
  box-shadow:inset 0 1px 3px #000a,0 0 8px #ffffff22
}
.stats .meter-health i {
  background:linear-gradient(90deg,#27bd72,#b7f77a);
  box-shadow:0 0 8px #70f2a5aa
}
.stats .meter-focus i {
  background:linear-gradient(90deg,#30aaff,#ffe36b);
  box-shadow:0 0 8px #ffe36baa
}
.detail-placeholder {
  margin:auto;
  text-align:center;
  color:#95a2ac
}
.detail-placeholder .spark {
  font-size:40px;
  color:#607080
}
.detail-placeholder strong {
  display:block;
  font:800 20px 'Barlow Condensed',sans-serif;
  text-transform:uppercase;
  color:#ccd2d4
}
.detail-placeholder span {
  font-size:10px;
  line-height:1.5;
  display:block;
  margin-top:5px
}
.bottomline {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  padding:11px 2px 0;
  color:#8d9aa5;
  font-size:10px
}
.data-state {
  display:flex;
  align-items:center;
  gap:7px
}
.data-state i {
  width:7px;
  height:7px;
  border-radius:50%;
  background:#f5bd4a
}
.data-state.ready i {
  background:#64d5a0
}
.data-state.error i {
  background:#f36c61
}
.selection-hint {
  text-align:right
}
.loading {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:230px;
  color:#aab6bf;
  font-size:12px
}
.spinner {
  width:17px;
  height:17px;
  border:2px solid #536270;
  border-top-color:var(--gold);
  border-radius:50%;
  animation:spin .8s linear infinite
}
@keyframes spin {
  to {
    transform:rotate(360deg)
  }
}
.toast {
  position:fixed;
  left:50%;
  bottom:22px;
  transform:translate(-50%,20px);
  opacity:0;
  pointer-events:none;
  background:#263746;
  border:1px solid #687988;
  border-radius:8px;
  padding:11px 16px;
  color:white;
  font-size:12px;
  box-shadow:0 8px 25px #0008;
  transition:.2s;
  z-index:5
}
.toast.show {
  opacity:1;
  transform:translate(-50%,0)
}
.duck-art img {
  height:84px;
  width:88px;
  object-fit:contain;
  filter:drop-shadow(0 4px 2px #10182088)
}
.detail-art img {
  width:164px;
  height:150px;
  object-fit:contain;
  filter:drop-shadow(0 8px 4px #0a1118)
}
.ready-button {
  min-width:150px
}
.ready-button.is-ready {
  background:#6cd6a0;
  box-shadow:0 3px 0 #347c58
}
.player-slot .ps-ready {
  font-size:8px;
  color:#73dda9;
  font-weight:900;
  letter-spacing:.11em;
  margin-left:5px
}
.battle-hud {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin:12px 0 15px
}
.battle-fighter {
  min-width:0;
  min-height:130px;
  background:linear-gradient(145deg,#202c37,#141f2a 75%);
  border:1px solid color-mix(in srgb,var(--pcolor) 72%,#ffffff);
  border-top:5px solid var(--pcolor);
  border-radius:12px;
  padding:14px;
  display:grid;
  grid-template-columns:58px minmax(0,1fr) 92px;
  align-items:center;
  gap:12px;
  box-shadow:inset 0 1px #ffffff1c,0 8px 24px #03070db3,0 0 15px color-mix(in srgb,var(--pcolor) 23%,transparent)
}
.battle-avatar {
  width:58px;
  height:58px;
  object-fit:contain;
  flex:none
}
.battle-meta {
  min-width:0;
  flex:1
}
.battle-player {
  font-size:9px;
  color:#a9b5bd;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.battle-duck {
  font:800 14px/.95 'Barlow Condensed',sans-serif;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  margin-top:2px
}
.item-equipped {
  margin-top:3px;
  color:#ffe27a;
  font-size:8px;
  font-weight:900;
  letter-spacing:.03em;
  text-transform:uppercase
}
.battle-damage {
  min-width:86px;
  padding:9px 6px;
  border-left:1px solid #ffffff26;
  font:900 clamp(31px,4vw,46px)/.82 'Barlow Condensed',sans-serif;
  text-align:right;
  color:color-mix(in srgb, #ff493d var(--damage-heat), #f4f6ed);
  text-shadow:0 0 10px #ff493d77,0 2px #090e16;
  filter:drop-shadow(0 0 9px #ff493d44)
}
.damage-track {
  height:12px;
  margin-top:7px;
  overflow:hidden;
  border-radius:5px;
  background:#263642;
  box-shadow:inset 0 1px 2px #000a,0 0 7px #ffffff1c
}
.damage-track i {
  display:block;
  width:var(--damage-heat);
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,#f0d85b,#ff873b,#ff3d4f);
  box-shadow:0 0 8px #ff544b
}
.battle-damage small {
  display:block;
  font:700 8px 'DM Sans',sans-serif;
  color:#9eabb5;
  margin-top:3px
}
.focus-caption {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top:8px;
  color:#ffe58c;
  font:900 10px 'DM Sans',sans-serif;
  letter-spacing:.13em;
  text-shadow:0 0 10px #ffda5e99
}
.focus-caption b {
  color:#fff7ce;
  font-size:11px
}
.health-track {
  height:13px;
  margin-top:7px;
  overflow:hidden;
  border:1px solid #bdf4c577;
  border-radius:6px;
  background:#14261f;
  box-shadow:inset 0 1px 3px #000a,0 0 9px #58e99855
}
.health-track i {
  display:block;
  width:100%;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,#16b76b,#aaf76c);
  box-shadow:0 0 8px #67f3a5
}
.stock-dots {
  display:flex;
  gap:5px;
  margin-top:7px
}
.stock-dots i {
  width:10px;
  height:10px;
  border-radius:50%;
  background:#f7c451;
  box-shadow:0 0 4px #f7c45166
}
.stock-dots i.lost {
  background:#495866;
  box-shadow:none
}
.arena-frame {
  position:relative;
  border:1px solid #435360;
  border-radius:13px;
  overflow:hidden;
  background:#111923;
  box-shadow:0 14px 36px #080d1380
}
.arena-frame canvas {
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:16/9;
  background:#172534
}
.battle-result {
  position:absolute;
  inset:0;
  display:grid;
  place-content:center;
  text-align:center;
  background:#101923ce;
  backdrop-filter:blur(4px);
  font:900 clamp(34px,6vw,70px)/.9 'Barlow Condensed',sans-serif;
  text-transform:uppercase;
  color:#ffce60;
  text-shadow:0 4px #735226
}
.battle-result span {
  font:700 13px 'DM Sans',sans-serif;
  color:#e6edf0;
  text-shadow:none;
  margin-top:12px
}
.battle-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 2px;
  color:#9eabb5;
  font-size:10px
}
.battle-controls {
  display:flex;
  align-items:center;
  gap:5px;
  flex-wrap:wrap;
  justify-content:flex-end
}
.battle-controls kbd {
  background:#2a3946;
  border:1px solid #51616d;
  border-bottom-width:2px;
  border-radius:4px;
  padding:3px 5px;
  color:white;
  font:800 9px 'DM Sans',sans-serif
}
.battle-message {
  position:absolute;
  top:18px;
  left:50%;
  transform:translateX(-50%);
  padding:8px 13px;
  border-radius:7px;
  background:#13202dcc;
  color:white;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
  pointer-events:none
}
.focus-track,.guard-track {
  height:3px;
  margin-top:4px;
  border-radius:4px;
  background:#0d1720;
  overflow:hidden
}
.focus-track {
  height:12px;
  margin-top:3px;
  border:1px solid #ffe792bb;
  background:#18243b;
  box-shadow:inset 0 1px 3px #000a,0 0 14px #ffd95c77
}
.focus-track i,.guard-track i {
  display:block;
  height:100%;
  transition:width .15s
}
.focus-track i {
  background:linear-gradient(90deg,#2e8cff,#8d69ff,#ffe06e);
  box-shadow:0 0 9px #ffe06e
}
.guard-track i {
  background:linear-gradient(90deg,#62c7e8,#c0f7ff)
}
.guard-track.overshield i {
  background:linear-gradient(90deg,#f0a83d,#fff0a3)
}
.battle-fighter.ultimate-ready {
  border-color:#ffda6c;
  box-shadow:0 0 16px #ffd55c55;
  animation:ultGlow .8s ease-in-out infinite alternate
}
.ultimate-badge {
  margin-top:3px;
  color:#ffe27a;
  font-size:7px;
  font-weight:900;
  letter-spacing:.04em;
  animation:warningPulse .65s ease-in-out infinite alternate
}
@keyframes ultGlow {
  to {
    box-shadow:0 0 24px #ffd55c99
  }
}
.battle-result button {
  margin:18px auto 0;
  min-width:145px
}
.battle-result[hidden] {
  display:none
}
.touch-controls {
  display:none;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:10px;
  padding:10px 0
}
.touch-group {
  display:flex;
  flex-wrap:wrap;
  gap:7px
}
.touch-controls button {
  min-width:48px;
  min-height:46px;
  padding:0 10px;
  border:1px solid #536675;
  border-radius:9px;
  background:#263746;
  color:white;
  font-size:11px;
  font-weight:900;
  touch-action:none
}
.touch-controls button:active,.touch-controls button.pressed {
  background:#e5b947;
  color:#18232f
}
@media(pointer:coarse) {
  .touch-controls {
    display:flex
  }
}
.controls-open {
  min-height:40px;
  padding:9px 15px;
  border:2px solid #ffe28b;
  border-radius:8px;
  background:linear-gradient(135deg,#ffe28b,#f3ad35);
  color:#18232f;
  text-transform:uppercase;
  letter-spacing:.1em;
  font-size:12px;
  font-weight:900;
  box-shadow:0 0 0 2px #18232f,0 0 16px #ffca5580
}
.controls-open:hover,.controls-open:focus-visible {
  background:#fff0b5;
  box-shadow:0 0 0 3px #18232f,0 0 22px #ffca55;
  outline:2px solid #fff;
  outline-offset:3px
}
.modal-backdrop {
  position:fixed;
  inset:0;
  z-index:20;
  display:grid;
  place-items:center;
  padding:16px;
  background:#071019d9;
  backdrop-filter:blur(8px)
}
.modal-backdrop[hidden] {
  display:none
}
.controls-dialog {
  width:min(520px,100%);
  padding:22px;
  border:1px solid #536675;
  border-radius:15px;
  background:linear-gradient(145deg,#253746,#151f29);
  box-shadow:0 24px 80px #000b
}
.platform-editor-dialog {
  width:min(1100px,100%);
  max-height:94vh;
  overflow:auto;
  padding:22px;
  border:1px solid #536675;
  border-radius:15px;
  background:linear-gradient(145deg,#253746,#151f29);
  box-shadow:0 24px 80px #000b
}
.platform-editor-canvas {
  position:relative;
  width:100%;
  aspect-ratio:var(--editor-aspect);
  overflow:visible;
  margin-bottom:160px;
  border:1px solid #d4e5ee66;
  border-radius:9px;
  background-color:#152334;
  background-size:100% 100%;
  background-position:center;
  touch-action:none
}
.platform-editor-platform {
  position:absolute;
  z-index:1;
  height:11px;
  min-width:8px;
  padding:0;
  transform:translateY(-50%);
  border:2px solid #6bd1e5;
  border-radius:5px;
  background:#152839bb;
  box-shadow:0 0 9px #42b9d888;
  cursor:grab;
  touch-action:none
}
.platform-editor-platform.selected {
  border-color:#fff;
  background:#6bd1e5aa;
  box-shadow:0 0 18px #fff
}
.platform-editor-platform span {
  position:absolute;
  left:3px;
  bottom:100%;
  color:#fff;
  font-size:10px;
  font-weight:900;
  text-shadow:0 1px 4px #000
}
.platform-resize-handle {
  position:absolute;
  top:-5px;
  right:-5px;
  bottom:-5px;
  width:12px;
  border:1px solid #fff;
  border-radius:4px;
  background:#3aa8bb;
  cursor:ew-resize
}
.platform-editor-floor {
  position:absolute;
  z-index:2;
  height:18px;
  transform:translateY(-50%);
  background:transparent;
  cursor:ns-resize;
  touch-action:none
}
.platform-editor-floor:before {
  content:'';
  position:absolute;
  top:50%;
  left:0;
  right:0;
  height:3px;
  transform:translateY(-50%);
  background:#62cde0;
  box-shadow:0 0 8px #62cde0aa;
  pointer-events:none
}
.platform-editor-floor span {
  position:absolute;
  top:1px;
  bottom:1px;
  width:12px;
  border:1px solid #d8fbff;
  border-radius:4px;
  background:#277c8c;
  cursor:ew-resize;
  touch-action:none
}
.platform-editor-floor span:first-child { left:0; transform:translateX(-50%); }
.platform-editor-floor span:last-child { right:0; transform:translateX(50%); }
.platform-editor-floor span:hover { background:#62cde0; }
.platform-editor-kill-floor { position:absolute; z-index:3; left:0; right:0; height:22px; transform:translateY(-50%); cursor:ns-resize; touch-action:none; }
.platform-editor-kill-floor:before { content:''; position:absolute; left:0; right:0; top:50%; border-top:2px dashed #ff554f; box-shadow:0 0 7px #ff554f99; }
.platform-editor-kill-floor span { position:absolute; top:-13px; right:8px; padding:2px 6px; border:1px solid #ff8a7e; border-radius:4px; background:#5b201fd9; color:#ffe4df; font-size:9px; font-weight:900; letter-spacing:.08em; pointer-events:none; }
}
.platform-editor-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px
}
.platform-editor-list { display:grid; gap:5px; margin-top:10px; }
.platform-editor-row { display:flex; gap:6px; }
.platform-editor-solid { display:flex; align-items:center; gap:5px; padding:0 8px; border:1px solid #536675; border-radius:6px; color:#9de8f3; font-size:11px; font-weight:800; cursor:pointer; }
.platform-editor-solid input { accent-color:#62cde0; }
.platform-editor-select,.platform-editor-remove { min-height:32px; border:1px solid #536675; border-radius:6px; color:#edf4f7; background:#172530; cursor:pointer; }
.platform-editor-select { flex:1; display:flex; justify-content:space-between; align-items:center; padding:5px 9px; text-align:left; }
.platform-editor-select.selected { border-color:#6bd1e5; background:#183640; }
.platform-editor-select small { color:#b6c3c9; }
.platform-editor-remove { padding:5px 10px; color:#ffb6aa; }
.platform-editor-empty { margin:0; color:#b6c3c9; font-size:12px; }
.platform-editor-status {
  min-height:16px;
  margin:10px 0 0;
  color:#c3d3dc;
  font-size:11px
}
.platform-code-output {
  display:block;
  width:100%;
  min-height:72px;
  margin-top:10px;
  padding:8px;
  border:1px solid #71818c;
  border-radius:7px;
  background:#0e1720;
  color:#e8f0f4;
  font:12px/1.4 Consolas,monospace
}
.platform-code-output[hidden] {
  display:none
}
.controls-heading {
  display:flex;
  justify-content:space-between;
  align-items:center
}
.controls-heading h2 {
  margin:5px 0 0;
  font:900 32px/.9 'Barlow Condensed',sans-serif;
  text-transform:uppercase
}
.controls-note {
  color:#aab8c1;
  font-size:12px;
  line-height:1.55;
  margin:14px 0
}
.control-rows {
  display:grid;
  gap:6px
}
.control-row {
  display:grid;
  grid-template-columns:1fr auto auto;
  align-items:center;
  gap:12px;
  padding:8px 10px;
  border-radius:7px;
  background:#10192388
}
.control-row span {
  font-size:11px;
  font-weight:800
}
.control-key {
  min-width:63px;
  text-align:center;
  font:900 12px 'Barlow Condensed',sans-serif;
  color:#ffe08a;
  text-transform:uppercase
}
.control-row button {
  min-height:32px;
  padding:0 11px
}
.controls-bottom {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-top:15px
}
.controls-bottom span {
  font-size:10px;
  color:#aab8c1
}
.smash-warning {
  position:absolute;
  z-index:2;
  top:14px;
  left:50%;
  transform:translateX(-50%);
  padding:9px 15px;
  border:1px solid #fff2bd;
  border-radius:6px;
  background:#8d3b18e8;
  color:#fff4c4;
  font:900 16px 'Barlow Condensed',sans-serif;
  letter-spacing:.12em;
  white-space:nowrap;
  box-shadow:0 0 24px #ff9d36aa;
  animation:warningPulse .65s ease-in-out infinite alternate
}
.smash-warning[hidden] {
  display:none
}
@keyframes warningPulse {
  to {
    transform:translateX(-50%) scale(1.07);
    filter:brightness(1.3)
  }
}
.ultimate-cutscene {
  position:absolute;
  inset:0;
  z-index:4;
  display:grid;
  place-items:center;
  overflow:hidden;
  background:radial-gradient(ellipse at center,#362959ed 0,#11111ff5 65%);
  isolation:isolate
}
.ultimate-cutscene[hidden] {
  display:none
}
.cutscene-rays {
  position:absolute;
  inset:-60%;
  z-index:-1;
  background:repeating-conic-gradient(from 0deg,#ffdf7c12 0deg 7deg,transparent 7deg 15deg);
  animation:raysSpin 8s linear infinite;
  transform:scale(1.4)
}
@keyframes raysSpin {
  to {
    transform:scale(1.4) rotate(360deg)
  }
}
.cutscene-card {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:clamp(8px,4vw,42px);
  width:min(850px,94%);
  min-height:80%;
  padding:18px 24px;
  background:linear-gradient(105deg,#160f20cc,#311b38aa 52%,transparent);
  border-left:5px solid #ffe17e;
  transform:skewX(-5deg);
  animation:cutsceneEnter .55s cubic-bezier(.16,1,.3,1) both
}
.cutscene-art {
  width:42%;
  display:grid;
  place-items:center;
  filter:drop-shadow(0 0 25px #ffdb72aa);
  animation:duckReveal .8s cubic-bezier(.16,1,.3,1) both
}
.cutscene-art img {
  width:min(100%,310px);
  height:260px;
  object-fit:contain;
  transform:scale(1.2)
}
.cutscene-copy {
  display:grid;
  gap:8px;
  transform:skewX(5deg)
}
.cutscene-copy span {
  font:900 15px 'DM Sans',sans-serif;
  letter-spacing:.35em;
  color:#ffe27a
}
.cutscene-copy strong {
  font:900 clamp(30px,6vw,70px)/.82 'Barlow Condensed',sans-serif;
  text-transform:uppercase;
  color:white;
  text-shadow:3px 4px 0 #c73c5a,0 0 24px #ffcc62aa
}
.cutscene-copy p {
  max-width:320px;
  color:#e7dced;
  font-size:12px;
  line-height:1.5
}
.ultimate-impact {
  position:absolute;
  left:50%;
  top:52%;
  opacity:0;
  pointer-events:none;
  transform:translate(-50%,-50%) scale(.2) rotate(-9deg);
  font:900 clamp(66px,17vw,180px)/.8 'Barlow Condensed',sans-serif;
  color:#fff6c6;
  text-shadow:7px 8px 0 #ed3b58,-5px -4px 0 #4bb7ee,0 0 44px #fff;
  white-space:nowrap
}
.ultimate-cutscene[data-phase="impact"] .cutscene-card {
  opacity:.2;
  transform:scale(.72) skewX(-5deg);
  filter:blur(2px)
}
.ultimate-cutscene[data-phase="impact"] .ultimate-impact {
  animation:impactBurst .8s cubic-bezier(.12,.8,.23,1) both
}
@keyframes cutsceneEnter {
  from {
    opacity:0;
    transform:translateX(-70px) skewX(-5deg)
  }
  to {
    opacity:1;
    transform:translateX(0) skewX(-5deg)
  }
}
@keyframes duckReveal {
  from {
    opacity:0;
    transform:translate(-80px,35px) scale(.3) rotate(-18deg)
  }
  to {
    opacity:1;
    transform:translate(0,0) scale(1) rotate(0)
  }
}
@keyframes impactBurst {
  0% {
    opacity:0;
    transform:translate(-50%,-50%) scale(.2) rotate(-9deg)
  }
  28% {
    opacity:1;
    transform:translate(-50%,-50%) scale(1.15) rotate(4deg)
  }
  65% {
    opacity:1;
    transform:translate(-50%,-50%) scale(1) rotate(-2deg)
  }
  100% {
    opacity:0;
    transform:translate(-50%,-50%) scale(1.3) rotate(0)
  }
}
.ultimate-cutscene {
  background:radial-gradient(circle at var(--focus-x,70%) var(--focus-y,50%),#613875 0,#211b36 27%,#10121ff5 72%);
}
.cutscene-rays {
  opacity:.75;
  background:repeating-conic-gradient(from 0deg,#ffe88c1c 0deg 4deg,transparent 4deg 12deg);
  animation:raysSpin 5.5s linear infinite
}
.cutscene-speedlines {
  position:absolute;
  inset:-35%;
  z-index:0;
  opacity:0;
  background:repeating-linear-gradient(166deg,transparent 0 17px,#b8eaff22 18px 20px,transparent 21px 37px);
  transform:translateX(-18%) rotate(-7deg)
}
.ultimate-cutscene[data-phase="reveal"] .cutscene-speedlines,.ultimate-cutscene[data-phase="impact"] .cutscene-speedlines {
  opacity:1;
  animation:speedlineRush .7s linear infinite
}
.cutscene-card {
  position:relative;
  z-index:1;
  min-height:90%;
  border-left:7px solid #ffe276;
  background:linear-gradient(100deg,#130f24ee 0,#35204bdc 42%,#211a38aa 72%,transparent 100%);
  box-shadow:0 0 70px #f5c46d22;
  animation:cutsceneEnter .6s cubic-bezier(.16,1,.3,1) both
}
.cutscene-art {
  position:relative;
  width:45%;
  min-height:260px;
  filter:drop-shadow(0 0 18px #ffda75cc);
  animation:heroFloat 1.25s ease-in-out infinite alternate
}
.cutscene-art:before {
  content:"";
  position:absolute;
  width:86%;
  aspect-ratio:1;
  border-radius:50%;
  background:radial-gradient(circle,#fff5c766 0,#ffcb5833 45%,transparent 72%);
  animation:auraPulse .7s ease-in-out infinite alternate
}
.cutscene-art img {
  position:relative;
  z-index:1;
  width:min(100%,350px);
  height:290px;
  object-fit:contain;
  filter:drop-shadow(0 0 15px #fff4a7);
  animation:heroDuckReveal .8s cubic-bezier(.15,.9,.3,1) both
}
.cutscene-copy {
  position:relative;
  z-index:2;
  max-width:48%;
}
.cutscene-copy span {
  color:#ffe588;
  text-shadow:0 0 18px #ffb83d;
  font-size:13px
}
.cutscene-copy strong {
  font-size:clamp(34px,6.3vw,78px);
  line-height:.78;
  letter-spacing:-.02em;
  text-shadow:4px 5px 0 #db315b,-2px -2px 0 #47bcec,0 0 30px #ffcf5e;
  animation:titleFlash .8s ease-out both
}
.cutscene-copy p {
  font-weight:700;
  color:#fff2d8;
  text-shadow:0 2px 9px #160d20;
  min-height:18px
}
.cutscene-beam {
  position:absolute;
  z-index:2;
  left:31%;
  top:50%;
  width:var(--beam-length,40%);
  height:13px;
  opacity:0;
  transform:rotate(var(--beam-angle,0deg));
  transform-origin:left center;
  border-radius:100%;
  background:linear-gradient(90deg,#fffbdc,#fff 30%,#86e9ff 60%,#ffec89);
  box-shadow:0 0 14px 6px #fff,0 0 38px 16px #63caffaa
}
.ultimate-cutscene[data-phase="reveal"] .cutscene-beam {
  opacity:.32;
  animation:beamCharge .7s ease-in-out infinite alternate
}
.ultimate-cutscene[data-phase="reveal"] .cutscene-beam {
  opacity:.32;
  animation:beamCharge .7s ease-in-out infinite alternate
}
.ultimate-cutscene[data-phase="impact"] .cutscene-beam {
  opacity:1;
  height:36px;
  animation:beamFire .52s cubic-bezier(.15,.9,.3,1) both
}
.cutscene-target {
  display:none;
  position:absolute;
  z-index:3;
  left:var(--aim-x,70%);
  top:var(--aim-y,50%);
  display:grid;
  justify-items:center;
  gap:2px;
  opacity:0;
  transform:translate(-50%,-50%);
  color:#fff4be;
  text-shadow:0 0 12px #ff9a42;
  pointer-events:none
}
.cutscene-target i {
  width:54px;
  height:54px;
  display:grid;
  place-items:center;
  border:2px solid #fff2a9;
  border-radius:50%;
  font-style:normal;
  font-size:25px;
  box-shadow:0 0 0 8px #ffeb8530,0 0 30px #ffb640;
  animation:targetSpin 2s linear infinite
}
.cutscene-target span {
  font:900 9px 'DM Sans',sans-serif;
  letter-spacing:.2em
}
.cutscene-flash {
  position:absolute;
  inset:0;
  z-index:4;
  opacity:0;
  background:#fff8d8;
  pointer-events:none
}
.ultimate-cutscene[data-phase="impact"] .cutscene-flash {
  animation:whiteFlash .42s ease-out both
}
.ultimate-cutscene[data-phase="impact"] .cutscene-card {
  opacity:.16;
  filter:blur(2px);
  transform:translateX(-9%) scale(.82) skewX(-5deg)
}
.ultimate-impact {
  z-index:5;
  top:50%;
  font-size:clamp(82px,20vw,210px);
  font-style:italic;
  letter-spacing:-.06em;
  -webkit-text-stroke:2px #fff;
  text-shadow:8px 9px 0 #ef315e,-6px -5px 0 #31c6f5,0 0 60px #fff
}
.ultimate-cutscene[data-phase="impact"] .ultimate-impact {
  animation:impactBurst .85s cubic-bezier(.12,.8,.23,1) both
}
@keyframes speedlineRush {
  from {
    transform:translateX(12%) rotate(-7deg)
  }
  to {
    transform:translateX(-12%) rotate(-7deg)
  }
}
@keyframes heroFloat {
  to {
    transform:translateY(-12px) rotate(-2deg)
  }
}
@keyframes auraPulse {
  to {
    transform:scale(1.2);
    opacity:.65
  }
}
@keyframes heroDuckReveal {
  from {
    opacity:0;
    transform:translate(-50px,40px) scale(.35) rotate(-18deg)
  }
  60% {
    transform:translate(8px,-8px) scale(1.12) rotate(5deg)
  }
  to {
    opacity:1;
    transform:translate(0,0) scale(1) rotate(0)
  }
}
@keyframes titleFlash {
  from {
    opacity:0;
    filter:blur(10px);
    transform:translateX(40px) skewX(-10deg)
  }
  to {
    opacity:1;
    filter:blur(0);
    transform:translateX(0) skewX(0)
  }
}
@keyframes targetLock {
  from {
    opacity:0;
    transform:translate(-50%,-50%) scale(3)
  }
  to {
    opacity:1;
    transform:translate(-50%,-50%) scale(1)
  }
}
@keyframes targetSpin {
  to {
    transform:rotate(360deg)
  }
}
@keyframes beamCharge {
  to {
    opacity:.8;
    filter:brightness(1.7)
  }
}
@keyframes beamFire {
  0% {
    opacity:0;
    transform:rotate(var(--beam-angle,0deg)) scaleX(.03)
  }
  25% {
    opacity:1;
    transform:rotate(var(--beam-angle,0deg)) scaleX(1.03)
  }
  100% {
    opacity:0;
    transform:rotate(var(--beam-angle,0deg)) scaleX(1)
  }
}
@keyframes targetImpact {
  0% {
    transform:translate(-50%,-50%) scale(1)
  }
  50% {
    transform:translate(-50%,-50%) scale(2.2);
    filter:brightness(2)
  }
  100% {
    opacity:0;
    transform:translate(-50%,-50%) scale(.5)
  }
}
@keyframes whiteFlash {
  0% {
    opacity:0
  }
  12% {
    opacity:.92
  }
  100% {
    opacity:0
  }
}
@media(max-width:850px) {
  .selector-stage {
    grid-template-columns:minmax(0,1fr) 240px
  }
  .duck-grid {
    grid-template-columns:repeat(auto-fill,minmax(96px,1fr))
  }
  .duck-card {
    min-height:119px
  }
  .duck-art {
    height:75px
  }
  .details-panel {
    padding:14px
  }
  .roster-scroll {
    height:52vh
  }
}
@media(max-width:650px) {
  .shell {
    padding:12px 12px 30px
  }
  .topbar {
    padding-bottom:13px
  }
  .topright .status-copy {
    display:none
  }
  .brandmark {
    width:37px;
    height:37px
  }
  .brandname {
    font-size:17px
  }
  .welcome {
    margin-top:55px
  }
  .welcome h1 {
    font-size:62px
  }
  .lobby-actions {
    grid-template-columns:1fr
  }
  .lobby-card {
    padding:17px
  }
  .game-top {
    grid-template-columns:1fr auto;
    gap:8px
  }
  .game-title {
    font-size:25px
  }
  .game-actions {
    grid-column:1/-1;
    justify-self:start
  }
  .player-strip {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px
  }
  .player-slot {
    min-height:61px;
    padding-left:42px
  }
  .player-slot:before {
    width:33px
  }
  .selector-stage {
    grid-template-columns:1fr
  }
  .details-panel {
    min-height:initial;
    display:grid;
    grid-template-columns:95px 1fr;
    column-gap:10px;
    padding:11px
  }
  .details-top {
    grid-column:1/-1
  }
  .detail-art {
    height:98px;
    grid-row:2/5;
    margin:0
  }
  .detail-art svg {
    height:95px;
    width:100px
  }
  .detail-art img {
    height:95px;
    width:100px
  }
  .detail-name {
    align-self:end;
    font-size:24px;
    margin-top:5px
  }
  .detail-creator {
    margin:3px 0
  }
  .detail-bio {
    grid-column:1/-1;
    max-height:45px;
    margin:3px 0
  }
  .stats {
    grid-column:1/-1;
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:8px
  }
  .stat-row {
    margin:4px 0
  }
  .bottomline {
    align-items:flex-start;
    flex-direction:column
  }
  .selection-hint {
    text-align:left
  }
  .ready-button {
    width:100%
  }
  .roster-head {
    flex-wrap:wrap
  }
  .roster-heading {
    min-width:75px
  }
  .count {
    margin-left:auto
  }
  .battle-hud {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px
  }
  .battle-fighter {
    min-height:112px;
    grid-template-columns:44px minmax(0,1fr) 72px;
    gap:8px;
    padding:9px
  }
  .battle-avatar {
    width:44px;
    height:44px
  }
  .battle-damage {
    min-width:66px;
    font-size:clamp(26px,7vw,36px)
  }
  .battle-footer {
    align-items:flex-start;
    flex-direction:column
  }
  .battle-controls {
    justify-content:flex-start
  }
  .arena-frame {
    border-radius:8px
  }
  .topright {
    gap:6px
  }
  .step-tag {
    display:none
  }
  .controls-dialog {
    padding:16px
  }
  .platform-editor-dialog {
    padding:16px
  }
  .platform-editor-actions > button {
    flex:1 1 42%
  }
  .controls-heading h2 {
    font-size:27px
  }
  .controls-bottom {
    align-items:flex-start;
    flex-direction:column
  }
  .cutscene-card {
    flex-direction:column;
    gap:0;
    text-align:center;
    padding:8px 12px;
    transform:none
  }
  .cutscene-art {
    width:75%;
    height:47%
  }
  .cutscene-art img {
    height:150px
  }
  .cutscene-copy {
    transform:none
  }
  .cutscene-copy p {
    margin:0 auto
  }
  .cutscene-copy span {
    font-size:11px
  }
}
@media(max-width:420px) {
  .battle-hud {
    grid-template-columns:1fr
  }
}
@media(max-width:650px) {
  .cutscene-card {
    width:100%;
    min-height:100%;
    padding:8px 12px
  }
  .cutscene-art {
    width:74%;
    min-height:125px;
    height:45%
  }
  .cutscene-art img {
    height:150px
  }
  .cutscene-copy {
    max-width:100%
  }
  .cutscene-target i {
    width:42px;
    height:42px
  }
  .cutscene-copy strong {
    font-size:clamp(36px,11vw,66px)
  }
}
@media(prefers-reduced-motion:reduce) {
  .cutscene-rays,.cutscene-speedlines,.cutscene-art,.cutscene-art img,.cutscene-target i,.cutscene-beam,.ultimate-impact,.cutscene-flash {
    animation:none!important
  }
}
.ultimate-cutscene {
  --smash-dir:1
}
.ultimate-cutscene[data-facing="left"] {
  --smash-dir:-1
}
.cutscene-slash {
  position:absolute;
  z-index:2;
  left:-35%;
  top:51%;
  width:145%;
  height:8px;
  opacity:0;
  transform:rotate(-13deg) scaleX(.05);
  transform-origin:left center;
  background:linear-gradient(90deg,transparent,#fff 18%,#92eaff 48%,#ffe27a 72%,transparent);
  box-shadow:0 0 18px 8px #70dfffaa,0 0 60px 15px #ffe27a66;
  pointer-events:none
}
.ultimate-cutscene[data-phase="reveal"] .cutscene-slash {
  animation:smashSlash .8s cubic-bezier(.12,.8,.2,1) both
}
.cutscene-impact-ring {
  position:absolute;
  z-index:2;
  left:var(--focus-x,88%);
  top:50%;
  width:38px;
  height:38px;
  border:5px solid #fff8c9;
  border-radius:50%;
  opacity:0;
  box-shadow:0 0 22px 8px #77dcff,inset 0 0 14px #ffcf62
}
.ultimate-cutscene[data-phase="impact"] .cutscene-impact-ring {
  animation:smashRing .72s cubic-bezier(.1,.7,.2,1) both
}
.ultimate-cutscene[data-phase="intro"] .cutscene-art img {
  animation:smashCharge .8s ease-in-out infinite alternate
}
.ultimate-cutscene[data-phase="reveal"] .cutscene-art {
  animation:smashLunge .65s cubic-bezier(.12,.8,.2,1) both
}
.ultimate-cutscene[data-phase="impact"] .cutscene-rays {
  animation:raysSpin .55s linear infinite;
  filter:brightness(2.2)
}
@keyframes smashCharge {
  from {
    transform:translateX(0) scale(1);
    filter:drop-shadow(0 0 12px #fff4a7)
  }
  to {
    transform:translateX(calc(-8px * var(--smash-dir))) scale(1.12);
    filter:drop-shadow(0 0 32px #fff)
  }
}
@keyframes smashLunge {
  0% {
    transform:translateX(0) scale(1)
  }
  34% {
    transform:translateX(calc(22px * var(--smash-dir))) scale(1.18,.9)
  }
  100% {
    transform:translateX(calc(110px * var(--smash-dir))) scale(.9,1.1);
    opacity:.35
  }
}
@keyframes smashSlash {
  0% {
    opacity:0;
    transform:rotate(-13deg) scaleX(.02)
  }
  25% {
    opacity:1
  }
  100% {
    opacity:0;
    transform:rotate(-13deg) scaleX(1.15)
  }
}
@keyframes smashRing {
  0% {
    opacity:1;
    transform:translate(-50%,-50%) scale(.3)
  }
  100% {
    opacity:0;
    transform:translate(-50%,-50%) scale(14);
    border-width:1px
  }
}
@media(prefers-reduced-motion:reduce) {
  .cutscene-slash,.cutscene-impact-ring,.ultimate-cutscene[data-phase="intro"] .cutscene-art img,.ultimate-cutscene[data-phase="reveal"] .cutscene-art {
    animation-duration:.01ms!important
  }
}
.ultimate-cutscene[data-facing="left"] .cutscene-slash {
  transform-origin:right center
}
.stage-intro {
  margin:16px 0;
  color:#afbdc6;
  font-size:13px
}
.rules-voting { margin: 14px 0 20px; padding: 14px; border: 1px solid #526574; border-radius: 12px; background: #111b25cc; }
.rules-voting h2 { margin: 0; color: #ffe08a; font: 900 20px 'Barlow Condensed', sans-serif; text-transform: uppercase; }
.rules-voting p { margin: 3px 0 12px; color: #afbdc6; font-size: 12px; }
.rules-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.rules-options button { display: grid; gap: 4px; padding: 10px 12px; text-align: left; color: #f4f7f7; background: #263744; border: 1px solid #526574; border-radius: 8px; cursor: pointer; }
.rules-options button.selected { border-color: #ffd15e; box-shadow: 0 0 15px #f3c55344; background: #3b3a2d; }
.rules-options strong { font: 900 18px 'Barlow Condensed',sans-serif; text-transform: uppercase; }
.rules-options small,.rules-options span,#ruleVoteStatus { color: #b6c3c9; font-size: 11px; }
#ruleVoteStatus { margin-top: 9px; }
.stage-cards {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px
}
.stage-card {
  position:relative;
  min-height:210px;
  padding:14px;
  text-align:left;
  color:#f4f7f7;
  background:linear-gradient(155deg,#283947,#17222c);
  border:1px solid #526574;
  border-radius:12px;
  cursor:pointer;
  transition:transform .16s,border-color .16s,box-shadow .16s
}
.stage-card:hover {
  transform:translateY(-3px);
  border-color:#ffe08a
}
.stage-card.selected {
  border:2px solid #ffd15e;
  box-shadow:0 0 22px #f3c55344
}
.stage-card:disabled {
  cursor:default
}
.stage-card strong {
  display:block;
  font:900 23px 'Barlow Condensed',sans-serif;
  text-transform:uppercase
}
.stage-card small {
  display:block;
  margin-top:2px;
  color:#b6c3c9;
  font-size:9px;
  font-weight:900;
  letter-spacing:.14em
}
.stage-preview {
  position:relative;
  height:112px;
  margin:10px 0 8px;
  overflow:hidden;
  border:1px solid #ffffff22;
  border-radius:7px;
  background:linear-gradient(180deg,var(--sky-a),var(--sky-b) 75%,#111a25)
}
.stage-preview-pond-party {
  background:repeating-linear-gradient(175deg,transparent 0 15px,#64e4d522 16px 19px),linear-gradient(180deg,var(--sky-a),var(--sky-b) 75%,#111a25)
}
.stage-preview-sunny-side-up {
  background:radial-gradient(circle at 78% 27%,#ffe29b 0 12px,transparent 13px),linear-gradient(180deg,var(--sky-a),var(--sky-b) 75%,#111a25)
}
.stage-preview-starlight-stage {
  background:radial-gradient(circle at 20% 25%,#fff 0 1px,transparent 2px),radial-gradient(circle at 76% 35%,#fff 0 1px,transparent 2px),linear-gradient(180deg,var(--sky-a),var(--sky-b) 75%,#111a25)
}
.stage-preview-green-hill-loop:before,
.stage-preview-skyworld-lift:before,
.stage-preview-dream-tree:before,
.stage-preview-rainbow-story:before,
.stage-preview-ects-arena:before {
  display:none
}
.stage-preview:before {
  content:'';
  position:absolute;
  left:10%;
  right:10%;
  bottom:13px;
  height:13px;
  border-top:3px solid var(--stage-top);
  background:linear-gradient(#425867,#182735);
  border-radius:3px
}
.stage-preview i {
  position:absolute;
  width:22%;
  height:8px;
  border-top:2px solid var(--stage-top);
  background:#344b5b;
  transform:translateX(-50%);
  border-radius:3px
}
.stage-card .stage-selected {
  position:absolute;
  right:10px;
  top:10px;
  color:#ffe08a;
  font-size:8px;
  font-weight:900;
  letter-spacing:.1em
}
.stage-bottom {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:16px;
  padding:12px;
  border-top:1px solid #52616d;
  color:#aebcc5;
  font-size:12px
}
.stage-bottom button {
  min-width:165px
}
.stage-bottom button:disabled {
  opacity:.45;
  cursor:not-allowed
}
@media(max-width:650px) {
  .stage-cards {
    grid-template-columns:1fr
  }
  .rules-options { grid-template-columns: 1fr; }
  .stage-card {
    min-height:175px
  }
  .stage-preview {
    height:90px
  }
  .stage-bottom {
    align-items:stretch;
    flex-direction:column
  }
  .stage-bottom button {
    width:100%
  }
}
/* Full-arena Final Smash sequence */
.ultimate-cutscene {
  display: block;
  background:
    radial-gradient(ellipse at var(--focus-x, 70%) 48%, #743f8b 0, #291d42 35%, #080d18 82%);
  animation: cinematicBackdropIn 0.35s ease-out both;
}

.ultimate-cutscene::before,
.ultimate-cutscene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ultimate-cutscene::before {
  z-index: 4;
  box-shadow: inset 0 70px 0 #05070df2, inset 0 -70px 0 #05070df2;
}

.ultimate-cutscene::after {
  z-index: 0;
  background: radial-gradient(ellipse, transparent 30%, #070a14b8 100%);
}

.ultimate-cutscene .cutscene-rays {
  z-index: 0;
  opacity: 0.9;
}

.ultimate-cutscene .cutscene-speedlines {
  z-index: 1;
}

.ultimate-cutscene .cutscene-card {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  animation: none;
}

.ultimate-cutscene .cutscene-art {
  position: absolute;
  left: 50%;
  top: 45%;
  width: min(68%, 580px);
  min-height: 0;
  height: 78%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 30px #ffe27c);
  animation: none;
}

.ultimate-cutscene .cutscene-art::before {
  width: 70%;
  background: radial-gradient(circle, #fff7c9a8 0, #ffbf4955 42%, transparent 72%);
}

.ultimate-cutscene .cutscene-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: none;
  animation: cinematicDuckReveal 1.1s cubic-bezier(.16, 1, .3, 1) both;
}

.ultimate-cutscene .cutscene-copy {
  position: absolute;
  z-index: 3;
  left: clamp(22px, 7vw, 90px);
  right: clamp(22px, 7vw, 90px);
  bottom: 12%;
  max-width: none;
  gap: 7px;
  padding-left: 18px;
  border-left: 4px solid #ffe588;
  transform: none;
  text-shadow: 0 3px 18px #080a14;
}

.ultimate-cutscene .cutscene-copy span {
  letter-spacing: .42em;
}

.ultimate-cutscene .cutscene-copy strong {
  display: block;
  font-size: clamp(34px, 7vw, 76px);
  line-height: .9;
}

.ultimate-cutscene .cutscene-copy p {
  margin: 4px 0 0;
  font-size: clamp(11px, 1.6vw, 15px);
}

.ultimate-cutscene[data-phase="intro"] .cutscene-art img {
  opacity: .2;
  filter: blur(8px) brightness(.55);
  transform: scale(.52) translateY(30px);
}

.ultimate-cutscene[data-phase="reveal"] .cutscene-art img {
  animation: cinematicDuckReveal 1.1s cubic-bezier(.16, 1, .3, 1) both;
}

.ultimate-cutscene[data-phase="reveal"] .cutscene-copy {
  animation: cinematicTitleIn .55s .12s cubic-bezier(.16, 1, .3, 1) both;
}

.ultimate-cutscene[data-phase="impact"] .cutscene-art {
  transform: translate(calc(-50% + var(--facing-shift, 16vw)), -50%) scale(.78);
  filter: brightness(1.8) drop-shadow(0 0 36px #fff);
  transition: transform .38s cubic-bezier(.12, .8, .23, 1), filter .15s ease-out;
}

.ultimate-cutscene[data-phase="impact"] .cutscene-copy {
  opacity: 0;
  transform: translateX(-35px);
  transition: opacity .16s ease-out, transform .16s ease-out;
}

.ultimate-cutscene[data-phase="impact"] .cutscene-flash {
  animation: whiteFlash .42s ease-out both;
}

.ultimate-cutscene[data-phase="aftermath"] .cutscene-art {
  transform: translate(-50%, -50%) scale(.94);
  filter: drop-shadow(0 0 24px #ffdd79);
  transition: transform .28s ease-out;
}

.ultimate-cutscene[data-phase="aftermath"] .ultimate-impact {
  opacity: .82;
  transform: translate(-50%, -50%) scale(.8) rotate(-4deg);
  transition: opacity .22s ease-out, transform .22s ease-out;
}

.ultimate-cutscene[data-phase="impact"] .cutscene-impact-ring {
  animation: cinematicShockwave .6s cubic-bezier(.1, .7, .2, 1) both;
}

.ultimate-cutscene .ultimate-impact {
  z-index: 5;
  top: 47%;
  font-size: clamp(90px, 22vw, 250px);
  -webkit-text-stroke: 3px #fff;
}

@keyframes cinematicBackdropIn {
  from { opacity: 0; filter: brightness(2); }
  to { opacity: 1; filter: brightness(1); }
}

@keyframes cinematicDuckReveal {
  0% { opacity: 0; transform: translateY(45px) scale(.38) rotate(-10deg); }
  55% { opacity: 1; transform: translateY(-12px) scale(1.08) rotate(3deg); }
  75% { transform: translateY(5px) scale(.98) rotate(-1deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes cinematicTitleIn {
  from { opacity: 0; transform: translateX(-70px) skewX(-8deg); filter: blur(8px); }
  to { opacity: 1; transform: translateX(0) skewX(0); filter: blur(0); }
}

@keyframes cinematicShockwave {
  0% { opacity: .95; transform: translate(-50%, -50%) scale(.15); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.8); }
}

@media (max-width: 620px) {
  .ultimate-cutscene::before { box-shadow: inset 0 44px 0 #05070df2, inset 0 -44px 0 #05070df2; }
  .ultimate-cutscene .cutscene-art { top: 43%; width: 92%; height: 66%; }
  .ultimate-cutscene .cutscene-copy { bottom: 10%; }
}
.ultimate-cutscene[data-phase="impact"] .cutscene-card {
  opacity: 1;
  filter: none;
  transform: none;
}
.ultimate-cutscene[data-facing="left"] { --facing-shift: -16vw; }
.ultimate-cutscene[data-facing="right"] { --facing-shift: 16vw; }
.ledge-hint {
  color: #b8c9d4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: right;
}

@media (max-width: 700px) {
  .ledge-hint {
    text-align: left;
  }

  .practice-entry {
    margin: 12px auto 0;
    display: block;
  }
  .match-options {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px 22px;
    margin-top: 15px;
    color: #dce5eb;
    font-size: 11px;
  }
  .match-options label {
    display: grid;
    gap: 5px;
    font-weight: 800;
  }
  .match-options select {
    min-width: 82px;
    padding: 7px 9px;
    border: 1px solid #536675;
    border-radius: 6px;
    background: #182531;
    color: #fff;
  }
  .match-options .toggle-option {
    display: flex;
    align-items: center;
    gap: 7px;
  }
  .hazard-note {
    color: #ffd879;
    font-weight: 800;
  }
  .room-spectators {
    min-height: 0;
    margin: 8px 0;
    color: #acbdc9;
    font-size: 11px;
  }
  .spectator-status {
    padding: 8px 12px;
    border: 1px solid #62c7e866;
    border-radius: 7px;
    background: #123143;
    color: #b6edff;
    font-size: 12px;
    font-weight: 800;
  }
  .battle-result {
    place-content: center;
    gap: 9px;
    padding: clamp(12px, 3vw, 32px);
    overflow: auto;
    font-size: clamp(18px, 3vw, 28px);
    line-height: 1.15;
    text-shadow: none;
  }
  .recap-heading {
    color: #ffce60;
    font: 900 clamp(34px, 6vw, 70px)/.9 'Barlow Condensed',sans-serif;
    text-shadow: 0 4px #735226;
  }
  .recap-table {
    width: min(620px, 88vw);
    max-height: 38vh;
    overflow: auto;
    margin: 8px auto 0;
    border: 1px solid #70818e88;
    border-radius: 8px;
    background: #111b26ed;
    text-align: left;
  }
  .recap-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-bottom: 1px solid #70818e44;
    color: #f5f3eb;
    font-size: 12px;
  }
  .recap-row:last-child {
    border-bottom: 0;
  }
  .recap-row span {
    margin: 0;
    color: #c3ced6;
    font: 600 10px 'DM Sans',sans-serif;
    text-align: right;
  }
  .recap-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .recap-actions button {
    min-width: 130px;
    margin: 4px 0 0;
    font-size: 11px;
  }
  .recap-highlights {
    display: grid;
    gap: 3px;
    width: min(620px, 88vw);
    margin: 0 auto;
    color: #ffda7f;
    font-size: 10px;
    text-align: left;
  }
  .recap-highlight {
    color: #e4eaf0;
    font-weight: 600;
  }
  .setting-row {
    display: grid;
    grid-template-columns: 1fr minmax(140px, 48%);
    align-items: center;
    gap: 12px;
    margin: 17px 0;
    color: #e2eaf0;
    font-size: 13px;
    font-weight: 700;
  }
  .setting-row input {
    width: 100%;
    accent-color: #ffca55;
  }
  .touch-controls {
    opacity: var(--touch-opacity, .85);
    transform: translateY(calc(-1 * var(--touch-offset, 0px)));
  }
  .touch-controls button {
    min-width: calc(48px * var(--touch-scale, 1));
    min-height: calc(46px * var(--touch-scale, 1));
    font-size: calc(11px * var(--touch-scale, 1));
  }
  @media(max-width:650px) {
    .recap-row {
      align-items: flex-start;
      flex-direction: column;
      gap: 3px;
    }
    .recap-row span {
      text-align: left;
    }
    .match-options {
      align-items: stretch;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
}
