#ogu-run-8ball-run,
#ogu-run-8ball-run * {
  box-sizing: border-box;
}

body.ogu-run-page {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  background: #05060a;
  color: #f7fbff;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#ogu-run-8ball-run {
  --ogu-blue: #005cff;
  --ogu-blue-hot: #1f8cff;
  --ogu-yellow: #fff200;
  --ogu-red: #ff304f;
  --ogu-panel: #090b12;
  min-height: 100svh;
  padding: 18px 12px 28px;
  color: #f7fbff;
  background:
    linear-gradient(rgba(0, 92, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 92, 255, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 50% 0%, rgba(0, 92, 255, 0.26), transparent 42%),
    #05060a;
  background-size: 18px 18px, 18px 18px, auto, auto;
  isolation: isolate;
}

#ogu-run-8ball-run [hidden] {
  display: none !important;
}

.ogu-run-shell {
  width: min(720px, 100%);
  margin: 0 auto;
}

.ogu-run-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.ogu-run-logo {
  color: #fff;
  font-size: clamp(24px, 6vw, 42px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
  text-decoration: none;
  text-shadow: 0 0 18px rgba(0, 92, 255, 0.72);
}

.ogu-run-link {
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.ogu-run-hud {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  margin-bottom: 10px;
  border: 2px solid var(--ogu-blue);
  border-radius: 8px;
  background: rgba(2, 8, 20, 0.92);
  padding: 8px 10px;
  box-shadow: 0 0 0 3px rgba(0, 92, 255, 0.18);
}

.ogu-run-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: clamp(13px, 3vw, 16px);
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
}

.ogu-run-score-value,
.ogu-run-lives-value,
.ogu-run-level-value {
  color: var(--ogu-yellow);
}

.ogu-run-live-ball {
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #050505;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
}

.ogu-run-stage {
  position: relative;
  width: min(100%, 650px);
  margin: 0 auto;
  touch-action: none;
}

.ogu-run-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 19 / 21;
  border: 3px solid var(--ogu-blue);
  border-radius: 8px;
  overflow: hidden;
  background: #01040b;
  box-shadow: 0 0 0 4px rgba(0, 92, 255, 0.16), 0 18px 46px rgba(0, 0, 0, 0.42);
}

#ogu-run-8ball-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  background: #01040b;
}

.ogu-run-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(1, 4, 11, 0.76);
  backdrop-filter: blur(2px);
  z-index: 2;
}

.ogu-run-overlay-panel {
  width: min(420px, 100%);
  border: 2px solid var(--ogu-blue);
  border-radius: 8px;
  background: rgba(3, 8, 18, 0.96);
  padding: 22px;
  text-align: center;
  box-shadow: 0 0 0 4px rgba(0, 92, 255, 0.2), 0 0 36px rgba(0, 92, 255, 0.3);
}

.ogu-run-overlay-title {
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 7vw, 54px);
  line-height: 0.96;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 0 20px rgba(0, 92, 255, 0.74);
}

.ogu-run-overlay-subtitle {
  margin: 10px 0 0;
  color: var(--ogu-yellow);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 950;
  text-transform: uppercase;
}

.ogu-run-overlay-copy {
  margin: 16px 0 0;
  color: #d8e7ff;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 750;
}

.ogu-run-primary,
.ogu-run-sound,
.ogu-run-dpad button {
  appearance: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.ogu-run-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin-top: 18px;
  border-radius: 6px;
  background: var(--ogu-yellow);
  color: #050505;
  font-size: 16px;
  font-weight: 950;
  text-transform: uppercase;
}

.ogu-run-primary:focus-visible,
.ogu-run-sound:focus-visible,
.ogu-run-dpad button:focus-visible,
.ogu-run-link:focus-visible,
.ogu-run-logo:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.ogu-run-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.ogu-run-status {
  min-height: 20px;
  color: #d8e7ff;
  font-size: 13px;
  font-weight: 800;
}

.ogu-run-sound {
  min-height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
}

.ogu-run-dpad {
  width: min(310px, 100%);
  margin: 14px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  touch-action: none;
}

.ogu-run-dpad button {
  min-height: 58px;
  border: 2px solid var(--ogu-blue);
  border-radius: 8px;
  background: rgba(0, 92, 255, 0.16);
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.ogu-run-dpad button:active,
.ogu-run-dpad button.is-pressed {
  background: var(--ogu-blue);
  color: #fff200;
  transform: translateY(1px);
}

.ogu-run-dpad-up {
  grid-column: 2;
}

.ogu-run-dpad-left {
  grid-column: 1;
  grid-row: 2;
}

.ogu-run-dpad-center {
  grid-column: 2;
  grid-row: 2;
  min-height: 58px;
  border: 2px solid rgba(0, 92, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.ogu-run-dpad-right {
  grid-column: 3;
  grid-row: 2;
}

.ogu-run-dpad-down {
  grid-column: 2;
  grid-row: 3;
}

@media (min-width: 760px) {
  #ogu-run-8ball-run {
    padding-top: 26px;
  }

  .ogu-run-dpad {
    display: none;
  }
}

@media (max-width: 520px) {
  #ogu-run-8ball-run {
    padding: 10px 10px 20px;
  }

  .ogu-run-nav {
    margin-bottom: 10px;
  }

  .ogu-run-hud {
    grid-template-columns: 1fr 0.8fr 0.72fr;
    gap: 6px;
    padding: 7px;
  }

  .ogu-run-stat {
    font-size: 12px;
  }

  .ogu-run-canvas-wrap {
    border-width: 2px;
  }

  .ogu-run-overlay-panel {
    padding: 18px;
  }

  .ogu-run-controls {
    margin-top: 8px;
  }

  .ogu-run-dpad button {
    min-height: 54px;
  }
}

html.ogu-embedded-game,
html.ogu-embedded-game body.ogu-run-page {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #01040b;
}

html.ogu-embedded-game #ogu-run-8ball-run {
  width: 100%;
  height: 100vh;
  min-height: 0;
  padding: 5px;
  display: flex;
  align-items: stretch;
  background: #01040b;
}

html.ogu-embedded-game .ogu-run-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
}

html.ogu-embedded-game .ogu-run-nav,
html.ogu-embedded-game .ogu-run-controls,
html.ogu-embedded-game .ogu-run-dpad {
  display: none !important;
}

html.ogu-embedded-game .ogu-run-hud {
  flex: 0 0 auto;
  grid-template-columns: 1fr auto auto;
  gap: 2px;
  min-height: 21px;
  margin: 0 0 3px;
  border-width: 1px;
  border-radius: 4px;
  padding: 3px 4px;
  box-shadow: none;
}

html.ogu-embedded-game .ogu-run-stat {
  gap: 2px;
  font-size: clamp(7px, 2.1vw, 9px);
  line-height: 1;
  white-space: nowrap;
}

html.ogu-embedded-game .ogu-run-live-ball {
  width: 10px;
  height: 10px;
  border-width: 1px;
  font-size: 6px;
}

html.ogu-embedded-game .ogu-run-stage {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  margin: 0;
  overflow: hidden;
}

html.ogu-embedded-game .ogu-run-canvas-wrap {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-width: 1px;
  border-radius: 4px;
  box-shadow: none;
}

html.ogu-embedded-game #ogu-run-8ball-canvas {
  width: 100%;
  height: 100%;
}

html.ogu-embedded-game .ogu-run-overlay {
  padding: 8px;
}

html.ogu-embedded-game .ogu-run-overlay-panel {
  width: min(92%, 270px);
  border-width: 1px;
  border-radius: 4px;
  padding: 11px;
  box-shadow: 0 0 16px rgba(0, 92, 255, 0.25);
}

html.ogu-embedded-game .ogu-run-overlay-title {
  font-size: clamp(18px, 7vw, 28px);
}

html.ogu-embedded-game .ogu-run-overlay-subtitle,
html.ogu-embedded-game .ogu-run-overlay-copy {
  margin-top: 8px;
  font-size: clamp(9px, 3vw, 12px);
  line-height: 1.35;
}

html.ogu-embedded-game .ogu-run-primary {
  min-height: 34px;
  margin-top: 10px;
  border-radius: 4px;
  font-size: 12px;
}
