/* Dark Mage of Mossfen — the choosing screen and the Druid's colours (v0.17).
   Same world as the HUD: moss-black glass, tarnished-brass edges, bone-coloured type. */

/* ---- the Druid's spells in the HUD ------------------------------------------- */
:root { --wood: #9dff4a; --poison: #d59bff; }
#log .tone-wood { color: #b4f07a; }
#log .tone-poison { color: var(--poison); }
.dmg-wood { color: #c8ff7a; }
.dmg-poison { color: #dca8ff; font-size: 17px; }               /* a tick of poison: smaller than a hit */
.dmg-note.note-wood { color: var(--wood); }
.dmg-note.note-poison { color: var(--poison); }
.elem.is-weak[data-el="wood"], #tg-ice.is-weak[data-el="wood"] { color: var(--wood); }
.elem.is-weak[data-el="poison"], #tg-ice.is-weak[data-el="poison"] { color: var(--poison); }
.elem.is-weak[data-el="fire"] { color: var(--fire); }

/* green flash when the roots break the ground, violet when the nightshade bursts */
.screen-flash.root-flash {
  background: radial-gradient(circle at 50% 58%, rgba(240, 255, 210, 0.85), rgba(141, 255, 58, 0.4) 45%, rgba(30, 90, 20, 0.2));
}
.screen-flash.shade-flash {
  background: radial-gradient(circle at 50% 58%, rgba(245, 225, 255, 0.8), rgba(176, 90, 255, 0.4) 45%, rgba(60, 20, 110, 0.22));
}

.help-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.help-foot .link-btn { margin: 0; }

/* ---- the choosing screen -------------------------------------------------------- */
#select {
  position: absolute; inset: 0; z-index: 40;
  display: grid; grid-template-rows: auto auto auto; justify-items: center; gap: 18px;
  align-content: start; align-content: safe center;      /* centred when it fits, from the top (and scrollable) when it doesn't */
  padding: 28px 16px 22px;
  overflow-y: auto;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(64, 104, 58, 0.34), transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 110%, rgba(8, 12, 9, 0.9), transparent 60%),
    linear-gradient(#131c16, #0b100d);
}
#select > header { display: grid; justify-items: center; gap: 4px; text-align: center; }
.select-kicker { margin: 0; font: 700 14px/1 var(--f-display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--edge-strong); }
#select h1 { margin: 0; font: 700 clamp(28px, 4.4vw, 44px)/1.05 var(--f-display); letter-spacing: 0.03em; color: var(--ink); text-wrap: balance; }
.select-note { margin: 2px 0 0; font-size: 15px; color: var(--ink-dim); }
.select-keys { margin: 0; font-size: 13px; color: var(--ink-faint); }
.select-keys kbd {
  display: inline-block; min-width: 22px; padding: 2px 5px; border: 1px solid var(--edge); border-radius: 4px;
  font: 700 12px/1.2 var(--f-display); color: var(--ink-dim); background: rgba(0, 0, 0, 0.3); text-align: center;
}
.select-loading {
  display: none; position: absolute; inset: 0; margin: 0; place-items: center;
  font: 500 18px var(--f-display); letter-spacing: 0.06em; color: var(--ink-dim);
}
#select.is-leaving > header, #select.is-leaving .pick-list, #select.is-leaving .select-keys { opacity: 0; pointer-events: none; transition: opacity 0.18s ease-out; }
#select.is-leaving .select-loading { display: grid; }

/* fireflies drifting up behind the cards */
.select-sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.select-sky i {
  position: absolute; bottom: -12px; width: 5px; height: 5px; border-radius: 50%;
  background: #d9ff9a; box-shadow: 0 0 10px 3px rgba(157, 255, 74, 0.55);
  opacity: 0; animation: select-rise 11s linear infinite;
}
.select-sky i:nth-child(1) { left: 8%;  animation-delay: -1s; }
.select-sky i:nth-child(2) { left: 21%; animation-delay: -6s; animation-duration: 14s; }
.select-sky i:nth-child(3) { left: 36%; animation-delay: -3s; background: #e6ceff; box-shadow: 0 0 10px 3px rgba(185, 140, 255, 0.55); }
.select-sky i:nth-child(4) { left: 52%; animation-delay: -9s; animation-duration: 13s; }
.select-sky i:nth-child(5) { left: 64%; animation-delay: -4.5s; background: #e6ceff; box-shadow: 0 0 10px 3px rgba(185, 140, 255, 0.55); }
.select-sky i:nth-child(6) { left: 77%; animation-delay: -7.5s; animation-duration: 15s; }
.select-sky i:nth-child(7) { left: 88%; animation-delay: -2s; }
.select-sky i:nth-child(8) { left: 95%; animation-delay: -10s; animation-duration: 12s; background: #e6ceff; box-shadow: 0 0 10px 3px rgba(185, 140, 255, 0.55); }
@keyframes select-rise {
  0% { transform: translate(0, 0); opacity: 0; }
  12% { opacity: 0.9; }
  50% { transform: translate(26px, -52vh); opacity: 0.6; }
  88% { opacity: 0.8; }
  100% { transform: translate(-14px, -108vh); opacity: 0; }
}

.pick-list {
  position: relative;
  display: grid; grid-template-columns: repeat(2, minmax(0, 380px)); gap: 22px;
  align-items: stretch; justify-content: center; width: 100%; max-width: 820px;
}
.pick {
  --pick: var(--edge-strong);
  position: relative; display: grid; grid-template-rows: auto auto auto 1fr auto auto auto auto; gap: 8px;
  padding: 0 18px 16px; cursor: pointer; text-align: center;
  background: linear-gradient(rgba(24, 33, 27, 0.92), rgba(14, 20, 16, 0.94));
  border: 1px solid var(--edge); border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.06), 0 14px 34px rgba(0, 0, 0, 0.5);
  transition: transform 0.16s ease-out, border-color 0.16s, box-shadow 0.16s;
  outline: none;
}
.pick:hover, .pick:focus-visible, .pick.is-hot {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--pick) 70%, #000);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.08), 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px color-mix(in srgb, var(--pick) 55%, transparent), 0 0 34px color-mix(in srgb, var(--pick) 26%, transparent);
}
.pick:focus-visible { outline: 2px solid color-mix(in srgb, var(--pick) 70%, #fff); outline-offset: 3px; }

/* the portrait stands in a pool of its own light */
.pick-stage {
  position: relative; height: 230px; margin: 0 -18px; overflow: hidden; border-radius: 10px 10px 0 0;
  background:
    radial-gradient(ellipse 46% 15% at 50% 88%, rgba(0, 0, 0, 0.55), transparent 70%),
    radial-gradient(ellipse 62% 70% at 50% 58%, color-mix(in srgb, var(--pick) 34%, transparent), transparent 72%),
    linear-gradient(rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0));
  border-bottom: 1px solid var(--edge);
}
.pick-stage canvas {
  position: absolute; left: 50%; bottom: 4px; width: 216px; height: 216px; transform: translateX(-50%);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
}
.pick h2 { margin: 6px 0 0; font: 700 28px/1 var(--f-display); letter-spacing: 0.04em; color: var(--ink); }
.pick-role { margin: 0; font: 700 13px/1.2 var(--f-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--pick); }
.pick-pitch { margin: 2px 0 0; font-size: 15px; line-height: 1.4; color: var(--ink-dim); text-wrap: pretty; }

.pick-ratings { display: grid; gap: 5px; margin: 6px auto 0; width: min(100%, 250px); }
.pick-ratings div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pick-ratings dt { font: 500 13px/1 var(--f-display); letter-spacing: 0.06em; color: var(--ink-dim); }
.pick-ratings dd { margin: 0; display: flex; gap: 4px; }
.pick-ratings i { width: 20px; height: 8px; border-radius: 2px; background: #080b09; border: 1px solid #000; }
.pick-ratings i.on { background: linear-gradient(#fff5 0 40%, transparent 40%), var(--pick); }

.pick-spells { display: flex; justify-content: center; gap: 14px; margin: 8px 0 0; padding: 10px 0 0; list-style: none; border-top: 1px solid var(--edge); }
.pick-spells li { display: grid; justify-items: center; gap: 5px; width: 82px; }
.pick-spells img { width: 44px; height: 44px; border: 1px solid #000; border-radius: 5px; box-shadow: 0 0 0 1px var(--edge); }
.pick-spells span { font: 500 12px/1.15 var(--f-display); letter-spacing: 0.04em; color: var(--ink-dim); }

.pick-save { margin: 4px 0 0; font-size: 14px; color: var(--ink-dim); min-height: 20px; }
.pick-save b { color: var(--exp); font: 700 15px/1 var(--f-display); letter-spacing: 0.04em; }
.pick-save em {
  margin-left: 8px; padding: 1px 7px; border: 1px solid var(--edge); border-radius: 9px;
  font: 500 11px/1.4 var(--f-display); letter-spacing: 0.08em; text-transform: uppercase; font-style: normal; color: var(--ink-faint);
}
.pick-actions { display: grid; justify-items: center; gap: 6px; min-height: 66px; align-content: start; }
.pick-go {
  min-width: 170px; padding: 10px 20px; border-radius: 5px; cursor: pointer;
  font: 700 17px/1 var(--f-display); letter-spacing: 0.06em;
  color: #1b140f; background: linear-gradient(#f3d68a, #c99d45); border: 1px solid #000;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}
.pick-go:hover { background: linear-gradient(#ffe6a3, #d9ae55); }
.pick-go:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pick-reset { margin: 0; }

@media (max-height: 860px) and (min-width: 721px) {
  #select { gap: 12px; padding: 16px 16px 14px; }
  .pick-stage { height: 196px; }
  .pick-stage canvas { width: 186px; height: 186px; }
  .pick { gap: 6px; padding-bottom: 12px; }
  .pick-pitch { font-size: 14px; }
  .pick-actions { min-height: 60px; }
}
@media (max-width: 720px) {
  #select { align-content: start; padding-top: 18px; gap: 12px; }
  .pick-list { grid-template-columns: minmax(0, 420px); gap: 14px; }
  .pick-stage { height: 180px; }
  .pick-stage canvas { width: 168px; height: 168px; }
  .select-keys { display: none; }
  .pick h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .select-sky i { animation: none; opacity: 0.5; bottom: auto; top: 30%; }
  .pick { transition: none; }
  .pick:hover, .pick:focus-visible, .pick.is-hot { transform: none; }
}
