:root {
  --bg: #10130f;
  --panel: #1a1f18;
  --panel-2: #222820;
  --line: #333c2f;
  --text: #e8ece4;
  --muted: #9aa691;
  --accent: #7fb069;
  --accent-dark: #5d8a4c;
  --warn: #d9a94c;
  --bad: #c05c4a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 64px; }

h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
h2 { margin: 32px 0 12px; font-size: 18px; font-weight: 600; }

.header { border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.muted { color: var(--muted); font-size: 13px; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }

input {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  min-width: 180px;
}
input:focus { outline: 2px solid var(--accent-dark); outline-offset: 1px; }

button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
button:hover { border-color: var(--accent-dark); }
button.primary { background: var(--accent-dark); border-color: var(--accent); color: #f2f7ee; }
button.primary:hover { background: var(--accent); }

.status {
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--panel);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sci { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stats { font-size: 13px; margin-top: 6px; }
.lvl { color: var(--accent); font-weight: 600; }
.rarity { color: var(--warn); font-size: 13px; letter-spacing: 2px; }

.badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
/* One hue per element so matchups are readable at a glance. */
.el-raptor { color: #d98c5f; }
.el-waterfowl { color: #5f9bd9; }
.el-corvid { color: #a98cd9; }
.el-songbird { color: #d9c95f; }
.el-woodpecker { color: #d95f7a; }
.el-shorebird { color: #5fd9c0; }

/* contest */
.contest {
  margin-top: 20px;
  background: var(--panel);
  border: 1px solid var(--accent-dark);
  border-radius: 10px;
  padding: 16px;
}
.arena { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; overflow: visible; }
.fighter { flex: 1 1 240px; background: var(--panel-2); border-radius: 8px; padding: 12px; }
.vs { color: var(--muted); font-size: 13px; }

.hpbar {
  height: 8px;
  background: #0d100c;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.hpfill { height: 100%; transition: width 0.3s ease var(--impact); }
.hp-good { background: var(--accent); }
.hp-warn { background: var(--warn); }
.hp-bad { background: var(--bad); }

.outcome { font-weight: 600; color: var(--accent); }

.log {
  margin-top: 14px;
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.logline { font-size: 13px; color: var(--muted); padding: 2px 0; }
.logline:first-child { color: var(--text); }

/* ---------- layout additions ---------- */
.titlebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.presence {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px; font-size: 12px; color: var(--muted);
}
.presence .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(127,176,105,0.5); }
  50% { opacity: 0.55; box-shadow: 0 0 0 5px rgba(127,176,105,0); }
}

.squadbar {
  margin-top: 18px; padding: 10px 14px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; font-size: 13px;
}
.chip {
  display: inline-block; background: #0f130e; border: 1px solid var(--line);
  color: var(--muted); border-radius: 999px; padding: 2px 9px;
  font-size: 11px; margin: 2px 3px 2px 0;
}
.chip.reward { color: var(--warn); border-color: var(--warn); }
.movelist { margin-top: 6px; }

.card.picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.tiny { padding: 3px 8px; font-size: 11px; margin-top: 6px; }
.tiny-text { font-size: 11px; margin-top: 6px; }

.rival.locked { opacity: 0.55; }
.rival.beaten { border-color: var(--accent-dark); }
.badge.beaten-badge { color: var(--accent); }

.vs-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.outcome.won { color: var(--accent); }
.outcome.lost { color: var(--bad); }

.reward-banner {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px;
  background: rgba(217,169,76,0.12); border: 1px solid var(--warn);
  color: var(--warn); font-weight: 600;
  animation: reward-in 0.5s ease-out both;
}
@keyframes reward-in {
  from { transform: translateY(8px) scale(0.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ---------- bench ---------- */
.benches { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.bench { display: flex; gap: 8px; flex: 1 1 240px; }
.benchbird {
  flex: 1; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px; font-size: 12px;
}
.benchbird.active { border-color: var(--accent-dark); }
.benchbird.fainted { opacity: 0.45; }
.benchname { font-weight: 600; margin-bottom: 5px; font-size: 11px; }

/* ---------- battle animations ----------
   Every animated node is keyed by turn number in the client, so these
   animations restart on each exchange instead of only firing once. */
.sprite { position: relative; transition: transform 0.15s ease; }

/* The attacker's flight is 1.3s and makes contact at 54% of it. Everything that
   happens *to* the defender — recoil, shock ring, feathers, damage number, arena
   jolt, HP drain — is delayed to that moment. Without this the defender flinched
   and lost HP before the attacker had crossed the arena, which was the single
   biggest thing making battles feel wrong. */
:root { --impact: 0.70s; }

/* Flight: the attacker leaves its perch, arcs across the arena, dives onto the
   target, then flies home. Only the bird moves — its name and HP card stay put,
   which is why the animation class sits on .birdbox rather than .sprite.

   The x distance is a percentage of the bird's own box, which tracks the panel
   width closely enough to land on the opponent at any viewport size. The slight
   scale-up mid-flight reads as coming toward the viewer. z-index lifts the
   flier over the opposite panel's background. */
.anim-fly-right { animation: fly-right 1.3s cubic-bezier(0.34, 0, 0.4, 1); z-index: 40; }
.anim-fly-left { animation: fly-left 1.3s cubic-bezier(0.34, 0, 0.4, 1); z-index: 40; }

/* The flight has four beats: a crouch to wind up, an explosive climb, a diving
   strike, and a return glide. The crouch is what sells the launch — without it
   the bird just slides. */
@keyframes fly-right {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
  7%   { transform: translate(-5%, 7px) rotate(4deg) scale(1.04, 0.9); }
  16%  { transform: translate(8%, -34px) rotate(-16deg) scale(1.03); }
  38%  { transform: translate(52%, -54px) rotate(-9deg) scale(1.08); }
  54%  { transform: translate(98%, -4px) rotate(11deg) scale(1.12); }
  60%  { transform: translate(92%, 5px) rotate(4deg) scale(1.06); }
  70%  { transform: translate(72%, -18px) rotate(-5deg) scale(1.03); }
  86%  { transform: translate(28%, -30px) rotate(-6deg) scale(1.01); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); }
}
@keyframes fly-left {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
  7%   { transform: translate(5%, 7px) rotate(-4deg) scale(1.04, 0.9); }
  16%  { transform: translate(-8%, -34px) rotate(16deg) scale(1.03); }
  38%  { transform: translate(-52%, -54px) rotate(9deg) scale(1.08); }
  54%  { transform: translate(-98%, -4px) rotate(-11deg) scale(1.12); }
  60%  { transform: translate(-92%, 5px) rotate(-4deg) scale(1.06); }
  70%  { transform: translate(-72%, -18px) rotate(5deg) scale(1.03); }
  86%  { transform: translate(-28%, -30px) rotate(6deg) scale(1.01); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); }
}

/* Recoil. A resisted hit barely rocks the bird; a super-effective one throws it
   back and washes it white-hot. */
.anim-hit-soft { animation: shake-soft 0.45s ease-out var(--impact) both; }
.anim-hit-hard { animation: shake-hard 0.62s cubic-bezier(0.2, 0, 0.3, 1) var(--impact) both; }
@keyframes shake-soft {
  0%, 100% { transform: translateX(0); filter: none; }
  15% { transform: translateX(-5px) rotate(-2deg); filter: brightness(1.3); }
  35% { transform: translateX(4px) rotate(1deg); }
  55% { transform: translateX(-3px); }
  75% { transform: translateX(2px); }
}
@keyframes shake-hard {
  0%   { transform: translate(0,0) rotate(0deg); filter: none; }
  8%   { transform: translate(-16px, -6px) rotate(-9deg) scale(0.94);
         filter: brightness(2.4) saturate(0.3); }
  20%  { transform: translate(11px, 3px) rotate(6deg) scale(1.03); filter: brightness(1.6); }
  34%  { transform: translate(-8px, -2px) rotate(-4deg); filter: brightness(1.25); }
  50%  { transform: translate(6px, 1px) rotate(3deg); }
  66%  { transform: translate(-4px, 0) rotate(-2deg); }
  82%  { transform: translate(2px, 0) rotate(1deg); }
  100% { transform: translate(0,0) rotate(0deg); filter: none; }
}

/* Impact flourish: a shock ring punched out from the point of contact, plus a
   puff of feathers thrown off in six directions. Both are keyed per event in the
   client so they re-fire on every hit. */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.ring {
  position: absolute; left: 50%; top: 46%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; border: 3px solid #fff;
  animation: ring-out 0.55s cubic-bezier(0.1, 0.6, 0.3, 1) var(--impact) both;
  opacity: 0;
}
.ring-normal { border-color: rgba(255,255,255,0.85); }
.ring-strong { border-color: var(--warn); border-width: 4px; }
@keyframes ring-out {
  0%   { transform: scale(0.2); opacity: 1; }
  70%  { opacity: 0.55; }
  100% { transform: scale(4.6); opacity: 0; }
}
.ring-strong { animation-duration: 0.68s; }

.feathers { position: absolute; left: 50%; top: 46%; }
.feather {
  position: absolute; width: 7px; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.9);
  animation: feather-fly 0.68s ease-out var(--impact) both;
  opacity: 0;
}
/* Six fixed directions rather than random, so the burst is stable across
   re-renders and needs no per-frame computation. */
.feather.f0 { --fx: 34px;  --fy: -26px; animation-delay: var(--impact); }
.feather.f1 { --fx: -30px; --fy: -20px; animation-delay: calc(var(--impact) + 0.03s); }
.feather.f2 { --fx: 26px;  --fy: 18px;  animation-delay: calc(var(--impact) + 0.06s); }
.feather.f3 { --fx: -22px; --fy: 24px;  animation-delay: calc(var(--impact) + 0.02s); }
.feather.f4 { --fx: 6px;   --fy: -34px; animation-delay: calc(var(--impact) + 0.05s); }
.feather.f5 { --fx: -8px;  --fy: 30px;  animation-delay: calc(var(--impact) + 0.08s); }
@keyframes feather-fly {
  0%   { transform: translate(0,0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--fx), var(--fy)) rotate(220deg); opacity: 0; }
}

/* A super-effective hit jolts the whole arena, not just the bird. */
.arena-jolt { animation: jolt 0.4s cubic-bezier(0.2, 0, 0.3, 1) var(--impact) both; }
@keyframes jolt {
  0%, 100% { transform: translate(0,0); }
  12% { transform: translate(-5px, 3px); }
  28% { transform: translate(4px, -2px); }
  46% { transform: translate(-3px, 1px); }
  68% { transform: translate(2px, 0); }
}

.resolving {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin-top: 4px;
  animation: breathe 1.1s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }

/* Fainting: knocked upward, then tumbles out of the frame. */
.anim-faint { animation: faint 1.15s cubic-bezier(0.3, 0, 0.6, 1) forwards; }
@keyframes faint {
  0%   { transform: translate(0,0) rotate(0deg); opacity: 1; filter: none; }
  18%  { transform: translate(-6px, -18px) rotate(-14deg); filter: brightness(1.8); }
  100% { transform: translate(-14px, 46px) rotate(-104deg); opacity: 0; }
}

/* A replacement bird swoops in from above and settles. */
.anim-enter { animation: enter 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
@keyframes enter {
  0%   { transform: translate(18px, -60px) rotate(18deg) scale(0.8); opacity: 0; }
  55%  { transform: translate(0, 6px) rotate(-4deg) scale(1.05); opacity: 1; }
  75%  { transform: translate(0, -3px) rotate(2deg) scale(0.99); }
  100% { transform: none; opacity: 1; }
}

/* Floating damage numbers. */
.float {
  position: absolute; top: -4px; right: 8px;
  font-weight: 700; font-size: 20px; pointer-events: none;
  animation: floatup 0.72s ease-out var(--impact) both;
  opacity: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.float .eff {
  display: block; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.float-normal { color: #f0f4ec; }
.float-strong { color: var(--warn); }
.float-weak { color: var(--muted); }
.float.miss { color: var(--muted); font-size: 15px; }
@keyframes floatup {
  0%   { transform: translateY(8px) scale(0.5); opacity: 0; }
  14%  { transform: translateY(0) scale(1.35); opacity: 1; }
  26%  { transform: translateY(-3px) scale(1); }
  100% { transform: translateY(-40px) scale(1); opacity: 0; }
}
.float-strong { font-size: 26px; }

/* Respect a user's reduced-motion preference: keep the game readable, drop
   the movement. */
@media (prefers-reduced-motion: reduce) {
  .anim-fly-right, .anim-fly-left, .anim-hit-soft, .anim-hit-hard, .anim-faint,
  .anim-enter, .float, .reward-banner, .presence .dot, .ring, .feather,
  .arena-jolt, .resolving {
    animation: none;
  }
  .anim-faint { opacity: 0.3; }
  .float { opacity: 1; }
}

/* ---------- bird art ---------- */
.birdbox {
  display: flex; justify-content: center; align-items: flex-end;
  height: 96px; margin-bottom: 4px;
  position: relative; z-index: 1;
}
.bird { width: 132px; height: 96px; overflow: visible; }

/* Idle flap: slow and shallow, so a resting bird still feels alive.

   Each element is a different drawing, so the wing pivots at a different point;
   a single shared transform-origin made the long-bodied birds' wings hinge from
   thin air. Values track each path's shoulder in svg coordinates. */
.bird .wing { animation: flap 2.6s ease-in-out infinite; }
.bird-songbird   .wing { transform-origin: 42px 48px; }
.bird-raptor     .wing { transform-origin: 36px 42px; }
.bird-waterfowl  .wing { transform-origin: 36px 55px; }
.bird-corvid     .wing { transform-origin: 40px 46px; }
.bird-woodpecker .wing { transform-origin: 46px 43px; }
.bird-shorebird  .wing { transform-origin: 40px 39px; }
@keyframes flap {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-11deg) translateY(-1px); }
}

.bird .tail { animation: tailwag 3.4s ease-in-out infinite; }
.bird-songbird   .tail { transform-origin: 26px 54px; }
.bird-raptor     .tail { transform-origin: 24px 58px; }
.bird-waterfowl  .tail { transform-origin: 18px 54px; }
.bird-corvid     .tail { transform-origin: 26px 55px; }
.bird-shorebird  .tail { transform-origin: 22px 44px; }
/* A woodpecker's tail is a stiff prop it braces against the trunk with, so it
   does not wag. */
.bird-woodpecker .tail { animation: none; }
@keyframes tailwag {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(4deg); }
}

/* Wings beat hard for the duration of the flight (0.13s x 9 ~= 1.25s). */
.anim-fly-right .bird .wing,
.anim-fly-left .bird .wing { animation: flap-fast 0.13s ease-in-out 9; }
@keyframes flap-fast {
  0%, 100% { transform: rotate(2deg); }
  50% { transform: rotate(-30deg) translateY(-3px); }
}

/* A fainted bird stops flapping and tips over. */
.anim-faint .bird .wing, .anim-faint .bird .tail { animation: none; }
.anim-faint .bird { transform: rotate(8deg); }

.benchbird.fainted .bird .wing { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .bird .wing, .bird .tail,
  .anim-fly-right .bird .wing, .anim-fly-left .bird .wing { animation: none; }
  .ring, .feather { display: none; }
}

/* ---------- PvP lobby ---------- */
.lobby {
  display: flex; align-items: center; gap: 14px;
  margin-top: 18px; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--accent-dark);
  border-radius: 10px;
}
.spinner {
  width: 22px; height: 22px; flex: none;
  border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pvp-btn { margin-left: 10px; }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}

/* "Leave battle" is deliberately quiet — it sits beside the move buttons but
   should never compete with them. */
button.leave { margin-left: auto; opacity: 0.7; font-size: 12px; }
button.leave:hover { opacity: 1; border-color: var(--bad); }
.moves { align-items: center; }


/* ---------- turn clarity ---------- */
.contest-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ready-pill {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  background: rgba(217,169,76,0.14); border: 1px solid var(--warn); color: var(--warn);
}

/* The banner is the primary answer to "what is the game waiting for". */
.banner {
  display: flex; align-items: center; gap: 12px;
  margin: 12px 0 14px; padding: 11px 14px;
  border-radius: 8px; border-left: 3px solid var(--line);
  background: var(--panel-2);
}
.banner-main { font-size: 15px; font-weight: 600; }
.banner-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.b-choose { border-left-color: var(--accent); }
.b-wait { border-left-color: var(--warn); }
.b-resolve.by-you { border-left-color: var(--accent); }
.b-resolve.by-them { border-left-color: var(--bad); }
.b-won { border-left-color: var(--accent); background: rgba(127,176,105,0.1); }
.b-lost { border-left-color: var(--bad); background: rgba(192,92,74,0.1); }
.b-won .banner-main { color: var(--accent); }
.b-lost .banner-main { color: var(--bad); }
.spinner.sm { width: 15px; height: 15px; border-width: 2px; }

.fighter-head { display: flex; align-items: baseline; gap: 7px; margin-bottom: 2px; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); }
.side-handle { font-size: 12px; color: var(--accent); font-weight: 600; }

/* Spotlight: the acting bird lifts and brightens, the other recedes. This is
   what makes "whose move is this" readable without reading text. */
.fighter {
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.fighter.acting {
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px var(--accent-dark), 0 8px 24px rgba(0,0,0,0.35);
}
.fighter.struck { opacity: 0.82; }
.arena:has(.acting) .fighter:not(.acting) { opacity: 0.7; }

/* ---------- bird art motion ---------- */
/* A gentle idle bob, so a bird waiting its turn still looks alive. */
.birdbox .bird { animation: bob 3.2s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
/* The shadow shrinks as the bird climbs, which is what sells altitude. */
.anim-fly-right .shadow, .anim-fly-left .shadow { animation: shadow-shrink 1.3s ease-in-out; }
@keyframes shadow-shrink {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  38% { transform: scale(0.55); opacity: 0.12; }
}
/* Suppress the idle bob mid-flight so the two do not fight each other. */
.anim-fly-right .bird, .anim-fly-left .bird, .anim-faint .bird { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .birdbox .bird, .anim-fly-right .shadow, .anim-fly-left .shadow { animation: none; }
  .fighter.acting { transform: none; }
}

/* ---------- battle-focused layout ----------
   A battle takes over the page, so the fight is not competing with a 47-card
   field guide for attention. */
.wrap.focused { max-width: 900px; }
.wrap.focused .contest { margin-top: 18px; }

/* ---------- move buttons ---------- */
.moves { gap: 10px; }
.movebtn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 8px 12px; min-width: 132px; text-align: left; line-height: 1.25;
}
.movetop { display: flex; align-items: center; gap: 7px; width: 100%; }
.movename { font-weight: 600; font-size: 13px; }
.movemeta { font-size: 10px; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.05em; }
/* The matchup badge is the fastest way to teach the element cycle: you see the
   consequence on the button before committing. */
.effbadge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.06em;
  padding: 1px 5px; border-radius: 4px; margin-left: auto;
}
.effbadge.eff-strong { background: var(--warn); color: #1a1608; }
.effbadge.eff-weak { background: #3a3f36; color: var(--muted); }
.movebtn.eff-strong { border-color: var(--warn); }
.movebtn.eff-weak { opacity: 0.82; }

/* ---------- benches ---------- */
.benchgroup { flex: 1 1 260px; }
.bench-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted); margin-bottom: 6px;
}
.benchgroup .bench { margin-bottom: 5px; }

/* ---------- log ---------- */
.log { max-height: 200px; }
.log-turn {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.11em;
  color: var(--accent-dark); margin: 8px 0 3px; padding-top: 5px;
  border-top: 1px solid var(--line);
}
.log-turn:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.logline.k-faint { color: var(--bad); }
.logline.k-switch { color: var(--accent); }

/* ---------- sign in ---------- */
.authcard {
  margin-top: 14px; padding: 14px; max-width: 520px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
}
.authtabs { display: flex; gap: 4px; margin-bottom: 10px; }
.authtabs .tab {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; padding: 5px 10px; font-size: 12px; color: var(--muted);
}
.authtabs .tab.on { color: var(--text); border-bottom-color: var(--accent); }
.authtabs .tab:hover { color: var(--text); }
.authcard .muted { margin-top: 8px; }

.signedin { align-items: center; }
.whoami { font-size: 13px; color: var(--muted); }
.whoami strong { color: var(--accent); }

/* ---------- contest additions ---------- */
.calling {
  color: var(--warn); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; font-size: 14px;
}
/* Rounds taken, as filled pips beside each performer. */
.pips { display: inline-flex; gap: 3px; margin-left: auto; }
.pip {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent;
}
.pip.on { background: var(--accent); border-color: var(--accent); }
.vs { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; color: var(--text); }
.benchspec {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); margin-bottom: 5px;
}
.effbadge.eff-any { background: #3a3f36; color: var(--text); }
.movebtn.eff-any { border-color: var(--line); }
.movebtn.unaffordable { opacity: 0.55; }
.b-draw { border-left-color: var(--warn); background: rgba(217,169,76,0.08); }
.b-draw .banner-main { color: var(--warn); }
.nextup { color: var(--warn); }

/* ---------- sound identification ---------- */

.soundid {
  margin-top: 28px;
  padding: 16px 18px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.soundid h2 { margin: 0 0 4px; }

.sound-controls { margin-top: 10px; }

/* The real file input is hidden inside the label so the control matches the
   buttons beside it; clicking the label still opens the picker. */
.filepick {
  display: inline-flex;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.filepick:hover { border-color: var(--accent-dark); }
.filepick input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.threshold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.threshold input[type="range"] { min-width: 120px; width: 120px; accent-color: var(--accent); }

.sound-loading { margin-top: 12px; }
.loadbar {
  height: 6px;
  background: var(--panel-2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.loadfill { height: 100%; background: var(--accent-dark); transition: width 0.2s linear; }

.sound-error { border-left: 3px solid var(--bad); }

.sound-live { color: var(--muted); font-size: 13px; }
.reclight {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bad);
  animation: recpulse 1.4s ease-in-out infinite;
}
@keyframes recpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.heard { margin-top: 14px; display: flex; flex-direction: column; gap: 1px; }
.heard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.heard-row:first-child { border-radius: 8px 8px 0 0; }
.heard-row:last-child { border-radius: 0 0 8px 8px; }
.heard-row:only-child { border-radius: 8px; }
.heard-name { min-width: 0; }
.heard-name strong { margin-right: 8px; }
.heard-conf { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.heard-action { text-align: right; }

.confbar {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.conffill { height: 100%; }
.conf-high { background: var(--accent); }
.conf-mid { background: var(--warn); }
.conf-low { background: var(--bad); }

/* A detection that is not a collectable bird: a frog, a siren, a dog. */
.badge.el-none { color: var(--muted); }

/* ---------- field guide search ---------- */

.guide-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.guide-search { flex: 1; min-width: 240px; max-width: 420px; }

@media (max-width: 620px) {
  .heard-row { grid-template-columns: 1fr; gap: 6px; }
  .heard-action { text-align: left; }
  .threshold { margin-left: 0; }
}

/* The listening indicator is the only thing on this panel that moves. */
@media (prefers-reduced-motion: reduce) {
  .reclight { animation: none; }
}
