:root {
  --bg-1: #f4ebdc;
  --bg-2: #e8d9c0;
  --ink: #2a2320;
  --ink-soft: #6b5e52;
  --accent: #c7633f;
  --glass: rgba(255, 253, 248, 0.55);
  --glass-edge: rgba(42, 35, 32, 0.12);
  --shadow: rgba(42, 35, 32, 0.08);

  /* Primaries */
  --c1: #c7633f;
  /* coral / red   */
  --c2: #cea448;
  /* amber / yellow */
  --c3: #678f96;
  /* sea / blue    */

  /* Secondaries (mixes) */
  --c4: #b87d3e;
  /* coral+amber = burnt orange */
  --c5: #7a9b6e;
  /* amber+sea   = moss green  */
  --c6: #8b6a9e;
  /* coral+sea   = dusty plum  */

  --c7: linear-gradient(135deg, #F8FAFC 0%, #94A3B8 100%);
  /* 7: Mercury - A sleek, chrome/silver metallic gradient */
  --c7-flat: #CBD5E1;
  /* Flat silver fallback for the lock band */
  /* Golden Drop Color */
}

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

html,
body {
  min-height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-1);
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(199, 99, 63, 0.08), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(91, 138, 148, 0.1), transparent 50%),
    radial-gradient(ellipse at 50% 50%, var(--bg-1), var(--bg-2));
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16 0 0 0 0 0.14 0 0 0 0 0.13 0 0 0 0.3 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 100;
  mix-blend-mode: multiply;
}

header {
  padding: 32px 24px 12px;
  text-align: center;
  width: 100%;
  max-width: 720px;
}

.header-logo {
  height: 80px;
  width: auto;
  margin-bottom: 8px;
  display: inline-block;
}

.mark {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: clamp(28px, 5vw, 40px);
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1;
}

.mark::after {
  content: '·';
  color: var(--accent);
  margin-left: 6px;
}

.subtitle {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 10px;
  font-weight: 500;
}

.date-line {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 6px;
}

.meta {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 20px;
  font-family: 'Fraunces', serif;
}

.meta-item {
  text-align: center;
}

.meta-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

.meta-value {
  font-size: 28px;
  font-weight: 300;
  margin-top: 4px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-width: 75px;
  text-align: center;
}

.meta-value .par {
  font-size: 14px;
  color: var(--ink-soft);
  font-style: italic;
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 28px 20px 20px;
  min-height: 340px;
}

.board {
  display: flex;
  flex-direction: column;
  gap: 48px;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}

.board-row {
  display: flex;
  gap: clamp(16px, 3vw, 28px);
  justify-content: center;
  width: 100%;
}

.tube {
  position: relative;
  width: clamp(52px, 9vw, 72px);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tube:hover {
  transform: translateY(-8px);
  filter: brightness(1.05);
}

.tube.selected {
  transform: translateY(-22px);
  outline: none;
}

.tube.selected .tube-glass {
  box-shadow:
    0 0 25px rgba(199, 99, 63, 0.4),
    inset 0 0 10px rgba(255, 255, 255, 0.5),
    0 12px 30px var(--shadow);
  border-color: var(--accent);
  animation: glow-pulse 2s infinite ease-in-out;
}

.tube.complete {
  animation: gentle-bob 3s ease-in-out infinite;
}

@keyframes glow-pulse {

  0%,
  100% {
    box-shadow: 0 0 15px rgba(199, 99, 63, 0.3);
  }

  50% {
    box-shadow: 0 0 30px rgba(199, 99, 63, 0.6);
  }
}

@keyframes gentle-bob {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

.tube-glass {
  position: absolute;
  inset: 0;
  background: var(--glass);
  border: 1.5px solid var(--glass-edge);
  border-top: none;
  border-radius: 8px 8px 36px 36px;
  box-shadow:
    inset 2px 0 4px rgba(255, 255, 255, 0.5),
    inset -2px 0 6px rgba(42, 35, 32, 0.08),
    0 4px 12px var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(2px);
  z-index: 2;
}

.tube-glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: -3px;
  right: -3px;
  height: 4px;
  background: var(--glass);
  border: 1.5px solid var(--glass-edge);
  border-radius: 2px;
  z-index: 1;
}

.liquid-stack {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 8px 8px 36px 36px;
  overflow: hidden;
}

.liquid {
  width: 100%;
  flex: 0 0 auto;
  position: relative;
  transition: height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.4s ease;
  animation: pour-in 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pour-in {
  from {
    height: 0;
    opacity: 0.6;
  }
}

.liquid.mixing {
  animation: mix-flash 0.7s ease-out;
}

@keyframes mix-flash {
  0% {
    filter: brightness(1) saturate(1);
  }

  30% {
    filter: brightness(1.4) saturate(1.5);
    transform: scaleY(1.05);
  }

  100% {
    filter: brightness(1) saturate(1);
  }
}

.liquid:last-child::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  animation: ripple 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes ripple {

  0%,
  100% {
    transform: translateX(0);
    opacity: 0.3;
  }

  50% {
    transform: translateX(2px);
    opacity: 0.5;
  }
}

.stream {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  background: currentColor;
  border-radius: 2px;
  animation: stream-fall 0.5s ease-out;
  pointer-events: none;
  z-index: 10;
}

@keyframes stream-fall {
  from {
    height: 0;
    opacity: 0;
  }

  30% {
    opacity: 1;
  }

  to {
    height: 60px;
    opacity: 0.8;
  }
}

.tube-base {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 4px;
  background: rgba(42, 35, 32, 0.1);
  filter: blur(3px);
  border-radius: 50%;
}

.tube-lock {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 4;
}

.tube-lock-band {
  width: calc(100% + 8px);
  min-width: 60px;
  height: 8px;
  border-radius: 4px;
  background: currentColor;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 2px 4px rgba(42, 35, 32, 0.15);
  position: relative;
  left: -4px;
}

.tube-lock-band::before {
  content: '';
  position: absolute;
  inset: 1px 6px 1px 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.4);
}

.controls {
  display: flex;
  gap: 16px;
  padding: 20px 24px 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  background: transparent;
  border: 1.5px solid var(--glass-edge);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn:hover:not(:disabled) {
  background: var(--ink);
  color: var(--bg-1);
  border-color: var(--ink);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  color: var(--bg-1);
  border-color: var(--accent);
}

.btn.primary:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.btn.danger {
  color: var(--accent);
  border-color: rgba(199, 99, 63, 0.4);
  /* subtle coral border */
}

.btn.danger:hover:not(:disabled) {
  background: var(--accent);
  color: var(--bg-1);
  border-color: var(--accent);
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(24, 20, 18, 0.50);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease,
    background 0.22s ease;
  z-index: 1000;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.overlay .card {
  transform: translateY(14px) scale(0.985);
  opacity: 0;
  transition:
    transform 0.24s ease,
    opacity 0.24s ease;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.22),
    0 8px 24px rgba(42, 35, 32, 0.12);
}

.overlay.show .card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.card {
  background: var(--bg-1);
  border: 1.5px solid var(--glass-edge);
  border-radius: 20px;
  padding: 40px 36px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(42, 35, 32, 0.15);
  animation: float-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-mark {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 64px;
  font-weight: 300;
  line-height: 1;
  color: var(--accent);
}

.card-title {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 400;
  margin-top: 14px;
  letter-spacing: -0.01em;
}

.card-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 8px;
  letter-spacing: 0.04em;
}

.win-stats {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 40px;
}

.win-stat-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.win-stat-value {
  font-family: 'Fraunces', serif;
  font-size: 40px;
  font-weight: 300;
  margin-top: 6px;
}

.win-grade {
  margin-top: 26px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--ink-soft);
}

.rank-line {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-soft);
}

.rank-line strong {
  color: var(--ink);
  font-weight: 600;
}

.name-field {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.name-field label {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.name-field input {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  padding: 10px 16px;
  border: 1.5px solid var(--glass-edge);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.6);
  color: var(--ink);
  text-align: center;
  width: 240px;
  outline: none;
  transition: border-color 0.2s ease;
}

.name-field input:focus {
  border-color: var(--accent);
}

.card-actions {
  margin-top: 28px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.share-btn {
  background: var(--glass);
  border: 1.5px solid var(--glass-edge);
  border-radius: 12px;
  padding: 10px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.share-btn:hover {
  background: var(--bg-2);
  color: var(--ink);
  transform: translateY(-2px);
}

.share-btn svg {
  width: 20px;
  height: 20px;
}

.share-result {
  margin-top: 20px;
  padding: 14px;
  background: rgba(255, 253, 248, 0.6);
  border: 1.5px solid var(--glass-edge);
  border-radius: 12px;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  text-align: left;
}

.leaderboard {
  margin-top: 22px;
  text-align: left;
}

.lb-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--glass-edge);
}

.lb-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 12px;
  padding: 10px 12px;
  align-items: center;
  font-size: 14px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 0.2s ease;
}

.lb-row:hover {
  background: rgba(255, 253, 248, 0.4);
}

.lb-row.you {
  background: rgba(199, 99, 63, 0.08);
  border: 1px solid rgba(199, 99, 63, 0.15);
}

.lb-rank {
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.lb-row.rank-1 .lb-rank {
  background: linear-gradient(135deg, #FFD700, #FDB931);
  color: #fff;
  font-weight: 600;
  font-style: normal;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(253, 185, 49, 0.4);
}

.lb-row.rank-2 .lb-rank {
  background: linear-gradient(135deg, #E0E0E0, #9E9E9E);
  color: #fff;
  font-weight: 600;
  font-style: normal;
  font-size: 13px;
}

.lb-row.rank-3 .lb-rank {
  background: linear-gradient(135deg, #CD7F32, #A0522D);
  color: #fff;
  font-weight: 600;
  font-style: normal;
  font-size: 13px;
}

.lb-name {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.lb-pours {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
}

.lb-time {
  font-size: 11px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  text-align: right;
  width: 36px;
}

.lb-empty {
  text-align: center;
  padding: 30px 0;
  color: var(--ink-soft);
  font-style: italic;
  font-family: 'Fraunces', serif;
}

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--bg-1);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 150;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.loading {
  padding: 80px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-family: 'Fraunces', serif;
  font-style: italic;
}

footer {
  width: 100%;
  text-align: center;
  padding: 14px;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}

footer a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dashed var(--glass-edge);
}

@media (max-width: 480px) {
  .meta {
    gap: 20px;
  }

  .win-stats {
    gap: 16px;
  }

  .card {
    padding: 32px 24px;
  }

  .share-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(199, 99, 63, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(199, 99, 63, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(199, 99, 63, 0);
  }
}

.pulse-warning {
  animation: pulse-red 2s infinite;
  border-color: var(--accent) !important;
  background: rgba(199, 99, 63, 0.1) !important;
}

.liquid::after {
  content: attr(data-symbol);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: bold;
  opacity: 0.6;
  color: white;
  pointer-events: none;
  z-index: 20 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

#mode-splash .btn {
  font-size: 13px;
  letter-spacing: 0.2em;
}

#mode-splash .card {
  max-width: 380px;
}

.splash-screen {
  background: var(--bg-1);
  background-image:
    radial-gradient(circle at 15% 50%, rgba(199, 99, 63, 0.1), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(91, 138, 148, 0.15), transparent 40%);
  z-index: 500;
}

.splash-content {
  text-align: center;
  animation: float-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.splash-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.splash-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.splash-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px !important;
  border-radius: 16px;
}

.splash-btn .btn-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.splash-btn .btn-sub {
  font-size: 10px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.8;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
  gap: 12px;
  margin-top: 24px;
  overflow-y: auto;
  padding: 10px 22px 20px 10px;
  mask-image: linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
}

.map-grid::-webkit-scrollbar {
  width: 6px;
}

.map-grid::-webkit-scrollbar-track {
  background: transparent;
  margin: 10px 0;
}

.map-grid::-webkit-scrollbar-thumb {
  background: var(--glass-edge);
  border-radius: 10px;
}

.map-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(42, 35, 32, 0.25);
}

.map-node {
  background: rgba(255, 253, 248, 0.4);
  border: 2px solid var(--glass-edge);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.map-node:hover {
  transform: translateY(-4px);
  background: rgba(255, 253, 248, 0.8);
}

.map-node.completed {
  background: rgba(91, 138, 148, 0.15);
  border-color: var(--c3);
}

.map-node.perfect {
  background: rgba(199, 99, 63, 0.15);
  border-color: var(--c1);
}

.map-node.current {
  border-color: var(--ink);
  background: var(--bg-1);
  box-shadow: 0 0 15px rgba(42, 35, 32, 0.1);
}

.map-node-lvl {
  font-weight: 600;
  font-size: 16px;
  font-family: 'Fraunces', serif;
  color: var(--ink);
}

.map-node-score {
  font-size: 10px;
  margin-top: 6px;
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.map-node-stats {
  display: flex;
  justify-content: space-evenly;
  margin-top: 8px;
  width: 100%;
}

.map-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.map-stat-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-bottom: 2px;
}

.map-stat-val {
  font-size: 13px;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  color: var(--ink);
}

.map-node.perfect .map-stat-val {
  color: var(--c1);
}

/* --- Advanced Mechanics --- */

/* Ribbed Frosted Vessels */
.tube.frosted .tube-glass {
  background: rgba(255, 253, 248, 0.45);
  backdrop-filter: blur(6px);
  /* Creates vertical ridges to simulate fluted/ribbed glass */
  background-image: repeating-linear-gradient(90deg,
      transparent,
      transparent 4px,
      rgba(255, 255, 255, 0.5) 4px,
      rgba(255, 255, 255, 0.5) 8px);
  box-shadow:
    inset 0 0 20px rgba(255, 255, 255, 0.9),
    inset 2px 0 4px rgba(255, 255, 255, 0.7),
    inset -2px 0 6px rgba(42, 35, 32, 0.08),
    0 4px 12px var(--shadow);
}

/* Replaces the buggy :last-child selector. Controlled directly by JS. */
.liquid.hidden-frosted {
  opacity: 0 !important;
  pointer-events: none;
}

/* Sink Vessels */
.tube.sink .tube-glass {
  background: rgba(42, 35, 32, 0.4);
  border-color: rgba(42, 35, 32, 0.6);
  box-shadow: inset 0 -10px 20px rgba(0, 0, 0, 0.3);
}

/* Distiller Vessels */
.tube.distiller .tube-glass {
  background: rgba(91, 138, 148, 0.1);
  border-color: var(--c3);
  border-style: dashed;
  border-width: 2px;
}

/* --- Utility Zone --- */
.utility-zone {
  display: flex;
  gap: clamp(16px, 4vw, 40px);
  justify-content: center;
  align-items: flex-end;
  /* Aligns the shorter tubes to the bottom */
  width: 100%;
  margin-top: 16px;
  padding-top: 40px;
  border-top: 2px dashed var(--glass-edge);
  position: relative;
}

.utility-zone::before {
  content: 'Utility Vessels';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

/* --- Tactile Physics --- */

/* The "Squish" - Elements yield physically under the thumb */
.btn:active {
  transform: scale(0.92);
  transition: transform 0.05s ease;
}

.tube:active .tube-glass {
  transform: scale(0.96) translateY(4px);
  transition: transform 0.05s ease;
}

/* The "Tilt" - Selected tubes tilt organically */
.tube.selected {
  /* Rotates the tube 4 degrees while lifting it */
  transform: translateY(-22px) rotate(4deg);
  /* Anchors the rotation to the bottom so it swings naturally */
  transform-origin: bottom center;
}

.tutorial-overlay,
#help-overlay {
  background: rgba(20, 16, 14, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tutorial-card {
  max-width: 420px;
}

.tutorial-card .card-sub {
  line-height: 1.55;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

body.modal-open header,
body.modal-open main,
body.modal-open .controls,
body.modal-open footer {
  filter: blur(1.5px);
  transform: scale(0.995);
  transition: filter 0.2s ease, transform 0.2s ease;
}