:root {
  color-scheme: light;
  --ink: #241a1d;
  --muted: #6d575d;
  --milk: #fff9f5;
  --pink: #f38aa9;
  --coral: #ff6f7f;
  --gold: #f3c84d;
  --leaf: #52a67d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #fff4ec;
  color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  touch-action: none;
  user-select: none;
}

button {
  font: inherit;
}

.game-shell {
  position: fixed;
  inset: 0;
  min-height: 100svh;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 24rem),
    linear-gradient(135deg, #fff8ef 0%, #ffe4ed 48%, #dff4eb 100%);
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hud {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.brand,
.score-strip,
.sound-button,
.start-panel {
  border: 1px solid rgba(89, 40, 50, 0.12);
  background: rgba(255, 252, 247, 0.82);
  box-shadow: 0 16px 45px rgba(126, 70, 70, 0.14);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
  padding: 8px 12px 8px 9px;
  border-radius: 8px;
  font-size: clamp(13px, 2.8vw, 16px);
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: #191103;
  font-size: 16px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.08);
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(50px, 1fr));
  gap: 1px;
  overflow: hidden;
  border-radius: 8px;
}

.score-strip > div {
  min-width: 0;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.54);
  text-align: right;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.score-strip strong {
  display: block;
  font-size: clamp(18px, 5vw, 28px);
  line-height: 1;
}

.sound-button {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.sound-button[aria-pressed="false"] {
  color: var(--muted);
}

.start-panel {
  position: absolute;
  left: 50%;
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + 24px);
  width: min(430px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 18px;
  border-radius: 8px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.start-panel.is-hidden {
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
}

.start-panel h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 8vw, 46px);
  line-height: 0.98;
  letter-spacing: 0;
}

.start-panel p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.start-panel button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #191414, #332124);
  color: #fff8ef;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 12px 20px rgba(40, 25, 20, 0.22);
}

@media (max-width: 620px) {
  .hud {
    align-items: stretch;
  }

  .brand {
    width: 44px;
    padding: 8px;
  }

  .brand span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .score-strip {
    flex: 1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .score-strip > div {
    padding: 8px 5px;
  }
}
