:root {
  color-scheme: dark;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  --bg-top: #3f1f0f;
  --bg-bottom: #120b08;
  --panel: rgba(20, 14, 11, 0.72);
  --panel-border: rgba(255, 229, 185, 0.14);
  --text: #fff2d4;
  --muted: #d7bc8b;
  --accent: #f59e0b;
  --accent-bright: #ffd26b;
  --foam: #fff4df;
  --glass-edge: rgba(255, 255, 255, 0.48);
  --shadow: rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(245, 158, 11, 0.34), transparent 36%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: #341602;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 0.8rem 1.8rem rgba(245, 158, 11, 0.18);
}

button:disabled {
  opacity: 0.55;
  box-shadow: none;
}

.app-shell {
  width: min(100%, 30rem);
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1.2rem, env(safe-area-inset-bottom));
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 1.5rem;
  padding: 1rem;
  backdrop-filter: blur(18px);
  box-shadow: 0 1.2rem 2.4rem var(--shadow);
}

.hero-panel h1 {
  margin: 0.1rem 0 0.6rem;
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 0.95;
}

.glass-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  pointer-events: none;
}

.viewport-title {
  width: min(90vw, 28rem);
  margin: 0;
  color: rgba(255, 242, 212, 0.92);
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-align: center;
  text-shadow: 0 0.2rem 1.2rem rgba(0, 0, 0, 0.38);
  pointer-events: none;
}

.eyebrow {
  margin: 0;
  color: var(--accent-bright);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.status-banner {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 232, 197, 0.08);
  color: var(--text);
  line-height: 1.35;
}

.stage-panel {
  display: grid;
  gap: 1rem;
}

.glass-stage {
  position: relative;
  min-height: 22rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 1.2rem;
  background:
    radial-gradient(circle at top, rgba(255, 244, 223, 0.18), transparent 33%),
    linear-gradient(180deg, rgba(255, 196, 77, 0.08), rgba(255, 255, 255, 0.02));
}

.pour-target {
  position: absolute;
  inset: 20% 12% 12%;
  border-radius: 50%;
  border: 1px dashed rgba(255, 244, 223, 0.12);
}

.glass {
  position: relative;
  width: min(48vw, 12rem);
  aspect-ratio: 0.62;
  border: 0.35rem solid var(--glass-edge);
  border-radius: 2.1rem 2.1rem 2.9rem 2.9rem;
  overflow: hidden;
  transform: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06));
  box-shadow:
    inset 0 0 0 0.08rem rgba(255, 255, 255, 0.22),
    0 1.6rem 3rem rgba(0, 0, 0, 0.36);
}

.glass::after {
  content: "";
  position: absolute;
  inset: auto 24% -1.5rem;
  height: 2.2rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.34), transparent 70%);
}

.glass-shine {
  position: absolute;
  inset: 6% auto 9% 12%;
  width: 18%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent);
  opacity: 0.55;
  z-index: 2;
}

.beer-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.beer-liquid {
  fill: url(#beerGradient);
}

.beer-foam {
  fill: rgba(255, 244, 223, 0.96);
  filter: drop-shadow(0 0.15rem 0.3rem rgba(255, 244, 223, 0.18));
}

.debug-layer {
  pointer-events: none;
}

.debug-point {
  vector-effect: non-scaling-stroke;
}

.debug-point--rim {
  fill: #67e8f9;
  stroke: rgba(8, 47, 73, 0.95);
  stroke-width: 1.1;
}

.debug-point--level {
  fill: #fb7185;
  stroke: rgba(76, 5, 25, 0.9);
  stroke-width: 1.1;
}

.meter-grid,
.detail-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meter-card,
.detail-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 0.9rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
}

.meter-label,
.detail-label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meter-value,
.detail-value {
  font-size: 1.12rem;
  line-height: 1.15;
}

.control-panel {
  display: grid;
  gap: 1rem;
}

.button-row {
  display: grid;
  gap: 0.7rem;
}

.slider-field {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--muted);
}

.slider-label {
  font-weight: 600;
}

.slider {
  width: 100%;
  accent-color: var(--accent);
}

body.page-main {
  min-height: 100vh;
  overflow: hidden;
}

.page-main .app-shell {
  width: 100%;
  min-height: 100vh;
  padding: 0;
  display: block;
}

.page-main .stage-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
  min-height: 100vh;
  display: block;
}

.page-main .glass-stage {
  min-height: 100vh;
  border-radius: 0;
  background:
    radial-gradient(circle at top, rgba(255, 244, 223, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(255, 196, 77, 0.06), rgba(255, 255, 255, 0.02));
}

.page-main .glass {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.glass-reset-button {
  min-width: 8rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.glass-reset-button--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.page-main .glass::after,
.page-main .glass-shine {
  display: none;
}

@media (min-width: 40rem) {
  .button-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
