#ogu-e-snake,
#ogu-e-snake * {
  box-sizing: border-box;
}

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

#ogu-e-snake {
  --es-green: #39ff58;
  --es-green-deep: #0a8f2f;
  --es-grid: rgba(57, 255, 88, 0.1);
  --es-red: #ff243d;
  --es-panel: #041107;
  min-height: 100svh;
  padding: max(16px, env(safe-area-inset-top)) 12px max(24px, env(safe-area-inset-bottom));
  background:
    linear-gradient(var(--es-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--es-grid) 1px, transparent 1px),
    radial-gradient(circle at 50% 0%, rgba(57, 255, 88, 0.16), transparent 42%),
    #020704;
  background-size: 18px 18px, 18px 18px, auto, auto;
  color: #f2fff0;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#ogu-e-snake [hidden] {
  display: none !important;
}

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

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

.ogu-esnake-logo {
  color: #fff;
  font-size: clamp(26px, 7vw, 46px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
  text-decoration: none;
  text-shadow: 0 0 18px rgba(57, 255, 88, 0.72);
}

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

.ogu-esnake-hud {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 10px;
  border: 2px solid var(--es-green);
  border-radius: 8px;
  background: rgba(2, 12, 5, 0.94);
  padding: 8px 11px;
  box-shadow: 0 0 0 3px rgba(57, 255, 88, 0.14), inset 0 0 22px rgba(57, 255, 88, 0.08);
}

.ogu-esnake-stat {
  min-width: 0;
  color: #fff;
  font-size: clamp(15px, 3.6vw, 18px);
  line-height: 1;
  font-weight: 950;
  text-transform: uppercase;
}

.ogu-esnake-stat span {
  color: var(--es-green);
}

.ogu-esnake-stage {
  width: min(100%, 590px);
  margin: 0 auto;
  touch-action: pan-y;
}

.ogu-esnake-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 3px solid var(--es-green);
  border-radius: 8px;
  overflow: hidden;
  background: #010301;
  box-shadow: 0 0 0 4px rgba(57, 255, 88, 0.12), 0 20px 48px rgba(0, 0, 0, 0.48);
  touch-action: none;
}

#ogu-esnake-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  background: #010301;
}

.ogu-esnake-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(1, 7, 3, 0.78);
  backdrop-filter: blur(2px);
  z-index: 2;
}

.ogu-esnake-panel {
  width: min(380px, 100%);
  border: 2px solid var(--es-green);
  border-radius: 8px;
  background: rgba(2, 12, 5, 0.96);
  padding: 22px;
  text-align: center;
  box-shadow: 0 0 0 4px rgba(57, 255, 88, 0.16), 0 0 36px rgba(57, 255, 88, 0.24);
}

.ogu-esnake-panel h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(40px, 11vw, 72px);
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(57, 255, 88, 0.72);
}

.ogu-esnake-panel p {
  margin: 12px 0 0;
}

.ogu-esnake-panel [data-overlay-subtitle] {
  color: var(--es-green);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 950;
}

.ogu-esnake-panel [data-overlay-copy] {
  color: #ceffc9;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 750;
}

.ogu-esnake-primary,
.ogu-esnake-pause,
.ogu-esnake-dpad button {
  appearance: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.ogu-esnake-primary {
  display: inline-grid;
  place-items: center;
  width: 100%;
  min-height: 50px;
  margin-top: 18px;
  border-radius: 6px;
  background: var(--es-green);
  color: #031004;
  font-size: 16px;
  font-weight: 950;
  text-transform: uppercase;
}

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

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

.ogu-esnake-pause {
  min-height: 38px;
  border: 2px solid rgba(57, 255, 88, 0.32);
  border-radius: 6px;
  background: rgba(57, 255, 88, 0.08);
  color: #fff;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 950;
}

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

.ogu-esnake-dpad button {
  min-height: 48px;
  border: 2px solid var(--es-green);
  border-radius: 6px;
  background: #061c0b;
  color: #f6fff4;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.28);
}

.ogu-esnake-dpad button.is-pressed {
  transform: translateY(2px);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.28);
}

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

.ogu-esnake-dpad-left {
  grid-column: 1;
}

.ogu-esnake-dpad-center {
  grid-column: 2;
  min-height: 48px;
  border: 2px solid rgba(57, 255, 88, 0.26);
  border-radius: 6px;
  background: radial-gradient(circle, rgba(57, 255, 88, 0.16), rgba(57, 255, 88, 0.04));
}

.ogu-esnake-dpad-right {
  grid-column: 3;
}

.ogu-esnake-dpad-down {
  grid-column: 2;
}

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

@media (max-height: 760px) and (max-width: 760px) {
  #ogu-e-snake {
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .ogu-esnake-logo {
    font-size: 25px;
  }

  .ogu-esnake-hud {
    min-height: 38px;
    margin-bottom: 8px;
  }

  .ogu-esnake-dpad button,
  .ogu-esnake-dpad-center {
    min-height: 44px;
  }
}

@media (min-width: 900px) {
  #ogu-e-snake {
    padding-top: 24px;
  }
}

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

html.ogu-embedded-game #ogu-e-snake {
  width: 100%;
  height: 100vh;
  min-height: 0;
  padding: 5px;
  display: flex;
  align-items: stretch;
  background: #010301;
}

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

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

html.ogu-embedded-game .ogu-esnake-hud {
  flex: 0 0 auto;
  min-height: 21px;
  margin: 0 0 3px;
  border-width: 1px;
  border-radius: 4px;
  padding: 3px 4px;
  box-shadow: none;
}

html.ogu-embedded-game .ogu-esnake-stat {
  font-size: clamp(8px, 2.4vw, 10px);
  white-space: nowrap;
}

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

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

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

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

html.ogu-embedded-game .ogu-esnake-panel {
  width: min(92%, 260px);
  border-width: 1px;
  border-radius: 4px;
  padding: 11px;
  box-shadow: 0 0 16px rgba(57, 255, 88, 0.22);
}

html.ogu-embedded-game .ogu-esnake-panel h1 {
  font-size: clamp(22px, 8vw, 34px);
}

html.ogu-embedded-game .ogu-esnake-panel p {
  margin-top: 8px;
}

html.ogu-embedded-game .ogu-esnake-panel [data-overlay-subtitle],
html.ogu-embedded-game .ogu-esnake-panel [data-overlay-copy] {
  font-size: clamp(9px, 3vw, 12px);
  line-height: 1.35;
}

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