/* Squedrill's own colours (Squedrill/Website brand/): charcoal, lime and white */
:root {
  --charcoal: #2b2f2d;
  --lime: #8cc63f;
  --lime-dark: #6ea32b;
  --white: #ffffff;
  --panel: rgba(255, 255, 255, 0.92);
  --text: #1d2420;
  --muted: #5d6862;
  --line: rgba(43, 47, 45, 0.15);
}
@media (prefers-color-scheme: dark) {
  :root {
    --panel: rgba(36, 40, 38, 0.92);
    --text: #eef2ee;
    --muted: #a7b1ab;
    --line: rgba(255, 255, 255, 0.14);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font: 15px/1.45 system-ui, sans-serif; color: var(--text); background: #cfe3ea; }
#stage { position: fixed; inset: 0; }
#stage canvas { width: 100%; height: 100%; display: block; touch-action: none; }

#topbar {
  position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: var(--charcoal); color: var(--white); z-index: 5;
}
.who { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 2px solid #fff; }
.dot.diamond { border-radius: 2px; transform: rotate(45deg); width: 11px; height: 11px; }

.panel {
  position: fixed; z-index: 4; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; backdrop-filter: blur(6px); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}
.panel.center { top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100% - 32px)); max-height: calc(100% - 80px); overflow: auto; }
.panel.bottom { bottom: 16px; left: 50%; transform: translateX(-50%); width: min(460px, calc(100% - 32px)); }
h2 { font-size: 1rem; margin: 0 0 8px; }
h2:not(:first-child) { margin-top: 14px; }
p { margin: 6px 0; }
.muted { color: var(--muted); }

button, .button {
  font: inherit; padding: 9px 14px; border-radius: 10px; cursor: pointer; text-decoration: none; display: inline-block;
  border: 1px solid var(--line); background: transparent; color: var(--text);
}
button.primary, .button.primary { background: var(--lime); border-color: var(--lime-dark); color: var(--charcoal); font-weight: 600; }
button.quiet { border-color: transparent; color: var(--muted); }
button:disabled { opacity: 0.45; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

.creatures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.creatures button { padding: 8px 4px; font-size: 0.85rem; line-height: 1.2; }
.creatures button small { display: block; color: var(--muted); font-size: 0.75rem; }
.creatures .preview { display: block; width: 100%; aspect-ratio: 160 / 110; margin-bottom: 4px; border-radius: 8px; background: #cfe6f5; }
.creatures button[aria-pressed='true'], .options button[aria-pressed='true'] { border: 2px solid var(--lime-dark); background: rgba(140, 198, 63, 0.18); }
.options { display: flex; flex-direction: column; gap: 6px; }
.options button { text-align: left; display: flex; justify-content: space-between; }
#quick-match, #cancel { width: 100%; margin-top: 8px; }
.stats { color: var(--muted); font-size: 0.85rem; }

#hud { position: fixed; top: 52px; left: 0; right: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 16px; pointer-events: none; }
.players { display: flex; gap: 8px; width: min(560px, 100%); }
.player { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.player.active { border: 2px solid var(--lime-dark); }
.player .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.player .nums { font-size: 0.8rem; color: var(--muted); }
.player .nums.over { color: #c2410c; }
.turn { background: var(--charcoal); color: var(--white); padding: 4px 12px; border-radius: 999px; font-size: 0.85rem; }
.left { background: #ffd23f; color: var(--charcoal); padding: 4px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }   /* the value still to place: the move's yellow */

@media (max-width: 420px) {
  .creatures { grid-template-columns: repeat(2, 1fr); }
}

/* "Your turn": a card that pops up in the middle when the turn passes to you (user, 2026-10-17) */
.alert-card { position: fixed; left: 50%; top: 40%; z-index: 6; transform: translate(-50%, -50%) scale(0.9); opacity: 0; pointer-events: none;
  background: var(--white); color: var(--charcoal); border: 3px solid #ffd23f; border-radius: 14px; padding: 16px 28px;
  font-size: 1.4rem; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transition: opacity .25s, transform .25s; }
.alert-card.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
@media (prefers-reduced-motion: reduce) { .alert-card { transition: none; } }
