:root {
  color-scheme: light;
  --ink: #17332a;
  --muted: #4f675e;
  --line: #dbe5dc;
  --paper: #f7f8f3;
  --white: #fdfefa;
  --green: #285c48;
  --dark-green: #214c3d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:enabled { cursor: pointer; }
button:disabled { opacity: .46; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #267a68; outline-offset: 3px; }

.site-header { border-bottom: 1px solid var(--line); background: var(--white); }
.header-inner, .site-footer { max-width: 1144px; padding: 0 28px; margin: auto; }
.header-inner { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 16px; font-weight: 800; letter-spacing: -.045em; line-height: 1.05; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 8px); grid-auto-rows: 8px; gap: 3px; padding: 7px; border-radius: 9px; background: #254f41; flex: none; }
.brand-mark i { border-radius: 50%; background: #e2ef9e; }
.brand-mark i:nth-child(2) { background: #b3d7fa; }
.brand-mark i:nth-child(3) { background: #ffac9a; }
.brand-mark i:nth-child(4) { background: #a9dfb0; }
.top-nav { display: flex; align-items: center; justify-content: flex-end; gap: 24px; min-width: 0; font-size: .9rem; font-weight: 650; }
.top-nav > a { color: var(--muted); }
.languages { position: relative; }
.languages summary { cursor: pointer; border: 1px solid var(--line); padding: 8px 11px; border-radius: 8px; color: var(--green); white-space: nowrap; background: white; }
.languages summary span { color: #6a8c7f; }
.language-menu { display: grid; min-width: 156px; gap: 2px; position: absolute; right: 0; top: calc(100% + 6px); padding: 6px; z-index: 2; border-radius: 10px; border: 1px solid var(--line); background: white; box-shadow: 0 10px 30px #17332a14; }
.language-menu :is(a, button) { padding: 6px 9px; border-radius: 6px; }
.language-menu button { color: inherit; background: transparent; border: 0; text-align: start; }
.language-menu :is(a, button):hover, .language-menu [aria-current] { background: #e9f1e7; }

.page { padding: 36px 28px 30px; max-width: 1144px; margin: auto; }
.game-intro { margin-bottom: 23px; }
.game-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.game-switch a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--green); font-size: .85rem; font-weight: 750; }
.game-switch a[aria-current] { background: var(--dark-green); color: white; border-color: var(--dark-green); }
.eyebrow { margin: 0 0 8px; color: var(--green); text-transform: uppercase; font-size: .72rem; font-weight: 820; letter-spacing: .14em; }
h1, h2, p { overflow-wrap: anywhere; }
h1 { font-size: clamp(2.15rem, 5vw, 4rem); font-weight: 820; letter-spacing: -.075em; line-height: 1.03; margin: 0 0 10px; }
:lang(hi) h1, :lang(zh-Hans) h1 { letter-spacing: -.035em; line-height: 1.13; }
.game-intro p:not(.eyebrow), .instructions p, .daily-card p, .faq p, .game-tile p { margin: 0; color: var(--muted); line-height: 1.55; }
.game-layout { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(0, 1fr); align-items: start; gap: 18px; }
.game-card, .instructions, .daily-card, .faq, .game-tile {
  background: var(--white); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 3px 9px #13352507;
}
.game-card { min-width: 0; padding: 13px; }
.game-top, .stage, .dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.game-top { padding: 1px 0 12px; }
.modes { display: flex; align-items: stretch; gap: 3px; padding: 3px; border-radius: 10px; background: #edf3eb; max-width: 83%; }
.modes button { color: var(--green); background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 7px 11px; font-weight: 750; font-size: .8rem; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.modes button[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 4px #17332a13; border-color: #e0e8dc; }
.modes button[aria-pressed="false"]:hover { background: #e2eee1; }
.moves { display: flex; flex-direction: column; text-align: right; gap: 1px; padding-right: 5px; flex: 0 1 auto; min-width: 0; }
.moves span { color: var(--muted); font-size: .69rem; font-weight: 720; overflow-wrap: anywhere; }
.moves strong { font-variant-numeric: tabular-nums; font-size: 1.3rem; line-height: 1; }
.playfield { min-width: 0; overflow: hidden; border: 1px solid #cfdfd0; border-radius: 11px; padding: 14px 16px 8px; background-color: #e9f3e7; background-image: radial-gradient(circle at 1px 1px, #4e82642b .8px, transparent 0), linear-gradient(155deg,#eff7eb,#e1f0e7); background-size: 16px 16px, auto; }
.stage h2 { margin: 0; font-size: 1rem; letter-spacing: -.025em; }
.level-count { border: 1px solid #cddfd0; background: #f8fdf5; padding: 4px 9px; border-radius: 7px; font-size: .74rem; font-weight: 750; color: var(--green); font-variant-numeric: tabular-nums; white-space: nowrap; }
.level-count:hover { background: white; }
.board { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; align-items: end; column-gap: clamp(8px, 1.55vw, 22px); row-gap: 9px; min-height: 204px; padding: 20px 0 12px; }
.vial-button { --ball-size: 34px; display: grid; align-items: end; justify-items: center; gap: 4px; border: 0; border-radius: 10px; padding: 6px 4px 1px; background: transparent; color: var(--green); touch-action: manipulation; }
.board[data-size="8"] .vial-button, .board[data-size="9"] .vial-button, .board[data-size="10"] .vial-button { --ball-size: 29px; }
.vial { display: flex; flex-direction: column-reverse; justify-content: flex-start; align-items: center; gap: 3px; width: calc(var(--ball-size) + 14px); height: calc(var(--ball-size) * 4 + 24px); padding: 7px 3px 5px; position: relative; border: 2px solid #7ca591; border-top: 3px solid #91b5a0; border-radius: 8px 8px 16px 16px; background: #ffffff92; box-shadow: inset 3px 0 #fff9, 0 4px 0 #568b6622; transition: transform .18s, border-color .18s, box-shadow .18s; }
.vial::before { content: ""; position: absolute; top: -3px; right: -4px; left: -4px; height: 4px; border: 1px solid #6f9e85; border-radius: 4px; background: #f7fff5; }
.vial-index { color: #4e6f61; padding: 2px 5px; border-radius: 5px; font-size: .72rem; line-height: 1; font-weight: 750; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .vial-button:hover .vial { background-color: #ffffffc7; } }
.vial-button[aria-pressed="true"] .vial { transform: translateY(-7px); border-color: #356e56; box-shadow: 0 0 0 3px #5f9f7666, inset 3px 0 #fff9; }
.vial-button[aria-pressed="true"] .vial-index { color: white; background: #346951; }
.vial-button.hint-source .vial { outline: 2px dashed #2d775d; outline-offset: 2px; }
.vial-button.hint-target .vial { outline: 2px solid #2d775d; outline-offset: 2px; }
.vial-button.complete .vial { border-color: #4e8b60; background: #f2f9d9; }
.vial-button.complete .vial-index { background: #d8e9ca; }
.orb { width: var(--ball-size); aspect-ratio: 1; border-radius: 50%; flex: none; display: grid; place-items: center; position: relative; background: radial-gradient(circle at 32% 20%, #fff8, transparent 54%), linear-gradient(145deg,var(--ball-light),var(--ball-dark)); box-shadow: inset 0 -2px 3px #112c273d, 0 1px 2px #17332a24; }
.orb i { width: 27%; aspect-ratio: 1; border: 2px solid var(--mark-color); opacity: .83; border-radius: var(--shape, 50%); transform: rotate(var(--turn, 0deg)); }
.orb-0 { --ball-light: #ffba9b; --ball-dark: #e87265; --mark-color: #853f39; }
.orb-1 { --ball-light: #b4b2fa; --ball-dark: #7e74d8; --mark-color: #4b398b; --shape: 2px; --turn: 45deg; }
.orb-2 { --ball-light: #a4e5d1; --ball-dark: #4eab96; --mark-color: #245948; --shape: 2px; }
.orb-3 { --ball-light: #ffe9a2; --ball-dark: #edb848; --mark-color: #835313; }
.orb-3 i { height: 0; border-width: 0 0 2px; border-radius: 0; }
.orb-4 { --ball-light: #b5e1ff; --ball-dark: #65a6d6; --mark-color: #275e8b; }
.orb-4 i { background: var(--mark-color); width: 19%; }
.orb-5 { --ball-light: #fac1e0; --ball-dark: #d57eac; --mark-color: #753c60; --shape: 1px 8px 1px 8px; }
.orb-6 { --ball-light: #d7e99a; --ball-dark: #94b74b; --mark-color: #446221; }
.orb-6 i { height: 0; border-width: 0 0 2px; border-radius: 0; transform: rotate(-45deg); }
.orb-7 { --ball-light: #e5c4ac; --ball-dark: #b68365; --mark-color: #6c4534; }
.orb-7 i { height: 14%; width: 30%; border-radius: 4px; }
.orb.landed { animation: settle .23s ease-out; }
.water-bottle .vial { gap: 0; align-items: stretch; padding: 14px 3px 5px; border-radius: 7px 7px 13px 13px; }
.water-layer { display: grid; place-items: center; flex: 0 0 var(--ball-size); height: var(--ball-size); width: 100%; position: relative; background: linear-gradient(90deg, var(--ball-light), var(--ball-dark)); }
.water-layer:first-child { border-radius: 0 0 8px 8px; }
.water-layer:last-child::after { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 3px; border-radius: 50%; background: #ffffff65; }
.water-layer i { width: 8px; height: 8px; border: 2px solid var(--mark-color); opacity: .7; border-radius: var(--shape, 50%); transform: rotate(var(--turn, 0deg)); }
.water-layer.landed { animation: fill-water .24s ease-out; }
@keyframes fill-water { from { opacity: .45; } to { opacity: 1; } }
@keyframes settle { from { transform: translateY(-5px); } to { transform: translateY(0); } }
.game-status { display: grid; place-items: center; margin: 0; min-height: 30px; color: var(--green); text-align: center; font-size: .82rem; font-weight: 650; padding: 2px 0; }
.game-status[data-tone="warning"] { color: #8e4131; }
.game-status[data-tone="win"] { font-weight: 850; color: #235838; }
.toolbar, .level-navigation { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.toolbar { margin-top: 11px; }
.control { color: var(--green); background: #f8fbf5; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; line-height: 1.2; min-height: 40px; font-size: .8rem; font-weight: 720; overflow-wrap: anywhere; }
.control:enabled:hover { background: #ecf4e8; border-color: #bdd4c2; }
.control span[aria-hidden] { font-size: 1rem; margin-right: 6px; line-height: 1; vertical-align: -.03em; }
.toolbar #share { margin-inline-start: auto; }
.level-navigation { margin-top: 9px; justify-content: space-between; }
.level-navigation .next, .primary-link { color: white; background: var(--dark-green); border-color: var(--dark-green); }
.level-navigation .next:enabled:hover, .primary-link:hover { background: #316750; color: white; }
.level-navigation .next.won { box-shadow: 0 0 0 3px #bde0bd; }
.sidebar { min-width: 0; display: grid; gap: 12px; }
.instructions, .daily-card, .faq, .game-tile { padding: 17px 18px; }
.small-mark, .daily-star { display: grid; place-items: center; border-radius: 8px; background: #e4efe2; color: var(--green); width: 33px; height: 33px; flex: none; font-size: 1.13rem; font-weight: 850; margin-bottom: 10px; }
h2 { font-size: 1.15rem; letter-spacing: -.032em; margin: 0 0 7px; }
.steps { display: grid; gap: 9px; padding: 0; margin: 11px 0 13px; list-style: none; counter-reset: rules; }
.steps li { display: grid; grid-template-columns: 22px 1fr; align-items: start; gap: 8px; line-height: 1.35; font-size: .88rem; color: var(--muted); counter-increment: rules; }
.steps li::before { content: counter(rules); border-radius: 6px; color: var(--green); background: #eaf2e7; font-size: .69rem; font-weight: 820; line-height: 21px; text-align: center; }
.instructions .tip { padding: 9px 10px; border-radius: 8px; background: #f0f3e5; font-size: .8rem; margin-bottom: 8px; }
.text-link { color: var(--green); font-weight: 780; font-size: .82rem; }
.daily-card { display: flex; align-items: start; gap: 10px; background: #f2f6e9; }
.daily-card .daily-star { background: #e3ebca; }
.daily-card p { font-size: .83rem; margin-bottom: 4px; }
.faq { margin-top: 14px; }
.faq summary { color: var(--green); font-size: .93rem; cursor: pointer; font-weight: 650; }
.faq p { margin: 6px 0 0; }
.site-footer { display: flex; align-items: baseline; justify-content: space-between; gap: 13px; flex-wrap: wrap; padding-bottom: 28px; color: var(--muted); font-size: .8rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.article { max-width: 820px; }
.game-tile { display: grid; gap: 20px; grid-template-columns: minmax(90px, 1fr) minmax(0, 2.2fr); align-items: center; }
.game-tile + .game-tile { margin-top: 16px; }
.tile-preview { --ball-size: 36px; display: grid; grid-template-columns: repeat(2, 36px); justify-content: center; gap: 8px; padding: 16px; background: #e9f3e7; border-radius: 9px; }
.tile-preview.water-tile { grid-template-columns: 62px; gap: 0; }
.water-tile .water-layer { border-radius: 0; }
.water-tile .water-layer:first-child { border-radius: 7px 7px 0 0; }
.water-tile .water-layer:last-child { border-radius: 0 0 7px 7px; }
.primary-link { display: inline-block; margin-top: 12px; padding: 9px 12px; border-radius: 8px; font-size: .88rem; font-weight: 750; }
dialog { border: 1px solid var(--line); padding: 15px; border-radius: 12px; color: var(--ink); background: var(--white); width: min(460px,calc(100% - 24px)); max-height: min(85vh, 600px); }
dialog::backdrop { background: #152c2680; }
.dialog-top { margin-bottom: 9px; }
.dialog-top h2 { margin: 0; }
.level-grid { display: grid; gap: 5px; grid-template-columns: repeat(auto-fit,minmax(43px,1fr)); }
.level-grid button[aria-current] { background: #dcebe0; border-color: #8cb49a; }
#share-url { width: 100%; margin-top: 8px; padding: 7px; border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 850px) {
  .game-layout { grid-template-columns: minmax(0,1fr); }
  .sidebar { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .board { min-height: 196px; }
}
@media (max-width: 540px) {
  .header-inner, .site-footer { padding-inline: 12px; }
  .header-inner { min-height: 56px; }
  .top-nav { gap: 6px; }
  .top-nav > a { display: none; }
  .page { padding: 23px 12px; }
  .game-intro { margin-bottom: 14px; }
  .game-intro p:not(.eyebrow) { font-size: .9rem; }
  .game-card { padding: 8px; }
  .playfield { padding: 9px 7px 4px; }
  .sidebar { grid-template-columns: minmax(0,1fr); }
  .board { display: grid; grid-template-columns: repeat(4, minmax(44px, 52px)); gap: 6px 5px; min-height: 155px; padding: 13px 0 6px; }
  .board[data-size="6"] { grid-template-columns: repeat(3, minmax(44px, 52px)); }
  .vial-button, .board[data-size] .vial-button { --ball-size: 27px; padding-inline: 2px; gap: 3px; min-width: 44px; }
  .stage h2 { font-size: .88rem; }
  .toolbar .control { flex: 1 1 auto; min-width: 0; }
  .toolbar #share { margin: 0; }
  .control { padding: 6px 7px; }
  .control span[aria-hidden] { margin-right: 3px; }
  .game-tile { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
