/* Hormone Maze: only what the page adds to style.css (same tokens, same quiet dark UI).
   The three hormones get the only new colors: amber ethylene, green gibberellin, violet abscisic acid. */
.maze-page { --eth: #f5a524; --ga: #34d399; --aba: #a78bfa; }

a.seg { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.seg[aria-current="page"] { color: var(--text); }
.seg[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent);
}
.maze-page .layout { grid-template-columns: minmax(340px, 720px) minmax(320px, 1fr); }

/* ---------------------------------------------------------------- level bar */
.level-bar { display: flex; align-items: center; gap: 8px; }
.level-meta { flex: 1; min-width: 0; }
.level-name { display: flex; align-items: baseline; gap: 8px; font-size: 16px; font-weight: 600; letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.level-no { font: 500 12px var(--mono); color: var(--muted); letter-spacing: 0.3px; text-transform: uppercase; }
.level-sub { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.stars { display: inline-flex; gap: 2px; color: var(--surface-3); }
.stars svg { width: 14px; height: 14px; }
.stars .on { color: var(--amber); }

/* ---------------------------------------------------------------- the maze */
.maze-shell { background: #0c0e11; overflow: hidden; }
#maze { width: 100%; display: block; touch-action: manipulation; cursor: default; border-radius: var(--r); }
#maze.can { cursor: pointer; }
.maze-tip {
  position: absolute; z-index: 5; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap;
  padding: 5px 9px; border-radius: 7px; font-size: 12px; line-height: 1.3; font-weight: 500;
  background: rgba(17, 19, 23, 0.95); border: 1px solid var(--line-2); color: var(--text); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}
.maze-tip.no { color: var(--muted); }
.maze-hint { margin: 2px 2px 0; min-height: 40px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }

/* ---------------------------------------------------------------- hormone vials */
.hormones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.horm {
  --c: var(--eth);
  position: relative; display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto auto; align-items: center; gap: 1px 10px;
  padding: 10px 12px 10px 10px; text-align: left; border-radius: 12px; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 7%, var(--surface)), var(--surface) 60%);
  border: 1px solid var(--line-2); color: var(--text);
  transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast) ease, box-shadow var(--t) ease, opacity var(--t-fast) ease;
}
.horm[data-h="ga"] { --c: var(--ga); }
.horm[data-h="aba"] { --c: var(--aba); }
.horm:hover:not(:disabled) { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.horm[aria-checked="true"] {
  border-color: var(--c);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 20%, var(--surface)), color-mix(in srgb, var(--c) 5%, var(--surface)) 70%);
  box-shadow: 0 0 0 1px var(--c) inset, 0 10px 28px -12px var(--c);
}
.horm:disabled { opacity: 0.4; cursor: not-allowed; }
.horm .vial { grid-row: 1 / 4; width: 30px; height: 47px; overflow: visible; transform-origin: 50% 85%; transition: transform 320ms var(--ease-out); }
.horm[aria-checked="true"] .vial { transform: rotate(-14deg) scale(1.08); }
.horm .vial .glass { fill: none; stroke: rgba(226, 232, 240, 0.8); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.horm .vial .shine { stroke: rgba(255, 255, 255, 0.45); stroke-width: 1.2; stroke-linecap: round; }
.horm .vial .liq { fill: var(--c); transition: y 380ms var(--ease-out), height 380ms var(--ease-out); }
.horm .vial .bub { fill: rgba(255, 255, 255, 0.75); opacity: 0; }
.horm[aria-checked="true"] .vial .bub { animation: bubble 1.6s ease-in infinite; }
.horm[aria-checked="true"] .vial .b2 { animation-delay: 0.7s; }
@keyframes bubble { 0% { opacity: 0; transform: translateY(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
.horm .nm { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 14px; }
.horm .nm em { margin-left: 7px; font: 500 11px var(--mono); color: var(--c); }
.horm .fx { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.horm .pips { display: flex; gap: 4px; margin-top: 5px; }
.horm .pips i { width: 9px; height: 9px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); transition: background var(--t) ease, transform var(--t) var(--ease-out); }
.horm .pips i.on { background: var(--c); box-shadow: 0 0 8px -1px var(--c); }
.horm .pips i:not(.on) { transform: scale(0.8); }
.horm .mol { position: absolute; right: 6px; bottom: 4px; width: 62px; height: 37px; fill: none; stroke: var(--c); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.2; pointer-events: none; transition: opacity var(--t) ease; }
.horm .mol circle { fill: var(--c); stroke: none; }
.horm[aria-checked="true"] .mol { opacity: 0.42; }
.horm kbd { position: absolute; top: 6px; right: 8px; font: 500 9.5px var(--mono); color: var(--faint); }

/* the level's name, shown for a moment when it loads */
.maze-banner {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 4; pointer-events: none; opacity: 0;
  display: flex; align-items: baseline; gap: 10px; padding: 7px 14px; border-radius: 999px; white-space: nowrap;
  background: rgba(10, 11, 13, 0.78); border: 1px solid var(--line-2); backdrop-filter: blur(6px);
}
.maze-banner small { font: 500 11px var(--mono); color: var(--accent); letter-spacing: 0.5px; text-transform: uppercase; }
.maze-banner b { font-size: 14px; font-weight: 600; }
.maze-banner.show { animation: banner 2.4s var(--ease-out) both; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -10px); } 12%, 75% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -6px); } }
.maze-shell { background: radial-gradient(120% 90% at 50% 40%, #131820, #0a0c0f 75%); }
.maze-tip { border-color: color-mix(in srgb, var(--c, #fff) 55%, transparent); }
.maze-tip.no { border-color: var(--line-2); }
#go.pulse { animation: go-pulse 1.5s ease-in-out infinite; }
@keyframes go-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35); } 50% { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); } }
.stars.pop svg.on { animation: star-pop 520ms cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: calc(var(--i) * 180ms + 250ms); }
@keyframes star-pop { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 100% { transform: none; opacity: 1; } }

.maze-controls { display: flex; align-items: center; gap: 8px; }
.maze-controls .spacer { flex: 1; }
.maze-controls #go { min-width: 108px; }
.maze-controls .btn[aria-pressed="true"]#speed { color: var(--accent); }
.maze-page .status { min-height: 20px; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- the brain panel */
.brain-read { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 12px 0 0; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.brain-read div { background: var(--surface); padding: 9px 10px 8px; min-width: 0; }
.brain-read dt { font-size: 10px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: 0.6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brain-read dd { margin: 3px 0 0; font: 600 14px/1.2 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brain-read dd small { font: 500 11.5px var(--mono); color: var(--muted); }
.brain-read .attractive { color: var(--green); }
.brain-read .aversive { color: var(--red); }
.maze-page .stage-caption { max-width: calc(100% - 20px); }
.maze-page .stage-orient { bottom: auto; top: 9px; }

/* ---------------------------------------------------------------- what the fly smells */
.smells { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.smells li { display: grid; grid-template-columns: 14px minmax(96px, auto) 1fr 64px; align-items: center; gap: 10px; font-size: 13px; }
.smells i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.smells .nm { white-space: nowrap; }
.smells .nm small { color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.smells .bar { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.smells .bar b { display: block; height: 100%; border-radius: 4px; background: var(--c); transition: width 200ms var(--ease-out); }
.smells .v { text-align: right; font: 500 12px var(--mono); color: var(--muted); white-space: nowrap; }
.smells li.lead .nm { font-weight: 600; }
.smells li.lead .v { color: var(--text); }
.smells .none { display: block; color: var(--muted); font-size: 13px; }

.horm-notes { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.horm-notes dt { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.horm-notes dt i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.horm-notes dt span { font: 500 11.5px var(--mono); color: var(--muted); }
.horm-notes dd { margin: 3px 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }

.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin-top: 10px; }
.lv {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 9px 10px; border-radius: 9px; text-align: left;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  transition: background var(--t-fast) ease, border-color var(--t-fast) ease;
}
.lv:hover:not(:disabled) { background: var(--surface-3); }
.lv[aria-current="true"] { border-color: var(--accent); }
.lv:disabled { opacity: 0.45; cursor: not-allowed; }
.lv .k { font: 500 11px var(--mono); color: var(--muted); }
.lv .t { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lv .stars svg { width: 11px; height: 11px; }
.lv .lock { color: var(--faint); }
.lv .lock svg { width: 12px; height: 12px; }

.maze-page .result-emblem.wide { width: 112px; }
.maze-page .result-emblem .stars { gap: 4px; }
.maze-page .result-emblem .stars svg { width: 24px; height: 24px; }
.maze-page .result-card { padding-bottom: 20px; }
.maze-page .result-stats { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1120px) {
  .maze-page .layout { max-width: 720px; }
}
@media (max-width: 720px) {
  .maze-page .brand-name { display: none; }
  .brain-read { display: none; }
  .hormones { gap: 6px; }
  .horm { grid-template-columns: 22px 1fr; padding: 8px 8px 8px 6px; gap: 0 6px; }
  .horm .vial { width: 22px; height: 35px; }
  .horm .mol, .horm kbd, .horm .fx { display: none; }
  .horm .nm { font-size: 12.5px; padding-right: 0; display: flex; flex-direction: column; }
  .horm .nm em { margin-left: 0; }
  .maze-hint { font-size: 13px; min-height: 0; }
  .level-name { font-size: 15px; }
  .smells li { grid-template-columns: 14px minmax(84px, auto) 1fr 58px; gap: 8px; }
}
