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

:root {
  --bg:       #0d0500;
  --bg-card:  #1c0e00;
  --gold:     #f5a623;
  --orange:   #e85d04;
  --red:      #ff3b30;
  --green:    #34c759;
  --text:     #ffffff;
  --muted:    rgba(255,255,255,0.55);
  --border:   rgba(245,166,35,0.18);
  --radius:   16px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── PAGES ── */

.page {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.page.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
}

.page-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100dvh;
  padding: 28px 20px 40px;
  max-width: 480px;
  margin: 0 auto;
}

/* ── HERO ── */

.hero {
  text-align: center;
  padding: 12px 0 4px;
}

.hero-icon {
  font-size: 60px;
  line-height: 1;
  margin-bottom: 10px;
}

h1 {
  font-size: clamp(40px, 12vw, 56px);
  font-weight: 900;
  letter-spacing: 5px;
  background: linear-gradient(135deg, var(--gold) 30%, var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--muted);
  font-size: 15px;
  margin-top: 6px;
}

/* ── CARDS ── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.rules {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.rules li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  padding-left: 18px;
  position: relative;
}

.rules li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 12px;
  top: 1px;
}

.rules li strong {
  color: var(--text);
  font-weight: 600;
}

/* ── SETTINGS ── */

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.setting-label {
  font-size: 15px;
  font-weight: 500;
}

.num-input {
  display: flex;
  align-items: center;
  gap: 10px;
}

.num-input input {
  width: 60px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  padding: 7px 2px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.num-input input::-webkit-inner-spin-button,
.num-input input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.btn-round {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn-round:active {
  background: var(--gold);
  color: var(--bg);
}

.beer-equiv {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  color: var(--gold);
  margin-bottom: 6px;
}

.beer-num {
  font-size: 26px;
}

.beer-detail {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

.duration-line {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.duration-line strong {
  color: var(--text);
}

/* ── BUTTONS ── */

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s, opacity 0.15s;
  user-select: none;
}

.btn-primary:active {
  transform: scale(0.97);
  opacity: 0.88;
}

.btn-large {
  width: 100%;
  padding: 20px;
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1.5px solid rgba(255,59,48,0.5);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 14px;
  width: 100%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
  margin-top: auto;
}

.btn-danger:active {
  background: rgba(255,59,48,0.1);
  border-color: var(--red);
}

/* ── GAME LAYOUT ── */

.game-layout {
  padding-top: 20px;
  gap: 16px;
  justify-content: space-between;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.shot-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shot-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--gold);
  text-transform: uppercase;
}

.shot-row {
  display: flex;
  gap: 6px;
}

.shot-num {
  font-size: clamp(36px, 10vw, 48px);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.shot-sep {
  font-size: 18px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.remaining-block {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.remaining-num {
  font-size: clamp(28px, 8vw, 36px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.remaining-label {
  font-size: 12px;
  color: var(--muted);
}

/* ── SHOT GLASS TIMER ── */

.glass-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.shot-glass {
  width: clamp(110px, 30vw, 148px);
  height: auto;
  filter: drop-shadow(0 4px 14px rgba(245,166,35,0.2));
  transition: filter 0.3s;
}

.glass-section.warn .shot-glass {
  animation: glassShake 0.35s ease infinite;
  filter: drop-shadow(0 0 18px rgba(255,59,48,0.55));
}

@keyframes glassShake {
  0%, 100% { transform: rotate(0deg); }
  25%       { transform: rotate(-5deg); }
  75%       { transform: rotate(5deg); }
}

.timer-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.timer-digits {
  font-size: clamp(52px, 15vw, 68px);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

.glass-section.warn .timer-digits {
  color: var(--red);
}

.timer-unit {
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
}

/* ── PROGRESS ── */

.progress-section {
  text-align: center;
}

.progress-track {
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  border-radius: 100px;
  transition: width 0.6s ease;
}

.progress-info {
  font-size: 13px;
  color: var(--muted);
}

/* ── BELL OVERLAY ── */

.bell-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  cursor: pointer;
  animation: overlayIn 0.2s ease;
}

.bell-overlay.hidden {
  display: none;
}

.bell-inner {
  text-align: center;
  animation: bellPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bell-icon {
  font-size: 80px;
  line-height: 1;
  display: block;
  margin-bottom: 16px;
  animation: bellShake 0.6s ease;
}

.bell-cta {
  font-size: clamp(40px, 12vw, 56px);
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bell-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
  letter-spacing: 0.5px;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes bellPop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

@keyframes bellShake {
  0%,100% { transform: rotate(0deg); }
  15%      { transform: rotate(-18deg); }
  30%      { transform: rotate(16deg); }
  45%      { transform: rotate(-12deg); }
  60%      { transform: rotate(10deg); }
  75%      { transform: rotate(-6deg); }
  90%      { transform: rotate(4deg); }
}

/* ── END PAGE ── */

.end-layout {
  align-items: center;
  justify-content: center;
  padding-top: 48px;
  text-align: center;
}

.end-trophy {
  font-size: 80px;
  line-height: 1;
  margin-bottom: 16px;
}

.end-title {
  font-size: clamp(40px, 12vw, 56px);
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.end-sub {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 36px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 8px;
}

.stat-val {
  font-size: clamp(20px, 5.5vw, 26px);
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}

.stat-lbl {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
  line-height: 1.3;
}

/* ── RESPONSIVE ── */

@media (max-height: 600px) {
  .page-content { gap: 12px; padding-top: 16px; padding-bottom: 24px; }
  .hero-icon { font-size: 40px; }
  .hero { padding: 4px 0; }
  .game-layout { gap: 10px; }
  .shot-glass { width: clamp(80px, 22vw, 110px); }
}

@media (max-width: 340px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 12px; display: flex; align-items: center; gap: 12px; }
  .stat-val { margin-bottom: 0; }
}
