:root {
  color-scheme: dark;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #061a2c;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(30, 103, 146, .42), transparent 36rem),
    linear-gradient(160deg, #071827, #04101b 65%, #02080d);
}

body {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

button { font: inherit; }

#app {
  position: relative;
  height: min(100dvh, 1280px);
  aspect-ratio: 592 / 1280;
  max-width: 100vw;
  overflow: hidden;
  border-radius: clamp(0px, 1.8vw, 22px);
  background: #163b56;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .58), inset 0 0 0 1px rgba(255, 255, 255, .1);
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  outline: none;
}

.top-actions {
  position: absolute;
  z-index: 4;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  display: flex;
  gap: 8px;
}

.round-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 14px;
  color: white;
  background: linear-gradient(#314b63d9, #182c3fd9);
  box-shadow: 0 5px 0 rgba(3, 15, 25, .48), inset 0 1px 0 rgba(255, 255, 255, .26);
  font-weight: 900;
  cursor: pointer;
}

.round-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(3, 15, 25, .48); }

.cover {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  opacity: 0;
  visibility: hidden;
  background: linear-gradient(rgba(2, 14, 24, .18), rgba(2, 12, 21, .79));
  transition: opacity .22s ease, visibility .22s ease;
  pointer-events: none;
}

.cover.visible { opacity: 1; visibility: visible; pointer-events: auto; }

.cover-card {
  width: min(100%, 430px);
  padding: 30px 24px 24px;
  border: 1px solid rgba(152, 236, 255, .58);
  border-radius: 30px;
  text-align: center;
  background: linear-gradient(160deg, rgba(12, 51, 75, .95), rgba(7, 25, 42, .96));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.eyebrow {
  margin: 0 0 4px;
  color: #5af6ff;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: .22em;
}

h1 {
  margin: 0;
  color: white;
  font-size: clamp(34px, 9vw, 54px);
  line-height: 1.08;
  letter-spacing: -.04em;
  text-shadow: 0 4px 0 #0a6594, 0 8px 22px rgba(0, 207, 255, .28);
}

#coverText {
  margin: 18px auto 22px;
  color: #dff7ff;
  font-size: 15px;
  line-height: 1.7;
}

#primaryBtn {
  width: 100%;
  min-height: 54px;
  border: 1px solid #f7ff9a;
  border-radius: 18px;
  color: #173000;
  background: linear-gradient(#ecff62, #86e727);
  box-shadow: 0 7px 0 #428515, 0 13px 28px rgba(123, 244, 36, .24), inset 0 2px 0 rgba(255, 255, 255, .64);
  font-size: 20px;
  font-weight: 1000;
  cursor: pointer;
}

#primaryBtn:active { transform: translateY(4px); box-shadow: 0 3px 0 #428515; }

.keys { margin: 18px 0 0; color: #8fb8cb; font-size: 11px; }

.loading {
  position: absolute;
  z-index: 7;
  inset: auto 0 30px;
  margin: 0;
  color: white;
  text-align: center;
  font-weight: 800;
  text-shadow: 0 2px 8px black;
  pointer-events: none;
}

.loading.hidden { display: none; }

@media (max-aspect-ratio: 592/1280) {
  #app { width: 100vw; height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .cover { transition: none; }
}
