.keg-runner-shell,
body.keg-runner-standalone {
  color-scheme: dark;
  --page-bg: #10151a;
  --panel-bg: #1b252d;
  --panel-border: #344553;
  --text: #f1f5f8;
  --muted: #b9c7d1;
  --accent: #e9b949;
}

body.keg-runner-standalone {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, #24313b 0, var(--page-bg) 58%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.keg-runner-shell {
  margin-top: 1.5rem;
  color: var(--text);
  background: radial-gradient(circle at top, #24313b 0, var(--page-bg) 58%);
  border-radius: 16px;
  overflow: hidden;
}

.keg-runner-shell *,
.keg-runner-shell *::before,
.keg-runner-shell *::after,
body.keg-runner-standalone *,
body.keg-runner-standalone *::before,
body.keg-runner-standalone *::after {
  box-sizing: border-box;
}

.keg-runner-shell .game-shell,
body.keg-runner-standalone .game-shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 18px;
}

body.keg-runner-standalone .game-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

body.keg-runner-standalone .game-header h1 {
  margin: 0 0 6px;
  color: var(--accent);
  letter-spacing: 0.03em;
}

body.keg-runner-standalone .game-header p,
.keg-runner-shell .controls,
body.keg-runner-standalone .controls {
  margin: 0;
  color: var(--muted);
}

.fullscreen-button {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: #263746;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.fullscreen-button:hover {
  background: #30485a;
}

.keg-runner-shell .canvas-wrap,
body.keg-runner-standalone .canvas-wrap {
  position: relative;
  width: 100%;
  overflow: auto;
  padding: 12px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.keg-runner-shell canvas,
body.keg-runner-standalone canvas {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  background: #f5f5eb;
  border: 2px solid #0d1114;
  border-radius: 10px;
  cursor: crosshair;
}

.keg-runner-shell #hud,
body.keg-runner-standalone #hud {
  position: absolute;
  top: 24px;
  left: 24px;
  min-width: 270px;
  padding: 11px 12px;
  background: rgba(12, 16, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  line-height: 1.45;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.keg-runner-shell #hud .hud-title,
body.keg-runner-standalone #hud .hud-title {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffe08a;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.keg-runner-shell #hud .hud-row,
body.keg-runner-standalone #hud .hud-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: 2px 0;
}

.keg-runner-shell #hud .hud-row span,
body.keg-runner-standalone #hud .hud-row span {
  color: #d7e3ea;
}

.keg-runner-shell #hud .health strong,
.keg-runner-shell #hud .health,
body.keg-runner-standalone #hud .health strong,
body.keg-runner-standalone #hud .health {
  color: #ff6b6b;
}

.keg-runner-shell #hud .score strong,
.keg-runner-shell #hud .score,
body.keg-runner-standalone #hud .score strong,
body.keg-runner-standalone #hud .score {
  color: #8ef0a4;
}

.keg-runner-shell #hud .carrying strong,
.keg-runner-shell #hud .carrying,
body.keg-runner-standalone #hud .carrying strong,
body.keg-runner-standalone #hud .carrying {
  color: #82c9ff;
}

.keg-runner-shell #hud .ship strong,
.keg-runner-shell #hud .ship,
body.keg-runner-standalone #hud .ship strong,
body.keg-runner-standalone #hud .ship {
  color: #ffe08a;
}

.keg-runner-shell #hud .pirate strong,
.keg-runner-shell #hud .pirate,
body.keg-runner-standalone #hud .pirate strong,
body.keg-runner-standalone #hud .pirate {
  color: #ff9f6e;
}

.keg-runner-shell #hud .health-meter,
body.keg-runner-standalone #hud .health-meter {
  height: 9px;
  margin: 4px 0 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.keg-runner-shell #hud .health-meter div,
body.keg-runner-standalone #hud .health-meter div {
  height: 100%;
  background: linear-gradient(90deg, #f87171, #facc15, #4ade80);
  border-radius: inherit;
}

.keg-runner-shell .controls,
body.keg-runner-standalone .controls {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(27, 37, 45, 0.72);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
}

body.keg-runner-standalone .game-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 10px;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, #24313b 0, var(--page-bg) 58%);
}

body.keg-runner-standalone .game-shell:fullscreen .canvas-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.keg-runner-standalone .game-shell:fullscreen canvas {
  width: auto;
  height: min(100%, calc(100vh - 145px));
  max-width: 100%;
  max-height: 100%;
}

body.keg-runner-standalone .game-shell:fullscreen .controls {
  font-size: 13px;
}

@media (max-width: 768px) {
  .keg-runner-shell .game-shell,
  body.keg-runner-standalone .game-shell {
    padding: 10px;
  }

  .keg-runner-shell #hud,
  body.keg-runner-standalone #hud {
    position: static;
    margin-top: 12px;
    min-width: 0;
  }
}
/* Embedded slobsbeer fullscreen support */
.keg-runner-shell .game-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 10px;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, #24313b 0, var(--page-bg) 58%);
}

.keg-runner-shell .game-shell:fullscreen .canvas-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.keg-runner-shell .game-shell:fullscreen canvas {
  width: auto;
  height: min(100%, calc(100vh - 90px));
  max-width: 100%;
  max-height: 100%;
}

.keg-runner-shell .game-shell:fullscreen .controls {
  font-size: 13px;
}

/* Browser-prefixed fallback */
.keg-runner-shell .game-shell:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  padding: 10px;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, #24313b 0, var(--page-bg) 58%);
}

.keg-runner-shell .game-shell:-webkit-full-screen .canvas-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.keg-runner-shell .game-shell:-webkit-full-screen canvas {
  width: auto;
  height: min(100%, calc(100vh - 90px));
  max-width: 100%;
  max-height: 100%;
}

.keg-runner-shell .game-shell:-webkit-full-screen .controls {
  font-size: 13px;
}
