/* Blossom board. Tokens from style.css (Moonlit): the centre is moon gold, idle petals the neutral cell tone,
 * six bloom colours (one per petal position) light up the letters a word used. */
:root { --bl-centre: var(--accent); --bl-centre-ink: var(--accent-ink); --bl-petal: var(--cell); --bl-petal-ink: var(--ink); --bl-line: var(--board-bg);
  --bl-p0: #ff8f7a; --bl-p1: #f7c948; --bl-p2: #6fcf97; --bl-p3: #5cc8e6; --bl-p4: #9a94ff; --bl-p5: #f78fc3; --bl-toast: var(--ink); --bl-toast-ink: var(--bg); }
[data-theme='dark'] { --bl-petal: #2b2a5c; --bl-p0: #ff8a74; --bl-p1: #f2c25a; --bl-p2: #5fcf92; --bl-p3: #4fc3e8; --bl-p4: #a39dff; --bl-p5: #ff8fcb; }

.bl { width: 100%; position: relative; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; display: flex; flex-direction: column; gap: 10px; }
.bl.locked .bl-flower, .bl.locked .bl-acts { opacity: .5; pointer-events: none; }
.bl.done .bl-acts { opacity: .45; pointer-events: none; }

/* ---------- score bar ---------- */
.bl-score { display: flex; align-items: center; gap: 12px; padding: 6px 4px; cursor: pointer; border-radius: 10px; }
.bl-score:hover, .bl-score:focus-visible { background: var(--surface-2); outline: none; }
.bl-score .name { font-family: var(--display); font-weight: 700; font-size: 16px; min-width: 5.2em; white-space: nowrap; }
.bl-score.garden .name { color: var(--accent-2); } .bl-score.perfect .name { color: var(--accent); }
.bl-score .bar { position: relative; flex: 1; height: 30px; margin: 0 16px 0 15px; }
.bl-score .line { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line-strong); }
.bl-score .dot { position: absolute; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--line-strong); z-index: 1; transition: background-color .3s ease, transform .3s ease; }
.bl-score .dot.on { background: var(--accent); transform: scale(1.15); }
.bl-score.garden .line { background: var(--accent); }
.bl-score .ball { position: absolute; top: 50%; left: 0; width: 32px; height: 32px; margin: -16px 0 0 -16px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-family: var(--body); font-weight: 800; font-size: 12px; display: grid; place-items: center; z-index: 2; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); font-variant-numeric: tabular-nums; transition: left .45s cubic-bezier(.3, 1.35, .5, 1); }
.bl-score .best { font-size: 12px; color: var(--ink-faint); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bl-score .chev { color: var(--ink-faint); font-size: 18px; transition: transform .15s ease; }
.bl-score[aria-expanded='true'] .chev { transform: rotate(90deg); }
.bl-ranks { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-btn); padding: 10px 14px; font-size: 14px; animation: blin .2s ease; }
.bl-ranks .lede { margin: 0 0 6px; color: var(--ink-soft); font-size: 13px; }
.bl-ranks ul { list-style: none; margin: 0; padding: 0; }
.bl-ranks li { display: flex; justify-content: space-between; padding: 5px 8px; border-radius: 8px; }
.bl-ranks li.cur { background: color-mix(in srgb, var(--accent) 22%, transparent); font-weight: 800; }
.bl-ranks .sub { margin: 8px 0 0; color: var(--ink-soft); font-size: 13px; }
@keyframes blin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- input + toast ---------- */
.bl-top { position: relative; padding-top: 44px; }
.bl-msg { position: absolute; left: 0; right: 0; top: 4px; display: flex; justify-content: center; pointer-events: none; z-index: 3; }
.bl-toast { position: relative; display: inline-block; padding: 6px 14px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 700; box-shadow: var(--shadow); animation: blpop 1s cubic-bezier(.375, .25, .315, .89) both; white-space: nowrap; }
.bl-toast.err { background: var(--bl-toast); color: var(--bl-toast-ink); border-color: transparent; animation: blfade 1.1s cubic-bezier(.375, .25, .315, .89) both; }
.bl-toast.ok { background: var(--good); color: #fff; border-color: transparent; }
.bl-toast.awesome { background: var(--good); color: #fff; border-color: transparent; font-size: 15px; }
.bl-toast.pangram { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-size: 16px; }
.bl-toast.rv { background: var(--surface-2); animation-duration: 1.6s; }
.bl-toast .pts { position: absolute; left: calc(100% + 8px); bottom: 4px; font-size: 15px; color: var(--accent-2); font-weight: 900; animation: blfly .8s cubic-bezier(.375, .25, .315, .89) both; }
@keyframes blpop { 0% { opacity: 0; transform: translateY(6px); } 18% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes blfade { 0% { opacity: 0; } 12% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes blfly { 0% { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.bl-input { position: relative; display: flex; justify-content: center; align-items: center; height: 44px; font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }
.bl-input.long { font-size: 22px; letter-spacing: .02em; }
.bl-input .word { display: inline-flex; }
.bl-input .c { color: var(--accent); }
.bl-input .b { color: var(--accent-2); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; text-decoration-color: var(--accent-2); }
.bl-input .ph { font-family: var(--body); font-weight: 500; font-size: 22px; letter-spacing: 0; text-transform: none; color: var(--ink-faint); }
.bl-input .caret { width: 2px; height: 34px; margin-left: 3px; background: var(--accent); animation: blblink 1s step-end infinite; }
.bl-input.empty .caret { margin-left: -1px; }
.bl-input .pre { position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-family: var(--body); font-weight: 800; font-size: 13px; letter-spacing: 0; color: var(--ink-faint); background: var(--surface-2); border-radius: 999px; padding: 3px 9px; font-variant-numeric: tabular-nums; }
.bl-input .pre::after { content: " pts"; font-weight: 600; }
@keyframes blblink { 50% { opacity: 0; } }
.bl-input.shake .word { animation: blshake .7s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes blshake { 20% { transform: translate3d(-2px, 0, 0); } 40% { transform: translate3d(3px, 0, 0); } 60% { transform: translate3d(-2px, 0, 0); } 80% { transform: translate3d(3px, 0, 0); } }

/* ---------- flower + pots layout ---------- */
.bl-main { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
@media (min-width: 680px) { .bl-main { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 22px; } }
.bl-left { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bl-flower-wrap { position: relative; width: min(100%, 300px); margin: 0 auto; }
.bl-flower { display: block; width: 100%; height: auto; overflow: visible; }
.bl-flower .petal, .bl-flower .centre { cursor: pointer; transition: transform .1s ease; outline: none; }
.bl-flower .petal path { fill: var(--bl-petal); stroke: var(--bl-line); stroke-width: 6; stroke-linejoin: round; transition: fill .35s ease, stroke .2s ease; }
.bl-flower .petal.bonus path { stroke: var(--accent); stroke-width: 9; }
.bl-flower .petal text, .bl-flower .centre text { font-family: var(--display); font-weight: 800; font-size: 60px; fill: var(--bl-petal-ink); pointer-events: none; }
.bl-flower .centre circle { fill: var(--bl-centre); stroke: var(--bl-line); stroke-width: 6; transition: transform .35s ease; }
.bl-flower .centre text { fill: var(--bl-centre-ink); }
.bl-flower .petal.p0.bloom path { fill: var(--bl-p0); } .bl-flower .petal.p1.bloom path { fill: var(--bl-p1); } .bl-flower .petal.p2.bloom path { fill: var(--bl-p2); }
.bl-flower .petal.p3.bloom path { fill: var(--bl-p3); } .bl-flower .petal.p4.bloom path { fill: var(--bl-p4); } .bl-flower .petal.p5.bloom path { fill: var(--bl-p5); }
.bl-flower .petal.bloom text { fill: #1b1a3f; }
.bl-flower .petal.bloom { transform: scale(1.06); }
.bl-flower .press { transform: scale(.92); }
.bl-flower .petal.bloom.press { transform: scale(1); }
.bl-flower .badge { display: none; }
.bl-flower .petal.bonus .badge { display: block; animation: blbadge .35s cubic-bezier(.3, 1.4, .5, 1) both; }
.bl-flower .badge circle { fill: var(--accent); stroke: var(--bl-line); stroke-width: 4; }
.bl-flower .badge text { font-size: 26px !important; fill: var(--accent-ink) !important; font-weight: 900; }
@keyframes blbadge { from { transform: scale(0); } to { transform: scale(1); } }
.bl-flower.fade .petal > text { opacity: 0; transition: opacity .3s ease; }
.bl-flower .petal > text { transition: opacity .3s ease; }
@media (hover: hover) { .bl-flower .petal:hover path, .bl-flower .centre:hover circle { filter: brightness(.96); } }
.bl-fx { position: absolute; inset: -60px -30px -30px; width: calc(100% + 60px); height: calc(100% + 90px); pointer-events: none; z-index: 30; }
.bl-acts { display: flex; justify-content: center; gap: 10px; }
.bl-acts .btn { min-width: 96px; border-radius: 999px; }
.bl-acts .btn-icon { min-width: 0; width: 44px; height: 44px; }
.bl-acts .btn-icon svg { width: 20px; height: 20px; }

/* the flying mini flower */
.bl-fly { position: absolute; z-index: 25; pointer-events: none; opacity: .95; transform: translate(0, 0) scale(1); transition: transform .62s cubic-bezier(.45, .05, .25, 1), opacity .62s ease; will-change: transform; }
.bl-fly .bl-mini { width: 100%; height: 100%; display: block; }

.bl-right { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bl-foot { margin: 0; font-size: 12px; color: var(--ink-faint); text-align: right; }
.bl-foot a { color: var(--ink-faint); }
.bl-foot a:hover { color: var(--accent-2); }

/* pots */
.bl-pots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 6px; }
@media (min-width: 680px) { .bl-pots { grid-template-columns: repeat(3, 1fr); gap: 12px 8px; align-content: start; } .bl-right { align-self: stretch; } }
@media (min-width: 900px) { .bl-pots { grid-template-columns: repeat(4, 1fr); } }
.bl-pot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 86px; padding: 4px 2px 2px; border-radius: 10px; }
.bl-pot .pot { width: 42px; height: auto; display: block; }
.bl-pot .pot path { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.5; stroke-linejoin: round; }
.bl-pot .bl-mini { width: 56px; height: 56px; margin-bottom: -22px; position: relative; z-index: 1; }
.bl-pot.done .pot { width: 36px; }
.bl-pot .lbl { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 12px; line-height: 1.15; color: var(--ink-soft); text-align: center; max-width: 100%; }
.bl-pot .lbl:empty { display: none; }
.bl-pot .lbl a { color: var(--ink); text-decoration: none; font-weight: 700; word-break: break-all; }
.bl-pot .lbl a:hover { color: var(--accent-2); }
.bl-pot .lbl b { font-size: 11px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.bl-pot.pangram .lbl a { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.bl-pot.done { background: var(--surface); border: 1px solid var(--line); }
.bl-pot.pop .bl-mini { animation: blpot .4s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes blpot { 0% { transform: scale(.5); } 100% { transform: scale(1); } }

/* mini flowers (pots, fly, archive) */
.bl-mini { display: inline-block; width: 64px; height: 64px; vertical-align: middle; overflow: visible; }
.bl-mini .p { fill: var(--bl-petal); stroke: var(--bl-line); stroke-width: 10; stroke-linejoin: round; }
.bl-mini .p0.on { fill: var(--bl-p0); } .bl-mini .p1.on { fill: var(--bl-p1); } .bl-mini .p2.on { fill: var(--bl-p2); }
.bl-mini .p3.on { fill: var(--bl-p3); } .bl-mini .p4.on { fill: var(--bl-p4); } .bl-mini .p5.on { fill: var(--bl-p5); }
.bl-mini .c { fill: var(--bl-centre); stroke: var(--bl-line); stroke-width: 10; }
.bl-mini.lg { width: 120px; height: 120px; }

/* ---------- hints ---------- */
.bl-hints { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 12px 14px 14px; animation: blin .2s ease; font-size: 14px; }
.bl-hints .head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.bl-hints h2 { margin: 0; font-size: 18px; }
.bl-hints .facts { margin: 8px 0 0; color: var(--ink-soft); }
.bl-hints .rv-row { margin: 12px 0 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bl-hints .rv-row small { font-weight: 600; opacity: .8; margin-left: 4px; }
.bl-hints .hint-step { margin: 12px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); font-weight: 700; }

/* ---------- end: review + best plan ---------- */
.bl-end { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 12px 14px 14px; animation: blin .25s ease; font-size: 14px; }
.bl-end h2 { margin: 0; font-size: 18px; }
.bl-end .lede { margin: 4px 0 8px; color: var(--ink-soft); font-size: 13px; }
.bl-review { list-style: none; margin: 0; padding: 0; }
.bl-review li { display: grid; grid-template-columns: 22px minmax(0, 1fr) 36px minmax(0, 1.6fr); gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.bl-review .n { color: var(--ink-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.bl-review .w { font-weight: 800; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.bl-review .w a { color: inherit; text-decoration: none; } .bl-review .w a:hover { color: var(--accent-2); }
.bl-review .bt { font-style: normal; font-size: 11px; font-weight: 800; color: var(--accent-2); margin-left: 5px; }
.bl-review .p { font-variant-numeric: tabular-nums; text-align: right; }
.bl-review .alt { color: var(--ink-soft); font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.bl-review li.ok .alt { color: var(--good); font-weight: 800; }
.bl-review li.bad .alt { color: var(--bad); }
.bl-review.plan .alt { color: var(--ink-faint); }
.bl-end .sum { margin: 10px 0 0; font-weight: 700; }
.bl-end .sum.ok { color: var(--good); }
.bl-plan { margin-top: 12px; }
.bl-plan summary { cursor: pointer; font-weight: 700; }

/* ---------- page bits ---------- */
.bl-page .board-wrap { padding: 14px; align-items: stretch; }
.bl-page .board-wrap #game { min-height: 640px; }
.bl-page .solved .btn { white-space: nowrap; }
.btn-icon svg { width: 20px; height: 20px; }
.btn-icon { position: relative; }
.btn-icon .cnt { position: absolute; right: -5px; top: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.btn-icon .cnt:empty { display: none; }
.snd-off .ic-on, .btn-icon:not(.snd-off) .ic-off { display: none; }
.gp-bar { position: relative; }
.q-meta { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.q-meta .pill { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-variant-numeric: tabular-nums; }
.q-pick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 12px; }
.q-pick button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.q-pick button[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* answers (archive pages) */
.bl-answers { margin: 16px 0; }
.bl-answers summary { cursor: pointer; font-weight: 700; }
.bl-answers ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px 12px; }
.bl-answers li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.bl-answers li.p { font-weight: 800; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.bl-answers a { color: var(--ink); text-decoration: none; }
.bl-answers a:hover { color: var(--accent-2); }

@media (max-width: 480px) {
  .bl-score .name { min-width: 4.6em; font-size: 15px; }
  .bl-input { font-size: 26px; }
  .bl-acts .btn { min-width: 84px; padding-inline: 14px; }
  .bl-pot { min-height: 78px; }
  .bl-pot .bl-mini { width: 48px; height: 48px; margin-bottom: -19px; }
  .bl-pot .lbl { font-size: 11px; }
  .bl-review li { grid-template-columns: 18px minmax(0, 1fr) 32px; }
  .bl-review .alt { grid-column: 2 / -1; }
}
