/* Game shell only. Native game assets and the lobby layout stay independent. */
html.game-player-open {
  overflow: hidden !important;
  overscroll-behavior: none;
  scrollbar-gutter: auto;
}
body.game-player-open {
  overflow: hidden;
  overscroll-behavior: none;
}
.game-player:not([hidden]) {
  position: fixed;
  inset: auto;
  top: var(--player-top, 0px);
  left: var(--player-left, 0px);
  grid-template-rows: auto minmax(0, 1fr);
  width: var(--player-width, 100%);
  height: var(--player-height, 100vh);
  height: var(--player-height, 100dvh);
  max-height: none;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #070d17;
}
.game-player-toolbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
  min-height: calc(68px + env(safe-area-inset-top, 0px));
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 10px max(20px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid #c1a66a38;
  background: radial-gradient(ellipse at 50% 0%, #29456675, transparent 65%), linear-gradient(110deg, #101e31, #0a1525 55%, #101e31);
  box-shadow: 0 4px 20px #0004;
}
.game-player-heading {
  display: grid;
  gap: 3px;
  min-width: 0;
  text-align: center;
}
.game-player-brand {
  color: #cfb77e;
  font: 600 9px/1.2 system-ui, sans-serif;
  letter-spacing: .22em;
}
.game-player-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #f6f3eb;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-player-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  min-width: 44px;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid #a7b6cb40;
  border-radius: 13px;
  color: #e9eff8;
  background: linear-gradient(180deg, #ffffff0d, #ffffff04);
  box-shadow: inset 0 1px #ffffff0a;
  font-size: 13px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease;
}
.game-player-control svg {
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.game-player-fullscreen {
  justify-self: end;
  border-color: #ccb17566;
  color: #eddbaf;
  background: linear-gradient(180deg, #c5a05b1c, #c5a05b09);
}
.game-player-control .game-player-collapse-icon { display: none; }
.game-player-fullscreen[aria-pressed="true"] .game-player-expand-icon { display: none; }
.game-player-fullscreen[aria-pressed="true"] .game-player-collapse-icon { display: block; }
.game-player-control:focus-visible { outline: 2px solid #ebd49c; outline-offset: 3px; }
@media (hover:hover) {
  .game-player-control:hover { border-color: #d7c28e; background: #d5bc7c1f; }
}
.game-player-control:active { background: #d5bc7c2c; }
#game-player-frame {
  display: block;
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.game-player:fullscreen { width: 100%; height: 100%; max-height: none; }
.game-player:-webkit-full-screen { width: 100%; height: 100%; max-height: none; }
/* Keep only the two controls over the full-viewport game. */
.game-player-expanded .game-player-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  min-height: 0;
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) 0 max(10px, env(safe-area-inset-left, 0px));
  border: 0;
  background: none;
  box-shadow: none;
  pointer-events: none;
}
.game-player-expanded .game-player-heading { visibility: hidden; }
.game-player-expanded .game-player-control {
  width: 44px;
  height: 44px;
  padding: 0;
  pointer-events: auto;
  background: #101e31e8;
}
.game-player-expanded .game-player-control span { display: none; }
.game-player.game-player-expanded { grid-template-rows: minmax(0, 1fr); }
@media (max-width:600px) {
  .game-player-toolbar {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 12px;
    min-height: calc(60px + env(safe-area-inset-top, 0px));
    padding: calc(7px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
  }
  .game-player-control { width: 44px; height: 44px; padding: 0; border-radius: 12px; }
  .game-player-control span { display: none; }
  .game-player-title { font-size: 14px; }
  .game-player-brand { font-size: 8px; letter-spacing: .18em; }
}
@media (orientation:landscape) and (max-height:500px) {
  .game-player-toolbar { min-height: 50px; padding-top: 2px; padding-bottom: 3px; }
  .game-player-brand { display: none; }
  .game-player-title { font-size: 14px; }
}
@media (prefers-reduced-motion:reduce) {
  .game-player-control { transition: none; }
}

/* Vortex uses both top corners for native controls. Keep the host toolbar in its own row. */
#game-player.game-player-expanded:is([data-game-code="tubo-vortex"], [data-game-code="tubo-vortex2"]) {
  grid-template-rows: auto minmax(0, 1fr);
}
#game-player.game-player-expanded:is([data-game-code="tubo-vortex"], [data-game-code="tubo-vortex2"]) .game-player-toolbar {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  min-height: calc(52px + env(safe-area-inset-top, 0px));
  padding: calc(4px + env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) 4px max(10px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid #c1a66a38;
  background: linear-gradient(110deg, #101e31, #0a1525 55%, #101e31);
  pointer-events: auto;
}
#game-player.game-player-expanded:is([data-game-code="tubo-vortex"], [data-game-code="tubo-vortex2"]) .game-player-heading {
  visibility: visible;
}
#game-player.game-player-expanded:is([data-game-code="tubo-vortex"], [data-game-code="tubo-vortex2"]) .game-player-brand {
  display: none;
}
