:root {
  color-scheme: dark;
  --bg: #02030b;
  --court: #050b24;
  --panel: rgba(3, 8, 25, 0.76);
  --panel-strong: rgba(4, 11, 34, 0.94);
  --text: #f7fbff;
  --muted: #9fb5d2;
  --line: rgba(159, 228, 255, 0.24);
  --hand: #33e6ff;
  --tongue: #f8c86b;
  --faith: #f8c86b;
  --soft: #9ed9ff;
  --shadow: rgba(0, 0, 0, 0.44);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 24%, rgba(51, 230, 255, 0.18), transparent 30%),
    radial-gradient(circle at 78% 68%, rgba(248, 200, 107, 0.16), transparent 32%),
    linear-gradient(180deg, #07103a, var(--bg));
  color: var(--text);
  top: 0 !important;
}

html.translated-rtl body,
html[dir="rtl"] body {
  direction: rtl;
}

.skiptranslate iframe {
  display: none !important;
}

.notranslate {
  direction: ltr;
  unicode-bidi: isolate;
}

button {
  border: 0;
  font: inherit;
}

button:focus-visible {
  outline: 2px solid var(--faith);
  outline-offset: 3px;
}

.game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 420px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(51, 230, 255, 0.08), transparent 46%),
    linear-gradient(rgba(51, 230, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 230, 255, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: none;
}

.hud,
.lower-hud {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: none;
}

.hud {
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  width: min(720px, calc(100vw - 92px));
  justify-content: space-between;
  transform: translateX(-50%);
}

.lower-hud {
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  flex-wrap: wrap;
  justify-content: flex-end;
}

.score-block,
.center-mark,
.lower-hud > div {
  min-width: 96px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 48px var(--shadow);
  backdrop-filter: blur(14px);
}

.score-block {
  display: grid;
  gap: 2px;
}

.score-block-right {
  text-align: right;
}

.score-block strong,
.lower-hud strong {
  font-size: clamp(1.05rem, 2vw, 1.65rem);
  line-height: 1;
}

.label,
.eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.center-mark {
  min-width: 130px;
  color: rgba(251, 255, 248, 0.82);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.lower-hud > div {
  min-width: 84px;
  display: grid;
  gap: 4px;
}

.lower-hud {
  display: none;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 18px 48px var(--shadow);
  backdrop-filter: blur(14px);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    background 140ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
}

.icon-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.pause-button {
  position: absolute;
  z-index: 6;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
}

.pause-button.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.pause-button .play-icon,
.pause-button.is-paused .pause-icon {
  display: none;
}

.pause-button.is-paused .play-icon {
  display: block;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  align-content: center;
  justify-items: center;
  gap: 24px;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(2, 3, 11, 0.68), rgba(2, 8, 28, 0.24)),
    radial-gradient(circle at 72% 54%, rgba(248, 200, 107, 0.14), transparent 36%),
    radial-gradient(circle at 32% 38%, rgba(51, 230, 255, 0.12), transparent 34%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.overlay-visible {
  opacity: 1;
  pointer-events: auto;
}

.brand-lockup {
  width: min(790px, 100%);
  align-self: end;
  text-align: center;
}

.brand-lockup h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(4.6rem, 15vw, 11rem);
  line-height: 0.84;
  letter-spacing: 0;
  text-shadow: 0 0 32px rgba(51, 230, 255, 0.2);
}

.tagline {
  max-width: 720px;
  margin: 22px auto 0;
  color: var(--faith);
  font-size: clamp(1.24rem, 3.1vw, 2.55rem);
  font-weight: 900;
  line-height: 1.08;
}

.brand-line {
  max-width: 650px;
  margin: 10px auto 0;
  color: rgba(251, 255, 248, 0.78);
  font-size: clamp(1rem, 2.05vw, 1.35rem);
  font-weight: 700;
  text-shadow: 0 2px 18px rgba(2, 3, 11, 0.76);
}

.language-control {
  width: min(790px, 100%);
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 10px;
  color: var(--muted);
}

.language-icon {
  min-width: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--faith);
  font-size: 0.82rem;
  font-weight: 900;
}

.language-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

#google_translate_element {
  min-width: 150px;
}

.language-reset {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(246, 213, 116, 0.32);
  border-radius: 8px;
  background: rgba(246, 213, 116, 0.1);
  color: var(--faith);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
}

.language-reset:hover {
  background: rgba(246, 213, 116, 0.18);
}

#google_translate_element .goog-te-gadget {
  color: transparent !important;
  font-size: 0 !important;
  line-height: 1;
}

#google_translate_element .goog-te-gadget span,
#google_translate_element .goog-logo-link {
  display: none !important;
}

#google_translate_element select.goog-te-combo {
  width: 150px;
  min-height: 34px;
  margin: 0 !important;
  border: 1px solid rgba(246, 213, 116, 0.24);
  border-radius: 8px;
  background: #061225;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}

.actions {
  width: min(790px, 100%);
  display: flex;
  align-self: start;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.primary-button {
  background: linear-gradient(135deg, #fff0a8, var(--faith) 48%, #ffb84a);
  color: #110d03;
  box-shadow: 0 0 22px rgba(248, 200, 107, 0.22);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.secondary-button:hover {
  border-color: rgba(248, 200, 107, 0.58);
  box-shadow: 0 0 22px rgba(51, 230, 255, 0.18);
}

.primary-button:disabled,
.secondary-button:disabled {
  color: rgba(251, 255, 248, 0.42);
  cursor: wait;
  transform: none;
}

.status {
  width: min(790px, 100%);
  margin: 0;
  align-self: start;
  color: var(--muted);
  font-size: 0.94rem;
  text-align: center;
}

.control-note {
  width: min(790px, 100%);
  margin: 0;
  align-self: start;
  color: rgba(251, 255, 248, 0.82);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.45;
  text-align: center;
}

.privacy-note {
  width: fit-content;
  max-width: min(790px, 100%);
  margin: 0;
  justify-self: center;
  align-self: start;
  padding: 10px 14px;
  border: 1px solid rgba(51, 230, 255, 0.22);
  border-radius: 999px;
  background: rgba(51, 230, 255, 0.08);
  color: #bfefff;
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.pause-overlay,
.end-overlay {
  background: rgba(2, 3, 11, 0.74);
  backdrop-filter: blur(10px);
}

.pause-panel,
.end-panel {
  width: min(470px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(155deg, rgba(248, 200, 107, 0.12), transparent 34%),
    linear-gradient(25deg, rgba(51, 230, 255, 0.1), transparent 42%),
    var(--panel-strong);
  box-shadow: 0 24px 80px var(--shadow);
}

.pause-panel h2,
.end-panel h2 {
  margin: 6px 0 18px;
  font-size: clamp(2.2rem, 7vw, 4.25rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.end-message {
  margin: 0 0 14px;
  color: rgba(251, 255, 248, 0.8);
  font-size: 1rem;
  line-height: 1.45;
}

.end-score {
  margin: 0 0 20px;
  color: var(--faith);
  font-size: 1.2rem;
  font-weight: 900;
}

.game-offering-cta {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid rgba(246, 213, 116, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 16%, rgba(246, 213, 116, 0.14), transparent 9rem),
    rgba(246, 213, 116, 0.06);
}

.game-offering-cta p {
  margin: 0;
  color: rgba(251, 255, 248, 0.84);
  font-size: 0.94rem;
  line-height: 1.45;
}

.game-offering-cta .offering-link {
  display: inline-grid;
  place-items: center;
  justify-self: center;
  min-height: 42px;
  text-decoration: none;
}

.pause-actions,
.end-actions {
  width: 100%;
}

.camera-feed {
  position: absolute;
  right: 18px;
  bottom: 88px;
  z-index: 4;
  width: 150px;
  max-width: 28vw;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #020403;
  box-shadow: 0 18px 48px var(--shadow);
  object-fit: cover;
  opacity: 0;
  transform: scaleX(-1);
  transition: opacity 180ms ease;
}

.camera-feed.is-visible {
  opacity: 0.72;
}

@media (max-width: 760px) {
  .hud {
    top: 12px;
    gap: 8px;
    width: min(560px, calc(100vw - 80px));
  }

  .score-block,
  .center-mark,
  .lower-hud > div {
    min-width: 72px;
    padding: 8px 10px;
  }

  .center-mark {
    display: none;
  }

  .lower-hud {
    left: 12px;
    right: 12px;
    bottom: 12px;
    justify-content: space-between;
    gap: 8px;
  }

  .overlay {
    align-content: center;
  }

  .brand-lockup,
  .language-control,
  .actions,
  .control-note,
  .status {
    align-self: center;
  }

  .actions {
    display: grid;
  }

  .language-control {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .language-label {
    display: none;
  }

  #google_translate_element,
  #google_translate_element select.goog-te-combo {
    width: min(220px, 72vw);
  }

  .camera-feed {
    width: 112px;
    right: 12px;
    bottom: 94px;
  }

  .pause-button {
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
  }
}
