:root {
  color-scheme: light;
  --ink: #18202f;
  --muted: #667085;
  --surface: #ffffff;
  --surface-strong: #f6f8fb;
  --line: #d8dee9;
  --accent: #177ddc;
  --accent-dark: #0d5fa8;
  --good: #18865a;
  --warn: #b76b12;
  --shadow: 0 18px 45px rgba(24, 32, 47, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
radial-gradient(circle at 15% 15%, rgba(23, 125, 220, 0.16), transparent 28rem),
linear-gradient(135deg, #f9fbfd 0%, #e9f2f8 48%, #fff7e8 100%);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font: inherit;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(23, 125, 220, 0.2);
  transition: transform 140ms ease, background 140ms ease, opacity 140ms ease;
}

button:hover:not(:disabled),
button:focus-visible:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.app-shell {
  width: min(1120px, calc(100% - 28px));
  min-height: calc(100vh - 28px);
  margin: 14px auto;
  padding: clamp(16px, 3vw, 28px);
}


.screen.hidden {
  display: none;
}

.screen {
  min-height: calc(100vh - 84px);
}

.home-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  align-items: center;
  gap: clamp(24px, 6vw, 74px);
}

.home-copy {
  max-width: 620px;
}

.home-subtitle {
  max-width: 520px;
  margin: 18px 0 28px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.24rem);
  font-weight: 700;
  line-height: 1.45;
}

.play-button {
  min-width: 164px;
  min-height: 56px;
  font-size: 1.12rem;
}

.home-preview {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  min-height: 300px;
  padding: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(216, 222, 233, 0.86);
  box-shadow: var(--shadow);
}

.preview-tube {
  display: flex;
  flex-direction: column-reverse;
  width: clamp(54px, 7vw, 78px);
  height: clamp(150px, 24vw, 210px);
  overflow: hidden;
  border: 4px solid rgba(119, 137, 164, 0.7);
  border-top: 0;
  border-radius: 0 0 26px 26px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 -12px 18px rgba(49, 65, 88, 0.12), 0 10px 18px rgba(24, 32, 47, 0.12);
}

.preview-tube span {
  flex: 0 0 25%;
}

.preview-one span:nth-child(1) { background: #ef476f; }
.preview-one span:nth-child(2) { background: #06d6a0; }
.preview-one span:nth-child(3) { background: #ffd166; }
.preview-one span:nth-child(4) { background: #118ab2; }
.preview-two span:nth-child(1) { background: #8338ec; }
.preview-two span:nth-child(2) { background: #ef476f; }
.preview-two span:nth-child(3) { background: #118ab2; }
.preview-two span:nth-child(4) { background: #06d6a0; }
.preview-three span:nth-child(1) { background: #ffd166; }
.preview-three span:nth-child(2) { background: #8338ec; }

.screen-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

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

.level-button {
  display: grid;
  gap: 6px;
  min-height: 94px;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(216, 222, 233, 0.95);
  box-shadow: 0 10px 24px rgba(24, 32, 47, 0.08);
}

.level-button:hover:not(:disabled),
.level-button:focus-visible:not(:disabled) {
  color: #ffffff;
  background: var(--accent);
  transform: translateY(-2px);
}

.level-button strong {
  font-size: 1.7rem;
}

.level-button span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.level-button:hover span,
.level-button:focus-visible span {
  color: rgba(255, 255, 255, 0.86);
}

.top-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
}

.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stat {
  min-width: 94px;
  border: 1px solid rgba(216, 222, 233, 0.9);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 10px 24px rgba(24, 32, 47, 0.08);
}

.stat span,
.stat strong {
  display: block;
}

.stat span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.stat strong {
  font-size: 1.45rem;
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.power-ups {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(216, 222, 233, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.power-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.power-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.power-button {
  background: #18865a;
  box-shadow: 0 8px 18px rgba(24, 134, 90, 0.18);
}

.power-button:hover:not(:disabled),
.power-button:focus-visible:not(:disabled) {
  background: #116b48;
}

.danger-power {
  background: #b74343;
  box-shadow: 0 8px 18px rgba(183, 67, 67, 0.16);
}

.danger-power:hover:not(:disabled),
.danger-power:focus-visible:not(:disabled) {
  background: #963232;
}

.hint-power {
  background: #6f4cc2;
  box-shadow: 0 8px 18px rgba(111, 76, 194, 0.16);
}

.hint-power:hover:not(:disabled),
.hint-power:focus-visible:not(:disabled) {
  background: #5939a8;
}

.power-button span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  border-radius: 999px;
  color: #18865a;
  background: #ffffff;
  font-size: 0.84rem;
}

.status {
  min-height: 28px;
  margin: 0 0 20px;
  color: var(--muted);
  font-weight: 700;
}

.status.win {
  color: var(--good);
}

.status.warn {
  color: var(--warn);
}

.tube-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: clamp(14px, 2.4vw, 26px);
  align-items: end;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(216, 222, 233, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: var(--shadow);
}

.tube-button {
  display: grid;
  place-items: end center;
  width: 100%;
  min-height: 220px;
  padding: 14px 8px 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}

.tube-button:hover:not(:disabled),
.tube-button:focus-visible:not(:disabled) {
  background: rgba(24, 32, 47, 0.025);
  box-shadow: none;
  transform: none;
}

.tube-button:focus-visible:not(:disabled) {
  outline: 2px solid rgba(24, 32, 47, 0.16);
  outline-offset: 2px;
}

.tube-button.selected {
  background: rgba(23, 125, 220, 0.13);
  outline: 3px solid rgba(23, 125, 220, 0.38);
  outline-offset: 2px;
  transform: translateY(-8px);
}

.tube-button.blocked {
  background: rgba(183, 107, 18, 0.1);
  outline: 3px solid rgba(183, 107, 18, 0.42);
  outline-offset: 2px;
  animation: blockedTube 420ms ease;
}

.tube-button.blocked .tube {
  border-color: rgba(183, 107, 18, 0.88);
}

.tube-button.hint-source {
  background: rgba(111, 76, 194, 0.13);
  outline: 3px solid rgba(111, 76, 194, 0.42);
  outline-offset: 2px;
  transform: translateY(-6px);
}

.tube-button.hint-destination {
  background: rgba(24, 134, 90, 0.12);
  outline: 3px solid rgba(24, 134, 90, 0.4);
  outline-offset: 2px;
}

.tube-button.hint-source .tube {
  border-color: rgba(111, 76, 194, 0.82);
}

.tube-button.hint-destination .tube {
  border-color: rgba(24, 134, 90, 0.82);
}

.tube {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  width: clamp(58px, 9vw, 78px);
  height: 190px;
  overflow: hidden;
  border: 4px solid rgba(119, 137, 164, 0.7);
  border-top: 0;
  border-radius: 0 0 26px 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(222, 233, 244, 0.45));
  box-shadow: inset 0 -12px 18px rgba(49, 65, 88, 0.13), 0 10px 18px rgba(24, 32, 47, 0.12);
}

.tube::before {
  content: "";
  position: absolute;
  top: 0;
  left: -4px;
  right: -4px;
  height: 6px;
  border-radius: 999px;
  background: rgba(119, 137, 164, 0.72);
  z-index: 2;
}

.tube::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 36%, rgba(24, 32, 47, 0.08));
  z-index: 1;
}

.liquid {
  position: relative;
  flex: 0 0 25%;
  width: 100%;
  background: var(--color);
  transition: transform 180ms ease;
}

.is-pouring .tube-button {
  pointer-events: none;
}

.pouring-original .tube {
  opacity: 0.18;
}

.pouring-destination .tube {
  animation: receiveLiquid var(--stream-duration, 720ms) ease-in-out;
}

.flying-tube {
  position: absolute;
  pointer-events: none;
  z-index: 8;
  animation: flyToPour var(--stream-duration, 720ms) cubic-bezier(0.24, 0.72, 0.18, 1) forwards;
  transform-origin: 50% 8%;
}

.flying-tube .tube {
  width: 100%;
  height: 100%;
}

.falling-stream {
  position: absolute;
  width: 14px;
  height: var(--stream-height);
  margin-left: -7px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent 0%, var(--stream-color) 10%, var(--stream-color) 92%, transparent 100%);
  box-shadow: 0 0 12px color-mix(in srgb, var(--stream-color) 48%, transparent);
  pointer-events: none;
  z-index: 7;
  transform-origin: top center;
  animation: fallingLiquid var(--stream-duration, 720ms) cubic-bezier(0.18, 0.74, 0.2, 1) forwards;
}

.falling-stream::before {
  content: "";
  position: absolute;
  top: 10%;
  left: 4px;
  width: 4px;
  height: 76%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.34);
  animation: streamShimmer 260ms linear infinite;
}

.falling-stream::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 9px;
  height: 9px;
  margin-left: -4px;
  border-radius: 999px;
  background: var(--stream-color);
  box-shadow: 0 16px 0 -2px var(--stream-color), 0 32px 0 -3px var(--stream-color);
  opacity: 0;
  animation: fallingDrops var(--stream-duration, 720ms) ease-in-out forwards;
}

.pour-mouth {
  position: absolute;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 999px;
  background: var(--stream-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--stream-color) 22%, transparent);
  pointer-events: none;
  z-index: 6;
}

.pour-mouth-destination {
  animation: destinationRipple var(--stream-duration, 720ms) ease-out forwards;
}

@keyframes blockedTube {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-5px); }
  36% { transform: translateX(5px); }
  54% { transform: translateX(-3px); }
  72% { transform: translateX(3px); }
}

@keyframes flyToPour {
  0% {
transform: translate(0, 0) rotate(0deg);
  }
  46% {
transform: translate(var(--move-x), var(--move-y)) rotate(var(--tilt));
  }
  88% {
transform: translate(var(--move-x), var(--move-y)) rotate(var(--tilt));
  }
  100% {
transform: translate(var(--move-x), var(--move-y)) rotate(0deg);
  }
}

@keyframes fallingLiquid {
  0%, 40% {
opacity: 0;
transform: scaleY(0);
  }
  48% {
opacity: 1;
transform: scaleY(0.55);
  }
  56%, 86% {
opacity: 1;
transform: scaleY(1);
  }
  100% {
opacity: 0;
transform: scaleY(0.18);
  }
}

@keyframes fallingDrops {
  0%, 44% { opacity: 0; transform: translateY(-8px) scale(0.6); }
  54%, 82% { opacity: 0.75; transform: translateY(22px) scale(1); }
  100% { opacity: 0; transform: translateY(34px) scale(0.65); }
}
@keyframes streamShimmer {
  0% { transform: translateY(-10px); opacity: 0.25; }
  50% { opacity: 0.8; }
  100% { transform: translateY(10px); opacity: 0.25; }
}

@keyframes receiveLiquid {
  0%, 72% { transform: scale(1); }
  84% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

@keyframes destinationRipple {
  0%, 58% { transform: scale(0.4); opacity: 0; }
  76% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.9); opacity: 0; }
}


.win-screen {
  display: grid;
  place-items: center;
}

.win-panel {
  width: min(560px, 100%);
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid rgba(216, 222, 233, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.win-panel h1 {
  margin: 0;
}

.win-text {
  margin: 14px 0 22px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.win-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.win-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
@media (prefers-reduced-motion: reduce) {
  .tube-button.blocked,
  .flying-tube,
  .falling-stream,
  .falling-stream::before,
  .falling-stream::after,
  .pour-mouth,
  .pouring-destination .tube {
animation: none;
  }
}

.tube-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@media (max-width: 680px) {
  .win-actions {
display: grid;
grid-template-columns: 1fr;
  }
  .app-shell {
width: min(100% - 16px, 560px);
padding: 12px 0 18px;
  }

  .home-screen {
grid-template-columns: 1fr;
  }

  .home-preview {
min-height: 220px;
order: -1;
  }

  .screen-header {
align-items: flex-start;
flex-direction: column;
  }

  .top-bar {
align-items: flex-start;
flex-direction: column;
  }

  .stats {
width: 100%;
justify-content: stretch;
  }

  .stat {
flex: 1;
  }

  .controls {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .power-ups {
align-items: stretch;
flex-direction: column;
gap: 8px;
  }

  .power-list {
display: grid;
grid-template-columns: 1fr;
  }

  button {
padding: 0 10px;
font-size: 0.92rem;
  }

  .tube-board {
grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
gap: 12px;
padding: 16px 10px;
  }

  .tube-button {
min-height: 184px;
  }

  .tube {
width: 56px;
height: 158px;
  }
}

























/* Premium visual pass */
:root {
  --ink: #132033;
  --muted: #5b677c;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(168, 185, 210, 0.46);
  --accent: #1d8fff;
  --accent-dark: #0868c9;
  --good: #0c9669;
  --warn: #c46d16;
  --shadow: 0 24px 70px rgba(10, 26, 48, 0.18);
  --glass-highlight: rgba(255, 255, 255, 0.74);
}

body {
  position: relative;
  overflow-x: hidden;
  background:
linear-gradient(115deg, rgba(246, 251, 255, 0.88), rgba(232, 246, 250, 0.78) 48%, rgba(255, 246, 230, 0.78)),
#e8f5fb;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
linear-gradient(180deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 78%);
}

.app-shell {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: 0 28px 95px rgba(8, 26, 49, 0.16);
  backdrop-filter: blur(18px) saturate(1.14);
}

button {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #35a6ff, var(--accent-dark));
  box-shadow: 0 12px 26px rgba(29, 143, 255, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

button::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 45%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent);
  pointer-events: none;
}

button:hover:not(:disabled),
button:focus-visible:not(:disabled) {
  background: linear-gradient(180deg, #52b5ff, #0b72d9);
  box-shadow: 0 15px 32px rgba(29, 143, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.home-copy,
.screen-header,
.top-bar {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.home-preview,
.tube-board,
.power-ups,
.stat,
.level-button,
.win-panel {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(245, 250, 255, 0.58));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(1.14);
}

.home-preview {
  position: relative;
  min-height: 330px;
  background:
linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(226, 242, 251, 0.58)),
linear-gradient(135deg, rgba(29, 143, 255, 0.12), rgba(12, 150, 105, 0.1));
}

.preview-tube,
.tube {
  border-color: rgba(114, 136, 166, 0.82);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.62), rgba(222, 236, 250, 0.18) 46%, rgba(105, 123, 151, 0.16));
  box-shadow:
inset 9px 0 12px rgba(255, 255, 255, 0.34),
inset -9px 0 14px rgba(35, 55, 82, 0.13),
inset 0 -14px 18px rgba(29, 42, 64, 0.15),
0 18px 26px rgba(10, 26, 48, 0.18);
}

.preview-tube::after,
.tube::after {
  background:
linear-gradient(90deg, rgba(255, 255, 255, 0.68), transparent 18% 66%, rgba(20, 32, 51, 0.14)),
linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 50%);
}

.tube::before {
  height: 8px;
  background: linear-gradient(180deg, rgba(244, 250, 255, 0.95), rgba(117, 139, 169, 0.72));
  box-shadow: 0 3px 8px rgba(34, 52, 78, 0.16);
}

.liquid {
  background:
linear-gradient(90deg, rgba(255, 255, 255, 0.28), transparent 18% 72%, rgba(0, 0, 0, 0.16)),
linear-gradient(180deg, color-mix(in srgb, var(--color) 88%, white), var(--color) 54%, color-mix(in srgb, var(--color) 82%, black));
  box-shadow: inset 0 7px 10px rgba(255, 255, 255, 0.18), inset 0 -8px 14px rgba(0, 0, 0, 0.12);
}

.liquid::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.tube-button {
  transition: transform 180ms ease, background 180ms ease, filter 180ms ease;
}

.tube-button:hover:not(:disabled),
.tube-button:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  filter: drop-shadow(0 12px 18px rgba(10, 26, 48, 0.08));
}

.tube-button.selected {
  background: rgba(255, 255, 255, 0.22);
  outline: 3px solid rgba(29, 143, 255, 0.34);
  filter: drop-shadow(0 18px 22px rgba(29, 143, 255, 0.16));
}

.tube-button.blocked {
  background: rgba(255, 238, 217, 0.5);
  outline-color: rgba(196, 109, 22, 0.46);
}

.tube-button.hint-source,
.tube-button.hint-destination {
  filter: drop-shadow(0 14px 20px rgba(61, 78, 164, 0.16));
}

.level-button {
  min-height: 104px;
}

.level-button:hover:not(:disabled),
.level-button:focus-visible:not(:disabled) {
  background: linear-gradient(180deg, #35a6ff, #0b72d9);
}

.power-ups {
  background:
linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(245, 250, 255, 0.56)),
linear-gradient(90deg, rgba(12, 150, 105, 0.08), rgba(111, 76, 194, 0.07));
}

.power-button {
  background: linear-gradient(180deg, #22b77f, #0f7d57);
  box-shadow: 0 12px 24px rgba(24, 134, 90, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.danger-power {
  background: linear-gradient(180deg, #e46161, #a93434);
}

.hint-power {
  background: linear-gradient(180deg, #8f6cf4, #6040b8);
}

.falling-stream {
  width: 12px;
  filter: saturate(1.2);
  background:
linear-gradient(90deg, rgba(255, 255, 255, 0.48), transparent 32%),
linear-gradient(180deg, transparent 0%, var(--stream-color) 10%, var(--stream-color) 92%, transparent 100%);
}

.pour-mouth {
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--stream-color) 18%, transparent), 0 0 18px color-mix(in srgb, var(--stream-color) 42%, transparent);
}

.win-panel {
  text-align: center;
  background:
linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(240, 250, 255, 0.7)),
linear-gradient(135deg, rgba(12, 150, 105, 0.11), rgba(29, 143, 255, 0.1));
}

.win-actions {
  justify-content: center;
}

@media (max-width: 680px) {
  .app-shell {
border-radius: 0;
margin: 0 auto;
min-height: 100vh;
  }

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

  .home-preview {
min-height: 240px;
  }
}

/* Liquid softness reset */
.liquid {
  background: var(--color);
  box-shadow: inset 0 6px 10px rgba(255, 255, 255, 0.12), inset 0 -8px 12px rgba(0, 0, 0, 0.08);
}

.liquid::before {
  display: none;
}


/* Flat gradient design pass */
:root {
  --ink: #172033;
  --muted: #65728a;
  --surface: #ffffff;
  --surface-strong: #f5f7fb;
  --line: #d7dfec;
  --accent: #2f80ed;
  --accent-dark: #1761c2;
  --good: #16a36f;
  --warn: #c8781f;
  --shadow: 0 14px 28px rgba(30, 48, 72, 0.12);
}

body {
  background:
radial-gradient(circle at 12% 10%, rgba(255, 214, 112, 0.34), transparent 28rem),
radial-gradient(circle at 90% 18%, rgba(47, 128, 237, 0.22), transparent 25rem),
linear-gradient(135deg, #f7fbff 0%, #e8f3ff 48%, #fff5df 100%);
}

body::before {
  display: none;
}

.app-shell {
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

button {
  background: linear-gradient(135deg, #35a6ff 0%, #2f80ed 100%);
  box-shadow: 0 8px 16px rgba(47, 128, 237, 0.2);
}

button::before {
  display: none;
}

button:hover:not(:disabled),
button:focus-visible:not(:disabled) {
  background: linear-gradient(135deg, #48b2ff 0%, #1761c2 100%);
  box-shadow: 0 10px 20px rgba(47, 128, 237, 0.24);
}

.home-copy,
.screen-header,
.top-bar {
  text-shadow: none;
}

.home-preview,
.tube-board,
.power-ups,
.stat,
.level-button,
.win-panel {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #ffffff 0%, #f0f6ff 100%);
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.home-preview {
  background: linear-gradient(135deg, #ffffff 0%, #eaf7ff 55%, #fff0d0 100%);
}

.preview-tube,
.tube {
  border-color: #9aaec5;
  background: linear-gradient(180deg, #f5f8fc 0%, #e3edf7 100%);
  box-shadow: 0 10px 16px rgba(34, 52, 78, 0.16);
}

.preview-tube::after,
.tube::after {
  display: none;
}

.tube::before {
  background: #9aaec5;
  box-shadow: none;
}

.preview-tube span,
.liquid {
  background: linear-gradient(135deg, color-mix(in srgb, var(--color) 88%, white) 0%, var(--color) 100%);
  box-shadow: none;
}

.preview-tube span::before,
.liquid::before {
  display: none;
}

.tube-button:hover:not(:disabled),
.tube-button:focus-visible:not(:disabled) {
  background: rgba(47, 128, 237, 0.05);
  filter: none;
}

.tube-button.selected {
  background: rgba(47, 128, 237, 0.1);
  outline: 3px solid rgba(47, 128, 237, 0.34);
  filter: none;
}

.tube-button.blocked {
  background: rgba(255, 209, 102, 0.18);
  outline-color: rgba(200, 120, 31, 0.42);
}

.tube-button.hint-source,
.tube-button.hint-destination {
  filter: none;
}

.level-button {
  background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
}

.level-button:hover:not(:disabled),
.level-button:focus-visible:not(:disabled) {
  background: linear-gradient(135deg, #35a6ff 0%, #2f80ed 100%);
}

.power-ups {
  background: linear-gradient(135deg, #ffffff 0%, #eefaf4 52%, #f5f0ff 100%);
}

.power-button {
  background: linear-gradient(135deg, #20c989 0%, #16a36f 100%);
  box-shadow: 0 8px 16px rgba(22, 163, 111, 0.18);
}

.danger-power {
  background: linear-gradient(135deg, #ff6f73 0%, #c94a4e 100%);
  box-shadow: 0 8px 16px rgba(201, 74, 78, 0.16);
}

.hint-power {
  background: linear-gradient(135deg, #9b7cff 0%, #6f4cc2 100%);
  box-shadow: 0 8px 16px rgba(111, 76, 194, 0.16);
}

.falling-stream {
  background: linear-gradient(180deg, transparent 0%, var(--stream-color) 12%, var(--stream-color) 88%, transparent 100%);
  box-shadow: none;
  filter: none;
}

.pour-mouth {
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--stream-color) 20%, transparent);
}

.win-panel {
  background: linear-gradient(135deg, #ffffff 0%, #e8fff6 52%, #eaf3ff 100%);
}

/* Flat reference vial refinement */
.tube-board {
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: clamp(22px, 4vw, 48px);
}

.tube-button {
  min-height: 242px;
  padding-top: 12px;
}

.preview-tube,
.tube {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  width: clamp(82px, 8vw, 96px);
  height: 224px;
  overflow: hidden;
  border: 6px solid #91a9c0;
  border-top: 0;
  border-radius: 0 0 34px 34px;
  background: #edf3f8;
  box-shadow: 0 14px 22px rgba(60, 80, 105, 0.14);
}

.preview-tube::before,
.tube::before {
  content: "";
  position: absolute;
  top: 0;
  left: -6px;
  right: -6px;
  height: 8px;
  border-radius: 0;
  background: #91a9c0;
  box-shadow: none;
  z-index: 4;
}

.preview-tube::after,
.tube::after {
  display: none;
}

.preview-tube span,
.liquid {
  position: relative;
  flex: 0 0 25%;
  width: 100%;
  background: linear-gradient(90deg, color-mix(in srgb, var(--color) 92%, white) 0%, var(--color) 50%, color-mix(in srgb, var(--color) 88%, #0a5f7d) 100%);
  box-shadow: none;
  z-index: 1;
}

.preview-tube span::before,
.liquid::before {
  display: none;
}

.preview-one span:nth-child(1) { --color: #1699b8; background: linear-gradient(90deg, #21a9c5 0%, #1699b8 55%, #1185a0 100%); }
.preview-one span:nth-child(2) { --color: #ef3f73; background: linear-gradient(90deg, #ff4f82 0%, #ef3f73 55%, #d92f63 100%); }
.preview-one span:nth-child(3) { --color: #11d3a8; background: linear-gradient(90deg, #20e2bb 0%, #11d3a8 55%, #0db990 100%); }
.preview-one span:nth-child(4) { --color: #11d3a8; background: linear-gradient(90deg, #20e2bb 0%, #11d3a8 55%, #0db990 100%); }
.preview-two span:nth-child(1) { --color: #1699b8; background: linear-gradient(90deg, #21a9c5 0%, #1699b8 55%, #1185a0 100%); }
.preview-two span:nth-child(2) { --color: #ffd36c; background: linear-gradient(90deg, #ffdc82 0%, #ffd36c 55%, #efbd4f 100%); }
.preview-two span:nth-child(3) { --color: #11d3a8; background: linear-gradient(90deg, #20e2bb 0%, #11d3a8 55%, #0db990 100%); }
.preview-two span:nth-child(4) { --color: #1699b8; background: linear-gradient(90deg, #21a9c5 0%, #1699b8 55%, #1185a0 100%); }
.preview-three span:nth-child(1) { --color: #11d3a8; background: linear-gradient(90deg, #20e2bb 0%, #11d3a8 55%, #0db990 100%); }
.preview-three span:nth-child(2) { --color: #ffd36c; background: linear-gradient(90deg, #ffdc82 0%, #ffd36c 55%, #efbd4f 100%); }

.tube-button.hint-source .tube,
.tube-button.hint-destination .tube,
.tube-button.blocked .tube {
  border-top: 0;
}

.flying-tube .tube {
  width: 100%;
  height: 100%;
}

@media (max-width: 680px) {
  .tube-board {
grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
gap: 14px;
  }

  .tube-button {
min-height: 192px;
  }

  .preview-tube,
  .tube {
width: 64px;
height: 166px;
border-width: 5px;
border-radius: 0 0 28px 28px;
  }

  .preview-tube::before,
  .tube::before {
left: -5px;
right: -5px;
height: 7px;
  }
}

/* Balanced level rows */
.level-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .level-grid {
grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .level-grid {
grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .level-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Menu latéral */
.menu-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 30;
  width: 44px;
  padding: 0;
  font-size: 1.4rem;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10, 16, 28, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(280px, 85vw);
  padding: 16px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(-105%);
  visibility: hidden;
  transition: transform 220ms ease, visibility 220ms;
}

.side-menu.open {
  transform: none;
  visibility: visible;
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.2rem;
}

.side-close {
  width: 44px;
  padding: 0;
  font-size: 1.6rem;
}

.theme-toggle {
  margin-top: auto;
}

.app-shell {
  padding-top: 64px;
}

/* Mode sombre */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8edf6;
  --muted: #9aa7bd;
  --surface: #1c2433;
  --surface-strong: #232d40;
  --line: #34415a;
  --shadow: 0 14px 28px rgba(0, 0, 0, 0.4);
}

:root[data-theme="dark"] body {
  background:
radial-gradient(circle at 12% 10%, rgba(47, 128, 237, 0.2), transparent 28rem),
linear-gradient(135deg, #0f1522 0%, #141c2c 55%, #1a1a26 100%);
  background-attachment: fixed;
}

:root[data-theme="dark"] .home-preview,
:root[data-theme="dark"] .tube-board,
:root[data-theme="dark"] .power-ups,
:root[data-theme="dark"] .stat,
:root[data-theme="dark"] .level-button,
:root[data-theme="dark"] .win-panel {
  background: linear-gradient(135deg, #1c2433 0%, #232d40 100%);
}

:root[data-theme="dark"] .tube,
:root[data-theme="dark"] .preview-tube {
  background: linear-gradient(180deg, #2a3650 0%, #1d2638 100%);
}
