* { box-sizing: border-box; }

:root {
  --bg: #090b14;
  --panel: #121625;
  --text: #f8fbff;
  --muted: #9ba6bd;
  --accent: #ffd43b;
  --accent2: #ff8a00;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% 10%, #202743 0%, transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: hidden;
}

.game-shell {
  width: min(1100px, 100%);
}

.hud {
  min-height: 76px;
  display: grid;
  grid-template-columns: 150px 1fr 150px;
  align-items: center;
  gap: 15px;
  padding: 0 18px;
  border: 1px solid #293047;
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: rgba(18, 22, 37, .92);
  backdrop-filter: blur(12px);
}

.hud > div:first-child { text-align: left; }
.hud > div:last-child { text-align: right; }

.title {
  text-align: center;
  font-size: clamp(15px, 2vw, 22px);
  font-weight: 900;
  letter-spacing: .12em;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .15em;
  font-weight: 800;
}

.hud strong {
  display: block;
  margin-top: 2px;
  font-size: 28px;
}

.game-wrap {
  position: relative;
  width: 100%;
  height: min(70vh, 700px);
  min-height: 430px;
  border: 1px solid #293047;
  overflow: hidden;
  background: #0b1020;
  box-shadow: 0 25px 70px rgba(0,0,0,.4);
}

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

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 6, 14, .62);
  backdrop-filter: blur(7px);
  transition: opacity .25s ease;
}

.hidden {
  opacity: 0;
  pointer-events: none;
}

.card {
  width: min(430px, calc(100% - 32px));
  padding: 34px 28px;
  text-align: center;
  border: 1px solid #39425d;
  border-radius: 28px;
  background: rgba(19, 24, 42, .95);
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}

.big-smile {
  width: 86px;
  height: 86px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #16130a;
  background: #ffd43b;
  font-size: 67px;
  line-height: 1;
  font-family: Arial, sans-serif;
  box-shadow: 0 0 35px rgba(255,212,59,.35);
}

.big-smile.sad { background: #ff9f43; }

h1, h2 { margin: 0 0 10px; }
h1 { font-size: 34px; }
h2 { font-size: 32px; }

.card p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 auto 22px;
}

button {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 15px 20px;
  color: #15120a;
  background: linear-gradient(135deg, #ffe66d, #ffb300);
  font-weight: 950;
  letter-spacing: .08em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 179, 0, .2);
}

button:hover { filter: brightness(1.08); transform: translateY(-1px); }
button:active { transform: translateY(1px); }

small {
  display: block;
  margin-top: 16px;
  color: #8792aa;
  line-height: 1.5;
}

.final-score {
  font-size: 54px;
  font-weight: 1000;
  margin: -3px 0 18px;
  color: #ffd43b;
}

footer {
  display: flex;
  justify-content: center;
  gap: 35px;
  padding: 13px;
  color: #7f8aa2;
  font-size: 12px;
}

@media (max-width: 650px) {
  body { padding: 8px; }
  .hud { grid-template-columns: 75px 1fr 75px; min-height: 64px; padding: 0 10px; }
  .hud strong { font-size: 22px; }
  .game-wrap { height: calc(100vh - 135px); min-height: 400px; }
  footer { gap: 12px; font-size: 10px; }
  footer span:nth-child(2) { display: none; }
}
