/* Word Ladder Race: mode switch, the ladder (rails + rungs of letter tiles), keyboard, results.
   Sibling of Daily Word (same tiles and keyboard), with its own green: the changed letter on each
   rung is filled green, a letter that already matches the goal gets a green bar under it. */
.wl-page { --wl-c: #0e8a6e; --wl-c-soft: #dcf2ea; --wl-rail: #c9a27c; --wl-empty: #e9dfd2; --wl-key: #efe6da; }
.wl-page [hidden] { display: none !important; }

.wl-modes { display: flex; gap: 6px; margin: 0 0 10px; background: var(--cbx-soft); padding: 4px; border-radius: 14px; }
.wl-modes button { flex: 1; border: 0; background: transparent; padding: 10px 6px; border-radius: 11px; font: 900 15px var(--cbx-body); color: var(--cbx-muted); cursor: pointer; white-space: nowrap; }
.wl-modes button[aria-selected="true"] { background: #fff; color: var(--cbx-ink); box-shadow: 0 2px 6px rgba(42, 29, 23, .12); }
.wl-tick { color: var(--wl-c); }

.wl-card { padding: 12px 12px 16px; }
.wl-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wl-top-r { display: flex; align-items: center; gap: 6px; flex: none; }
.wl-pill { font: 900 13px var(--cbx-body); background: color-mix(in srgb, var(--cbx-accent) 12%, #fff); color: color-mix(in srgb, var(--cbx-accent) 70%, #000); padding: 6px 11px; border-radius: 999px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-icon { border: 0; background: var(--cbx-soft); width: 36px; height: 34px; border-radius: 10px; font: 900 17px var(--cbx-body); color: var(--cbx-ink-2); cursor: pointer; }
.wl-lens { display: flex; background: var(--cbx-soft); border-radius: 10px; padding: 3px; gap: 2px; }
.wl-lens button { border: 0; background: transparent; min-width: 32px; height: 28px; border-radius: 8px; font: 900 14px var(--cbx-body); color: var(--cbx-muted); cursor: pointer; }
.wl-lens button[aria-checked="true"] { background: #fff; color: var(--cbx-ink); box-shadow: 0 1px 4px rgba(42, 29, 23, .12); }

.wl-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 0; }
.wl-bar span { background: var(--cbx-soft); border-radius: 12px; padding: 5px 4px; text-align: center; }
.wl-bar b { display: block; font: 900 20px/1.1 var(--cbx-body); color: var(--cbx-ink); font-variant-numeric: tabular-nums; }
.wl-bar small { display: block; font: 800 11px var(--cbx-body); color: var(--cbx-muted); text-transform: uppercase; letter-spacing: .05em; }

.wl-stage { position: relative; margin: 10px 0 8px; }
.wl-card .wl-ladder { --n: 4; list-style: none; margin: 0 auto; padding: 4px 0; width: fit-content; max-width: 100%; max-height: min(52vh, 520px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.wl-rung { position: relative; display: flex; justify-content: center; margin: 0; padding: 0; }
.wl-rbtn { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 3px 0; margin: 0; font: inherit; color: inherit; border-radius: 12px; }
button.wl-rbtn { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.wl-rbtn:hover .wl-tiles, button.wl-rbtn:focus-visible .wl-tiles { box-shadow: 0 0 0 3px color-mix(in srgb, var(--wl-c) 35%, transparent); }
button.wl-rbtn:focus-visible { outline: none; }
.wl-num { width: 36px; text-align: right; font: 900 11px var(--cbx-body); color: var(--cbx-muted); text-transform: uppercase; letter-spacing: .02em; }
.wl-hinted { position: absolute; right: 10px; font-size: 15px; }
.wl-rung .wl-rbtn { position: relative; }
/* the rails: a wooden frame around each rung's tiles */
.wl-tiles { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 5px; padding: 5px 9px; border-left: 5px solid var(--wl-rail); border-right: 5px solid var(--wl-rail); border-radius: 4px; margin-right: 44px; transition: box-shadow .12s; }
.wl-tile { width: min(46px, calc((100vw - 196px) / var(--n))); aspect-ratio: 1; display: grid; place-items: center; position: relative; border-radius: 9px; background: #fff; box-shadow: inset 0 0 0 2px #cdbcab; font: 900 min(25px, calc(48vw / var(--n) / 1.6))/1 var(--cbx-body); color: var(--cbx-ink); text-transform: uppercase; user-select: none; }
.wl-tile.ch { background: var(--wl-c); color: #fff; box-shadow: none; }
.wl-tile.m::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: 4px; height: 3px; border-radius: 2px; background: var(--wl-c); }
.wl-tile.ch.m::after { background: #fff; opacity: .85; }
.wl-tile.ghost { color: #cdbfb1; box-shadow: inset 0 0 0 2px var(--wl-empty); }
.wl-rung.start .wl-tile { background: #fff7ec; box-shadow: inset 0 0 0 2px #e2c9a6; }
.wl-rung.typing .wl-tile:not(.ch):not(.ghost) { box-shadow: inset 0 0 0 2px #8f7b6a; }
.wl-rung.typing .wl-tiles { background: color-mix(in srgb, var(--wl-c) 7%, transparent); }
.wl-rung.goal .wl-tile { background: #f1faf6; box-shadow: inset 0 0 0 2px var(--wl-c); color: #0b6b56; }
.wl-rung.goal.reached .wl-tile { background: var(--wl-c); color: #fff; box-shadow: none; }
.wl-rung.goal.reached .wl-tile.m::after { display: none; }
.wl-rung.goal .wl-num, .wl-rung.start .wl-num { color: var(--wl-c); }
.wl-gap { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; }
.wl-gap i { display: block; width: 5px; height: 5px; border-radius: 50%; background: #d4c3b2; }

.wl-tile.pop { animation: wl-pop .18s ease-out; }
.wl-rung.shake { animation: wl-shake .4s; }
.wl-rung.win .wl-tile { animation: wl-hop .5s ease-out both; }
.wl-rung.win .wl-tile:nth-child(2) { animation-delay: .06s; } .wl-rung.win .wl-tile:nth-child(3) { animation-delay: .12s; }
.wl-rung.win .wl-tile:nth-child(4) { animation-delay: .18s; } .wl-rung.win .wl-tile:nth-child(5) { animation-delay: .24s; }
@keyframes wl-pop { 50% { transform: scale(1.12); } }
@keyframes wl-shake { 15%, 55% { transform: translateX(-7px); } 35%, 75% { transform: translateX(7px); } }
@keyframes wl-hop { 40% { transform: translateY(-10px); } 70% { transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .wl-tile.pop, .wl-rung.shake, .wl-rung.win .wl-tile { animation: none; } .wl-tiles { transition: none; } }

.wl-card .wl-toast { position: absolute; left: 50%; top: 6px; transform: translate(-50%, -6px); max-width: 92%; width: max-content; padding: 9px 14px; border-radius: 12px; background: #1f2a44; color: #fff; font: 900 15px/1.3 var(--cbx-body); text-align: center; box-shadow: 0 10px 24px rgba(20, 25, 45, .3); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 5; }
.wl-card .wl-toast.on { opacity: 1; transform: translate(-50%, 0); }

.wl-tools { display: flex; gap: 8px; justify-content: center; margin: 2px 0 10px; flex-wrap: wrap; }
.wl-tool { border: 0; border-radius: 999px; padding: 8px 13px; background: var(--wl-c-soft); color: #0b6b56; font: 900 14px var(--cbx-body); cursor: pointer; }
.wl-tool small { font: 800 12px var(--cbx-body); opacity: .75; }
.wl-tool.quiet { background: var(--cbx-soft); color: var(--cbx-muted); }
.wl-tool.quiet.armed { background: var(--cbx-bad-soft); color: var(--cbx-bad); }

.wl-keys { display: grid; gap: 6px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.wl-krow { display: flex; gap: 5px; justify-content: center; }
.wl-key { flex: 1 1 0; min-width: 0; max-width: 46px; height: 52px; border: 0; border-radius: 9px; padding: 0; background: var(--wl-key); color: var(--cbx-ink); font: 900 17px var(--cbx-body); cursor: pointer; box-shadow: 0 2px 0 #dccdbb; -webkit-tap-highlight-color: transparent; }
.wl-key.wide { flex: 1.55 1 0; max-width: 74px; font-size: 13px; }
.wl-key[data-k="Backspace"] { font-size: 20px; }
.wl-key:active { transform: translateY(1px); box-shadow: none; }
@media (max-width: 380px) { .wl-krow { gap: 4px; } .wl-key { height: 48px; font-size: 15px; } .wl-key.wide { font-size: 11px; } }

.wl-result { margin-top: 14px; padding-top: 14px; border-top: 2px dashed var(--cbx-line); }
.wl-result .cbx-big small { font-size: .42em; }
.wl-card .wl-sum { margin: 4px 0 12px; font: 800 15px/1.45 var(--cbx-body); color: var(--cbx-ink-2); }
.wl-card .wl-sum b { color: var(--wl-c); }
.wl-best { margin: 0 0 14px; padding: 10px 12px; border-radius: 14px; background: #f1faf6; }
.wl-card .wl-best-h { margin: 0 0 6px; font: 900 12px var(--cbx-body); color: #0b6b56; text-transform: uppercase; letter-spacing: .05em; }
.wl-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; }
.wl-chip { font: 900 15px var(--cbx-body); letter-spacing: .06em; color: var(--cbx-ink); background: #fff; border-radius: 8px; padding: 3px 7px; box-shadow: inset 0 0 0 1.5px #cfe7dd; }
.wl-chip b { color: var(--wl-c); }
.wl-arrow { color: #8bbfae; font: 900 13px var(--cbx-body); padding: 0 1px; }
.wl-mini, .wl-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 14px; }
.wl-mini div, .wl-nums div { background: var(--cbx-soft); border-radius: 12px; padding: 8px 4px; text-align: center; }
.wl-mini b, .wl-nums b { display: block; font: 900 22px var(--cbx-body); color: var(--cbx-ink); font-variant-numeric: tabular-nums; }
.wl-mini span, .wl-nums span { display: block; font: 800 11px var(--cbx-body); color: var(--cbx-muted); text-transform: uppercase; letter-spacing: .04em; }
.wl-card .wl-challenge { margin: 10px 0 0; padding: 10px 12px; border-radius: 14px; background: #fff4e6; box-shadow: inset 0 0 0 2px #f6c58f; font: 800 15px/1.35 var(--cbx-body); color: #5a3510; }
.wl-card .wl-challenge b { color: #c25e00; }
.wl-card .wl-vs { margin: -4px 0 14px; padding: 10px 12px; border-radius: 14px; background: var(--cbx-soft); font: 900 16px/1.35 var(--cbx-body); color: var(--cbx-ink); text-align: center; }
.wl-card .wl-vs.win { background: var(--wl-c-soft); color: #0b6b56; }
.wl-name { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font: 900 13px var(--cbx-body); color: var(--cbx-muted); text-transform: uppercase; letter-spacing: .04em; }
.wl-name input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 2px solid var(--cbx-line); font: 800 16px var(--cbx-body); color: var(--cbx-ink); text-transform: none; letter-spacing: 0; background: #fff; }
.wl-result #resShare2 { margin-top: 8px; }
.wl-link { display: block; margin: 8px auto 0; border: 0; background: none; padding: 8px; font: 900 15px var(--cbx-body); color: var(--wl-c); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.wl-dlg { border: 0; padding: 0; border-radius: 22px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.wl-dlg::backdrop { background: rgba(31, 42, 68, .45); }
.wl-dlg-card { padding: 20px; }
.wl-dlg h2 { margin: 0 0 2px; font: 900 22px var(--cbx-display); color: var(--cbx-ink); }
.wl-dlg h3 { margin: 4px 0 8px; font: 900 15px var(--cbx-body); color: var(--cbx-ink); }
.wl-dlg .wl-dlg-sub { margin: 0 0 12px; font: 800 14px var(--cbx-body); color: var(--cbx-muted); }
.wl-dist { display: grid; gap: 5px; }
.wl-bar2 { display: flex; align-items: center; gap: 8px; font: 900 13px var(--cbx-body); }
.wl-bar2 .k { width: 78px; color: var(--cbx-ink-2); text-align: right; flex: none; }
.wl-bar2 .v { display: block; min-width: 24px; padding: 3px 8px; border-radius: 6px; background: #9aa39f; color: #fff; text-align: right; box-sizing: border-box; }
.wl-bar2.me .v { background: var(--wl-c); }
.wl-dlg-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
