:root{color-scheme:dark;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#10111a;color:#f8f8fb}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(circle at 50% 30%,#282543 0%,#10111a 65%)}.screen{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;padding:24px}.eyebrow{font-size:12px;letter-spacing:2px;text-transform:uppercase;color:#acacbf}h1{margin:8px 0 0;font-weight:800;font-size:clamp(44px,8vw,90px);letter-spacing:-.065em}h1 span{color:#a39cff}.tagline{margin:0;font-size:clamp(15px,2vw,22px);font-weight:700;letter-spacing:.24em}.panel{margin-top:18px;display:flex;flex-direction:column;align-items:center;gap:16px;width:min(100%,640px);border:1px solid #3a3a57;border-radius:18px;padding:clamp(18px,3vw,32px);background:#202032e8}.panel strong{font-size:clamp(18px,2vw,28px)}.panel p{color:#c9cad8;line-height:1.5;margin:0}button{border:0;cursor:pointer;border-radius:10px;background:#a39cff;color:#121224;font-weight:700;padding:14px 20px;font-size:15px}button:disabled{opacity:.6;cursor:default}button:hover:not(:disabled){background:#beb8ff}output{font-size:14px;color:#b8ddc8;min-height:24px;overflow-wrap:anywhere}.error{color:#ffadae!important}.qr{width:min(70vh,75vw,420px);height:min(70vh,75vw,420px);max-width:100%;background:white;border-radius:12px;padding:10px;display:grid;place-items:center}.qr svg{width:100%;height:100%;display:block}.room-code{letter-spacing:.15em;font-size:13px;color:#c9cad8}.join-link{color:#ccc5ff;font-size:12px;overflow-wrap:anywhere}.hint{font-size:13px;color:#a8a8bf;line-height:1.5;max-width:620px}.mobile h1{font-size:clamp(42px,11vw,60px)}.mobile .panel{max-width:460px}.join-form{display:flex;flex-direction:column;gap:14px;text-align:left;width:100%}.join-form label{font-size:14px;font-weight:600}.join-form input{width:100%;font-size:18px;background:#12121e;border:1px solid #77758a;border-radius:10px;padding:14px;color:white}.join-form input:focus{outline:2px solid #a39cff}.join-form button{width:100%}#host-box{display:flex;flex-direction:column;gap:12px}[hidden]{display:none!important}
/* Etapa 2b: přehled lobby a výběr hry na telefonu */
.players{width:100%;margin:0;padding:0;list-style:none;display:grid;gap:8px;text-align:left}
.players li{background:#151624;border:1px solid #3a3a57;padding:12px 15px;border-radius:10px;color:#f4f3ff}
#game-select{width:100%;text-align:left}
#game-select h2{font-size:18px;margin:8px 0 14px}
.game-grid{display:grid;gap:12px}
.game-grid button{width:100%;text-align:left}
/* Krok 6: připravenost, stav spojení, odpočet */
.players .player-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.players .player-state{font-size:13px;font-weight:700;text-align:right;color:#c9cad8;white-space:nowrap}
.players .player-state.is-ready{color:#a4f1c0}
.players .player-state.is-offline{color:#ffb5b5}
.ready-controls{display:grid;width:100%;gap:10px}
.ready-controls button{width:100%}
#ready-toggle[aria-pressed="true"]{background:#f7d17b;color:#28200d}
#ready-toggle[aria-pressed="true"]:hover:not(:disabled){background:#ffe09a}
#host-start{background:#a4f1c0;color:#102018}
#host-start:hover:not(:disabled){background:#bfffd6}
#host-start:disabled{background:#5b596d;color:#b5b3c7}
.small-hint{font-size:13px;color:#aaa9bf}
.countdown{font-size:clamp(80px,22vw,180px);line-height:1;font-weight:900;letter-spacing:-.07em;color:#eeeaff;text-shadow:0 0 44px #7265ff70}
.mobile .countdown{font-size:clamp(80px,27vw,140px)}
.game-preview{display:grid;justify-items:center;gap:12px;width:100%;padding:18px;border:1px solid #515073;border-radius:14px;background:#141521}
.game-preview strong{font-size:22px}
.preview-paddle{width:18px;height:86px;background:#f8f8fb;border-radius:3px}

/* Krok 7 – skutečné ovladače a Pong na hlavní obrazovce */
#game-canvas{display:block;width:100%;height:auto;aspect-ratio:16/9;border:2px solid #555474;border-radius:10px;background:#08080b;max-height:73vh}
.panel:has(#game-canvas:not([hidden])){width:min(96vw,1100px);padding:clamp(10px,2vw,25px)}
.panel:has(#game-canvas:not([hidden])) #players{max-width:760px}
.rtc-status,#rtc-status{display:block;font-weight:600;color:#b6e4d0;font-size:13px;overflow-wrap:anywhere}
.pong-control{display:grid;justify-items:center;gap:10px;width:100%}
.pong-control strong{font-size:21px}
.paddle-touch{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;width:min(100%,340px);height:min(53vh,410px);min-height:230px;background:linear-gradient(180deg,#141522,#292844);border:2px solid #6e6c93;border-radius:20px;overflow:hidden;cursor:ns-resize}
.paddle-touch::before{content:'';position:absolute;top:50%;left:0;right:0;border-top:1px dashed #555575}
.paddle-marker{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:42px;height:95px;background:#bcb6ff;border-radius:9px;box-shadow:0 0 22px #aaa1ff55;pointer-events:none}
.mobile:has(.pong-control:not([hidden])){justify-content:flex-start;padding:14px 16px}
.mobile:has(.pong-control:not([hidden])) h1{font-size:32px}
.mobile:has(.pong-control:not([hidden])) .panel{margin-top:2px;gap:10px;padding:12px}
.mobile:has(.pong-control:not([hidden])) #mobile-players{display:none}

/* Krok 8: hostitelské MENU, pauza a konec zápasu */
.host-menu-container{display:grid;justify-items:center;gap:8px;width:100%}
.host-menu-toggle{justify-self:end;background:#34364d;color:#ededff;font-size:12px;letter-spacing:.08em;padding:8px 13px;border:1px solid #76738e}
.host-menu{display:grid;gap:9px;width:100%;padding:14px;border:1px solid #686583;background:#161625;border-radius:15px}
.host-menu h2{margin:0 0 4px;font-size:20px}
.host-menu button{width:100%}
.host-menu .danger{color:#fff;background:#913d52}
.host-menu .danger:hover:not(:disabled){background:#b54b65}

/* Krok 9.1: zvuky na hlavní obrazovce a jednodušší označení ovladače. */
.controller-subtitle{margin:0;color:#c9cad8;font-size:14px;font-weight:650;letter-spacing:.07em}
.mobile .panel{margin-top:8px}
.audio-toggle{padding:8px 14px;font-size:13px;background:#34364d;color:#ededff;border:1px solid #76738e;border-radius:10px}
.audio-toggle:hover:not(:disabled){background:#4b4b69}
.audio-toggle[aria-pressed="true"]{border-color:#a4f1c0;color:#c8ffda}

/* Pong (modern): samostatná neonová dotyková plocha obou mobilů. */
.modern-pong-control { margin-top: 1rem; text-align: center; }
.modern-pong-control > strong { display: block; margin-bottom: .4rem; }
.modern-pong-control > p { color: #b6bfd2; font-size: .9rem; }
.modern-paddle-touch {
  position: relative;
  min-height: min(55vh, 410px);
  margin: 1rem auto 0;
  max-width: 340px;
  overflow: hidden;
  border: 2px solid #42eaff88;
  border-radius: 20px;
  background: linear-gradient(150deg, #081d3f, #101024 70%, #15102f);
  box-shadow: 0 0 20px #42eaff20, inset 0 0 22px #42eaff10;
  touch-action: none;
  cursor: ns-resize;
  user-select: none;
}
.modern-right .modern-paddle-touch { border-color: #ffb70088; box-shadow: 0 0 20px #ffb70020, inset 0 0 22px #ffb70010; }
.modern-paddle-line { position:absolute; top:0; bottom:0; left:50%; border-left: 2px dashed #ffffff22; }
.modern-paddle-marker {
  position: absolute;
  top: 50%; left: 13%;
  width: 74%; height: 19%;
  border: 2px solid #42eaff;
  border-radius: 12px;
  background: #42eaff35;
  box-shadow: 0 0 24px #42eaff66;
  transform: translateY(-50%);
  pointer-events: none;
}
.modern-right .modern-paddle-marker { border-color: #ffb700; background: #ffb70035; box-shadow: 0 0 24px #ffb70066; }
.modern-touch-hint { position:absolute; bottom:12px; left:0; right:0; color:#ffffff70; font-size: .68rem; letter-spacing: .18em; pointer-events:none; }
.mobile:has(.modern-pong-control:not([hidden])){justify-content:flex-start;padding:14px 16px}
.mobile:has(.modern-pong-control:not([hidden])) h1{font-size:32px}
.mobile:has(.modern-pong-control:not([hidden])) .panel{margin-top:2px;gap:10px;padding:12px}
.mobile:has(.modern-pong-control:not([hidden])) #mobile-players{display:none}

/* Krok 13: nastavení hostitele, bez dalších tlačítek během hry. */
.modern-game-options{margin-top:1rem;padding:14px;border:1px solid #ffb70066;border-radius:14px;background:#101820}
.modern-game-options[hidden]{display:none}
.modern-score-choices{display:flex;gap:10px;justify-content:space-between;margin:12px 0;border:0;padding:0}
.modern-score-choices legend{margin-bottom:8px;color:#d8e7f0}
.modern-score-choices label{flex:1;text-align:center;border:1px solid #42eaff55;border-radius:8px;padding:10px 4px}
.modern-score-choices label:has(input:checked){background:#42eaff25;border-color:#42eaff}
.modern-power-toggle{display:block;padding:10px 0 15px}
#modern-settings-confirm{width:100%;background:#176b77;border:1px solid #42eaff;color:white;border-radius:10px;padding:12px}

/* Krok 14: mobilní ovladač Light Cycles. */
.cycles-control {margin:14px 0;touch-action:none;user-select:none;-webkit-user-select:none}
.cycles-control strong {display:block;margin:0 0 15px;color:#ddf6ff}
.cycles-pad {display:grid;grid-template-columns:1fr 1fr;gap:11px;margin:10px 0}
.cycles-pad button {min-height:110px;border:1px solid #348eab;border-radius:16px;background:#0a3246;color:#e5fbff;font-weight:900;font-size:clamp(15px,5vw,25px);touch-action:none;-webkit-tap-highlight-color:transparent}
.cycles-pad .cycle-boost {background:#175a57}
.cycles-pad .cycle-trail {background:#253755}
.cycles-pad button:active,.cycles-pad button.is-held {filter:brightness(1.55);border-color:#83f5ff}
#cycles-game-options label {display:inline-block;margin:8px 10px 8px 0}
#cycles-arena {width:100%;padding:9px;background:#101f36;color:white;border-radius:8px}
#join-complete-button {width:100%;margin:10px 0;background:#176580}

/* KROK 14.2: Light Cycles = jen aréna při aktivní jízdě. Ostatní hry beze změny. */
body.cycles-immersive {overflow:hidden;background:#030813;}
.cycles-immersive .screen {
  position:fixed;inset:0;width:100vw;height:100dvh;min-height:0;
  margin:0;padding:0;gap:0;overflow:hidden;display:flex;align-items:center;justify-content:center;
}
.cycles-immersive .screen > :not(.panel) {display:none!important;}
.cycles-immersive .panel:has(#game-canvas:not([hidden])) {
  position:fixed;inset:0;margin:0;padding:0;gap:0;
  width:100vw;max-width:none;height:100dvh;max-height:none;
  background:#030813;border:0;border-radius:0;
  display:flex;align-items:center;justify-content:center;overflow:hidden;
}
.cycles-immersive .panel > :not(#game-canvas) {display:none!important;}
.cycles-immersive #game-canvas:not([hidden]) {
  display:block;position:relative;flex:none;
  width:min(100vw, 177.77778dvh);height:min(100dvh, 56.25vw);
  max-width:100vw;max-height:100dvh;aspect-ratio:16/9;
  border:none;border-radius:0;box-shadow:none;background:#030813;
}
/* Zvuk mistnosti ovlada jen hostitel. */
#host-sound-toggle {background:#244b60;color:#edfcff;border:1px solid #347e98;}
#host-sound-toggle[aria-pressed="false"] {background:#373849;color:#d6d3dc;border-color:#67677a;}

/* KROK 14.3: stav zvuku jen v lobby / pred zapasem na hlavni obrazovce. */
.display-audio-setup{max-width:min(96%,610px);padding:9px 14px;border:1px solid #375e73;
 border-radius:10px;background:#0b2430;color:#d6f5ff;text-align:center;font-size:13px;}
.display-audio-setup p{margin:0 0 8px;line-height:1.4;}
.display-audio-setup button{font-size:13px;padding:10px 14px;background:#24556b;color:#fff;
 border:1px solid #5ecbe2;}
/* V fullscreen rezimu zustava pouze canvas s kompletni herni grafikou vcetne HUDu. */
.cycles-immersive .display-audio-setup{display:none!important;}

/* KROK 14.6: jednotné celoplošné PC/TV rozhraní pro všechny tři hry.
   Herní HUD, pauza, odpočty a výsledky jsou kreslené uvnitř canvasu a nemění se. */
body.game-immersive {overflow:hidden;background:#030813;}
.game-immersive .screen {
  position:fixed;inset:0;width:100vw;height:100dvh;min-height:0;
  margin:0;padding:0;gap:0;overflow:hidden;display:flex;align-items:center;justify-content:center;
}
.game-immersive .screen > :not(.panel) {display:none!important;}
.game-immersive .panel:has(#game-canvas:not([hidden])) {
  position:fixed;inset:0;margin:0;padding:0;gap:0;
  width:100vw;max-width:none;height:100dvh;max-height:none;
  background:#030813;border:0;border-radius:0;
  display:flex;align-items:center;justify-content:center;overflow:hidden;
}
.game-immersive .panel > :not(#game-canvas) {display:none!important;}
.game-immersive #game-canvas:not([hidden]) {
  display:block;position:relative;flex:none;
  width:min(100vw, 177.77778dvh);height:min(100dvh, 56.25vw);
  max-width:100vw;max-height:100dvh;aspect-ratio:16/9;
  border:none;border-radius:0;box-shadow:none;background:#030813;
}
/* More visible but still only in lobby: once-per-screen browser audio permission. */
.display-audio-setup:has(#display-audio-unlock:not([hidden])) {border-color:#65b5ce;}

/* KROK 14.13 – Light Cycles: posunout CELÝ obraz dolů, ne jednotlivé
   HUD / arénu / štítek. Horní mezera 28 px, spodní okraj beze změny.
   Zachovat 16:9 a neorezávat při 16:9 ani na širokých monitorech. */
body.game-immersive .panel:has(#game-canvas[width="1600"]:not([hidden])) {
  padding:28px 0 0 !important;
}
body.game-immersive #game-canvas[width="1600"]:not([hidden]) {
  width:min(100vw, calc((100dvh - 28px) * 16 / 9));
  height:min(calc(100dvh - 28px), 56.25vw);
  max-height:calc(100dvh - 28px);
}

/* KROK 14.15 – pouze OLD PONG: 28 px od horniho i dolniho okraje PC/TV.
   Canvas zustava v pomeru 16:9, zadne oriznuti; Modern Pong a Light Cycles beze zmeny. */
body.game-immersive.pong-old-immersive .panel:has(#game-canvas:not([hidden])) {
  padding:28px 0 !important;
}
body.game-immersive.pong-old-immersive #game-canvas:not([hidden]) {
  width:min(100vw, calc((100dvh - 56px) * 16 / 9));
  height:min(calc(100dvh - 56px), 56.25vw);
  max-height:calc(100dvh - 56px);
}

/* KROK 14.19 – pouze MODERN PONG: stejne odsazeni celeho herniho
   canvasu jako u Old Ponga, 28 CSS px nahore i dole; zachovat 16:9.
   Plati shodne pri hrani, pauze i vyhlaseni vysledku. */
body.game-immersive.pong-modern-immersive .panel:has(#game-canvas:not([hidden])) {
  padding:28px 0 !important;
}
body.game-immersive.pong-modern-immersive #game-canvas:not([hidden]) {
  width:min(100vw, calc((100dvh - 56px) * 16 / 9));
  height:min(calc(100dvh - 56px), 56.25vw);
  max-height:calc(100dvh - 56px);
}

/* KROK 14.17: Prvni aktivace zvuku vyhradne PRED zapasem. Nikdy nesmi
   prekryt hru, jeji startovni odpocet, pauzu ani vyhlaseni viteze. */
body.game-immersive #display-audio-setup,
body.cycles-immersive #display-audio-setup { display:none!important; }

/* KROK 14.18 – potvrzovani zvuku OK na dalkovem ovladaci TV. */
.display-audio-setup #display-audio-unlock:focus-visible {outline:3px solid #bcefff; outline-offset:4px; box-shadow:0 0 0 5px #123549;}

/* HOSTINGER TEST 03: Smart TV can miss :has(), dvh and CSS calc sizing.
   Layout gets pixel-perfect 16:9 dimensions from JS, including 28px gap. */
body.game-immersive .screen,body.cycles-immersive .screen {
  position:fixed!important;inset:0!important;width:100vw!important;height:100vh!important;
  min-height:0!important;margin:0!important;padding:0!important;gap:0!important;
  display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;
}
body.game-immersive .screen > :not(.panel),body.cycles-immersive .screen > :not(.panel){display:none!important;}
body.game-immersive .panel,body.cycles-immersive .panel{
  position:fixed!important;inset:0!important;width:100vw!important;max-width:none!important;
  height:100vh!important;max-height:none!important;margin:0!important;padding:0!important;
  gap:0!important;display:flex!important;align-items:center!important;justify-content:center!important;
  background:#030813!important;border:0!important;border-radius:0!important;overflow:hidden!important;
}
body.game-immersive .panel > :not(#game-canvas),body.cycles-immersive .panel > :not(#game-canvas){display:none!important;}
body.game-immersive #game-canvas:not([hidden]){
  display:block!important;position:relative!important;flex:none!important;
  border:0!important;border-radius:0!important;box-shadow:none!important;background:#030813;
}
/* Reconnection is deliberately visible ONLY in lobby or when match is paused. */
body.game-immersive #rejoin-overlay:not([hidden]),body.cycles-immersive #rejoin-overlay:not([hidden]){
  display:flex!important;position:absolute;inset:auto!important;z-index:5;
  align-items:center;justify-content:center;flex-direction:column;gap:10px;
  padding:14px!important;max-width:400px;max-height:95vh;overflow:auto;
  border-radius:14px;background:rgba(4,12,23,.96);border:2px solid #5a9bd0;
}
#rejoin-overlay .qr{width:min(42vh,270px);height:min(42vh,270px);padding:8px;}
#rejoin-overlay h2{font-size:clamp(18px,2.5vw,25px);margin:0;}
#rejoin-overlay p{margin:0;line-height:1.35;}
#rejoin-overlay a{color:#bfe9ff;}

/* Place Light Cycles 28px below top even on TVs without :has() support. */
body.game-immersive.light-cycles-immersive .panel{padding:28px 0 0!important;}

/* HOSTINGER 06: univerzální start bez automatického rozpoznávání zařízení. */
.mode-choice .mode-screen {min-height:100vh;min-height:100dvh;}
.mode-choice .mode-panel {max-width:560px;width:100%;gap:12px;}
.mode-panel h2 {font-size:clamp(21px,3vw,30px);margin:0 0 10px;}
.mode-option {width:100%;display:flex;align-items:center;gap:16px;text-align:left;
 padding:20px 18px;border-radius:16px;border:2px solid #54556e;background:#161c2b;
 text-decoration:none;color:#f7f9ff;min-height:102px;}
.mode-option.mode-primary {border-color:#55cce8;background:#152d3b;}
.mode-option .mode-symbol {font-size:clamp(36px,6vw,50px);line-height:1;color:#79e9ff;min-width:54px;text-align:center;}
.mode-option strong {display:block;font-size:clamp(17px,2.5vw,22px);margin-bottom:5px;}
.mode-option small {display:block;color:#c6d2df;font-size:14px;line-height:1.4;}
.mode-option:focus,.mode-option:focus-visible {outline:3px solid #fff;outline-offset:4px;border-color:#87f6ff;background:#234258;}
.mode-option:hover {background:#24374b;}
.mode-help {margin:12px 0 0;font-size:13px;color:#b7c8d8;}

/* HOSTINGER 06: herní ovladač přes celou dostupnou plochu telefonu.
   Žádná pravidla hry, pozice pálek ani signální protokol se nemění.
   Režim je ovládán výhradně třídou přidanou po serverovém statusu playing,
   takže funguje i na telefonech bez podpory CSS :has(). */
body.controller-playing {overflow:hidden;overscroll-behavior:none;}
body.controller-playing .screen.mobile {
 position:fixed!important;top:0;left:0;right:0;bottom:0;
 width:100%!important;height:100vh!important;height:100dvh!important;min-height:0!important;
 margin:0!important;padding:0!important;gap:0!important;
 display:block!important;overflow:hidden!important;
}
body.controller-playing .screen.mobile > :not(.panel) {display:none!important;}
body.controller-playing .screen.mobile .panel {
 position:relative!important;width:100%!important;max-width:none!important;
 height:100%!important;max-height:none!important;margin:0!important;padding:0!important;
 border:0!important;border-radius:0!important;background:#0b1424!important;
 display:block!important;overflow:hidden!important;
}
body.controller-playing .screen.mobile .panel > :not(#pong-control):not(#modern-pong-control):not(#cycles-control):not(#host-menu-container) {display:none!important;}
body.controller-playing .screen.mobile .panel > #pong-control:not([hidden]),
body.controller-playing .screen.mobile .panel > #modern-pong-control:not([hidden]),
body.controller-playing .screen.mobile .panel > #cycles-control:not([hidden]) {
 position:absolute!important;inset:0!important;display:flex!important;flex-direction:column!important;
 width:100%!important;height:100%!important;max-height:none!important;max-width:none!important;
 margin:0!important;padding:0!important;gap:0!important;overflow:hidden!important;
 touch-action:none;user-select:none;-webkit-user-select:none;
}
body.controller-playing #pong-control > strong,body.controller-playing #pong-control > p,
body.controller-playing #modern-pong-control > strong,body.controller-playing #modern-pong-control > p,
body.controller-playing #cycles-control > strong {display:none!important;}
body.controller-playing #paddle-touch,
body.controller-playing #modern-paddle-touch {
 flex:1 1 auto!important;width:100%!important;max-width:none!important;
 height:100%!important;min-height:0!important;max-height:none!important;
 border:0!important;border-radius:0!important;margin:0!important;
 box-shadow:none!important;touch-action:none!important;
}
body.controller-playing #modern-pong-control {text-align:initial!important;}
body.controller-playing #modern-paddle-touch .modern-touch-hint {display:none;}
body.controller-playing .screen.mobile .panel > #cycles-control:not([hidden]) {
 display:grid!important;grid-template-columns:1fr!important;grid-template-rows:1fr 1fr!important;
 gap:8px!important;padding:12px!important;
 padding-top:max(12px,env(safe-area-inset-top))!important;
 padding-bottom:max(12px,env(safe-area-inset-bottom))!important;
}
body.controller-playing #cycles-control .cycles-pad {display:grid!important;grid-template-columns:1fr 1fr!important;
 gap:8px!important;margin:0!important;min-height:0!important;}
body.controller-playing #cycles-control .cycles-pad button {
 width:100%!important;height:100%!important;min-height:0!important;
 padding:8px 5px!important;font-size:clamp(16px,4.6vw,28px)!important;
 touch-action:none!important;}
@media (orientation:landscape) {
 body.controller-playing .screen.mobile .panel > #cycles-control:not([hidden]) {
  grid-template-columns:1fr 1fr!important;grid-template-rows:1fr!important;gap:10px!important;
 }
 body.controller-playing #cycles-control .cycles-pad button {font-size:clamp(14px,3.1vw,26px)!important;}
}
/* Jediný další viditelný prvek při hraní: MENU hostitele v rohu. */
body.controller-playing #host-menu-container:not([hidden]) {
 position:fixed!important;top:calc(8px + env(safe-area-inset-top));right:calc(8px + env(safe-area-inset-right));
 z-index:100;display:flex!important;align-items:flex-end!important;flex-direction:column!important;
 width:auto!important;max-width:min(92vw,380px);padding:0!important;margin:0!important;
 pointer-events:none;
}
body.controller-playing #host-menu-container .host-menu-toggle {
 pointer-events:auto;min-height:40px;padding:9px 12px;
 background:rgba(20,28,45,.91);border:1px solid #91c9dd;color:#fff;
}
body.controller-playing #host-menu-container #host-menu:not([hidden]) {
 pointer-events:auto;max-height:calc(100vh - 65px);overflow-y:auto;
}

/* HOSTINGER 10: Light Cycles only. A landscape gamepad with compact buttons.
   Left side: two steering controls. Right side: Boost + smaller wall switch.
   The layout works independently of the mobile user agent and screen lock. */
body.controller-playing.controller-cycles .screen.mobile .panel > #cycles-control:not([hidden]) {
  display:grid!important;
  grid-template-columns:minmax(0, 58fr) minmax(0, 42fr)!important;
  grid-template-rows:minmax(0, 1fr)!important;
  align-items:center!important;justify-items:center!important;
  gap:clamp(8px, 2vw, 18px)!important;
  padding:10px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left))!important;
  background:linear-gradient(125deg,#07172a,#0d253b 60%,#07172a)!important;
}
body.controller-playing.controller-cycles #cycles-control .cycles-pad {
  display:grid!important;margin:0!important;padding:0!important;
  justify-content:center!important;align-content:center!important;
  justify-items:center!important;align-items:center!important;
  width:100%!important;height:100%!important;min-height:0!important;
}
body.controller-playing.controller-cycles #cycles-control .cycles-steer {
  grid-template-columns:repeat(2, minmax(0, 122px))!important;
  grid-template-rows:auto!important;
  gap:clamp(10px, 2vw, 20px)!important;
}
body.controller-playing.controller-cycles #cycles-control .cycles-actions {
  grid-template-columns:minmax(0, 1fr)!important;
  grid-template-rows:auto auto!important;
  gap:clamp(8px, 1.8vh, 16px)!important;
}
body.controller-playing.controller-cycles #cycles-control .cycles-pad button {
  border-radius:19px!important;max-width:100%!important;
  padding:6px!important;line-height:1.16!important;letter-spacing:.01em!important;
  box-shadow:inset 0 0 16px rgba(104,229,255,.06),0 7px 18px rgba(0,0,0,.27)!important;
  -webkit-tap-highlight-color:transparent!important;
}
body.controller-playing.controller-cycles #cycles-control .cycles-steer button {
  width:clamp(76px, 17vw, 118px)!important;height:clamp(76px, 23vh, 112px)!important;
  font-size:clamp(14px, 2.45vw, 20px)!important;
  border-color:#55bde2!important;
}
body.controller-playing.controller-cycles #cycles-control .cycle-boost {
  width:clamp(106px, 21vw, 145px)!important;height:clamp(65px, 17vh, 90px)!important;
  font-size:clamp(16px, 2.6vw, 22px)!important;border-color:#45c9ab!important;
}
body.controller-playing.controller-cycles #cycles-control .cycle-trail {
  width:clamp(102px, 19vw, 132px)!important;height:clamp(46px, 11vh, 64px)!important;
  font-size:clamp(12px, 1.85vw, 15px)!important;border-color:#87a2cc!important;
}
/* Chrome on Android, locked iPhones, and other portrait browsers: rotate the
   *interface* (not the device), so holding the phone sideways gives the same
   landscape controller. This doesn't depend on screen.orientation.lock(). */
@media (orientation:portrait) {
  body.controller-playing.controller-cycles .screen.mobile .panel {
    position:fixed!important;inset:auto!important;
    top:0!important;left:100vw!important;
    width:100vh!important;width:100dvh!important;
    height:100vw!important;max-width:none!important;max-height:none!important;
    transform-origin:top left!important;transform:rotate(90deg)!important;
    overflow:hidden!important;
  }
  body.controller-playing.controller-cycles #host-menu-container:not([hidden]) {
    position:absolute!important;top:6px!important;right:8px!important;
  }
  body.controller-playing.controller-cycles #cycles-control .cycles-steer button {
    width:clamp(74px, 17vh, 118px)!important;
    height:clamp(72px, 24vw, 112px)!important;
  }
  body.controller-playing.controller-cycles #cycles-control .cycle-boost {
    width:clamp(99px, 22vh, 145px)!important;
    height:clamp(60px, 21vw, 90px)!important;
  }
  body.controller-playing.controller-cycles #cycles-control .cycle-trail {
    width:clamp(94px, 20vh, 132px)!important;
    height:clamp(45px, 15vw, 64px)!important;
  }
}

/* HOSTINGER 11: Old + Modern Pong — a centered control area at 80% of the
   phone height. The whole paddle travel still maps from top (0) to bottom (1)
   of this smaller touch window; Light Cycles stays unchanged. */
body.controller-playing #paddle-touch,
body.controller-playing #modern-paddle-touch {
  flex:0 0 80%!important;
  height:80%!important;
  min-height:0!important;
  margin:auto 0!important;
}

/* HOSTINGER 12: Pong active touch area uses 80% of the LONG axis in either
   orientation. Portrait: Y coordinate; landscape: X coordinate (full paddle
   movement remains 0..1). 10% end margins prevent edge gestures. */
body.controller-playing #paddle-touch,
body.controller-playing #modern-paddle-touch {
  position:absolute!important;
  flex:none!important;
  top:10%!important;left:0!important;
  width:100%!important;height:80%!important;
  max-width:none!important;max-height:none!important;
  margin:0!important;
}
@media (orientation:landscape) {
  body.controller-playing #paddle-touch,
  body.controller-playing #modern-paddle-touch {
    top:0!important;left:10%!important;
    width:80%!important;height:100%!important;
  }
  body.controller-playing #paddle-touch {cursor:ew-resize;}
  body.controller-playing #modern-paddle-touch {cursor:ew-resize;}
  body.controller-playing #paddle-marker {
    width:95px;height:42px;
  }
  body.controller-playing #modern-paddle-marker {
    width:19%;height:74%;top:13%;left:50%;
    transform:translateX(-50%);
  }
  body.controller-playing #modern-paddle-touch .modern-paddle-line {
    border-left:0;border-top:2px dashed #ffffff22;
    left:0;right:0;top:50%;bottom:auto;
  }
}
