* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  background: #0f172a;
  background-image: radial-gradient(circle at 20% 10%, #1e293b 0%, #0f172a 60%);
  color: #e2e8f0;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 16px;
  overflow: hidden;
}

.game-wrap {
  position: relative;
  width: min(420px, calc(100vw - 32px), calc((100dvh - 90px) * 0.65625));
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

canvas#game {
  display: block;
  width: 100%;
  aspect-ratio: 420 / 640;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
  background: #79c9f2;
  cursor: pointer;
}

.icon-btn {
  border: none;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
}

.icon-btn:active {
  transform: scale(0.9);
}

.sound-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
}

.overlay {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 10;
  transition: opacity 0.25s ease;
}

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

.panel-card {
  background: rgba(255, 255, 255, 0.97);
  color: #0f172a;
  border-radius: 20px;
  padding: 28px 32px;
  text-align: center;
  max-width: 82%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  animation: pop 0.3s ease;
}

@keyframes pop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.panel-kicker {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}

.panel-title {
  font-size: 44px;
  line-height: 1.05;
  font-weight: 900;
  color: #f59e0b;
  text-shadow: 2px 2px 0 #b45309;
  margin-bottom: 8px;
}

.panel-title.small {
  font-size: 34px;
}

.panel-bird {
  font-size: 56px;
  margin: 4px 0 8px;
  animation: bob 1.2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.panel-hint {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 12px;
}

.panel-hint kbd {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 1px 7px;
  font-family: inherit;
  font-size: 12px;
}

.panel-best {
  font-size: 15px;
  color: #64748b;
  margin-bottom: 16px;
}

.panel-best strong {
  color: #0f172a;
}

.medal {
  font-size: 52px;
  min-height: 60px;
}

.new-best {
  font-size: 16px;
  font-weight: 800;
  color: #16a34a;
  margin-bottom: 8px;
  animation: pop 0.4s ease;
}

.new-best.hidden {
  display: none;
}

.big-btn {
  border: none;
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  font-family: inherit;
  padding: 14px 42px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 0 #15803d, 0 10px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.big-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #15803d, 0 6px 12px rgba(0, 0, 0, 0.25);
}

.credit {
  margin-top: 14px;
  font-size: 12px;
  color: #64748b;
}
