:root {
  --bg-900: #23060d;
  --bg-800: #3a0815;
  --bg-700: #5b0f1f;
  --prague-red: #741424;
  --brick: #9f3429;
  --gold-500: #ffc53d;
  --gold-400: #ffd979;
  --gold-200: #fff1b7;
  --beer-700: #b86a00;
  --beer-500: #f2a915;
  --beer-300: #ffd15f;
  --cream: #fff7df;
  --cream-2: #f7e8bd;
  --ink: #25150a;
  --muted: #765e4a;
  --glass: rgba(255, 246, 215, 0.16);
  --glass-strong: rgba(255, 246, 215, 0.28);
  --shadow: rgba(35, 6, 13, 0.45);
  --line: rgba(255, 245, 214, 0.24);
  --success: #2d8a4e;
  --danger: #bc3143;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --mug-fill: 0%;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #23060d;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  background: #23060d;
  margin: 0;
  color: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 199, 89, 0.25), transparent 30rem),
    radial-gradient(circle at 90% 0%, rgba(180, 22, 44, 0.22), transparent 28rem),
    linear-gradient(145deg, #310813 0%, #5b0f1f 48%, #13070a 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%);
  background-position: 0 0, 0 13px, 13px -13px, -13px 0;
  background-size: 26px 26px;
  mix-blend-mode: soft-light;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--cream);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 247, 223, 0.1);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.brand strong {
  display: block;
  letter-spacing: 0.02em;
}

.brand small {
  display: block;
  color: var(--gold-400);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions,
.action-row,
.form-actions,
.modal-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold-200);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

.status-pill:hover {
  background: rgba(255, 255, 255, 0.13);
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-500);
  box-shadow: 0 0 0 4px rgba(255, 197, 61, 0.18);
}

.status-pill.is-online::before {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(45, 138, 78, 0.18);
}

.status-pill.is-error::before {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(188, 49, 67, 0.18);
}

.status-pill.is-paused {
  color: var(--cream);
  background: rgba(255, 197, 61, 0.13);
}

.status-pill.is-paused::before {
  background: var(--gold-500);
  box-shadow: 0 0 0 4px rgba(255, 197, 61, 0.18);
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 234, 176, 0.22);
  border-radius: 34px;
  padding: 26px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 199, 89, 0.18), transparent 26rem),
    radial-gradient(circle at 100% 8%, rgba(255, 197, 61, 0.2), transparent 20rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05)),
    rgba(42, 8, 17, 0.82);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.36);
}

.hero::after {
  content: "Praha";
  position: absolute;
  right: -10px;
  bottom: -56px;
  color: rgba(255, 247, 223, 0.065);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(6rem, 16vw, 15rem);
  font-weight: 800;
  letter-spacing: -0.08em;
  pointer-events: none;
}

.skyline {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 0;
  height: 120px;
  pointer-events: none;
  opacity: 0.5;
  filter: drop-shadow(0 -10px 25px rgba(0, 0, 0, 0.18));
}

.bridge {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 42px;
  border-top: 10px solid rgba(255, 218, 121, 0.22);
  border-radius: 50% 50% 0 0;
}

.bridge::before,
.bridge::after {
  content: "";
  position: absolute;
  bottom: -8px;
  width: 16%;
  height: 46px;
  border: 4px solid rgba(255, 218, 121, 0.18);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
}

.bridge::before {
  left: 22%;
}

.bridge::after {
  right: 22%;
}

.tower,
.roof {
  position: absolute;
  bottom: 36px;
  background: rgba(255, 218, 121, 0.16);
}

.tower {
  width: 44px;
  height: 80px;
  border-radius: 18px 18px 0 0;
}

.tower::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  border-left: 22px solid transparent;
  border-right: 22px solid transparent;
  border-bottom: 38px solid rgba(255, 218, 121, 0.2);
}

.tower-left {
  left: 12%;
}

.tower-right {
  right: 14%;
  height: 96px;
}

.roof-one {
  left: 45%;
  width: 94px;
  height: 58px;
  transform: translateX(-50%);
  border-radius: 16px 16px 0 0;
}

.roof-one::before {
  content: "";
  position: absolute;
  left: -12px;
  right: -12px;
  bottom: 100%;
  border-left: 59px solid transparent;
  border-right: 59px solid transparent;
  border-bottom: 42px solid rgba(255, 218, 121, 0.18);
}

.moon {
  position: absolute;
  right: 7%;
  top: 5px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 241, 183, 0.32);
  box-shadow: 0 0 50px rgba(255, 241, 183, 0.22);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: 28px;
  align-items: stretch;
}

.hero-copy,
.mug-card,
.info-panel {
  border: 1px solid rgba(255, 234, 176, 0.2);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05)),
    rgba(42, 8, 17, 0.56);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.22);
}

.hero-copy {
  padding: clamp(24px, 4vw, 42px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold-400);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 0.96;
  text-wrap: balance;
}

h1 {
  max-width: 760px;
  font-size: clamp(3.2rem, 8vw, 6.5rem);
  letter-spacing: -0.055em;
}

h2 {
  color: var(--cream);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.04em;
}

.hero-text,
.modal-copy,
.info-panel p,
.progress-copy p {
  color: rgba(255, 247, 223, 0.83);
  line-height: 1.65;
}

.hero-text {
  max-width: 640px;
  margin: 22px 0 28px;
  font-size: 1.08rem;
}

.bet-helper {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 620px;
  margin: 24px 0 0;
  padding: 14px 16px;
  border: 1px solid rgba(255, 245, 214, 0.16);
  border-radius: 18px;
  color: rgba(255, 247, 223, 0.8);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  font-size: 0.96rem;
  line-height: 1.6;
}

.bet-helper p {
  margin: 0;
}

.bet-helper-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  font-size: 0.95rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}

.size-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 620px;
  margin: -8px 0 24px;
}

.size-chip {
  display: grid;
  min-height: 78px;
  place-items: center;
  padding: 12px 8px;
  border: 1px solid rgba(255, 245, 214, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 197, 61, 0.2), transparent 58%),
    rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 26px rgba(0, 0, 0, 0.12);
  text-align: center;
}

.size-chip strong {
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 4vw, 1.9rem);
  letter-spacing: -0.045em;
  line-height: 1;
  white-space: nowrap;
}

.size-chip small {
  color: rgba(255, 247, 223, 0.65);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.size-chip em {
  margin-top: 3px;
  color: rgba(255, 247, 223, 0.56);
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.stat-card {
  min-height: 144px;
  padding: 18px;
  border: 1px solid rgba(255, 245, 214, 0.22);
  border-radius: 26px;
  background:
    radial-gradient(circle at 30% 0%, rgba(255, 199, 89, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.055)),
    rgba(35, 6, 13, 0.16);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.08), 0 14px 34px rgba(0, 0, 0, 0.16);
}

.stat-card.featured {
  background:
    radial-gradient(circle at 85% 0%, rgba(255, 197, 61, 0.28), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.06));
}

.stat-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 15px;
  background: rgba(255, 197, 61, 0.16);
  font-size: 1.35rem;
}

.stat-label,
.stat-note {
  display: block;
}

.stat-label {
  color: rgba(255, 247, 223, 0.68);
  font-size: 0.9rem;
}

.stat-value {
  display: block;
  margin-top: 3px;
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.15rem, 3.45vw, 3.25rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#literCount {
  font-size: clamp(1.95rem, 3vw, 2.9rem);
}

#literCount,
#mugLiters {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.12em;
}

#mugLiters {
  margin-top: -10px;
}

.stat-value .value-number,
.mug-readout strong .value-number {
  line-height: 0.92;
}

.stat-value .value-unit,
.mug-readout strong .value-unit {
  flex: 0 0 auto;
  font-size: 0.82em;
  line-height: 1;
}

.stat-value.compact {
  margin-top: 9px;
  max-width: 100%;
  font-family: inherit;
  font-size: clamp(0.96rem, 1.05vw, 1.2rem);
  letter-spacing: -0.02em;
  line-height: 1.08;
  overflow-wrap: normal;
}

.stat-note {
  margin-top: 7px;
  color: rgba(255, 247, 223, 0.58);
  font-size: 0.83rem;
}

.primary-button,
.secondary-button,
.ghost-button,
.text-button {
  border: 0;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 800;
}

.primary-button {
  color: #351704;
  background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
  box-shadow: 0 16px 34px rgba(255, 197, 61, 0.22);
}

.secondary-button {
  color: var(--cream);
  background: rgba(255, 247, 223, 0.16);
  border: 1px solid rgba(255, 247, 223, 0.28);
}

.secondary-button.small {
  min-height: 40px;
  padding: 10px 14px;
  font-size: 0.92rem;
}

.ghost-button {
  color: var(--cream);
  background: transparent;
  border: 1px solid rgba(255, 247, 223, 0.26);
}

.ghost-button.dark {
  color: var(--ink);
  border-color: rgba(37, 21, 10, 0.18);
}

.text-button {
  padding: 0;
  color: var(--gold-400);
  background: transparent;
  font-weight: 850;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  box-shadow: 0 20px 40px rgba(255, 197, 61, 0.28);
}

.mug-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 620px;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 197, 61, 0.18), transparent 38%),
    rgba(255, 247, 223, 0.12);
}

.mug-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.mug-card-header h2 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
}

.mug-stage {
  display: grid;
  min-height: 390px;
  place-items: center;
  padding: 22px 102px 10px 0;
  overflow: visible;
}

.beer-mug {
  position: relative;
  width: min(252px, 60vw);
  height: 332px;
  filter: drop-shadow(0 28px 30px rgba(0, 0, 0, 0.28));
}

.mug-glass {
  position: absolute;
  inset: 0 36px 0 0;
  overflow: hidden;
  border: 8px solid rgba(255, 250, 226, 0.72);
  border-top-width: 12px;
  border-radius: 28px 28px 44px 44px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06) 18%, rgba(255, 255, 255, 0.18) 76%, rgba(255, 255, 255, 0.34)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 30px rgba(255, 255, 255, 0.26),
    inset 0 -16px 30px rgba(255, 255, 255, 0.12);
}

.mug-glass::before {
  content: "";
  position: absolute;
  inset: 12px auto 14px 22px;
  width: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.04));
  z-index: 5;
}

.mug-glass::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  filter: blur(0.5px);
  z-index: 6;
}

.glass-shine {
  position: absolute;
  top: -16px;
  left: 12%;
  width: 34%;
  height: 120%;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0.3), transparent 58%);
  transform: skewX(-10deg);
  z-index: 4;
  pointer-events: none;
}

.mug-handle {
  position: absolute;
  top: 77px;
  right: -20px;
  width: 96px;
  height: 170px;
  border: 16px solid rgba(255, 250, 226, 0.66);
  border-left: 0;
  border-radius: 0 58px 58px 0;
  box-shadow: inset -10px 0 16px rgba(255, 255, 255, 0.14);
}

.mug-mark {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.34);
  z-index: 7;
}

.mug-mark span {
  position: absolute;
  right: 2px;
  bottom: 4px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.mark-25 { bottom: 25%; }
.mark-50 { bottom: 50%; }
.mark-75 { bottom: 75%; }

.projection-line {
  position: absolute;
  left: 8px;
  width: calc(100% + 118px);
  bottom: 0;
  z-index: 12;
  border-top: 2px dashed rgba(255, 247, 223, 0.72);
  filter: drop-shadow(0 1px 3px rgba(35, 6, 13, 0.3));
  pointer-events: none;
  transition: bottom 1100ms cubic-bezier(0.2, 0.85, 0.2, 1), opacity 180ms ease;
}

.projection-line > span {
  position: absolute;
  right: 0;
  top: 50%;
  display: grid;
  min-width: 92px;
  padding: 8px 10px;
  border: 1px solid rgba(37, 21, 10, 0.1);
  border-radius: 18px;
  color: rgba(37, 21, 10, 0.76);
  background: rgba(255, 247, 223, 1);
  box-shadow: 0 10px 24px rgba(35, 6, 13, 0.16);
  font-size: 0.64rem;
  font-weight: 950;
  line-height: 1.08;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateY(-50%);
}

.projection-line > span strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  letter-spacing: -0.04em;
  line-height: 1;
  text-transform: none;
}

.liquid-level {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--mug-fill);
  min-height: 0;
  background:
    radial-gradient(circle at 25% 18%, rgba(255, 241, 183, 0.28), transparent 12%),
    linear-gradient(180deg, var(--beer-300), var(--beer-500) 50%, var(--beer-700));
  transition: height 1100ms cubic-bezier(0.2, 0.85, 0.2, 1);
  z-index: 2;
}

.liquid-level::before,
.liquid-level::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.liquid-level::before {
  left: -10%;
  top: -18px;
  width: 120%;
  height: 32px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 5% 88%, rgba(255, 249, 233, 0.98) 0 10px, transparent 10.5px),
    radial-gradient(circle at 16% 48%, rgba(255, 249, 233, 0.98) 0 13px, transparent 13.5px),
    radial-gradient(circle at 28% 72%, rgba(255, 249, 233, 0.98) 0 11px, transparent 11.5px),
    radial-gradient(circle at 40% 38%, rgba(255, 249, 233, 0.98) 0 14px, transparent 14.5px),
    radial-gradient(circle at 53% 72%, rgba(255, 249, 233, 0.98) 0 12px, transparent 12.5px),
    radial-gradient(circle at 66% 42%, rgba(255, 249, 233, 0.98) 0 13px, transparent 13.5px),
    radial-gradient(circle at 79% 74%, rgba(255, 249, 233, 0.98) 0 11px, transparent 11.5px),
    radial-gradient(circle at 92% 46%, rgba(255, 249, 233, 0.98) 0 12px, transparent 12.5px),
    linear-gradient(180deg, rgba(255, 253, 245, 0.98), rgba(247, 232, 189, 0.96));
  filter: drop-shadow(0 2px 6px rgba(255, 245, 214, 0.22));
  animation: foamDrift 7.4s ease-in-out infinite;
  z-index: 3;
}

.liquid-level::after {
  left: -6%;
  top: -7px;
  width: 112%;
  height: 12px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.12));
  opacity: 0.5;
  animation: foamDriftSecondary 4.6s ease-in-out infinite;
  z-index: 3;
}

.beer-mug.is-empty .liquid-level::before,
.beer-mug.is-empty .liquid-level::after,
.beer-mug.is-empty .bubble {
  opacity: 0;
}

.bubble {
  position: absolute;
  bottom: -26px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 248, 218, 0.55);
  animation: bubbleRise 4.2s ease-in infinite;
}

.bubble-one { left: 22%; animation-delay: 0.2s; }
.bubble-two { left: 44%; width: 6px; height: 6px; animation-delay: 1.3s; animation-duration: 3.3s; }
.bubble-three { left: 62%; width: 12px; height: 12px; animation-delay: 0.7s; animation-duration: 5.2s; }
.bubble-four { left: 72%; width: 7px; height: 7px; animation-delay: 2.1s; animation-duration: 4.6s; }
.bubble-five { left: 33%; width: 5px; height: 5px; animation-delay: 2.8s; animation-duration: 3.7s; }

.mug-readout {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 15px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  color: var(--cream);
  background: rgba(35, 6, 13, 0.26);
  backdrop-filter: blur(7px);
  text-align: center;
}

.mug-readout strong {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.12em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.15rem;
  line-height: 1;
  white-space: nowrap;
}

.mug-readout > span {
  margin-top: 4px;
  color: rgba(255, 247, 223, 0.75);
  font-size: 0.86rem;
}

.mug-readout strong .value-number {
  font-size: 1em;
}

.mug-readout strong .value-unit {
  font-size: 0.8em;
}

.mug-metrics {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.mug-metrics span {
  display: grid;
  min-height: 78px;
  place-items: center;
  padding: 12px 8px;
  border: 1px solid rgba(255, 245, 214, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 197, 61, 0.2), transparent 58%),
    rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 26px rgba(0, 0, 0, 0.12);
  text-align: center;
}

.mug-metrics strong {
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 2vw, 1.62rem);
  letter-spacing: -0.045em;
  line-height: 1;
  white-space: nowrap;
}

#currentPace {
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}

.mug-metrics small {
  color: rgba(255, 247, 223, 0.65);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mug-metrics em {
  margin-top: 3px;
  color: rgba(255, 247, 223, 0.56);
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.info-panel {
  padding: 24px;
}

.info-panel h2 {
  margin-bottom: 10px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.info-panel p {
  margin: 0 0 16px;
}

.challenge-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.challenge-highlights span {
  min-height: 78px;
  padding: 12px;
  border: 1px solid rgba(255, 234, 176, 0.2);
  border-radius: 18px;
  color: rgba(255, 247, 223, 0.78);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  font-weight: 800;
}

.challenge-highlights strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-400);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.accent-panel {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 197, 61, 0.22), transparent 34%),
    rgba(255, 247, 223, 0.105);
}

.modal {
  width: min(560px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 28px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

.modal.large-modal {
  width: min(920px, calc(100% - 32px));
}

.modal::backdrop {
  background: rgba(25, 5, 10, 0.72);
  backdrop-filter: blur(9px);
}

.modal-card {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 197, 61, 0.26), transparent 32%),
    linear-gradient(180deg, #fff8e8, #f4dfac);
}

.modal-card::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(116, 20, 36, 0.08);
  pointer-events: none;
}

.modal-card h2 {
  color: var(--ink);
  font-size: clamp(2.1rem, 5vw, 3.4rem);
}

.modal-card .eyebrow {
  color: var(--prague-red);
}

.modal-card .secondary-button {
  color: var(--ink);
  background: rgba(116, 20, 36, 0.08);
  border-color: rgba(116, 20, 36, 0.16);
  box-shadow: none;
}

.modal-card .secondary-button:hover {
  background: rgba(116, 20, 36, 0.12);
}

.modal-copy {
  margin: 14px 0 24px;
  color: rgba(37, 21, 10, 0.72);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(37, 21, 10, 0.08);
  font-size: 1.6rem;
  line-height: 1;
}

.modal-header-row {
  justify-content: space-between;
  padding-right: 42px;
}

.bet-form {
  display: grid;
  gap: 16px;
}

.bet-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.bet-form input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 21, 10, 0.16);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
}

.bet-form input:focus {
  border-color: rgba(116, 20, 36, 0.48);
  box-shadow: 0 0 0 4px rgba(116, 20, 36, 0.12);
}

.form-message {
  min-height: 0px;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.form-message.is-success {
  color: var(--success);
}

.form-message.is-error {
  color: var(--danger);
}

.table-wrap {
  position: relative;
  z-index: 1;
  width: min(100%, 820px);
  margin: 0 auto;
  margin-top: 24px;
  overflow-x: auto;
  border: 1px solid rgba(37, 21, 10, 0.1);
  border-radius: 22px;
  background: rgba(255, 248, 232, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.bets-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
}

.bets-table th,
.bets-table td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(37, 21, 10, 0.09);
  text-align: left;
}

.bets-table th {
  color: rgba(37, 21, 10, 0.62);
  background: rgba(255, 197, 61, 0.2);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.bets-table tbody tr {
  background: rgba(255, 255, 255, 0.18);
}

.bets-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.31);
}

.bets-table tbody tr:last-child td {
  border-bottom: 0;
}

.bets-table tbody tr.closest-row {
  outline: 2px solid rgba(255, 197, 61, 0.78);
  background:
    linear-gradient(90deg, rgba(255, 197, 61, 0.3), rgba(255, 197, 61, 0.12)),
    rgba(255, 255, 255, 0.36);
}

.bets-table .name-cell,
.bets-table .guess-cell,
.bets-table .pace-cell,
.bets-table .distance-cell {
  font-weight: 850;
}

.bets-table .date-cell {
  color: rgba(37, 21, 10, 0.66);
  font-size: 0.92rem;
  white-space: nowrap;
}

@media (min-width: 621px) {
  .bets-table tbody tr.closest-row .name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .bets-table tbody tr.closest-row .name-cell::after {
    content: "Aktuell am nächsten dran";
    padding: 5px 8px;
    border-radius: 999px;
    color: #351704;
    background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
    box-shadow: 0 5px 16px rgba(255, 197, 61, 0.22);
    font-size: 0.62rem;
    font-weight: 950;
    line-height: 1;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }
}

.bets-table .empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

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

@keyframes foamDriftSecondary {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}

@keyframes bubbleRise {
  0% {
    transform: translateY(0) scale(0.65);
    opacity: 0;
  }
  18% { opacity: 0.75; }
  100% {
    transform: translateY(-220px) translateX(12px) scale(1.15);
    opacity: 0;
  }
}

@media (max-width: 940px) {
  .hero-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .mug-card {
    min-height: auto;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .hero {
    padding: 14px;
    border-radius: 24px;
  }

  .topbar {
    align-items: flex-start;
    margin-bottom: 20px;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .status-pill,
  #refreshButton {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 15px;
  }

  .hero-copy,
  .mug-card,
  .info-panel {
    padding: 20px;
    border-radius: 22px;
  }

  .action-row,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .bet-helper {
    margin-top: 24px;
    padding: 12px 14px;
    font-size: 0.92rem;
  }

  .bet-helper-icon {
    width: 26px;
    height: 26px;
    font-size: 0.88rem;
  }

  .beer-mug {
    width: 230px;
    height: 306px;
  }

  .mug-handle {
    top: 68px;
    width: 82px;
    height: 158px;
  }

  .mug-stage {
    padding-right: 48px;
  }

  .projection-line {
    width: calc(100% + 72px);
  }

  .projection-line > span {
    min-width: 66px;
    padding: 6px 7px;
    border-radius: 14px;
    font-size: 0.52rem;
  }

  .projection-line > span strong {
    font-size: 0.92rem;
  }

  .modal-header-row {
    align-items: flex-start;
    flex-direction: column;
    padding-right: 44px;
  }

  .stat-card {
    min-height: auto;
    padding: 22px;
  }
  .size-breakdown {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: -6px 0 20px;
  }

  .size-chip {
    min-height: 70px;
    padding: 10px 6px;
    border-radius: 20px;
  }

  .size-chip strong {
    font-size: clamp(1rem, 6.7vw, 1.9rem);
  }

  .size-chip small {
    font-size: 0.62rem;
  }

  .size-chip em {
    font-size: 0.58rem;
  }


  .stat-icon {
    width: 46px;
    height: 46px;
    font-size: 1.5rem;
  }

  .stat-value:not(.compact) {
    font-size: clamp(3rem, 16vw, 4.8rem);
  }

  .stat-value.compact {
    font-size: clamp(1.14rem, 6.2vw, 1.42rem);
    line-height: 1.12;
  }

  .stat-note {
    font-size: 0.92rem;
  }

  #literCount {
    font-size: clamp(2.75rem, 14vw, 4.1rem);
  }

  #literCount,
  #mugLiters {
    gap: 0.1em;
  }

  .challenge-highlights {
    grid-template-columns: 1fr;
  }

  .mug-metrics {
    gap: 8px;
  }

  .mug-metrics span {
    min-height: 70px;
    padding: 10px 6px;
    border-radius: 20px;
  }

  .mug-metrics strong {
    font-size: clamp(1rem, 4.7vw, 1.34rem);
  }

  #currentPace {
    font-size: clamp(0.92rem, 4vw, 1.12rem);
  }

  .mug-metrics small {
    font-size: 0.62rem;
  }

  .mug-metrics em {
    font-size: 0.58rem;
  }

  .modal {
    width: min(100% - 20px, 560px);
    max-height: calc(100dvh - 20px);
  }

  .modal.large-modal {
    width: calc(100% - 20px);
  }

  .modal-card {
    max-height: inherit;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .modal-card::after {
    display: none;
  }

  .large-modal .modal-card {
    padding: 20px;
  }

  .modal-header-row .secondary-button.small {
    width: auto;
    align-self: flex-start;
  }

  .table-wrap {
    width: 100%;
    margin: 0;
	margin-top: 24px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .bets-table {
    display: block;
    min-width: 0;
  }

  .bets-table thead {
    display: none;
  }

  .bets-table tbody {
    display: grid;
    gap: 12px;
  }

  .bets-table tbody tr {
    position: relative;
    display: grid;
    padding: 12px 14px;
    border: 1px solid rgba(37, 21, 10, 0.12);
    border-radius: 22px;
    background:
      radial-gradient(circle at 100% 0%, rgba(255, 197, 61, 0.18), transparent 46%),
      rgba(255, 255, 255, 0.5);
    box-shadow: 0 12px 26px rgba(37, 21, 10, 0.09);
  }

  .bets-table tbody tr:nth-child(even) {
    background:
      radial-gradient(circle at 100% 0%, rgba(255, 197, 61, 0.18), transparent 46%),
      rgba(255, 255, 255, 0.5);
  }

  .bets-table tbody tr.closest-row {
    outline: 2px solid rgba(255, 197, 61, 0.78);
    background:
      radial-gradient(circle at 100% 0%, rgba(255, 197, 61, 0.28), transparent 48%),
      rgba(255, 255, 255, 0.62);
  }

  .bets-table tbody tr.closest-row::before {
    content: "Aktuell am nächsten dran";
    justify-self: start;
    margin: 0 0 10px;
    padding: 6px 10px;
    border-radius: 999px;
    color: #351704;
    background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
    font-size: 0.74rem;
    font-weight: 950;
    letter-spacing: 0.02em;
  }

  .bets-table td {
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(37, 21, 10, 0.08);
    text-align: right;
  }

  .bets-table td:last-child {
    border-bottom: 0;
  }

  .bets-table td::before {
    content: attr(data-label);
    color: rgba(37, 21, 10, 0.56);
    font-size: 0.74rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
  }

  .bets-table .name-cell {
    font-size: 1.12rem;
    padding-top: 0;
  }

  .bets-table .guess-cell,
  .bets-table .pace-cell,
  .bets-table .distance-cell {
    font-size: 1.02rem;
  }

  .bets-table td[colspan] {
    display: block;
    text-align: center;
  }

  .bets-table td[colspan]::before {
    content: none;
  }

  .bets-table .empty-state {
    display: block;
    padding: 24px;
    text-align: center;
  }

  .bets-table .empty-state::before {
    content: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* -----------------------------
   Mobile control webapp
------------------------------ */
.control-body {
  min-height: 100svh;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 199, 89, 0.28), transparent 30rem),
    radial-gradient(circle at 90% 0%, rgba(180, 22, 44, 0.25), transparent 26rem),
    linear-gradient(145deg, #310813 0%, #5b0f1f 45%, #13070a 100%);
  color: #fff7dc;
  overflow-x: hidden;
}

.control-shell {
  min-height: 100svh;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
}

.control-card {
  width: 100%;
  border: 1px solid rgba(255, 234, 176, 0.22);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05)),
    rgba(42, 8, 17, 0.82);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(18px);
  padding: 20px;
}

.control-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.mini-brand {
  width: 54px;
  height: 54px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 1.75rem;
  background: linear-gradient(145deg, #ffc857, #f28b18);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.35), 0 12px 30px rgba(0,0,0,0.28);
}

.control-header h1 {
  margin: 2px 0 0;
  font-size: clamp(2rem, 10vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.token-panel {
  margin: 0 0 16px;
  border: 1px solid rgba(255, 222, 145, 0.28);
  border-radius: 22px;
  padding: 14px;
  background: rgba(255, 199, 89, 0.1);
}

.token-panel.is-saved {
  display: none;
}

.token-copy {
  margin: 0 0 12px;
  color: rgba(255, 247, 220, 0.82);
  font-size: 0.95rem;
  line-height: 1.45;
}

.token-form {
  display: grid;
  gap: 12px;
}

.token-form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
  color: #ffe6a4;
}

.token-form input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  padding: 14px 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #26100a;
  font: inherit;
  font-weight: 700;
}

.full-width {
  width: 100%;
}

.button-console {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.beer-action {
  min-height: clamp(132px, 26svh, 190px);
  border: 0;
  border-radius: 30px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  padding: 18px;
  color: #2b1207;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.95), transparent 0.55rem),
    radial-gradient(circle at 70% 15%, rgba(255,255,255,0.75), transparent 0.38rem),
    linear-gradient(160deg, #ffe89a 0%, #ffc247 40%, #e87a11 100%);
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.45),
    inset 0 -14px 30px rgba(124, 50, 0, 0.24),
    0 16px 34px rgba(0,0,0,0.28);
  text-align: left;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.beer-action::before {
  content: "";
  position: absolute;
  inset: auto -18% -34% -18%;
  height: 58%;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 50% 50% 0 0;
}

.beer-action span,
.beer-action small {
  position: relative;
  z-index: 1;
  display: block;
}

.beer-action span {
  font-size: clamp(2.25rem, 13vw, 4.35rem);
  font-weight: 1000;
  letter-spacing: -0.08em;
  line-height: 0.92;
}

.beer-action small {
  margin-top: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
  opacity: 0.72;
}

.beer-action.big {
  background:
    radial-gradient(circle at 25% 17%, rgba(255,255,255,0.95), transparent 0.65rem),
    radial-gradient(circle at 77% 19%, rgba(255,255,255,0.8), transparent 0.46rem),
    linear-gradient(160deg, #fff0a9 0%, #ffbd3e 38%, #d9630c 100%);
}

.beer-action.undo {
  color: #fff5f5;
  background:
    radial-gradient(circle at 25% 20%, rgba(255,255,255,0.28), transparent 0.62rem),
    linear-gradient(160deg, #ff5365 0%, #d51c34 48%, #7e0d20 100%);
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.24),
    inset 0 -16px 34px rgba(69, 0, 13, 0.32),
    0 16px 34px rgba(0,0,0,0.3);
}

.beer-action:active {
  transform: scale(0.97) translateY(2px);
  filter: brightness(0.98);
}

.beer-action:disabled {
  opacity: 0.62;
  cursor: wait;
  transform: none;
}

.control-status-card {
  margin-top: 14px;
  padding: 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.status-label {
  display: block;
  color: rgba(255, 247, 220, 0.65);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#actionStatus {
  display: block;
  margin-top: 4px;
  font-size: 1.08rem;
}

#actionStatus.is-ok {
  color: #92ffb7;
}

#actionStatus.is-error {
  color: #ff9ca8;
}

#actionStatus.is-warn {
  color: #ffe08a;
}

.mini-stats {
  display: grid;
  gap: 4px;
  text-align: right;
  font-weight: 800;
  white-space: nowrap;
}

.mini-stats strong {
  color: #ffd35c;
}

.control-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.text-link {
  color: #ffe6a4;
  font-weight: 900;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

@media (max-width: 390px) {
  .control-card {
    padding: 14px;
    border-radius: 26px;
  }

  .button-console {
    gap: 10px;
  }

  .beer-action {
    min-height: 122px;
    border-radius: 24px;
    padding: 14px;
  }

  .control-status-card,
  .control-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .mini-stats {
    text-align: left;
  }
}


.mini-brand {
  background: linear-gradient(180deg, rgba(255, 247, 223, 0.22), rgba(255, 247, 223, 0.08));
}
