/* mobile-room-prompt.css */
.mobile-room-prompt{grid-column:1/-1;display:flex;align-items:center;gap:12px;margin:0 0 16px;padding:15px;border:1px solid #8b7543;border-radius:14px;background:linear-gradient(120deg,#1c3040,#14222e);color:#edf4fa;box-sizing:border-box;min-width:0}
.mobile-room-prompt[hidden]{display:none!important}
.mobile-room-prompt-icon{font:700 30px system-ui;color:#f8d26c;flex:none}
.mobile-room-prompt-copy{min-width:0;flex:1}
.mobile-room-prompt strong{display:block;color:#ffda77;font-size:15px;line-height:1.4}
.mobile-room-prompt p{margin:5px 0 0;font-size:12px;line-height:1.6;color:#c1d3e3;overflow-wrap:anywhere}
.mobile-room-prompt-actions{display:flex;gap:8px;flex-wrap:wrap}
.mobile-room-prompt-actions button{font:inherit;font-size:12px;min-height:44px;white-space:normal;overflow-wrap:anywhere;padding:10px 12px;border-radius:8px;border:1px solid #64788b;background:#1a2e3e;color:#edf4fa;cursor:pointer;touch-action:manipulation}
.mobile-room-prompt-actions [data-mobile-fullscreen]{background:#f3ce67;color:#101d29;border-color:#ffe5a0;font-weight:700}
@media(max-width:760px){.mobile-room-prompt{flex-wrap:wrap}.mobile-room-prompt-copy{flex-basis:calc(100% - 48px)}.mobile-room-prompt-actions{width:100%}.mobile-room-prompt-actions [data-mobile-fullscreen]{flex:1}}
body.game-fullscreen .mobile-room-prompt{display:none!important}

/* Shared enlarged controls: CPU, friendly, ranked and Allstar. */
/* Fill the existing side columns; never reduce or cover the game column. */
@media (orientation:landscape) {
 .game-stage.is-fullscreen.mobile-room-ui .touch .dpad {
  width:calc(100% - 16px);height:auto;aspect-ratio:1;
  max-width:calc(var(--game-view-height,100dvh) - 96px);
 }
 .game-stage.is-fullscreen.mobile-room-ui .touch .dpad-key {
  width:33.333333%;height:44.444444%;left:33.333333%;top:0;
  transform-origin:50% 112.5%;
 }
 .game-stage.is-fullscreen.mobile-room-ui .touch-actions {
  width:calc(100% - 16px);gap:8px;
 }
 .game-stage.is-fullscreen.mobile-room-ui .touch-actions .action {
  width:calc((100% - 8px) / 2);height:auto;aspect-ratio:1;
  max-width:calc((var(--game-view-height,100dvh) - 112px) / 2);
  font-size:clamp(21px,4vw,34px);flex-shrink:0;
 }
 .game-stage.is-fullscreen.mobile-room-ui .touch-system {
  width:calc(100% - 16px);gap:8px;padding-top:12px;justify-content:center;
 }
 .game-stage.is-fullscreen.mobile-room-ui .touch-system button {
  width:calc((100% - 8px) / 2);min-height:clamp(44px,15vh,64px);
  padding:8px 2px;font-size:clamp(9px,1.5vw,12px);
 }
}



/* allstar-room.css */
.allstar-play{margin-inline-start:8px;border-color:#f2cb64!important;background:#142d4a!important;color:#ffe08c!important}
.allstar-drafting{position:relative;min-height:0!important;max-height:calc(100dvh - 100px)!important;overflow:hidden}
.allstar-drafting #game{visibility:hidden}
.allstar-game-menu{position:absolute;inset:0;z-index:5;background:#060d17;overflow:hidden;min-height:0}
.allstar-drafting .touch{visibility:hidden;pointer-events:none}
@media(max-width:600px){.allstar-play{margin-inline-start:0}}
@media(max-width:760px){body:has(.allstar-drafting) :is(.online-widget,.general-chat-widget){display:none}}
.game-fullscreen .allstar-drafting{max-height:100dvh!important}
.game-fullscreen .allstar-game-menu{inset:0}

/* Use the phone width for draft text instead of shrinking a tall menu into the match canvas. */
@media(max-width:600px) and (orientation:portrait){.allstar-drafting:not(.is-fullscreen){min-height:min(calc((100vw - 32px) * 1.708334),calc(100dvh - 100px))!important}}

/* Fill the existing side columns; never reduce or cover the game column. */
@media (orientation:landscape) {
 .game-stage.is-fullscreen.mobile-room-ui:is(.allstar-android-controls,.allstar-ios-controls) .touch .dpad {
  width:calc(100% - 16px);height:auto;aspect-ratio:1;
  max-width:calc(var(--game-view-height,100dvh) - 96px);
 }
 .game-stage.is-fullscreen.mobile-room-ui:is(.allstar-android-controls,.allstar-ios-controls) .touch .dpad-key {
  width:33.333333%;height:44.444444%;left:33.333333%;top:0;
  transform-origin:50% 112.5%;
 }
 .game-stage.is-fullscreen.mobile-room-ui:is(.allstar-android-controls,.allstar-ios-controls) .touch-actions {
  width:calc(100% - 16px);gap:8px;
 }
 .game-stage.is-fullscreen.mobile-room-ui:is(.allstar-android-controls,.allstar-ios-controls) .touch-actions .action {
  width:calc((100% - 8px) / 2);height:auto;aspect-ratio:1;
  max-width:calc((var(--game-view-height,100dvh) - 112px) / 2);
  font-size:clamp(21px,4vw,34px);flex-shrink:0;
 }
 .game-stage.is-fullscreen.mobile-room-ui:is(.allstar-android-controls,.allstar-ios-controls) .touch-system {
  width:calc(100% - 16px);gap:8px;padding-top:12px;justify-content:center;
 }
 .game-stage.is-fullscreen.mobile-room-ui:is(.allstar-android-controls,.allstar-ios-controls) .touch-system button {
  width:calc((100% - 8px) / 2);min-height:clamp(44px,15vh,64px);
  padding:8px 2px;font-size:clamp(9px,1.5vw,12px);
 }
}


/* youtube-panel.css */
.yt-dock{--tab:36px;position:fixed;z-index:18;left:0;top:50%;width:clamp(264px,16vw,340px);max-width:calc(100vw - var(--tab) - 8px);transform:translate(-100%,-50%);transition:transform .22s ease;color:#f4f4ed;text-align:left}
.yt-dock.yt-open{transform:translate(0,-50%)}
.yt-dock[hidden],.yt-panel [hidden]{display:none!important}
.yt-panel,.yt-tab{box-sizing:border-box;background:#171e28;border:1px solid #685338;box-shadow:0 8px 25px #0005}
.yt-panel{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;max-height:calc(100dvh - 112px);padding:12px 12px 13px max(12px,env(safe-area-inset-left));overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;border-left:0;border-radius:0 12px 12px 0}
.yt-dock .yt-tab{position:absolute;left:100%;top:50%;transform:translateY(-50%);border-left:0;border-radius:0 9px 9px 0;width:var(--tab);min-height:108px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:6px 0;color:#ffce67;cursor:pointer;font:700 13px/1 system-ui}
.yt-tab svg{width:20px;height:20px}.yt-tab span:first-of-type{writing-mode:vertical-rl}.yt-chevron{font-size:19px}.yt-open .yt-chevron{transform:rotate(180deg)}
.yt-head,.yt-foot{display:flex;align-items:center;justify-content:space-between;gap:6px}
.yt-head{position:sticky;top:-12px;z-index:2;margin:-12px -12px 0;padding:8px 12px;background:#171e28}
.yt-foot{flex-wrap:wrap}
.yt-head h2{margin:0;font-size:17px;color:#ffcf69}.yt-dock .yt-close{width:32px;height:32px;padding:0;border:1px solid #3f4a58;border-radius:6px;background:#202834;font-size:22px;color:#eee;line-height:1}
.yt-panel select{min-width:0;width:100%;height:35px;padding:0 7px;background:#111a23;border:1px solid #405064;color:#f6f2ea;border-radius:6px}
.yt-screen{position:relative;width:100%;min-width:0;aspect-ratio:16/9;overflow:hidden;border-radius:7px;background:radial-gradient(ellipse at 20% 15%,#304b60,transparent 70%),linear-gradient(145deg,#122230,#10161d)}
.yt-screen:has(iframe){min-height:200px}
.yt-screen iframe,.yt-dock .yt-play{position:absolute;inset:0;box-sizing:border-box;width:100%;min-width:0;height:100%;border:0}
.yt-dock .yt-play{display:grid;align-content:center;justify-items:center;gap:12px;padding:16px;color:#f4f3ed;background:transparent;cursor:pointer}
.yt-play span{display:grid;place-items:center;width:52px;height:36px;border-radius:9px;background:#efc364;color:#161d27;font-size:17px}
.yt-play strong{font-size:15px;line-height:1.3;overflow-wrap:anywhere;white-space:normal;min-width:0;max-width:100%}
.yt-play img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:.53}
.yt-play span,.yt-play strong{position:relative}.yt-play strong{text-shadow:0 1px 4px #000}
.yt-screen small:not(:empty){position:absolute;bottom:4px;left:4px;right:4px;background:#111a23;color:#fff;padding:5px;text-align:center;pointer-events:none}
.yt-foot a{font-size:12px;font-weight:650;color:#edc56c;text-decoration:none}.yt-foot a:hover{text-decoration:underline}
.yt-foot .yt-subscribe{padding:7px 10px;border-radius:6px;background:#efc364;color:#201b11}
.yt-dock :focus-visible{outline:2px solid #ffd47d;outline-offset:2px}
@media(max-width:760px){.yt-dock{--tab:44px;width:min(338px,calc(100vw - 46px - env(safe-area-inset-right)));top:49%}.yt-dock .yt-tab{min-height:104px}.yt-panel{max-height:calc(100dvh - 142px)}.yt-dock .yt-close{width:38px;height:38px}}
@media(max-width:1024px){.yt-dock{--tab:44px;width:min(360px,calc(100vw - 52px - env(safe-area-inset-right)))}.yt-dock .yt-tab{min-height:104px}.yt-dock .yt-close{width:44px;height:44px;min-width:44px;min-height:44px;touch-action:manipulation}.yt-panel{scrollbar-width:thin}}
@media(max-height:440px){.yt-dock{top:46%}.yt-panel{max-height:72dvh}}
@media(max-width:760px) and (max-height:740px){
  body:has(#analytics-choice:not([hidden])) .yt-dock{--video-space:calc(100dvh - var(--community-bottom,0px) - 70px);--video-top:min(16dvh,104px);top:calc((var(--video-space) + var(--video-top)) / 2)}
  body:has(#analytics-choice:not([hidden])) .yt-panel{max-height:max(108px,calc(var(--video-space) - var(--video-top) - 12px))}
}
@media(prefers-reduced-motion:reduce){.yt-dock{transition:none}}

/* The fixed dock is larger than its visible tab; let taps pass through its empty area. */
.yt-dock{pointer-events:none}
.yt-dock .yt-tab,.yt-dock .yt-panel{pointer-events:auto}


/* support-panel.css */
.support-dock {
  --tab: 36px;
  position: fixed;
  z-index: 18;
  right: 0;
  top: 50%;
  width: clamp(264px, 16vw, 340px);
  max-width: calc(100vw - var(--tab) - 8px);
  height: 0;
  transform: none;
  color: #f4f4ed;
  text-align: left;
}
.support-dock.is-open { transform: none; }
.support-dock[hidden], #welcome[data-room-connecting] .support-dock { display: none; }
.support-dock .support-tab, #support-panel {
  background: #171e28;
  border: 1px solid #685338;
  box-shadow: 0 8px 25px #0005;
}
.support-tab-stack {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: var(--tab);
}
.support-dock .support-tab {
  position: relative;
  right: auto;
  top: auto;
  transform: none;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  width: var(--tab);
  min-height: 112px;
  padding: 6px 0;
  border-left: 0;
  border-radius: 0 9px 9px 0;
  color: #ffce67;
  font: 700 13px/1 system-ui;
}
.support-tab span {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  max-height: 116px;
}
.support-tab b { font-size: 19px; }
.support-dock.is-open .support-tab b { transform: rotate(180deg); }
#support-panel {
  position: relative;
  transform: translate(calc(100% + var(--tab) + 8px), -50%);
  transition: transform .22s ease;
  max-height: calc(100dvh - 112px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 12px max(12px, env(safe-area-inset-right)) 13px 12px;
  border-right: 1px solid #685338;
  border-radius: 12px;
}
.support-dock.is-open #support-panel { transform: translate(calc(0px - var(--tab)), -50%); }
#support-panel header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#support-panel h2 { margin: 0; font-size: 17px; color: #ffcf69; }
#support-panel p { margin: 5px 0 10px; color: #cdd3db; font-size: 13px; line-height: 1.4; }
#support-panel .support-close { width: 32px; min-height: 32px; background: #202834; border: 1px solid #3f4a58; color: #eee; font-size: 22px; line-height: 1; }
#support-panel fieldset { display: grid; gap: 4px; min-width: 0; margin: 0; padding: 0; border: 0; }
#support-panel .support-option {
  display: grid;
  grid-template-columns: 16px 27px minmax(0,1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  margin: 0;
  padding: 3px 8px;
  border: 1px solid #35404b;
  border-radius: 7px;
  cursor: pointer;
  color: #e3e7ea;
  font-size: 13px;
}
.support-option strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
#support-panel .support-option:has(:checked) { border-color: #deba6c; background: #292a29; }
#support-panel .support-option:has(:focus-visible) { outline: 2px solid #ffd47d; }
#support-panel input { width: 14px; height: 14px; min-height: 0; margin: 0; padding: 0; accent-color: #f3c65b; }
.support-badge, .support-badge img { display: block; width: 27px; height: 27px; }
#support-panel .support-buy { width: 100%; margin-top: 10px; background: #efc364; color: #201b11; font-weight: 700; }
#support-panel .support-status { margin-bottom: 0; }
#support-panel .support-status { overflow-wrap: anywhere; }
#support-panel .support-status:empty { display: none; }
#support-panel .crypto-support-content[hidden] { display: none; }
#support-panel .crypto-support-content {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #3a4654;
  border-radius: 9px;
  background: #111923;
}
#support-panel .crypto-support-content h3 {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 42px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid #d9ad51;
  border-radius: 7px;
  background: #efc364;
  color: #201b11;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}
#support-panel .crypto-support-content p { margin: 7px 0 0; }
#support-panel .crypto-support-note { padding: 8px; border-left: 2px solid #d9ae58; background: #1b2430; font-size: 12px; }
#support-panel .crypto-wallet-list { display: grid; gap: 8px; }
#support-panel .crypto-wallet-card, #support-panel .crypto-wallet-empty {
  min-width: 0;
  margin: 0;
  padding: 9px;
  border: 1px solid #35404b;
  border-radius: 7px;
  background: #171e28;
}
#support-panel .crypto-wallet-network { margin: 0 0 6px; color: #ffcf69; font-size: 12px; font-weight: 700; }
#support-panel .crypto-wallet-row { display: grid; gap: 7px; }
#support-panel .crypto-wallet-address {
  display: block;
  min-width: 0;
  padding: 7px;
  border-radius: 5px;
  background: #0d131b;
  color: #edf0f3;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
  user-select: all;
}
#support-panel .crypto-copy-button {
  min-height: 36px;
  border: 1px solid #735e38;
  border-radius: 6px;
  background: #252a2b;
  color: #ffcf69;
  font-weight: 700;
}
#support-panel .crypto-support-status:empty { display: none; }
#support-panel .crypto-support-status { color: #cdd3db; font-size: 12px; }
@media (max-width:760px) {
  .support-dock { --tab: 44px; top: 49%; width: min(338px, calc(100vw - 48px - env(safe-area-inset-left))); }
  #welcome:has(.yt-dock) .side-dock { max-width: calc(100vw - 96px - env(safe-area-inset-left) - env(safe-area-inset-right)); }
  #support-panel { max-height: calc(100dvh - 142px); }
  #support-panel .support-option, #support-panel .support-close { min-height: 44px; }
  #support-panel .support-close { width: 44px; }
}
@media (max-width:1024px) {
  .support-dock { --tab: 44px; width: min(360px, calc(100vw - 52px - env(safe-area-inset-right))); }
  .support-dock .support-tab { min-height: 104px; }
  #support-panel .support-close { width: 44px; min-width: 44px; min-height: 44px; touch-action: manipulation; }
}
@media (max-height:440px) {
  .support-dock { top: 46%; }
  .support-dock .support-tab { min-height: 88px; }
  #support-panel { max-height: 72dvh; }
}
@media (max-width:760px) and (max-height:740px) {
  body:has(#analytics-choice:not([hidden])) .support-dock {
    --space: calc(100dvh - var(--community-bottom, 0px) - 70px);
    --start: min(16dvh, 104px);
    top: calc((var(--space) + var(--start)) / 2);
  }
  body:has(#analytics-choice:not([hidden])) #support-panel { max-height: max(108px, calc(var(--space) - var(--start) - 12px)); }
}
@media (prefers-reduced-motion:reduce) { #support-panel { transition: none; } }

/* Keep each drawer reachable while both are open on narrow phones. */
@media (max-width: 575px) {
  #welcome:has(.yt-open):has(.support-dock.is-open) {
    --dock-start: max(10px, env(safe-area-inset-top));
    --dock-space: calc(100dvh - var(--dock-start) - var(--community-bottom, 16px) - 68px);
  }
  #welcome:has(.yt-open):has(.support-dock.is-open) .yt-dock {
    top: calc(var(--dock-start) + var(--dock-space) * .21);
  }
  #welcome:has(.yt-open):has(.support-dock.is-open) .support-dock {
    top: calc(var(--dock-start) + var(--dock-space) * .71);
  }
  #welcome:has(.support-dock.is-open) .yt-open .yt-panel {
    max-height: calc(var(--dock-space) * .42 - 6px);
  }
  #welcome:has(.yt-open) .support-dock.is-open #support-panel {
    max-height: calc(var(--dock-space) * .58 - 6px);
  }
}
@media (min-width: 576px) and (max-width: 760px) {
  #welcome:has(.yt-open):has(.support-dock.is-open) .side-dock {
    max-width: calc(50vw - var(--tab) - 5px);
  }
}

/* The fixed dock is wider than its edge tab; its transparent area must not eat taps. */
.support-dock { pointer-events: none; }
.support-dock .support-tab-stack,
.support-dock .support-tab,
.support-dock #support-panel { pointer-events: auto; }
