@import url('https://fonts.googleapis.com/css2?family=Black+Ops+One&family=Space+Mono:wght@400;700&display=swap');

:root { color-scheme: dark; font-family: "Space Mono", monospace; background: #080d1d; color: #f6edcf; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 50% 0%, #273963 0, #080d1d 54%); }
main { max-width: 1024px; margin: auto; padding: 24px 16px 36px; }
header { text-align: center; margin: 8px 0 18px; padding-top: 5px; }
.eyebrow { color: #72e2df; font-size: .7rem; letter-spacing: .14em; margin: 0; }
h1 { color: #ffca3a; font: clamp(2.7rem, 10vw, 5.7rem)/.85 "Black Ops One", sans-serif; margin: 9px 0; letter-spacing: -.035em; text-shadow: 4px 4px #ba3040, 7px 7px #10132b; }
.subtitle { color: #ed5360; text-transform: uppercase; letter-spacing: .22em; margin: 0; font-size: .8rem; }
.panel { max-width: 760px; min-height: 344px; margin: 22px auto; padding: 22px; border: 3px solid #e7b42c; background-image: linear-gradient(90deg, rgba(8,13,29,.94) 0%, rgba(8,13,29,.78) 52%, rgba(8,13,29,.24) 100%), url('/assets/santiago-night-title-mobile.webp'); background-size: cover; background-position: center; box-shadow: 8px 8px #07101f; }
.select-label { margin: 0 0 10px; color: #ffdf78; font-size: .8rem; letter-spacing: .09em; }
.character-select { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 18px; }
.character-card { display: grid; gap: 4px; min-height: 132px; padding: 8px 4px; text-align: center; background: rgba(9, 16, 37, .89); border: 2px solid #405172; box-shadow: none; }
.character-card strong { font-size: .68rem; color: #fff1bd; }.character-card small { color: #93a4c6; font-size: .57rem; }
.character-card.selected { border-color: #ffce45; background: rgba(62, 33, 67, .93); box-shadow: inset 0 0 0 2px #f05a68; }
.portrait { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 3px; border: 2px solid #91e4eb; background: #28395e; color: #f9dd7b; font-size: 2.1rem; line-height: 1; }
.portrait.drums { color: #ff7190; }.portrait.mic { color: #8ce9d2; }.portrait.guitar { color: #ffb54b; }
.character-card[data-character="vocalista"] .portrait { background: #16213a url('/assets/vocalista-portrait-mobile.webp') center 27% / cover no-repeat; color: transparent; }
.character-card[data-character="baterista"] .portrait { background: #16213a url('/assets/baterista-portrait-mobile.webp') center 22% / cover no-repeat; color: transparent; }
.character-card[data-character="bajista"] .portrait { background: #16213a url('/assets/bajista-portrait-mobile.webp') center 21% / cover no-repeat; color: transparent; }
.character-card[data-character="guitarrista"] .portrait { background: #16213a url('/assets/guitarrista-portrait-mobile.webp') center 22% / cover no-repeat; color: transparent; }
label { display: block; margin-bottom: 8px; font-size: .8rem; }
.name-row { display: flex; gap: 8px; }
.name-row button { width: 100%; }
.lobby-room { margin: 12px 0; border: 1px solid #405172; background: rgba(5,11,27,.85); }
.lobby-member { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 6px 9px; border-bottom: 1px solid #263755; font-size: .68rem; color: #c6d7ec; }
.lobby-member:last-child { border-bottom: 0; }.lobby-member .slot { color: #72e2df; }.lobby-member .role { flex: 1; color: #ffdf78; }.lobby-member .state-ready { color: #8ce9d2; }.lobby-member .state-wait { color: #8e9bb4; }.kick { padding: 4px 7px; font-size: .55rem; box-shadow: none; background: #8d3444; }.ready { background: #26766d; }.start-match { background: #d86a37; }
input, button { font: inherit; border: 0; border-radius: 0; }
input { min-width: 0; flex: 1; padding: 13px; background: #f6edcf; color: #11192a; }
button { padding: 13px 16px; cursor: pointer; background: #e94b57; color: #fff7da; font-weight: 700; box-shadow: 3px 3px #551c36; }
button:hover, button:focus-visible { background: #ff6d54; outline: 3px solid #72e2df; outline-offset: 2px; }
.hint { color: #b4c2d6; font-size: .75rem; line-height: 1.55; }
#hud { display: flex; align-items: center; gap: 14px; padding: 7px 12px; font-size: .72rem; color: #72e2df; border: 2px solid #31466e; border-bottom: 0; background: #101a31; }
#hud span:nth-child(2) { flex: 1; text-align: center; }.leave, .music-toggle { padding: 5px 9px; font-size: .65rem; box-shadow: none; background: #28395e; }.music-toggle { background: #31586a; }
#game canvas { width: 100% !important; height: auto !important; display: block; image-rendering: pixelated; border: 2px solid #31466e; }
#mobile-controls { display: none; justify-content: space-between; align-items: center; margin-top: 15px; user-select: none; touch-action: none; }
.joystick { position: relative; width: 100px; height: 100px; touch-action: none; }
.joystick-ring { position: absolute; inset: 0; border: 3px solid rgba(126, 232, 226, .75); border-radius: 50%; background: radial-gradient(circle, rgba(40,57,94,.82), rgba(11,20,42,.72)); box-shadow: inset 0 0 0 7px rgba(126,232,226,.1), 0 0 14px rgba(88,210,223,.25); }
.joystick-knob { position: absolute; width: 46px; height: 46px; left: 27px; top: 27px; border: 3px solid #f7e29a; border-radius: 50%; background: radial-gradient(circle at 35% 28%, #72e2df, #315a75 66%, #192c52); box-shadow: 0 3px 0 #152441; pointer-events: none; transition: transform .04s linear; }
.combat-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.combat { min-width: 68px; min-height: 56px; padding: 6px; font-size: .58rem; box-shadow: none; }
.combat.melee { background: #d85a47; }.combat.ranged { background: #3b7190; }.combat.guard { background: #53617c; }
@media (pointer: coarse), (max-width: 720px) { #mobile-controls { display: flex; } main { padding: 12px 8px 22px; } .panel { padding: 16px; } .name-row { flex-direction: column; } .character-select { grid-template-columns: repeat(2, 1fr); } }

/* Al iniciar la partida en teléfono, no se muestra la portada: sólo juego y controles. */
@media (pointer: coarse), (max-width: 720px) {
  body.playing { overflow: hidden; background: #080d1d; }
  body.playing main { width: 100vw; max-width: none; min-height: 100svh; padding: 0; display: flex; flex-direction: column; }
  body.playing header, body.playing #lobby { display: none !important; }
  body.playing #game-shell { position: relative; width: 100%; height: 100svh; min-height: 100svh; overflow: hidden; display: block; background: #080d1d; }
  body.playing #hud { position: absolute; z-index: 5; top: 0; left: 0; right: 0; min-height: 32px; padding: 5px 8px; border: 0; background: rgba(16,26,49,.78); pointer-events: auto; }
  body.playing #game { width: 100%; height: 100%; display: grid; place-items: center; background: #080d1d; }
  body.playing #game canvas { width: 100% !important; height: 100% !important; max-height: none; object-fit: contain; border: 0; }
  body.playing #mobile-controls { position: absolute; z-index: 6; left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); bottom: max(8px, env(safe-area-inset-bottom)); display: flex; margin: 0; pointer-events: none; }
  body.playing #mobile-controls > * { pointer-events: auto; }
  body.playing .joystick { width: 92px; height: 92px; }
  body.playing .joystick-knob { left: 24px; top: 24px; width: 44px; height: 44px; }
  body.playing .joystick-ring { opacity: .82; }
  body.playing .combat-controls { opacity: .9; }
  body.playing .combat { min-width: 62px; min-height: 46px; }
}

/* En horizontal se aprovecha aún más la altura disponible. */
@media (max-width: 720px) and (orientation: landscape) {
  body { overflow: hidden; }
  body.playing #game canvas { width: 100% !important; height: 100% !important; }
  body.playing .joystick { width: 78px; height: 78px; }
  body.playing .joystick-knob { left: 20px; top: 20px; width: 38px; height: 38px; }
  body.playing .combat { min-width: 58px; min-height: 42px; }
}
