/* Shared look of the iOS/Android UI (GameSurfaces.kt): palette, font, glass cards, framed
   buttons, selection buttons, toolbar buttons, SF icons. 1 CSS px = 1 dp/pt. */
@font-face { font-family: "Nunito"; src: url("ui/fonts/nunito.ttf") format("truetype"); font-weight: 200 1000; font-display: block; }
@font-face { font-family: "Source Serif Caption"; src: url("ui/fonts/source_serif_caption_black.ttf") format("truetype"); font-weight: 900; font-display: block; }
:root {
  --ios-blue-accent: #3DB3FF; --ios-selected-rim: #2EA8FF; --ios-slider-blue: #2EA3FF; --ios-cyan: #5AC8FA;
  --ios-mint: #64EBA6; --ios-green: #30D158; --ios-red: #FF453A; --ios-orange: #FF9F0A; --ios-yellow: #FFD60A;
  --ios-purple: #BF5AF2; --ios-brown: #AC8E68; --ios-blue: #0A84FF;
  --game-font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1c1410; color: #fff; font: 15px/1.25 var(--game-font); user-select: none; -webkit-user-select: none; touch-action: none; }
canvas#table { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }
#hud, #hud > .hud-layer { position: fixed; inset: 0; pointer-events: none; }
#hud .hit, #hud button, #hud input { pointer-events: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }

/* billiardPress: scale 0.975, 110 ms ease-out */
.press { transition: transform 110ms cubic-bezier(.4, 0, .2, 1); }
.press:active { transform: scale(.975); }

/* SfIcon: template PNG tinted with currentColor (or --tint). */
.sf { display: inline-block; flex: none; width: 18px; height: 18px; background-color: var(--tint, currentColor);
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }

/* menuBackdrop */
.menu-backdrop { background: linear-gradient(135deg, rgba(0,0,0,.82), rgba(8,31,41,.52), rgba(0,0,0,.92)); }

/* GlassCard (BilliardSelectionSurface). --r radius, --o fillOpacity, --accent for tinted cards. */
.glass { --r: 16px; --o: 1; position: relative; display: flex; align-items: center; justify-content: center; border-radius: var(--r);
  background: linear-gradient(135deg, rgba(14,15,17,calc(.92*var(--o))), rgba(0,0,0,calc(.94*var(--o))));
  border: .7px solid rgba(255,255,255,.16); box-shadow: 0 4px 8px rgba(0,0,0,.55); }
.glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,calc(.055*var(--o))), transparent 48%); }
.glass.selected { background: linear-gradient(135deg, rgba(6,74,128,calc(.98*var(--o))), rgba(3,27,59,calc(.99*var(--o))));
  border: 1.2px solid rgba(46,168,255,.96); box-shadow: 0 6px 12px rgba(46,168,255,.38), 0 3px 8px rgba(0,0,0,.52); }
.glass.selected::after { content: ""; position: absolute; inset: 3px; border-radius: calc(var(--r) - 3px); pointer-events: none;
  border: .55px solid rgba(46,168,255,.34); }
.glass.tinted { background: linear-gradient(135deg, color-mix(in srgb, #0A141E 64%, var(--accent) 36%), color-mix(in srgb, #04090F 84%, var(--accent) 16%));
  border: 1.2px solid color-mix(in srgb, var(--accent) 96%, transparent); box-shadow: 0 6px 12px color-mix(in srgb, var(--accent) 38%, transparent), 0 3px 8px rgba(0,0,0,.52); }
.glass.tinted::after { content: ""; position: absolute; inset: 3px; border-radius: calc(var(--r) - 3px); pointer-events: none;
  border: .55px solid color-mix(in srgb, var(--accent) 34%, transparent); }
.glass.flat { box-shadow: none; }            /* fillOpacity < 0.90: no elevation shadow */
.glass > * { position: relative; }

/* GlossyGlassCard */
.glossy { --r: 16px; position: relative; border-radius: var(--r); background: rgba(0,0,0,.50);
  border: 1.2px solid rgba(255,255,255,.18); box-shadow: 0 12px 24px rgba(0,0,0,.55); }
.glossy::before { content: ""; position: absolute; inset: 1.5px; border-radius: calc(var(--r) - 1.5px); pointer-events: none;
  border: .8px solid rgba(255,255,255,.10); border-right-color: transparent; border-bottom-color: transparent; }

/* FramedButton (BilliardButtonSurface): wood bezel, black groove, glossy blue panel. */
.framed { --r: 18px; --inset: 5px; position: relative; display: flex; min-height: 56px; border-radius: var(--r); padding: 2.8px;
  background: linear-gradient(180deg, #573621, #1F120B 50%, #402414); box-shadow: 0 8px 16px rgba(46,168,255,.34), 0 4px 10px rgba(0,0,0,.72); }
.framed::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.4px; pointer-events: none;
  background: linear-gradient(135deg, rgba(224,212,186,.88), rgba(107,93,79,.75), rgba(0,0,0,.90));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.framed > .groove { flex: 1; display: flex; border-radius: calc(var(--r) - 2.5px); background: #000; padding: max(calc(var(--inset) - 2.8px), 1.8px); }
.framed > .groove > .panel { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 12px; border-radius: calc(var(--r) - var(--inset)); background: linear-gradient(180deg, #054F87, #031F40);
  border: .75px solid rgba(46,168,255,.55); border-top-color: rgba(255,255,255,.45); border-bottom-color: rgba(0,0,0,.65); overflow: hidden; }
.framed > .groove > .panel::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,.10), transparent 50%); }
.framed .title { position: relative; display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 17px; color: #fff; white-space: nowrap; }
.framed .title .sf { width: 19px; height: 19px; }
.framed .detail { position: relative; font-weight: 700; font-size: 12px; color: var(--ios-blue-accent); }
.framed.has-detail { min-height: 64px; }
.framed:disabled, .framed.disabled { opacity: .62; box-shadow: 0 4px 8px rgba(0,0,0,.60); }
.framed:disabled .panel, .framed.disabled .panel { background: linear-gradient(180deg, #282D32, #121519); }
.framed:disabled .title, .framed.disabled .title { color: rgba(255,255,255,.52); }
.framed:disabled .detail, .framed.disabled .detail { color: rgba(255,255,255,.45); }

/* GameButton (BilliardSelectionButton) = .glass + .game-btn */
.game-btn { --r: 14px; min-height: 44px; padding: 10px 14px; gap: 7px; font-weight: 900; font-size: 15px; line-height: 17px; color: #fff; white-space: nowrap; }
.game-btn.compact { padding: 6px 4px; color: rgba(255,255,255,.80); }
.game-btn.compact.selected, .game-btn.compact.tinted { color: #fff; }
.game-btn:disabled { opacity: .56; color: rgba(255,255,255,.56); }

/* ToolButton: 48x48 selected glass, radius 16, full-size toolbar template icon. */
.tool-btn { --r: 16px; width: 48px; height: 48px; flex: none; color: #fff; }
.tool-btn .sf { width: 100%; height: 100%; }
.tool-btn:disabled { opacity: .48; }

/* GameHeading: white -> blue vertical gradient text. */
.heading { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 26px;
  background: linear-gradient(180deg, #fff, var(--ios-blue-accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Loading screen */
#loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #2a1d15, #120c09); z-index: 10; }
.loading-card { width: min(320px, 80vw); text-align: center; }
.loading-title { font-size: 28px; font-weight: 900; margin-bottom: 16px; }
.loading-track { height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
#loading-bar { height: 100%; width: 0; background: var(--ios-blue-accent); transition: width .15s; }
#loading-text { margin-top: 10px; opacity: .7; font-size: 13px; }
/* Menu layer (MenuScreens.kt): home screen and the Local / Players / Multiplayer / Private Games pages. */
.menu-root { position: absolute; inset: 0; line-height: 1.18;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.menu-safe { position: relative; width: 100%; height: 100%; }

/* Home */
.menu-home-scroll { position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; touch-action: pan-y; scrollbar-width: none; }
.menu-home-scroll::-webkit-scrollbar, .menu-content::-webkit-scrollbar { display: none; }
.menu-home { position: relative; height: 100%; }
.menu-title { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; white-space: nowrap;
  font-weight: 900; letter-spacing: -1px; line-height: 1.364;
  background: linear-gradient(180deg, #fff, var(--ios-blue-accent)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 2.5px rgba(0,0,0,.85)); }
.menu-home-buttons { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 620px;
  padding: 14px 20px; display: flex; flex-direction: column; gap: 12px; }
.menu-home-row { display: flex; gap: 12px; }
.menu-home-row > .framed { flex: 1 1 0; min-width: 0; }
.menu-framed { width: 100%; }

/* Header + page column */
.menu-col { position: absolute; inset: 0; padding: 10px 18px; display: flex; flex-direction: column; }
.menu-header { display: flex; align-items: center; gap: 10px; flex: none; }
.menu-header.locked { opacity: .48; }
.menu-spacer { flex: 1; }
/* verticalScroll clips only top/bottom: the scroller spans the column's side padding so card glows are not cut. */
.menu-content { flex: 1 1 0; min-height: 0; align-self: center; box-sizing: content-box; width: 100%; max-width: 1080px; margin: 0 -18px; padding: 12px 18px;
  display: flex; flex-direction: column; gap: 18px; overflow-x: hidden; overflow-y: auto; touch-action: pan-y; scrollbar-width: none; }
.menu-content > * { flex: none; }
.menu-bottom { flex: none; align-self: center; width: 100%; max-width: 1080px; padding: 8px 0; display: flex; }
.menu-error { color: var(--ios-orange); font-size: 14px; font-weight: 600; }

.msec { display: flex; flex-direction: column; }
.menu-section-title { color: rgba(255,255,255,.72); font-size: 13px; font-weight: 700; letter-spacing: 1.1px; }

/* CenterGrid + ChoiceCard */
.cgrid { display: flex; flex-direction: column; align-items: center; width: 100%; }
.cgrid-row { display: flex; justify-content: center; width: 100%; }
.cgrid-cell { flex: none; min-width: 0; }
.choice { --r: 16px; width: 100%; height: 100px; color: #fff; overflow: hidden; }
.choice.compact { height: 80px; }
.choice:disabled { opacity: .56; cursor: default; }
.choice-col { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; min-width: 0; }
.choice-title { width: 100%; padding: 0 6px; font-weight: 700; font-size: 17px; line-height: 19px; text-align: center; overflow: hidden; }
.choice.compact .choice-title { font-size: 15px; line-height: 17px; }
.choice-title.single { white-space: nowrap; }
.choice-title.multi { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; text-overflow: ellipsis; }
.vicon { display: block; flex: none; overflow: hidden; }
.vicon.glass { display: block; }
.vicon-img { display: block; width: 100%; height: 100%; border-radius: inherit; pointer-events: none; }

.menu-pair { display: flex; gap: 10px; }
.menu-unranked { font-size: 17px; font-weight: 700; color: #fff; }

/* GameTextField / CodeEntry */
.menu-code { display: flex; align-items: center; gap: 8px; }
.menu-field { flex: 1 1 0; min-width: 0; width: 100%; min-height: 48px; margin: 0; padding: 11px 14px; border-radius: 14px;
  border: .8px solid rgba(255,255,255,.16); background: linear-gradient(135deg, rgba(14,15,17,.92), rgba(0,0,0,.94));
  color: #fff; caret-color: var(--ios-blue-accent); font: 700 17px/1.18 var(--game-font); outline: none;
  -webkit-appearance: none; appearance: none; user-select: text; -webkit-user-select: text; touch-action: manipulation; }
.menu-field::placeholder { color: rgba(255,255,255,.46); opacity: 1; }
.menu-field.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Droid Sans Mono", monospace; font-weight: 900; }
.menu-field.name { font-size: 20px; font-weight: 400; }

/* Players page */
.menu-players-title { font-size: 22px; font-weight: 900; color: #fff; }
.menu-players-mode { font-size: 13px; font-weight: 900; color: var(--ios-blue-accent); }
.menu-caption { color: rgba(255,255,255,.75); font-size: 13px; font-weight: 700; }
.menu-team { color: rgba(255,255,255,.88); font-size: 15px; font-weight: 900; }
.menu-player-row { display: flex; align-items: center; gap: 12px; }
.menu-number { flex: none; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 900; color: #fff; background: linear-gradient(135deg, #064A80, #031B3B);
  border: 1.4px solid var(--ios-selected-rim); box-shadow: 0 4px 8px rgba(46,168,255,.40); }
.menu-bot { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 10px 14px; gap: 10px; justify-content: flex-start; }
.menu-bot-name { flex: 1; font-size: 20px; font-weight: 700; color: #fff; }
.menu-bot-note { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.56); }

/* MatchmakingSearchBar: the framed surface at radius 20 with a plain blue panel. */
.menu-search { --r: 20px; --inset: 5px; width: 100%; min-height: 65px; }
.menu-search > .groove > .panel { flex-direction: row; gap: 10px; min-height: 56px; padding: 8px 14px; border: 0; }
.menu-search > .groove > .panel::before { display: none; }
.menu-search-status { flex: 1 1 0; min-width: 0; font-size: 15px; font-weight: 700; color: #fff; text-align: left;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.menu-search-time { min-width: 42px; text-align: right; font-size: 14px; font-weight: 700; color: rgba(255,255,255,.72); font-variant-numeric: tabular-nums; }

/* CircularProgressIndicator */
.menu-spinner { display: inline-block; flex: none; border-radius: 50%; border-style: solid; border-color: currentColor currentColor currentColor transparent;
  animation: menu-spin 1s linear infinite; }
@keyframes menu-spin { to { transform: rotate(360deg); } }

/* roomOperation backdrop */
.menu-roomop { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #fff; }
.menu-roomop-label { font-size: 16px; font-weight: 700; }

/* Web sign-in gate (PlayGamesAccountGate layout). */
.signin-wrap { display: flex; align-items: center; justify-content: center; padding: 20px; min-height: 100%; }
.signin-card { width: 100%; max-width: 420px; padding: 24px; flex-direction: column; gap: 14px; text-align: center; }
.signin-tile { width: 68px; height: 68px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
  background: rgba(61,179,255,.16); border: 1px solid rgba(46,168,255,.42); }
.signin-title { font-weight: 900; font-size: 22px; color: #fff; }
.signin-text { font-weight: 600; font-size: 15px; color: rgba(255,255,255,.78); }
.signin-guest { font-weight: 800; font-size: 15px; color: var(--ios-blue-accent); padding: 8px 14px; }
.signin-guest:disabled { opacity: .5; }
.signin-note { font-weight: 600; font-size: 12px; color: rgba(255,255,255,.5); }
/* In-game HUD, controls, tutorial, break decision, game over (PureStrikeScreen.kt). */
.g-root, .g-over { position: absolute; inset: 0; font-family: var(--game-font); line-height: 1.18; color: #fff; }
.g-full { position: absolute; inset: 0; }
/* windowInsetsPadding(safeDrawing) */
.g-safe { position: absolute; top: env(safe-area-inset-top, 0px); right: env(safe-area-inset-right, 0px);
  bottom: env(safe-area-inset-bottom, 0px); left: env(safe-area-inset-left, 0px); }
.g-root .hit { touch-action: none; }
/* GlassCard with a custom accent also honours fillOpacity (base.css ignores --o for tinted cards). */
.g-root .glass.tinted { background: linear-gradient(135deg,
  color-mix(in srgb, color-mix(in srgb, #0A141E 64%, var(--accent) 36%) calc(var(--o) * 100%), transparent),
  color-mix(in srgb, color-mix(in srgb, #04090F 84%, var(--accent) 16%) calc(var(--o) * 100%), transparent)); }

/* ---- tutorialEdgeHighlight: 3px cyan -> white -> blue stroke, pulsing 820 ms ---- */
.g-hl { position: absolute; inset: calc(-1 * var(--ho) - 1.5px); border-radius: calc(var(--hr) + 1.5px); pointer-events: none; display: none; z-index: 1; }
.g-hl.on { display: block; animation: g-hl .82s cubic-bezier(.4, 0, .2, 1) infinite alternate; }
.g-hl::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 3px;
  background: linear-gradient(135deg, rgba(90,200,250,.55), #fff, rgba(10,132,255,.78));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
@keyframes g-hl {
  from { transform: scale(1); box-shadow: 0 0 7px rgba(90,200,250,.48), inset 0 0 5px rgba(90,200,250,.24); }
  to { transform: scale(1.018); box-shadow: 0 0 13px rgba(90,200,250,.80), inset 0 0 8px rgba(90,200,250,.40); }
}

/* ---- TutorialInstruction ---- */
.g-tut-wrap { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: center; }
.g-tut { width: min(100% - 36px, 524px); margin-top: 12px; display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 24px;
  background: rgba(6,16,29,.94); border: 1.2px solid rgba(90,200,250,.44); box-shadow: 0 8px 16px rgba(0,0,0,.45); }
.g-tut.retry { border: 2px solid rgba(255,159,10,.70); }
.g-tut-icon { flex: none; width: 58px; height: 58px; border-radius: 16px; background: rgba(90,200,250,.14); display: flex; align-items: center; justify-content: center; }
.g-tut-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.g-tut-head { display: flex; align-items: center; gap: 10px; }
.g-tut-title { flex: 1; min-width: 0; font-size: 20px; font-weight: 900; }
.g-tut.retry .g-tut-title { color: var(--ios-orange); }
.g-tut-step { flex: none; border-radius: 999px; background: rgba(90,200,250,.12); padding: 5px 9px; font-size: 13px; font-weight: 900; color: var(--ios-cyan); font-variant-numeric: tabular-nums; }
.g-tut-msg { font-size: 15px; line-height: 20px; font-weight: 600; color: rgba(255,255,255,.80); }
.g-tut-dots { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.g-tut-dots i { width: 8px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); }
.g-tut-dots i.on { background: var(--ios-cyan); }
.g-tut-dots i.cur { width: 24px; }

/* ---- TutorialPlacementTargetOverlay ---- */
.g-ring { position: absolute; pointer-events: none; }
.g-ring-pulse { position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(90,200,250,.90);
  animation: g-ring .9s cubic-bezier(.4, 0, .2, 1) infinite alternate; }
.g-ring-pulse i { position: absolute; inset: 4px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.70); }
@keyframes g-ring {
  from { transform: scale(.96); background: rgba(90,200,250,.05); box-shadow: 0 0 7px rgba(90,200,250,.40); }
  to { transform: scale(1.08); background: rgba(90,200,250,.11); box-shadow: 0 0 13px rgba(90,200,250,.68); }
}

/* ---- tutorialCompletedOverlay ---- */
.g-complete { position: absolute; inset: 0; background: rgba(0,0,0,.68); display: flex; align-items: center; justify-content: center; padding: 0 24px; }
.g-complete-card { width: 100%; max-width: 430px; border-radius: 28px; background: rgba(9,19,33,.97); border: 1.2px solid rgba(255,255,255,.22);
  padding: 28px; display: flex; flex-direction: column; align-items: center; gap: 18px; box-shadow: 0 12px 24px rgba(0,0,0,.55); }
.g-complete-badge { position: relative; width: 82px; height: 82px; border-radius: 50%; background: rgba(48,209,88,.18); display: flex; align-items: center; justify-content: center; }
.g-complete-badge i { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: #fff; }
.g-complete-badge .sf { position: relative; }
.g-complete-texts { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.g-complete-title { font-size: 26px; font-weight: 900; }
.g-complete-sub { font-size: 16px; font-weight: 600; color: rgba(255,255,255,.76); }
.g-done { align-self: stretch; height: 52px; border-radius: 16px; background: linear-gradient(90deg, #0A84FF, rgba(90,200,250,.82)); font-size: 17px; font-weight: 900; color: #fff; }

/* ---- Top HUD ---- */
.g-top { position: absolute; top: 0; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; }
.g-top-row { display: flex; align-items: center; width: 100%; }
.g-side { flex: 1 1 0; min-width: 0; display: flex; align-items: center; }
.g-side.left { justify-content: flex-start; text-align: left; }
.g-side.right { justify-content: flex-end; text-align: right; }
.g-side-col { display: flex; flex-direction: column; gap: 3px; max-width: min(100%, 240px); min-width: 0; }
.g-side.compact .g-side-col { gap: 2px; }
.g-side-row { display: flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; }
.g-side.compact .g-side-row { gap: 6px; }
.g-side-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.g-side.left .g-side-col, .g-side.left .g-side-text { align-items: flex-start; }
.g-side.right .g-side-col, .g-side.right .g-side-text { align-items: flex-end; }
.g-side.right:not(.stack) .g-badges { order: 2; }
/* stackHeader: avatar above the names on tight widths */
.g-side.stack .g-side-col { gap: 2px; max-width: 100%; }
.g-side.stack .g-side-row { flex-direction: column; gap: 2px; }
.g-side.stack .g-side-text { gap: 2px; }
.g-side.stack.left .g-side-row { align-items: flex-start; }
.g-side.stack.right .g-side-row { align-items: flex-end; }
.g-badges { display: flex; gap: 5px; flex: none; }
.g-badge { position: relative; flex: none; border-radius: 50%; background: rgba(0,0,0,.66); display: flex; align-items: center; justify-content: center; }
.g-badge::before { content: ""; position: absolute; inset: 0; border-radius: 50%; padding: var(--ring);
  background: linear-gradient(135deg, rgba(255,255,255,.76), rgba(255,255,255,.28));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.g-badge.turn::before { background: linear-gradient(135deg, #52EB7D, #14853D); }
.g-badge > i { position: absolute; border-radius: 50%; background: radial-gradient(circle closest-side, rgba(255,255,255,.12), rgba(0,0,0,.72)); }
.g-badge > b { position: relative; font-family: "Source Serif Caption", serif; font-weight: 900; color: rgba(255,255,255,.94); line-height: 1; white-space: nowrap; }
.g-badge > img { border-radius: 50%; object-fit: cover; }
.g-side-title, .g-side-status, .g-side-info { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 .5px 1.2px rgba(0,0,0,.62); }
.g-side-title { font-weight: 700; color: #fff; }
.g-side-status { letter-spacing: .022em; }
.g-side-info { font-weight: 500; }
.g-side-info.two { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.g-pill { flex: none; display: flex; flex-direction: column; align-items: center; border-radius: 999px; background: rgba(0,0,0,.42);
  border: .7px solid rgba(255,255,255,.16); text-align: center; overflow: hidden; }
.g-pill-1 { font-weight: 700; font-variant-numeric: tabular-nums; white-space: pre-wrap; max-width: 100%; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.g-pill-2 { font-weight: 500; color: rgba(255,255,255,.72); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-clock { display: flex; align-items: center; gap: 4px; margin-top: 1px; font-weight: 700; font-variant-numeric: tabular-nums; }
.g-strip { display: flex; flex-direction: column; align-items: center; }
.g-strip-row { display: flex; align-items: center; justify-content: center; }
.g-strip-foot { color: rgba(48,209,88,.95); font-weight: 600; }
.g-banner { border-radius: 999px; background: rgba(0,0,0,.58); border: .7px solid rgba(255,255,255,.14); padding: 7px 12px;
  color: var(--ios-orange); font-weight: 700; text-align: center; }
.g-bottom-banner { position: absolute; left: 14px; right: 14px; display: flex; justify-content: center; }
.g-bottom-banner span { border-radius: 999px; background: rgba(0,0,0,.45); padding: 6px 12px; font-size: 12px; font-weight: 500; text-align: center; }

/* HudBallBadge */
.g-ball { position: relative; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; flex: none; }
.g-ball i { position: absolute; }
.g-ball .band { left: 0; right: 0; top: 24%; height: 52%; }
.g-ball .vig { inset: 0; }
.g-ball .disc { left: 28%; top: 28%; width: 44%; height: 44%; border-radius: 50%; background: radial-gradient(circle, #fff, #F3F3F5); }
.g-ball .spec { left: 39%; top: 17%; width: 14%; height: 14%; border-radius: 50%; background: rgba(255,255,255,.45); }
.g-ball b { position: relative; color: #111; font-weight: 900; }

/* Call-pocket overlay */
.g-call-col { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px; }
.g-call-title { font-size: 11px; font-weight: 900; color: rgba(255,255,255,.86); }
.g-root .g-call-balls { display: flex; align-items: center; gap: 6px; max-width: 100%; overflow-x: auto; touch-action: pan-x; scrollbar-width: none; }
.g-safety { height: 28px; padding: 0 12px; gap: 5px; font-size: 10px; font-weight: 900; color: rgba(255,255,255,.90); }
.g-call-pockets { display: flex; gap: 5px; width: 100%; }
.g-pocket-btn { flex: 1 1 0; height: 30px; font-size: 11px; font-weight: 900; color: rgba(255,255,255,.84); }
.g-pocket-btn.tinted { color: #fff; }

/* ---- Left tool stack (HudTool) ---- */
.g-tools { position: absolute; left: 14px; display: flex; flex-direction: column; gap: 12px; }
.g-tool-wrap { position: relative; }
.g-menu-backdrop { position: fixed; inset: 0; z-index: 2; }
.g-menu { position: absolute; left: 0; z-index: 3; min-width: 112px; display: flex; flex-direction: column; padding: 8px 0; border-radius: 4px;
  background: rgba(18,22,30,.95); box-shadow: 0 3px 8px rgba(0,0,0,.40); }
.g-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 48px; padding: 0 12px;
  font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap; }
.g-menu-item.cur { color: var(--ios-blue-accent); font-weight: 900; }

/* ---- PowerRail: 44 wide hit area, 18 wide track, fill grows from the bottom ---- */
.g-power { position: absolute; right: 20px; width: 44px; display: flex; justify-content: center; cursor: pointer; }
.g-track { position: relative; width: 18px; height: 100%; border-radius: 4px; overflow: hidden; background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.32); }
.g-track.active { background: rgba(0,0,0,.46); border-color: rgba(255,255,255,.22); }
.g-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(180deg, var(--ios-red), var(--ios-yellow), var(--ios-green)); }
.g-idle { position: absolute; left: 50%; bottom: 11px; width: 4px; height: 34px; margin-left: -2px; border-radius: 2px; background: rgba(255,255,255,.38); }
.g-track.active .g-idle { display: none; }

/* ---- Spin pad, Cue box, rotate, reset ---- */
.g-controls { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: flex-end; width: max-content; }
.g-ctl { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.g-ctl-label { font-size: 12px; font-weight: 700; color: #fff; }
.g-spin { position: relative; border-radius: 50%; border: 1.2px solid rgba(255,255,255,.88); box-shadow: 0 2px 4px rgba(0,0,0,.30); overflow: hidden; cursor: pointer; }
.g-spin i { position: absolute; pointer-events: none; }
.g-spin .rim { inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.16); }
.g-spin .sheen { left: 4%; top: 10%; width: 70%; height: 48%; border-radius: 50%; background: linear-gradient(to bottom right, rgba(255,255,255,.92), rgba(255,255,255,.12)); }
.g-spin .h { left: 14%; right: 14%; top: 50%; height: 1px; margin-top: -.5px; background: repeating-linear-gradient(90deg, rgba(0,0,0,.16) 0 2.5px, transparent 2.5px 5px); }
.g-spin .v { top: 14%; bottom: 14%; left: 50%; width: 1px; margin-left: -.5px; background: repeating-linear-gradient(180deg, rgba(0,0,0,.16) 0 2.5px, transparent 2.5px 5px); }
.g-spin .dot { left: 50%; top: 50%; width: 18%; height: 18%; transform: translate(-50%, -50%); border-radius: 50%; background: #088CFA;
  box-shadow: 0 1px 0 rgba(8,140,250,.35), 0 0 0 .5px rgba(255,255,255,.70), inset 0 0 0 .5px rgba(255,255,255,.70); }
.g-cue { position: relative; border-radius: 10px; background: rgba(0,0,0,var(--scrim, .10)); border: 1.2px solid rgba(255,255,255,var(--line, .35)); overflow: hidden; cursor: pointer; }
.g-cue i { position: absolute; pointer-events: none; background: rgba(255,255,255,var(--line, .35)); }
.g-cue .h { left: 0; right: 0; top: 50%; height: 1px; margin-top: -.5px; }
.g-cue .v { top: 0; bottom: 0; left: 50%; width: 1px; margin-left: -.5px; }
.g-btns { display: flex; align-items: flex-end; gap: 10px; }
.g-rot { display: flex; flex-direction: column; gap: 10px; }
.g-rot-btn { flex-direction: column; font-size: 10px; line-height: 11px; font-weight: 700; color: #fff; }

/* ---- BreakDecisionCard ---- */
.g-break-wrap { position: absolute; top: 0; left: 0; right: 0; padding-left: 88px; padding-right: 72px; display: flex; justify-content: center; }
.g-break { width: 100%; max-width: 292px; }
.g-break-col { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 10px 12px; text-align: center; }
.g-break-title { font-size: 12px; font-weight: 900; color: rgba(255,255,255,.92); }
.g-break-sub { font-size: 10px; font-weight: 600; color: rgba(255,255,255,.66); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.g-break-choices { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.g-break-btn { width: 100%; min-height: 32px; padding: 0 4px; gap: 5px; font-size: 11px; font-weight: 900; color: rgba(255,255,255,.94); text-align: center; }
.g-break-wait { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.76); }

/* ---- Pocket Cam panel: the card background has a hole where the GL preview is drawn ---- */
.g-pocket-wrap { position: absolute; left: 18px; right: 18px; display: flex; justify-content: center; }
.g-pocket-card { position: relative; }
.g-pocket-bg { position: absolute; inset: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='10'/%3E%3C/svg%3E") left 8px bottom 8px / calc(100% - 16px) var(--ph) no-repeat, linear-gradient(#000 0 0);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='10'/%3E%3C/svg%3E") left 8px bottom 8px / calc(100% - 16px) var(--ph) no-repeat, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; }
.g-pocket-col { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; }
.g-pocket-head { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.g-skip { padding: 6px 10px; gap: 4px; font-size: 11px; font-weight: 900; color: #fff; }
.g-pocket-view { border-radius: 10px; border: 1px solid rgba(255,255,255,.35); }

/* ---- GameOverOverlay ---- */
.g-over { background: linear-gradient(180deg, rgba(0,0,0,.88), rgba(0,0,0,.70)); display: flex; align-items: center; justify-content: center;
  padding: calc(20px + env(safe-area-inset-top, 0px)) calc(20px + env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) calc(20px + env(safe-area-inset-left, 0px)); }
.g-over-card { width: 100%; max-width: 520px; max-height: 100%; }
.g-over-col { width: 100%; max-height: calc(100vh - 40px); overflow-y: auto; touch-action: pan-y; pointer-events: auto; scrollbar-width: none;
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px; text-align: center; }
.g-over-kicker { font-size: 16px; font-weight: 900; letter-spacing: 1.2px; color: rgba(255,255,255,.66); }
.g-over-reason { font-size: 18px; font-weight: 700; color: rgba(255,255,255,.76); }
.g-ranked { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px; border-radius: 18px;
  background: rgba(0,0,0,.28); border: .7px solid rgba(255,255,255,.14); }
.g-ranked-title { font-size: 22px; font-weight: 900; }
.g-ranked-delta { font-size: 44px; font-weight: 900; font-variant-numeric: tabular-nums; }
.g-ranked-rating { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.g-ranked-tier { font-size: 14px; font-weight: 900; color: var(--ios-yellow); }
.g-over-row { align-self: stretch; display: flex; gap: 12px; }
/* Settings, pause, online lobby, friends, ladder (SettingsPanel.kt, SocialScreens.kt). */

/* A full page of this layer replaces the menu page, as in Compose where only one page is composed:
   hide the menu layer (the layer right below) while one is shown. */
#hud > .hud-layer:has(+ .hud-layer > .pn-covers) { visibility: hidden; }

/* Layout primitives: Column / Row with the Compose defaults used here. Text uses SwiftUI's natural leading. */
.pn-col { display: flex; flex-direction: column; min-width: 0; }
.pn-row { display: flex; flex-direction: row; align-items: center; min-width: 0; }
.pn-wide { width: 100%; }
.pn-center { width: 100%; margin-left: auto; margin-right: auto; }
.pn-t { line-height: 1.18; color: #fff; min-width: 0; }
.pn-tnum { font-variant-numeric: tabular-nums; }
.pn-mono { font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace; }
.pn-one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-two-lines { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.pn-section-title { font-size: 13px; font-weight: 700; letter-spacing: 1.1px; line-height: 1.18; color: rgba(255,255,255,.72); }
.pn-page .heading, .pn-pause .heading { line-height: 1.18; filter: drop-shadow(0 3px 4px rgba(7,30,50,.6)); }
.pn-page .glass, .pn-pause .glass, .pn-dialog .glass { flex: none; }
.pn-page .game-btn > span:last-child, .pn-pause .game-btn > span:last-child, .pn-dialog .game-btn > span:last-child { overflow: hidden; }

/* Pages (MenuScreens: backdrop, safe area, 18 x 10 padding, header row, scrolling column). */
.pn-page { position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.pn-page-col { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 10px 18px; }
.pn-scroll { flex: 1; min-height: 0; width: 100%; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; overscroll-behavior: contain;
  scrollbar-width: none; }
.pn-scroll::-webkit-scrollbar, .pn-chips::-webkit-scrollbar { display: none; }
.pn-enter { animation: pn-enter 220ms cubic-bezier(.4, 0, .2, 1); }
@keyframes pn-enter { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }

/* Room operation cover ("Creating private room…"). */
.pn-cover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pn-cover-col { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* CircularProgressIndicator */
.pn-spin { display: inline-block; flex: none; box-sizing: border-box; border-radius: 50%; border-style: solid; border-color: currentColor;
  border-right-color: transparent; animation: pn-spin 1s linear infinite; }
@keyframes pn-spin { to { transform: rotate(360deg); } }

/* Dialogs (Compose Dialog: dimmed window, card centred). */
.pn-dialog { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0,0,0,.6);
  animation: pn-fade 150ms ease-out; }
@keyframes pn-fade { from { opacity: 0; } to { opacity: 1; } }
.pn-dialog-card { width: 100%; max-height: 100%; overflow-y: auto; touch-action: pan-y; }
.pn-flag { width: 72px; height: 72px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,69,58,.18); border: 1.2px solid rgba(255,69,58,.72); box-shadow: 0 10px 20px rgba(255,69,58,.30); }

/* FriendDecisionButton: tint 28% fill, tint 70% border, radius 12, min height 44. */
.pn-decide { min-height: 44px; padding: 10px 16px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--tint) 28%, transparent); border: 1px solid color-mix(in srgb, var(--tint) 70%, transparent);
  font-weight: 900; font-size: 15px; line-height: 1.18; color: #fff; white-space: nowrap; }
.pn-decide:disabled { opacity: .5; }

/* GameTextField */
.pn-field { flex: 1; min-width: 0; min-height: 48px; padding: 11px 14px; border-radius: 14px; border: .8px solid rgba(255,255,255,.16);
  background: linear-gradient(135deg, rgba(14,15,17,.92), rgba(0,0,0,.94)); color: #fff; font-family: var(--game-font); line-height: 1.18;
  caret-color: var(--ios-blue-accent); outline: none; user-select: text; -webkit-user-select: text; touch-action: manipulation; }
.pn-field.pn-mono { font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace; }
.pn-field::placeholder { color: rgba(255,255,255,.46); opacity: 1; }

/* Settings */
.pn-icon-tile { --r: 15px; width: 46px; height: 46px; flex: none; }
.pn-slider { position: relative; flex: 1; min-width: 0; height: 44px; touch-action: none; cursor: pointer; }
.pn-slider-track { position: absolute; left: 0; right: 0; top: 50%; height: 8px; margin-top: -4px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; }
.pn-slider-fill { height: 100%; width: 0; border-radius: 4px; background: var(--ios-slider-blue); }
.pn-slider-thumb { position: absolute; top: 50%; left: 0; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.5); pointer-events: none; }
.pn-swatches { display: flex; gap: 14px; padding: 8px; border-radius: 15px; background: rgba(0,0,0,.34); }
.pn-swatch { position: relative; flex: 1; min-width: 0; aspect-ratio: 2; border-radius: 10px; overflow: hidden;
  background-color: var(--tint); background-size: 200% 400%; background-position: 25% 83.333%;
  box-shadow: 0 1px 3px rgba(0,0,0,.6); }
.pn-swatch::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.09), transparent 50%, rgba(0,0,0,.20)); }
.pn-swatch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: .8px solid color-mix(in srgb, var(--tint) 68%, transparent); }
.pn-swatch.chosen { box-shadow: 0 4px 10px rgba(46,168,255,.45), 0 2px 5px rgba(0,0,0,.5); }
.pn-swatch.chosen::after { border: 2px solid var(--ios-selected-rim); }
.pn-swatch-inner { position: absolute; inset: 3px; border-radius: 7px; border: .8px solid rgba(46,168,255,.65); }
.pn-signin-slot:empty { display: none; }

/* Pause card */
.pn-pause { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.62);
  padding: calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + 20px) calc(env(safe-area-inset-bottom) + 8px) calc(env(safe-area-inset-left) + 20px); }
.pn-pause-card { width: 100%; max-width: 340px; max-height: 100%; overflow: hidden; align-items: stretch; }
.pn-pause-card > .pn-scroll { flex: 0 1 auto; }

/* Friends */
.pn-code-card { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 22px; position: relative;
  background: linear-gradient(135deg, #0E384F, #081F36 50%, #06121F); box-shadow: 0 8px 16px rgba(0,0,0,.33); }
.pn-code-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(166,224,255,.60), rgba(166,224,255,.15));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.pn-copy-hit { min-height: 44px; display: flex; align-items: center; }
.pn-copy-pill { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: rgba(0,0,0,.25);
  border: 1px solid rgba(166,224,255,.35); color: #A6E0FF; font-weight: 700; font-size: 14px; line-height: 1.18; }
.pn-code-box { padding: 13px 8px; border-radius: 13px; background: rgba(0,0,0,.26); border: .8px solid rgba(166,224,255,.17); }
.pn-code-box > .pn-fit { text-align: center; font-weight: 600; text-overflow: clip; }
.pn-badge { width: 26px; height: 26px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--ios-orange); color: #000; font-weight: 700; font-size: 13px; }
.pn-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; }
.pn-avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; }
.pn-actions { position: relative; flex: none; }
.pn-ellipsis { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.pn-ellipsis:active { background: rgba(255,255,255,.10); }
.pn-popup { position: absolute; right: 0; bottom: 0; width: 196px; z-index: 5; }
.glass:has(.pn-popup) { z-index: 5; }
/* Outgoing request (BoxWithConstraints: row from 320 wide, column below). */
.pn-outgoing-box { container-type: inline-size; padding: 10px 14px; }
.pn-outgoing { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 44px; }
@container (max-width: 319.9px) { .pn-outgoing > * { flex: 1 1 100% !important; } }

/* Lobby: Team A / Team B side by side from 380 wide. */
.pn-teams { display: flex; gap: 10px; align-items: flex-start; }
@media (max-width: 415.9px) { .pn-teams { flex-direction: column; align-items: stretch; } }

/* Ladder */
.pn-ladder { flex: 1; min-height: 0; }
.pn-chips { display: flex; gap: 8px; flex: none; overflow-x: auto; overflow-y: hidden; touch-action: pan-x; scrollbar-width: none;
  padding: 8px 0 14px; margin: -8px 0 -14px; }
.pn-variant { display: block; flex: none; object-fit: contain; -webkit-user-drag: none; }

/* Online setup page */
.pn-grid { display: flex; flex-wrap: wrap; justify-content: center; width: 100%; }
.pn-choice { flex: none; padding: 0; color: #fff; }
.pn-choice:disabled { opacity: .56; }
.pn-search { display: flex; width: 100%; }
.pn-search > .groove > .panel { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; min-height: 56px; padding: 8px 14px; }
.pn-search > .groove > .panel > * { position: relative; }
