#stage, .arena {
  border-color: #526080;
  border-radius: 14px;
  box-shadow: -10px 0 30px #ed365c17, 10px 0 34px #357fff30;
}

#panel {
  padding: clamp(12px, 2.3vw, 24px);
  background: linear-gradient(125deg, #201326fa, #101a31fc 48%, #0a1224fc);
  border: 1px solid #698dbb;
  border-top-color: #91dcff;
  border-radius: 13px;
  box-shadow: 0 12px 32px #02040acf, 0 0 20px #468aff26;
}
#speaker {
  display: block;
  font-size: clamp(1rem, 2.25vw, 1.45rem);
}
#line { max-width: 82ch; }
#options {
  display: grid;
  gap: 8px;
}
#options button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  max-width: 100%;
  text-align: left;
  background: #15233b;
  border-color: #607b9e;
}
#options button:hover, #options button:focus-visible {
  background: #233e62;
  border-color: #9ceaff;
}
.choice-number {
  flex: 0 0 1.75em;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: #0a1427;
  color: #a8e8ff;
  border-radius: 5px;
}
#dialog-controls { display: block; margin-top: 8px; color: #a9beda; }
#action {
  color: #f2faff;
  background: linear-gradient(115deg, #24568c, #163666);
  border-color: #79c8f2;
}
#actions { flex-wrap: wrap; }
@media (min-width: 701px) {
  #options { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
}
@media (max-width: 650px) {
  #panel { bottom: 5px; }
  #dialog-controls { display: none; }
}

body[data-mode=adventure] #pad-open { display: none; }
.game-home-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.game-back { color: #c4d4ec; text-decoration: none; font-size: .92rem; }
.game-back:hover { color: #a0eaff; text-decoration: underline; }
.game-back:focus-visible { outline: 2px solid #a0eaff; outline-offset: 4px; }
.game-intro {
  padding: clamp(18px, 4vw, 46px);
  border: 1px solid #567198;
  border-radius: 16px;
  background: linear-gradient(96deg, #111229 4%, #11162aca 55%, #0b162f40),
    url('club.jpg') center 61% / cover;
  box-shadow: -10px 0 32px #eb315a1a, 10px 0 32px #357fff26;
}
.game-intro h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.4rem);
  font-weight: 900;
  letter-spacing: -.045em;
  line-height: .98;
}
.game-intro h1 em { color: #a3e7ff; font-style: normal; }
.game-intro p { margin: 12px 0 0; max-width: 49ch; line-height: 1.45; color: #e1e9f9; }
.game-picker { margin: clamp(16px, 3vw, 25px) 0; }
.game-picker h2 { margin: 0 0 10px; font-size: clamp(1.05rem, 2.7vw, 1.42rem); }
.mode-grid, .hero-grid { display: grid; gap: 10px; }
.mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mode-card, .hero-card {
  min-width: 0;
  border-radius: 11px;
  color: #f3f7ff;
  text-decoration: none;
}
.mode-card {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 6px;
  min-height: 118px;
  border: 1px solid #526686;
  padding: clamp(10px, 2vw, 18px);
  background: linear-gradient(112deg, #11172df8 27%, #11162abf 70%, #1416298c), var(--mode-art) center / cover;
  text-align: left;
}
.mode-club { --mode-art: url('club.jpg'); }
.mode-signal { --mode-art: url('senal-estudio.jpg'); }
.mode-arcade { --mode-art: url('arcade-club.webp'); }
.mode-card strong { font-size: clamp(.99rem, 2vw, 1.28rem); line-height: 1.13; }
.mode-card > span:last-child { font-size: .87rem; font-weight: 500; color: #d5dff3; }
.mode-card .mode-format {
  color: #a6e5ff;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.mode-card[aria-pressed=true] {
  border-color: #a3e8ff;
  box-shadow: inset 0 0 0 1px #a3e8ff, inset 0 0 28px #3b8ff35a;
}
.mode-card:hover, .mode-card:focus-visible { outline: 2px solid #9ceaff; outline-offset: 2px; }
.picker-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 14px; flex-wrap: wrap; margin-bottom: 9px; }
.picker-heading h2, .picker-heading p { margin: 0; }
.picker-heading p { color: #bfcee8; font-size: .86rem; }
.hero-card {
  position: relative;
  display: grid;
  align-items: end;
  min-height: clamp(108px, 17vw, 185px);
  isolation: isolate;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--rim);
  background: #121a2c;
  text-align: left;
}
.hero-blue { --rim: #58aaff; }
.hero-red { --rim: #ff6b8d; }
.hero-card::after {
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, #080d1df5, #0a10212e 70%);
}
.hero-card img {
  position: absolute; inset: 0;
  z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 19%;
}
.hero-card strong { font-size: clamp(1.05rem, 3vw, 1.6rem); }
.hero-card:hover strong, .hero-card:focus-visible strong { color: #d0f2ff; }

@media (max-width: 700px) {
  .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-arcade { grid-column: 1 / -1; min-height: 86px; }
  .mode-card { gap: 5px; }
  .mode-card > span:last-child { font-size: .81rem; }
  .game-intro p { font-size: .91rem; }
  .game-picker { margin: 15px 0; }
}
@media (max-width: 345px) {
  .mode-grid { grid-template-columns: minmax(0, 1fr); }
  .mode-card { min-height: 78px; }
}
@media (max-width: 700px) {
  #game header { flex-wrap: wrap; }
  #game #chapter { flex: 1 1 calc(100% - 65px); }
  #game #track { display: none; }
  #game:not(.expanded):not(:fullscreen) #stage { min-height: 0; }
  #brief { position: static; grid-row: 1; width: auto; max-width: none; border-radius: 0; }
  #stage:has(#panel:not([hidden])) #brief { display: none; }
  #stage:has(#panel:not([hidden])) #panel {
    position: static;
    max-height: none;
    overflow: visible;
    border-width: 1px 0 0;
    border-radius: 0;
  }
  #game:has(#panel:not([hidden])) #controls { display: none; }
  #game:is(.expanded,:fullscreen) #playfield { overflow: auto; }
  #game #controls { justify-content: space-between; }
  #game #arrows, #game #controls small { display: none; }
  #game #joy {
    display: grid; place-items: center; position: relative;
    width: 76px; height: 76px;
    border: 2px solid #79a4d3; border-radius: 50%;
    background: #111c32; touch-action: none;
  }
  #game #joy span {
    width: 30px; height: 30px; border: 2px solid #d9f7ff; border-radius: 50%;
    background: #78cbee; pointer-events: none;
    transform: translate(var(--joy-x,0px),var(--joy-y,0px));
  }
  #game #actions { justify-content: flex-end; flex: 1; }
  #game #actions button, #arcade #controls button { min-height: 44px; }
  #arcade header { justify-content: flex-start; flex-wrap: wrap; }
  #arcade header strong { flex: 1 1 calc(100% - 60px); }
  #arcade .arena:has(#hud:not([hidden])) { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
  #arcade #hud { position: relative; grid-row: 1; padding-bottom: 8px; }
  #arcade .arena:has(#hud:not([hidden])) canvas { grid-row: 2; }
  #arcade #arcade-track { display: none; }
}

body[data-mode=adventure]:has(#game:not([hidden]) #alert:not([hidden])) {
  background: radial-gradient(ellipse at 50% 34%, #4a101c, #090911 77%) fixed no-repeat #090911;
}
#stage:has(#alert:not([hidden])) {
  --alert-clearance: clamp(60px, 9vw, 100px);
  border-color: #ff6178;
  box-shadow: 0 0 0 1px #ff4d6377, 0 0 34px #ff173e99;
}
#alert {
  position: absolute;
  z-index: 2;
  inset: 10px 10px auto;
  justify-self: center;
  width: max-content;
  max-width: calc(100% - 20px);
  padding: .16em .5em .22em;
  border: 1px solid #ff98a4;
  border-radius: 9px;
  color: #fff9fa;
  background: linear-gradient(110deg, #660d23, #a11430 54%, #680d22);
  box-shadow: 0 0 24px #ff173eaa;
  font-size: clamp(1.45rem, 5.5vw, 3.3rem);
  font-weight: 950;
  line-height: 1.08;
  text-align: center;
  text-shadow: 0 2px 8px #440713;
}
#stage:has(#alert:not([hidden])) #panel {
  border-color: #dc536a;
  max-height: calc(100% - var(--alert-clearance) - 12px);
}
@media (prefers-reduced-motion: no-preference) {
  #alert:not([hidden]) { animation: trapped-arrival .44s ease-out both; }
  @keyframes trapped-arrival {
    from { box-shadow: 0 0 46px #ff244acc; }
    to { box-shadow: 0 0 24px #ff173eaa; }
  }
}
@media (max-width: 700px) {
  #alert {
    position: static;
    grid-row: 1;
    width: 100%;
    max-width: none;
    border-width: 0 0 1px;
    border-radius: 0;
  }
  #stage:has(#alert:not([hidden])) #panel { max-height: none; }
}
