/* Comet Hop — mobile-web, portrait, touch-only static bundle. */

:root {
  --ink: #09070f;
  --void: #12111b;
  --panel: rgba(9, 7, 15, 0.88);
  --text: #f7f4e9;
  --muted: #a6a1b7;
  --gold: #ffbd59;
  --mint: #6df7c1;
  --coral: #ff5a8a;
  --blue: #5ec8ff;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--ink);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

#app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  padding:
    max(12px, var(--safe-top))
    max(12px, var(--safe-right))
    max(12px, var(--safe-bottom))
    max(12px, var(--safe-left));
  background:
    radial-gradient(circle at 26% 12%, rgba(255, 189, 89, 0.22), transparent 24%),
    radial-gradient(circle at 76% 72%, rgba(109, 247, 193, 0.14), transparent 26%),
    linear-gradient(180deg, #181521 0%, #10131d 46%, #09070f 100%);
}

#hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 4px 0 10px;
}

.stat {
  min-width: 0;
  text-align: center;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.1;
}

.stat span:last-child {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
}

#combo,
.stat:nth-child(2) span:last-child {
  color: var(--mint);
}

#stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--void);
}

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

.panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px 18px;
  text-align: center;
  background: var(--panel);
  backdrop-filter: blur(2px);
}

.panel[hidden] {
  display: none;
}

.panel h1,
.panel h2 {
  margin: 0;
  font-weight: 900;
  letter-spacing: 0;
}

.panel h1 {
  color: var(--gold);
  font-size: 40px;
  line-height: 1.02;
}

.panel h2 {
  color: var(--coral);
  font-size: 30px;
  line-height: 1.05;
}

.tagline {
  max-width: 280px;
  margin: 0;
  color: #ded8e8;
  font-size: 17px;
  line-height: 1.45;
}

.result {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.result strong {
  color: var(--gold);
  font-size: 26px;
}

.result.sub {
  color: #ded8e8;
}

.result.sub strong {
  color: var(--text);
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(100%, 236px);
}

.cta {
  appearance: none;
  width: 100%;
  min-width: 212px;
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  padding: 0 22px;
  background: var(--gold);
  color: #18100a;
  font-size: 20px;
  font-weight: 850;
  touch-action: manipulation;
  transition: transform 0.06s ease, filter 0.12s ease;
}

.cta:active {
  transform: scale(0.96);
  filter: brightness(1.08);
}

.cta.secondary {
  background: var(--mint);
  color: #06110d;
  font-size: 18px;
}

.cta[hidden] {
  display: none;
}
