:root {
  --gdnf-safe-top: env(safe-area-inset-top, 0px);
  --gdnf-safe-right: env(safe-area-inset-right, 0px);
  --gdnf-safe-bottom: env(safe-area-inset-bottom, 0px);
  --gdnf-safe-left: env(safe-area-inset-left, 0px);
  --gdnf-edge-guard: 32px;
  --gdnf-mobile-topbar: calc(48px + var(--gdnf-safe-top));
}

html.gdnf-mobile,
html.gdnf-mobile body {
  width: 100%;
  min-height: var(--gdnf-vv-height, 100dvh);
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

html.gdnf-mobile body {
  -webkit-tap-highlight-color: transparent;
}

html.gdnf-mobile button,
html.gdnf-mobile a,
html.gdnf-mobile label,
html.gdnf-mobile select {
  touch-action: manipulation;
}

html.gdnf-mobile input,
html.gdnf-mobile textarea,
html.gdnf-mobile select {
  font-size: max(16px, 1em);
}

.mobile-nav-toggle {
  display: none;
}

html.gdnf-mobile .mobile-nav-toggle {
  position: relative;
  z-index: 3;
  width: 52px;
  min-width: 52px;
  height: 48px;
  display: grid;
  place-content: center;
  gap: 5px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-left: 1px solid currentColor;
  background: transparent;
  color: inherit;
}

html.gdnf-mobile .mobile-nav-toggle span {
  width: 20px;
  height: 2px;
  display: block;
  background: currentColor;
  transition: transform 160ms ease, opacity 160ms ease;
}

html.gdnf-mobile .mobile-nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
html.gdnf-mobile .mobile-nav-toggle.is-open span:nth-child(2) { opacity: 0; }
html.gdnf-mobile .mobile-nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

html.gdnf-mobile .utility-bar,
html.gdnf-mobile .duel-topbar,
html.gdnf-mobile .conclave-topbar {
  height: var(--gdnf-mobile-topbar);
  min-height: var(--gdnf-mobile-topbar);
  align-items: flex-end;
  padding: var(--gdnf-safe-top) 0 0 max(14px, var(--gdnf-safe-left));
}

html.gdnf-mobile .utility-brand,
html.gdnf-mobile .duel-brand,
html.gdnf-mobile .conclave-brand {
  min-width: 0;
  max-width: calc(100vw - 70px - var(--gdnf-safe-left) - var(--gdnf-safe-right));
  height: 48px;
  display: flex !important;
  align-items: center;
  padding: 0 10px 0 0;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.gdnf-mobile .mobile-nav-panel {
  position: fixed;
  z-index: 140;
  top: var(--gdnf-mobile-topbar);
  right: var(--gdnf-safe-right);
  left: var(--gdnf-safe-left);
  max-height: calc(var(--gdnf-vv-height, 100dvh) - var(--gdnf-mobile-topbar) - var(--gdnf-safe-bottom));
  display: none;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px;
  border-bottom: 1px solid currentColor;
  background: color-mix(in srgb, var(--paper, #08090b) 96%, transparent);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  backdrop-filter: blur(18px);
}

html.gdnf-mobile body.mobile-nav-open .mobile-nav-panel {
  display: grid;
  animation: mobile-panel-in 150ms ease-out both;
}

@keyframes mobile-panel-in {
  from { opacity: 0; transform: translateY(-8px); }
}

html.gdnf-mobile .utility-actions.mobile-nav-panel,
html.gdnf-mobile .duel-topbar-actions.mobile-nav-panel,
html.gdnf-mobile .conclave-topbar__status.mobile-nav-panel {
  align-items: stretch;
  gap: 8px;
}

html.gdnf-mobile .mobile-nav-panel > *,
html.gdnf-mobile .mobile-nav-panel .utility-button,
html.gdnf-mobile .mobile-nav-panel .utility-link,
html.gdnf-mobile .mobile-nav-panel .duel-menu-link,
html.gdnf-mobile .mobile-nav-panel .llm-provider-picker {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid currentColor;
  background: transparent;
  font-size: 10px;
  text-decoration: none;
}

html.gdnf-mobile .mobile-nav-panel .llm-provider-picker {
  align-items: stretch;
  flex-direction: column;
  gap: 6px;
}

html.gdnf-mobile .mobile-nav-panel .llm-provider-picker > span { display: block; }
html.gdnf-mobile .mobile-nav-panel .llm-provider-picker select { width: 100%; max-width: none; }

html.gdnf-mobile .app-shell,
html.gdnf-mobile .duel-shell,
html.gdnf-mobile .conclave-shell,
html.gdnf-mobile main {
  min-height: var(--gdnf-vv-height, 100dvh);
  height: var(--gdnf-vv-height, 100dvh);
}

html.gdnf-mobile .conclave-shell {
  padding-top: var(--gdnf-mobile-topbar);
}

html.gdnf-mobile .screen,
html.gdnf-mobile .duel-screen,
html.gdnf-mobile .conclave-screen {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-padding-bottom: calc(88px + var(--gdnf-safe-bottom));
}

html.gdnf-mobile .screen,
html.gdnf-mobile .duel-screen {
  top: var(--gdnf-mobile-topbar);
  bottom: max(var(--author-contact-height, 0px), var(--gdnf-safe-bottom));
}

html.gdnf-mobile .conclave-screen {
  height: calc(var(--gdnf-vv-height, 100dvh) - var(--gdnf-mobile-topbar));
  min-height: 0;
}

html.gdnf-mobile .author-contact {
  min-height: calc(30px + var(--gdnf-safe-bottom));
  height: calc(30px + var(--gdnf-safe-bottom));
  padding-bottom: var(--gdnf-safe-bottom);
  font-size: 8px;
}

html.gdnf-mobile body.mobile-game-active .utility-bar,
html.gdnf-mobile body.mobile-game-active .duel-topbar,
html.gdnf-mobile body.mobile-game-active .conclave-topbar,
html.gdnf-mobile body.mobile-game-active .author-contact {
  display: none;
}

html.gdnf-mobile body.mobile-game-active .screen,
html.gdnf-mobile body.mobile-game-active .duel-screen {
  inset: 0;
}

html.gdnf-mobile body.mobile-game-active .conclave-shell {
  padding-top: 0;
}

html.gdnf-mobile body.mobile-game-active .conclave-arena-screen {
  width: 100%;
  height: var(--gdnf-vv-height, 100dvh);
  min-height: 0;
}

html.gdnf-mobile body.mobile-game-active,
html.gdnf-mobile body.mobile-game-active .screen--arena,
html.gdnf-mobile body.mobile-game-active .duel-arena-screen,
html.gdnf-mobile body.mobile-game-active .conclave-arena-screen,
html.gdnf-mobile body.mobile-game-active canvas {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

/* Main menu and single-player flow */
html.gdnf-mobile .screen--void .void-copy {
  top: 46%;
  left: max(18px, var(--gdnf-safe-left));
  width: calc(100vw - max(36px, var(--gdnf-safe-left) + var(--gdnf-safe-right) + 24px));
}

html.gdnf-mobile .screen--void .button-row,
html.gdnf-mobile .selection-footer,
html.gdnf-mobile .pause-actions {
  gap: 10px;
}

html.gdnf-mobile .primary-button,
html.gdnf-mobile .secondary-button,
html.gdnf-mobile .text-button {
  min-height: 48px;
}

html.gdnf-mobile .screen--gods,
html.gdnf-mobile .screen--altar,
html.gdnf-mobile .screen--debrief {
  padding: 58px max(16px, var(--gdnf-safe-left)) calc(58px + var(--gdnf-safe-bottom)) max(16px, var(--gdnf-safe-right));
}

html.gdnf-mobile[data-mobile-orientation="portrait"] .screen--gods .selection-footer {
  position: fixed;
  z-index: 1000;
  right: 0;
  bottom: 0;
  left: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 18px max(16px, var(--gdnf-safe-right)) calc(14px + var(--gdnf-safe-bottom)) max(16px, var(--gdnf-safe-left));
  background: linear-gradient(180deg, transparent, var(--paper) 18px);
}

html.gdnf-mobile[data-mobile-orientation="portrait"] .screen--gods .selection-footer .primary-button {
  width: 100%;
  min-height: 54px;
}

html.gdnf-mobile .screen--debrief {
  height: auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 30px;
  padding-bottom: calc(116px + var(--gdnf-safe-bottom));
}

html.gdnf-mobile .screen--debrief .debrief-layout {
  display: block;
}

html.gdnf-mobile .screen--debrief h2 {
  max-width: 12ch;
  margin: 10px 0 14px;
  font-size: clamp(38px, 11vw, 62px);
  line-height: .9;
}

html.gdnf-mobile .screen--debrief .debrief-copy {
  margin: 14px 0 22px;
  font-size: 11px;
  line-height: 1.55;
}

html.gdnf-mobile .screen--debrief #return-altar-button {
  position: fixed;
  z-index: 80;
  right: max(14px, var(--gdnf-safe-right));
  bottom: calc(42px + var(--gdnf-safe-bottom));
  left: max(14px, var(--gdnf-safe-left));
  width: auto;
  min-height: 54px;
  box-shadow: 0 -12px 30px color-mix(in srgb, var(--paper) 82%, transparent);
}

html.gdnf-mobile .screen--debrief .debrief-metrics {
  margin-top: 24px;
}

html.gdnf-mobile .screen--debrief .debrief-path {
  height: 180px;
  margin-top: 24px;
}

html.gdnf-mobile .god-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 2px 0 12px;
}
html.gdnf-mobile .god-grid::-webkit-scrollbar { display: none; }
html.gdnf-mobile .god-card,
html.gdnf-mobile .god-card:nth-child(n) {
  min-width: min(82vw, 360px);
  min-height: 410px;
  flex: 0 0 min(82vw, 360px);
  border: 1px solid var(--ink);
  scroll-snap-align: center;
}

html.gdnf-mobile .screen--altar {
  height: auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 30px;
  padding-bottom: calc(64px + var(--gdnf-safe-bottom));
}

html.gdnf-mobile .screen--altar .altar-header h2 {
  font-size: clamp(34px, 10vw, 52px);
  line-height: .92;
}

html.gdnf-mobile .altar-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

html.gdnf-mobile .altar-panel,
html.gdnf-mobile .altar-panel--actions {
  width: 100%;
  min-height: 0;
  border: 1px solid var(--ink);
}

html.gdnf-mobile .altar-panel--actions {
  position: static;
  order: 3;
  padding-bottom: max(18px, var(--gdnf-safe-bottom));
  background: transparent;
  backdrop-filter: none;
}

html.gdnf-mobile .altar-panel--actions .edict-preview {
  min-height: 0;
  padding: 18px 0;
}

html.gdnf-mobile .altar-panel--actions .edict-preview strong {
  font-size: clamp(22px, 7vw, 34px);
}

html.gdnf-mobile .offer-actions {
  grid-template-columns: 1fr;
}

html.gdnf-mobile .offer-actions .secondary-button,
html.gdnf-mobile .offer-actions .row-action {
  width: 100%;
  min-width: 0;
  min-height: 48px;
}

html.gdnf-mobile .ability-row-head {
  flex-wrap: wrap;
}

html.gdnf-mobile .ability-row-head .row-action {
  min-height: 44px;
  padding: 10px 0;
}
html.gdnf-mobile .controls-copy { display: none; }

/* Duel and conclave menus */
html.gdnf-mobile #duel-lobby.is-active,
html.gdnf-mobile .duel-verdict.is-active,
html.gdnf-mobile #conclave-lobby.is-active,
html.gdnf-mobile .conclave-verdict.is-active {
  display: block;
}

html.gdnf-mobile .duel-lobby-copy,
html.gdnf-mobile .conclave-manifesto {
  min-height: auto;
  padding: 34px max(18px, var(--gdnf-safe-left)) 26px max(18px, var(--gdnf-safe-right));
}

html.gdnf-mobile #duel-lobby,
html.gdnf-mobile #conclave-lobby,
html.gdnf-mobile .duel-verdict,
html.gdnf-mobile .conclave-verdict {
  grid-template-columns: 1fr;
}

html.gdnf-mobile .duel-lobby-copy h1,
html.gdnf-mobile .conclave-manifesto h1 {
  font-size: clamp(52px, 17vw, 86px);
}

html.gdnf-mobile .duel-config,
html.gdnf-mobile .conclave-config,
html.gdnf-mobile .duel-verdict > div,
html.gdnf-mobile .duel-interpretation,
html.gdnf-mobile .conclave-verdict__summary,
html.gdnf-mobile .conclave-interpretation {
  padding: 28px max(16px, var(--gdnf-safe-left)) calc(68px + var(--gdnf-safe-bottom)) max(16px, var(--gdnf-safe-right));
}

html.gdnf-mobile .duel-choice-grid,
html.gdnf-mobile .duel-vessel-grid,
html.gdnf-mobile .conclave-choice-grid,
html.gdnf-mobile .conclave-vessel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 0;
  overflow: visible;
  scrollbar-width: auto;
  min-width: 0;
}

html.gdnf-mobile .duel-option,
html.gdnf-mobile .conclave-option {
  min-height: 102px;
  min-width: 0;
  width: 100%;
  flex: 0 0 auto;
}

html.gdnf-mobile .duel-loadout,
html.gdnf-mobile .conclave-loadout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  overflow: visible;
  padding: 0;
  min-width: 0;
}

html.gdnf-mobile .duel-theorem,
html.gdnf-mobile .conclave-theorem {
  min-width: 0;
  width: 100%;
  min-height: 124px;
  flex: 0 0 auto;
}

html.gdnf-mobile .duel-room-actions,
html.gdnf-mobile .conclave-entry__primary,
html.gdnf-mobile .conclave-join-row {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 10px;
}
html.gdnf-mobile .duel-room-actions > span { display: none; }
html.gdnf-mobile .duel-room-actions label { grid-column: auto; }
html.gdnf-mobile .duel-room-actions input,
html.gdnf-mobile .conclave-join-row input,
html.gdnf-mobile #conclave-name {
  min-height: 52px;
}

html.gdnf-mobile .conclave-room,
html.gdnf-mobile .duel-waiting {
  padding: 30px max(16px, var(--gdnf-safe-left)) calc(56px + var(--gdnf-safe-bottom)) max(16px, var(--gdnf-safe-right));
}
html.gdnf-mobile .conclave-room__actions {
  position: static;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 12px 0 max(12px, var(--gdnf-safe-bottom));
  background: linear-gradient(transparent, rgba(7, 8, 10, .86));
}
html.gdnf-mobile .conclave-seats { grid-template-columns: 1fr; }
html.gdnf-mobile .conclave-seat { min-height: 150px; }

html.gdnf-mobile .conclave-room__header {
  flex-wrap: wrap;
  gap: 16px;
}

html.gdnf-mobile .conclave-room__header h2 {
  font-size: clamp(32px, 10vw, 52px);
}

/* In-arena touch UI */
.mobile-game-ui {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--gdnf-vv-height, 100dvh);
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.mobile-game-ui[hidden] { display: none !important; }
.mobile-game-ui.is-gameplay-locked { z-index: 10; }
.mobile-game-ui.is-gameplay-locked .mobile-control-zone,
.mobile-game-ui.is-gameplay-locked .mobile-action-cluster,
.mobile-game-ui.is-gameplay-locked .mobile-pause-button { display: none; }

.mobile-control-zone {
  position: absolute;
  bottom: calc(max(18px, var(--gdnf-safe-bottom)) + 4px);
  width: min(43vw, 390px);
  height: min(52vh, 390px);
  pointer-events: auto;
  touch-action: none;
}
.mobile-control-zone--move {
  left: calc(max(var(--gdnf-edge-guard), var(--gdnf-safe-left)) + 4px);
}
.mobile-control-zone--aim {
  right: calc(max(var(--gdnf-edge-guard), var(--gdnf-safe-right)) + 4px);
}

.mobile-stick-base {
  --stick-x: 50%;
  --stick-y: 68%;
  position: absolute;
  left: var(--stick-x);
  top: var(--stick-y);
  width: clamp(98px, 16vw, 132px);
  height: clamp(98px, 16vw, 132px);
  transform: translate(-50%, -50%);
  border: 1px solid rgba(242, 240, 232, .3);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 240, 232, .1), rgba(5, 6, 8, .22) 68%, transparent 70%);
  opacity: .64;
  transition: opacity 120ms ease;
  pointer-events: none;
}
.mobile-stick-base.is-active { opacity: 1; }
.mobile-stick-base::before,
.mobile-stick-base::after {
  position: absolute;
  content: '';
  background: rgba(242, 240, 232, .12);
}
.mobile-stick-base::before { top: 50%; right: 12px; left: 12px; height: 1px; }
.mobile-stick-base::after { top: 12px; bottom: 12px; left: 50%; width: 1px; }
.mobile-stick-base > span {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  width: max-content;
  transform: translateX(-50%);
  color: rgba(242, 240, 232, .58);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .12em;
}
.mobile-stick-knob {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: clamp(44px, 7.5vw, 58px);
  height: clamp(44px, 7.5vw, 58px);
  margin: clamp(-29px, -3.75vw, -22px) 0 0 clamp(-29px, -3.75vw, -22px);
  border: 2px solid rgba(242, 240, 232, .76);
  border-radius: 50%;
  background: rgba(255, 79, 0, .42);
  box-shadow: 0 0 24px rgba(255, 79, 0, .26);
  will-change: transform;
}

.mobile-action-cluster {
  position: absolute;
  z-index: 3;
  right: calc(max(var(--gdnf-edge-guard), var(--gdnf-safe-right)) + min(2vw, 18px));
  bottom: calc(max(18px, var(--gdnf-safe-bottom)) + min(34vh, 260px));
  width: min(38vw, 330px);
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: flex-end;
  gap: clamp(7px, 1.4vw, 12px);
  pointer-events: none;
}

.mobile-action-button {
  --action-ready: 1;
  position: relative;
  width: clamp(52px, 8.5vw, 70px);
  height: clamp(52px, 8.5vw, 70px);
  display: grid;
  place-content: center;
  gap: 2px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(242, 240, 232, .46);
  border-radius: 50%;
  background: rgba(5, 6, 8, .74);
  color: #f2f0e8;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  touch-action: none;
}
.mobile-action-button::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  content: '';
  transform: scaleX(var(--action-ready));
  transform-origin: left;
  background: #ff4f00;
}
.mobile-action-button b { font-size: clamp(10px, 1.8vw, 14px); }
.mobile-action-button span { color: rgba(242, 240, 232, .58); font-size: 6px; }
.mobile-action-button.is-pressed { transform: scale(.9); background: #ff4f00; color: #08090b; }
.mobile-action-button:disabled {
  opacity: .42;
  pointer-events: auto;
  filter: saturate(.55);
}
.mobile-action-button--dash { width: clamp(62px, 10vw, 82px); height: clamp(62px, 10vw, 82px); }
.mobile-action-button--interact { border-radius: 20px; }
.mobile-action-button--ultimate { border-color: #ff4f00; }

.mobile-pause-button {
  position: absolute;
  z-index: 7;
  top: max(12px, var(--gdnf-safe-top));
  right: max(18px, var(--gdnf-safe-right));
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  border: 1px solid rgba(242, 240, 232, .35);
  border-radius: 50%;
  background: rgba(5, 6, 8, .7);
  pointer-events: auto;
  touch-action: manipulation;
}
.mobile-pause-button.has-match-status {
  width: 104px;
  padding: 0 9px;
  border-radius: 12px;
  background: rgba(5, 6, 8, .62);
  backdrop-filter: blur(7px);
}
.mobile-pause-glyph { display: flex; gap: 4px; flex: 0 0 auto; }
.mobile-pause-glyph > i { width: 3px; height: 16px; background: #f2f0e8; }
.mobile-pause-status { min-width: 0; flex: 1; display: grid; gap: 5px; }
.mobile-pause-status[hidden] { display: none; }
.mobile-pause-status > span { display: grid; grid-template-columns: 24px 1fr; gap: 4px; align-items: center; }
.mobile-pause-status > span > b { color: #f2f0e8; font-size: 6px; line-height: 1; text-align: right; }
.mobile-pause-status > span > i { height: 3px; display: block; overflow: hidden; background: rgba(242, 240, 232, .14); }
.mobile-pause-status > span > i > b { display: block; width: 0; height: 100%; transition: width .15s linear; }
.mobile-pause-status .is-stage > b { background: #42cfff; }
.mobile-pause-status .is-threat > b { background: #ff653f; }

.mobile-match-menu,
.mobile-orientation-gate {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(18px, var(--gdnf-safe-top)) max(18px, var(--gdnf-safe-right)) max(18px, var(--gdnf-safe-bottom)) max(18px, var(--gdnf-safe-left));
  background: rgba(5, 6, 8, .76);
  backdrop-filter: blur(13px);
  pointer-events: auto;
  touch-action: manipulation;
}
.mobile-match-menu[hidden],
.mobile-orientation-gate[hidden] { display: none !important; }
.mobile-match-menu__panel,
.mobile-orientation-gate > div {
  width: min(440px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: clamp(20px, 5vw, 34px);
  border: 1px solid rgba(242, 240, 232, .48);
  background: #08090b;
  color: #f2f0e8;
  max-height: min(92dvh, calc(var(--gdnf-vv-height, 100dvh) - 24px));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 10px 10px 0 #ff4f00;
}
.mobile-match-menu p,
.mobile-orientation-gate p { margin: 0; color: #ff4f00; font-size: 9px; letter-spacing: .14em; }
.mobile-match-menu strong,
.mobile-orientation-gate strong { font-family: var(--display, sans-serif); font-size: clamp(31px, 8vw, 52px); line-height: .9; }
.mobile-match-menu span,
.mobile-orientation-gate span { color: rgba(242, 240, 232, .64); font-size: 10px; line-height: 1.55; }
.mobile-match-status { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; border: 1px solid rgba(242, 240, 232, .15); background: rgba(255, 255, 255, .025); }
.mobile-match-status[hidden] { display: none; }
.mobile-match-status__scale { display: grid; align-content: start; gap: 6px; }
.mobile-match-status__scale > div { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.mobile-match-status__scale span,
.mobile-match-status__facts span { color: rgba(242, 240, 232, .56); font-size: 7px; letter-spacing: .1em; }
.mobile-match-status__scale b,
.mobile-match-status__facts b { color: #f2f0e8; font-size: 10px; }
.mobile-match-status__scale > i { height: 6px; display: block; overflow: hidden; background: rgba(242, 240, 232, .1); }
.mobile-match-status__scale > i > b { display: block; width: 0; height: 100%; transition: width .15s linear; }
.mobile-match-status__scale.is-stage > i > b { background: #42cfff; box-shadow: 0 0 12px rgba(66, 207, 255, .45); }
.mobile-match-status__scale.is-threat > i > b { background: linear-gradient(90deg, #ffb33f, #ff4f38); box-shadow: 0 0 12px rgba(255, 79, 56, .42); }
.mobile-match-status__scale small { color: rgba(242, 240, 232, .72); font-size: 8px; line-height: 1.3; }
.mobile-match-status__facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(242, 240, 232, .1); }
.mobile-match-status__facts > div { display: grid; gap: 4px; padding: 9px 8px 0 0; }
.mobile-match-status__challenge { grid-column: 1 / -1; padding-left: 8px; border-left: 3px solid #ff653f; color: #ffb879 !important; font-size: 8px !important; line-height: 1.4 !important; }
.mobile-orientation-gate button {
  min-height: 48px;
  border: 1px solid #f2f0e8;
  background: transparent;
  color: inherit;
}
.mobile-orientation-gate [data-mobile-immersive] { background: #ff4f00; color: #08090b; border-color: #ff4f00; }

@media (orientation: landscape) {
  html.gdnf-mobile .mobile-match-menu,
  html.gdnf-mobile .mobile-orientation-gate {
    padding: max(10px, var(--gdnf-safe-top)) max(10px, var(--gdnf-safe-right)) max(10px, var(--gdnf-safe-bottom)) max(10px, var(--gdnf-safe-left));
  }
  html.gdnf-mobile .mobile-match-menu__panel,
  html.gdnf-mobile .mobile-orientation-gate > div {
    width: min(88vw, 500px);
    max-height: min(88dvh, calc(var(--gdnf-vv-height, 100dvh) - 18px));
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
  }
  html.gdnf-mobile .mobile-match-menu strong {
    font-size: clamp(24px, 6vw, 46px);
    line-height: 0.92;
  }
  html.gdnf-mobile .mobile-match-menu span {
    font-size: 9px;
    line-height: 1.45;
  }
  html.gdnf-mobile .mobile-match-menu p,
  html.gdnf-mobile .mobile-match-menu strong,
  html.gdnf-mobile .mobile-match-menu span {
    grid-column: 1 / -1;
  }
  html.gdnf-mobile .mobile-match-menu [data-mobile-resume] {
    grid-column: 1 / -1;
  }
  html.gdnf-mobile .mobile-match-menu [data-mobile-menu-immersive],
  html.gdnf-mobile .mobile-match-menu [data-mobile-leave] {
    min-height: 42px;
  }
}

/* Arena HUD: reserve thumb space and keep information readable. */
html.gdnf-mobile .arena-hud--top,
html.gdnf-mobile .duel-hud,
html.gdnf-mobile .conclave-hud--top {
  top: max(8px, var(--gdnf-safe-top));
  right: calc(max(70px, var(--gdnf-safe-right) + 58px));
  left: max(8px, var(--gdnf-safe-left));
  width: auto;
  transform: none;
}
html.gdnf-mobile .arena-hud--bottom {
  right: auto;
  bottom: max(8px, var(--gdnf-safe-bottom));
  left: 50%;
  width: min(48vw, 420px);
  transform: translateX(-50%);
}

html.gdnf-mobile body.mobile-game-active .arena-hud--top > div,
html.gdnf-mobile body.mobile-game-active .vital-block {
  border-color: color-mix(in srgb, currentColor 16%, transparent);
  background: color-mix(in srgb, var(--paper) 28%, transparent);
  box-shadow: none;
  backdrop-filter: none;
}

html.gdnf-mobile body.mobile-game-active .duel-hud > div {
  padding: 5px 7px;
  border: 1px solid rgba(241, 239, 230, .12);
  background: rgba(5, 6, 8, .24);
  box-shadow: none;
  backdrop-filter: none;
}

html.gdnf-mobile body.mobile-game-active .conclave-hud {
  border-color: rgba(242, 240, 232, .12);
  background: rgba(5, 6, 8, .24);
  box-shadow: none;
  backdrop-filter: none;
}

html.gdnf-mobile body.mobile-game-active .conclave-hud > div {
  border-color: rgba(242, 240, 232, .1);
}

html.gdnf-mobile body.mobile-game-active .conclave-squad-member {
  border-color: rgba(242, 240, 232, .1);
  background: rgba(5, 6, 8, .2);
  box-shadow: none;
  backdrop-filter: none;
}
html.gdnf-mobile .ability-hud,
html.gdnf-mobile .duel-ability-hud,
html.gdnf-mobile .conclave-ability-hud {
  display: none;
}
html.gdnf-mobile .duel-controls,
html.gdnf-mobile .conclave-controls { display: none; }
html.gdnf-mobile .duel-ability-message,
html.gdnf-mobile .conclave-announcement,
html.gdnf-mobile .arena-message {
  max-width: min(70vw, 560px);
  top: max(72px, calc(var(--gdnf-safe-top) + 64px));
}

/* Never cover mobile gameplay with automatic messages or progress overlays. */
html.gdnf-mobile body.mobile-game-active .arena-message,
html.gdnf-mobile body.mobile-game-active .duel-ability-message,
html.gdnf-mobile body.mobile-game-active .conclave-announcement,
html.gdnf-mobile body.mobile-game-active .duel-countdown,
html.gdnf-mobile body.mobile-game-active .conclave-countdown,
html.gdnf-mobile body.mobile-game-active .toast-layer,
html.gdnf-mobile body.mobile-game-active .mobile-orientation-gate {
  display: none !important;
}
html.gdnf-mobile .conclave-squad {
  top: max(64px, calc(var(--gdnf-safe-top) + 58px));
  left: max(8px, var(--gdnf-safe-left));
  width: min(30vw, 210px);
}
html.gdnf-mobile .conclave-resonance {
  right: calc(max(var(--gdnf-edge-guard), var(--gdnf-safe-right)) + 6px);
  bottom: calc(max(18px, var(--gdnf-safe-bottom)) + min(51vh, 390px));
  width: min(32vw, 240px);
}


html.gdnf-mobile .conclave-arena-screen .mobile-action-cluster {
  width: min(43vw, 350px);
  gap: clamp(5px, 1vw, 9px);
}
html.gdnf-mobile .conclave-arena-screen .mobile-action-button {
  width: clamp(46px, 7.2vw, 60px);
  height: clamp(46px, 7.2vw, 60px);
}
html.gdnf-mobile .conclave-arena-screen .mobile-action-button--dash {
  width: clamp(56px, 8.7vw, 72px);
  height: clamp(56px, 8.7vw, 72px);
}
html.gdnf-mobile .conclave-arena-screen .mobile-action-button--ultimate {
  box-shadow: 0 0 0 2px rgba(255, 79, 0, .2), 0 6px 20px rgba(0, 0, 0, .28);
}
html.gdnf-mobile .conclave-squad-member {
  min-height: 0;
  grid-template-columns: 5px 1fr auto;
  gap: 6px;
  padding: 5px 7px;
}
html.gdnf-mobile .conclave-squad-member > i { width: 5px; height: 22px; }
html.gdnf-mobile .conclave-squad-member b { font-size: 7px; }
html.gdnf-mobile .conclave-squad-member small { font-size: 6px; }
html.gdnf-mobile .conclave-resonance { display: none; }

@media (orientation: portrait) {
  html.gdnf-mobile .mobile-control-zone {
    width: 46vw;
    height: 38vh;
  }
  html.gdnf-mobile .mobile-action-cluster {
    bottom: calc(max(18px, var(--gdnf-safe-bottom)) + 34vh);
    width: 46vw;
  }
  html.gdnf-mobile .arena-hud--top,
  html.gdnf-mobile .duel-hud,
  html.gdnf-mobile .conclave-hud--top {
    font-size: 7px;
  }
  html.gdnf-mobile .conclave-squad,
  html.gdnf-mobile .conclave-resonance { display: none; }
}

@media (max-height: 520px) and (orientation: landscape) {
  html.gdnf-mobile .mobile-control-zone { height: 76vh; width: min(41vw, 340px); }
  html.gdnf-mobile .mobile-action-cluster { bottom: calc(max(12px, var(--gdnf-safe-bottom)) + 37vh); }
  html.gdnf-mobile .mobile-action-button { width: 50px; height: 50px; }
  html.gdnf-mobile .mobile-action-button--dash { width: 58px; height: 58px; }
  html.gdnf-mobile .conclave-squad { width: 176px; }
  html.gdnf-mobile .conclave-resonance { width: 190px; bottom: 56%; }
}


@media (max-width: 620px) {
  html.gdnf-mobile .duel-lobby-copy h1,
  html.gdnf-mobile .conclave-manifesto h1 {
    font-size: clamp(44px, 15vw, 72px);
  }
  html.gdnf-mobile .duel-lobby-copy,
  html.gdnf-mobile .conclave-manifesto,
  html.gdnf-mobile .duel-config,
  html.gdnf-mobile .conclave-config,
  html.gdnf-mobile .duel-waiting,
  html.gdnf-mobile .conclave-room,
  html.gdnf-mobile .duel-verdict > div,
  html.gdnf-mobile .duel-interpretation,
  html.gdnf-mobile .conclave-verdict__summary,
  html.gdnf-mobile .conclave-interpretation {
    padding-right: max(14px, var(--gdnf-safe-right));
    padding-left: max(14px, var(--gdnf-safe-left));
  }
  html.gdnf-mobile .duel-metrics,
  html.gdnf-mobile .conclave-team-metrics { grid-template-columns: 1fr 1fr; }
  html.gdnf-mobile .conclave-rank {
    grid-template-columns: 34px 1fr auto;
    gap: 8px;
  }
  html.gdnf-mobile .conclave-rank span:nth-last-child(n+2) { display: none; }
  html.gdnf-mobile .duel-choice-grid,
  html.gdnf-mobile .duel-vessel-grid,
  html.gdnf-mobile .conclave-choice-grid,
  html.gdnf-mobile .conclave-vessel-grid,
  html.gdnf-mobile .duel-loadout,
  html.gdnf-mobile .conclave-loadout {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-game-ui *,
  .mobile-nav-panel { transition: none !important; animation: none !important; }
}

/* Собор 1.3: three essential actions, one objective, safe gesture margins. */
html.gdnf-mobile .conclave-objective-panel {
  top: max(8px, var(--gdnf-safe-top));
  right: max(120px, calc(var(--gdnf-safe-right) + 112px));
  left: max(8px, var(--gdnf-safe-left));
  width: auto;
  max-width: 430px;
  min-height: 38px;
  grid-template-columns: 1fr;
  padding: 0;
  transform: none;
  border-color: rgba(242, 240, 232, .16);
  background: rgba(5, 6, 8, .54);
  backdrop-filter: blur(6px);
}
html.gdnf-mobile .conclave-objective-step,
html.gdnf-mobile .conclave-expedition-readout,
html.gdnf-mobile .conclave-lives-readout { display: none; }
html.gdnf-mobile .conclave-objective-copy { display: grid; grid-template-columns: 1fr; gap: 5px; padding: 7px 10px; }
html.gdnf-mobile .conclave-objective-copy > span,
html.gdnf-mobile .conclave-objective-copy > small { display: none; }
html.gdnf-mobile .conclave-objective-copy > strong { font-size: clamp(9px, 1.55vw, 12px); }
html.gdnf-mobile .conclave-objective-copy > i { height: 3px; }
html.gdnf-mobile .conclave-squad {
  top: max(70px, calc(var(--gdnf-safe-top) + 62px));
  width: min(25vw, 190px);
}
html.gdnf-mobile .conclave-resonance {
  display: none;
  top: max(72px, calc(var(--gdnf-safe-top) + 64px));
  right: calc(max(var(--gdnf-edge-guard), var(--gdnf-safe-right)) + 8px);
  bottom: auto;
  width: min(22vw, 170px);
}
html.gdnf-mobile .conclave-coach {
  bottom: calc(max(12px, var(--gdnf-safe-bottom)) + min(24vh, 156px));
  max-width: min(54vw, 460px);
  padding: 7px 11px;
  font-size: clamp(8px, 1.25vw, 11px);
  pointer-events: none;
}
html.gdnf-mobile .conclave-arena-screen .mobile-action-cluster {
  right: calc(max(var(--gdnf-edge-guard), var(--gdnf-safe-right)) + 8px);
  bottom: calc(max(14px, var(--gdnf-safe-bottom)) + min(30vh, 220px));
  width: auto;
  max-width: 238px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  align-items: end;
  gap: clamp(7px, 1.2vw, 11px);
}
html.gdnf-mobile .conclave-arena-screen .mobile-action-button {
  width: clamp(52px, 7.8vw, 66px);
  height: clamp(52px, 7.8vw, 66px);
  min-width: 48px;
  min-height: 48px;
}
html.gdnf-mobile .conclave-arena-screen .mobile-action-button--dash {
  width: clamp(58px, 8.8vw, 74px);
  height: clamp(58px, 8.8vw, 74px);
}
html.gdnf-mobile .conclave-arena-screen .mobile-action-button--ability {
  width: clamp(62px, 9.4vw, 78px);
  height: clamp(62px, 9.4vw, 78px);
}
html.gdnf-mobile .conclave-arena-screen .mobile-action-button--ultimate {
  width: clamp(58px, 8.8vw, 74px);
  height: clamp(58px, 8.8vw, 74px);
}

@media (orientation: portrait) {
  html.gdnf-mobile .conclave-objective-panel { width: auto; }
  html.gdnf-mobile .conclave-squad,
  html.gdnf-mobile .conclave-resonance { display: none; }
  html.gdnf-mobile .conclave-arena-screen .mobile-action-cluster {
    right: calc(max(var(--gdnf-edge-guard), var(--gdnf-safe-right)) + 4px);
    bottom: calc(max(16px, var(--gdnf-safe-bottom)) + 30vh);
    grid-template-columns: repeat(3, auto);
  }
  html.gdnf-mobile .conclave-coach {
    bottom: calc(max(12px, var(--gdnf-safe-bottom)) + 25vh);
    max-width: 72vw;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  html.gdnf-mobile .conclave-objective-panel { min-height: 34px; }
  html.gdnf-mobile .conclave-squad { top: max(60px, calc(var(--gdnf-safe-top) + 52px)); }
  html.gdnf-mobile .conclave-resonance { top: max(60px, calc(var(--gdnf-safe-top) + 52px)); }
  html.gdnf-mobile .conclave-arena-screen .mobile-action-cluster {
    bottom: calc(max(10px, var(--gdnf-safe-bottom)) + 35vh);
  }
  html.gdnf-mobile .conclave-coach { display: none; }
}
