/* Sneaky Beaks: the shared portfolio look (cards, light and dark, works on phones),
   keeping the game's own touches: the yellow pixel title and the black 320x200 field. */

/* Colours: light by default, dark when the device asks for it */
:root {
  --bg: #f8f7ef;
  --surface: #ffffff;
  --text: #22210f;
  --muted: #66634a;
  --border: #e6e2c8;
  --accent: #8a6a00;
  --accent-strong: #634c00;
  --accent-soft: #fbf1c6;
  --duck: #ffd23c;
  --duck-shadow: #b5520f;
  --hero-from: #4f7a2a;
  --hero-to: #172409;
  --shadow: 0 1px 2px rgba(40, 40, 10, 0.06), 0 4px 16px rgba(40, 40, 10, 0.06);
  --radius: 14px;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  /* older names, still used by the sprite viewer's own styles */
  --panel: var(--surface);
  --line: var(--border);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12130d;
    --surface: #1c1d14;
    --text: #edebd8;
    --muted: #aeab8c;
    --border: #34352a;
    --accent: #ffd23c;
    --accent-strong: #ffe48a;
    --accent-soft: #3a3410;
    --hero-from: #34521a;
    --hero-to: #0b1104;
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-strong);
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Top bar */
.topbar {
  background: var(--hero-to);
  color: #fff;
}

.topbar .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  margin-right: auto;
}

.brand:hover {
  color: #fff;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.nav a {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 4px 12px;
  border-radius: 999px;
  opacity: 0.85;
}

.nav a:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

.nav a.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}

/* Header band: kept short so the game field fits on screen */
.hero {
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
  color: #fff;
  padding: 22px 0 40px;
}

.hero code {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

.pixel-title {
  margin: 0 0 4px;
  font: bold clamp(1.7rem, 5vw, 2.3rem) / 1.1 "Courier New", monospace;
  letter-spacing: 2px;
  color: var(--duck);
  text-shadow: 3px 3px 0 var(--duck-shadow);
}

.lead {
  margin: 0;
  max-width: 820px;
  opacity: 0.95;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 20px;
  padding: 20px 0 32px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  min-width: 0;
}

.card-wide {
  grid-column: 1 / -1;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.card > :last-child {
  margin-bottom: 0;
}

.overlap {
  margin-top: -24px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.9rem;
}

/* The game field */
#stage {
  width: 100%;
  display: flex;
  justify-content: center;
}

#screen {
  display: block;
  max-width: 100%;
  background: #000;
  border-radius: 6px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: crosshair;
  touch-action: manipulation;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 14px 0 8px;
}

button {
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

button.primary {
  font-weight: 600;
  color: #22210f;
  background: var(--duck);
  border-color: #d9a90a;
}

button.primary:hover {
  background: #ffdd66;
}

kbd {
  font: 0.72rem var(--mono);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 4px;
}

button.primary kbd {
  color: #5b4a00;
  border-color: #c79a00;
}

@media (max-width: 700px) {
  kbd {
    display: none;
  }
}

#stats {
  text-align: center;
  color: var(--muted);
  font: 0.8rem var(--mono);
  white-space: pre-wrap;
}

/* Ducks and the event log (filled in by js/render.js) */
.card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#roster li {
  display: grid;
  grid-template-columns: 14px 1fr 1fr 80px;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

#roster li.gone {
  opacity: 0.4;
  text-decoration: line-through;
}

#roster .st {
  color: var(--muted);
  font-size: 0.85rem;
}

#roster .bar {
  height: 7px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

#roster .bar span {
  display: block;
  height: 100%;
}

#log li {
  padding: 2px 0;
  font-size: 0.9rem;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}

.howto li {
  list-style: disc;
  margin-left: 1.2em;
  padding: 2px 0;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 28px;
  font-size: 0.9rem;
  color: var(--muted);
}
