:root {
  color-scheme: dark;
  --page: #151414;
  --panel: rgba(18, 13, 14, 0.84);
  --panel-strong: rgba(24, 14, 16, 0.95);
  --gold: #efc15d;
  --gold-soft: #f7da88;
  --line: rgba(239, 193, 93, 0.45);
  --text: #f8efe1;
  --muted: #c9b69a;
  --game-width: min(100vw, calc(100dvh * 16 / 9));
  --game-height: min(100dvh, calc(100vw * 9 / 16));
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  background: radial-gradient(circle at 52% 42%, #2d2830 0%, #141416 55%, #09090b 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  position: fixed;
  inset: 0;
  overscroll-behavior: none;
}

.shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: block;
  background: #08090e;
}

#game {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--game-width);
  height: var(--game-height);
  max-width: none;
  max-height: none;
  display: block;
  background: #08090e;
  image-rendering: auto;
  touch-action: none;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.45);
}

body.game-rotated #game {
  transform: translate(-50%, -50%) rotate(90deg);
  box-shadow: none;
}

.loading {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 240px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--gold-soft);
  text-align: center;
  font-weight: 700;
  letter-spacing: 0;
  z-index: 5;
}

.loading.hidden {
  display: none;
}

.rotate-notice {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(8, 7, 9, 0.82);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.rotate-notice.hidden {
  display: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.rotate-notice span {
  display: block;
  width: min(360px, calc(100vw - 48px));
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 13, 14, 0.92);
  color: var(--gold-soft);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.34);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: 0;
  text-align: center;
}

@supports (height: 100svh) {
  html,
  body,
  .shell {
    height: 100svh;
    min-height: 100svh;
  }
}

@media (orientation: landscape) and (max-width: 980px) {
  #game {
    box-shadow: none;
  }
}
