:root {
  --bg: #060910;
  --panel: #0b101a;
  --line: rgba(148, 163, 184, .14);
  --ink: #f7f9ff;
  --muted: #8d99b3;
  --accent: #ffcf4a;
  --accent-soft: rgba(255, 207, 74, .15);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(42, 93, 170, .18), transparent 34%),
    radial-gradient(circle at 92% 100%, rgba(255, 207, 74, .07), transparent 34%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.theme-breakout {
  --accent: #6bd3ff;
  --accent-soft: rgba(107, 211, 255, .14);
  background:
    radial-gradient(circle at 18% 0%, rgba(107, 211, 255, .15), transparent 34%),
    radial-gradient(circle at 92% 100%, rgba(255, 107, 214, .09), transparent 36%),
    var(--bg);
}

body.theme-chicken {
  --accent: #f4c95d;
  --accent-soft: rgba(244, 201, 93, .16);
  background:
    radial-gradient(circle at 16% 0%, rgba(132, 196, 77, .17), transparent 36%),
    radial-gradient(circle at 94% 100%, rgba(244, 201, 93, .11), transparent 38%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
svg { display: block; }

.play-header {
  position: relative;
  z-index: 10;
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 9, 16, .84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.play-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .45;
}

.play-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 8px);
  grid-template-rows: repeat(2, 8px);
  gap: 2px;
  width: 25px;
  height: 25px;
  flex: none;
  padding: 2px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 7px;
  background: rgba(255, 255, 255, .03);
}
.brand-mark i { border-radius: 2px; background: var(--accent); }
.brand-mark i:nth-child(2) { background: #6bd3ff; }
.brand-mark i:nth-child(3) { background: #ff6bd6; }
.brand-mark i:nth-child(4) { background: #5ce8c6; }
.brand-name {
  overflow: hidden;
  color: #9ba7bc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-name span { color: #58657c; }

.play-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  justify-self: center;
}
.play-label {
  flex: none;
  padding: 5px 7px;
  border: 1px solid rgba(255, 207, 74, .32);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
  border-radius: 5px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .10em;
}
.play-heading h1 {
  overflow: hidden;
  margin: 0;
  color: #eff4ff;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}
.play-button {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #a8b4c9;
  background: rgba(255, 255, 255, .032);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.play-button svg { width: 15px; height: 15px; }
.play-button:hover { color: var(--ink); border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .07); }
.play-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.play-main {
  position: relative;
  height: calc(100dvh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.play-main::before {
  content: "4494";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 0;
  color: transparent;
  font-size: min(34vw, 440px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.09em;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .035);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.game-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  height: 100%;
  max-height: 980px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px;
  background: #05080f;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .52), 0 0 0 1px rgba(0, 0, 0, .3);
}
body.theme-chicken .game-shell { width: min(100%, 1100px); }
.game-shell iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #05080f;
}
.game-shell:fullscreen,
.game-shell:-webkit-full-screen {
  width: 100vw;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: #05080f;
}
.game-shell:fullscreen iframe,
.game-shell:-webkit-full-screen iframe { height: 100dvh; }

.game-loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #79869d;
  background:
    radial-gradient(circle at 50% 45%, var(--accent-soft), transparent 34%),
    #05080f;
  transition: opacity .35s ease, visibility .35s ease;
}
.game-loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-gem {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 207, 74, .5);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 13px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .85) 0 6%, transparent 7%),
    linear-gradient(145deg, #fff8d8, var(--accent) 60%, #d18b08);
  box-shadow: 0 0 28px var(--accent-soft);
  animation: loaderBounce 1.15s ease-in-out infinite;
}
.theme-breakout .loader-gem {
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff 0 8%, transparent 9%), linear-gradient(145deg, #d9f7ff, var(--accent) 60%, #1e8db9);
}
.theme-chicken .loader-gem {
  border-radius: 12px 12px 16px 16px;
  background:
    radial-gradient(circle at 35% 28%, #fffdf0 0 8%, transparent 9%),
    linear-gradient(145deg, #fff6cf, #f4c95d 58%, #b9771e);
}
.game-loader p { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.game-loader small { color: #4d5a70; font-size: 9px; }
.game-loader small a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

@keyframes loaderBounce {
  0%, 100% { transform: translateY(0) rotate(-7deg); }
  50% { transform: translateY(-11px) rotate(7deg); }
}

@media (max-width: 700px) {
  .play-header {
    height: 56px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 12px;
  }
  .play-brand { display: none; }
  .play-heading { justify-self: start; }
  .play-label { display: none; }
  .play-heading h1 { font-size: 13px; }
  .play-button { width: 34px; padding: 0; }
  .play-button span { display: none; }
  .play-main { height: calc(100dvh - 56px); padding: 0; }
  .game-shell { width: 100%; max-height: none; border: 0; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .loader-gem { animation: none; }
  .game-loader { transition: none; }
}

body.theme-dive {
  --accent: #55d7e8;
  --accent-soft: rgba(85, 215, 232, .16);
  background:
    radial-gradient(circle at 16% 0%, rgba(85, 215, 232, .16), transparent 38%),
    radial-gradient(circle at 92% 100%, rgba(192, 138, 232, .10), transparent 40%),
    var(--bg);
}
.theme-dive .loader-gem {
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff 0 8%, transparent 9%),
    linear-gradient(145deg, #d8f7ff, #55d7e8 58%, #1d6a7d);
}
