/* =================================================================
   menus.css — "Living Meadow" painterly reskin for the MULTIPLAYER
   screens (lobby, waiting room, spot-pick, running match, end screen).
   Loaded BEFORE game.css, so selectors here are scoped under `.scene`
   (and scene ids) to out-specify the legacy `.mp-*` rules in game.css.
   Every class/id name is preserved — this file only restyles.

   Palette + motion come entirely from theme.css tokens.
   Lobby / waiting / end  → bright cream "meadow paper" cards.
   Running-match sidebar   → cozier warm-parchment cards (readable numbers).
   ================================================================= */

/* ----------------------------------------------------------------
   1. SCENE CONTAINERS — keep the scroll/padding behaviour from
   game.css; just make sure content is centred & breathes.
   ---------------------------------------------------------------- */
#scene-mp-lobby, #scene-mp-waiting, #scene-mp-spot-pick,
#scene-mp-match, #scene-mp-end {
  overflow-y: auto;
  padding: clamp(18px, 4vh, 40px) clamp(14px, 4vw, 40px);
  flex-direction: column;
  align-items: stretch;
}

/* ----------------------------------------------------------------
   2. CREAM PAPER CARDS  (.mp-lobby everywhere, .mp-match frame)
   ---------------------------------------------------------------- */
.scene .mp-lobby,
.scene .mp-match {
  max-width: 940px;
  margin: 0 auto;
  width: 100%;
  background: linear-gradient(168deg, var(--hm-cream) 0%, var(--hm-cream-2) 100%);
  border: 3px solid #fff;
  outline: 2px solid var(--hm-cream-edge);
  border-radius: 26px;
  box-shadow: var(--hm-shadow-card);
  color: var(--hm-ink);
  padding: clamp(20px, 3vw, 34px);
  position: relative;
  overflow: hidden;
}
/* honeycomb texture wash */
.scene .mp-lobby::before,
.scene .mp-match::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: url('/static/sprites/honeycomb.svg') 0 0 / 74px auto repeat;
  opacity: .07;
  pointer-events: none;
}
/* lift real content above the texture wash */
.scene .mp-lobby > *,
.scene .mp-match > * { position: relative; z-index: 1; }

/* ----------------------------------------------------------------
   3. HEADER
   ---------------------------------------------------------------- */
.scene .mp-lobby-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px dashed var(--hm-cream-edge);
}
.scene .mp-lobby-head h1,
.scene .mp-lobby-head h2 {
  margin: 0;
  font-family: var(--hm-display);
  font-weight: 700;
  letter-spacing: -.2px;
  color: var(--hm-honey-deep);
}
.scene .mp-lobby-head h1 { font-size: clamp(22px, 3vw, 30px); }
.scene .mp-lobby-head h2 { font-size: clamp(20px, 2.6vw, 26px); text-transform: none; }
.scene .mp-user {
  flex: 1 1 100%;
  font-size: 13px;
  font-weight: 600;
  color: var(--hm-ink-soft);
}
.scene .mp-lobby-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ghost buttons sit on cream → give them the light start-screen look */
.scene .mp-lobby .btn-ghost,
.scene .mp-match .btn-ghost {
  background: rgba(255, 255, 255, .6);
  border-color: var(--hm-cream-edge);
  color: var(--hm-ink);
  box-shadow: var(--hm-shadow-soft);
}
.scene .mp-lobby .btn-ghost:hover,
.scene .mp-match .btn-ghost:hover {
  background: #fff;
  border-color: var(--hm-honey);
  color: var(--hm-honey-deep);
}

/* ----------------------------------------------------------------
   4. BODY SUBHEADINGS
   ---------------------------------------------------------------- */
.scene .mp-lobby-body h2 {
  font-family: var(--hm-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--hm-ink-soft);
  margin: 18px 0 10px;
}

/* ----------------------------------------------------------------
   5. MATCH LIST — playful "hive tiles"
   ---------------------------------------------------------------- */
.scene .mp-match-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.scene .mp-match-entry {
  background: linear-gradient(150deg, #fff 0%, var(--hm-cream) 100%);
  border: 2px solid var(--hm-cream-edge);
  border-radius: 14px;
  padding: 13px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--hm-shadow-soft);
  transition: transform var(--hm-t-fast) var(--hm-ease),
              border-color var(--hm-t) var(--hm-ease),
              box-shadow var(--hm-t) var(--hm-ease),
              background var(--hm-t) var(--hm-ease);
  position: relative;
  overflow: hidden;
}
/* little honey-comb corner accent on each tile */
.scene .mp-match-entry::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 46px;
  background: url('/static/sprites/honeycomb.svg') right center / 46px auto repeat-y;
  opacity: .10;
  pointer-events: none;
}
.scene .mp-match-entry:hover {
  transform: translateX(4px) translateY(-1px);
  border-color: var(--hm-honey);
  background: linear-gradient(150deg, #fff 0%, var(--hm-gold-soft) 100%);
  box-shadow: 0 12px 26px -10px rgba(224, 124, 21, .45);
}
.scene .mp-match-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.scene .mp-match-head strong { color: var(--hm-ink); font-family: var(--hm-display); font-weight: 700; }
.scene .mp-match-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--hm-honey-deep);
  background: var(--hm-gold-soft);
  padding: 2px 9px;
  border-radius: 999px;
}
.scene .mp-match-meta { font-size: 12px; font-weight: 600; color: var(--hm-ink-soft); flex: 1; min-width: 100px; }
.scene .mp-empty {
  color: var(--hm-ink-mute);
  font-style: italic;
  padding: 16px 12px;
  text-align: center;
}

/* ----------------------------------------------------------------
   6. WAITING ROOM — invite info banner
   ---------------------------------------------------------------- */
.scene .mp-invite-info {
  background: linear-gradient(150deg, var(--hm-gold-soft) 0%, var(--hm-cream-2) 100%);
  border: 2px solid var(--hm-honey);
  color: var(--hm-ink);
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--hm-shadow-soft);
}

/* ----------------------------------------------------------------
   7. SPOT-PICK — text, timer, status, legend + canvas frame
   ---------------------------------------------------------------- */
#scene-mp-spot-pick .mp-lobby-body p {
  color: var(--hm-ink-soft);
  font-weight: 600;
  line-height: 1.5;
  max-width: 640px;
}
.scene #mp-spot-timer {
  font-family: var(--hm-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--hm-honey-deep);
  margin: 10px 0;
}
.scene #mp-spot-status {
  margin-top: 10px;
  font-weight: 700;
  color: var(--hm-ink);
}
.scene #mp-spot-legend {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--hm-ink-mute);
  line-height: 1.5;
}
/* the canvas keeps its inline border/background; we only add what
   inline can't set: rounded corners + a warm painterly frame. */
.scene #mp-spot-canvas {
  border-radius: 16px;
  box-shadow:
    0 0 0 4px var(--hm-cream-edge),
    var(--hm-shadow-card);
  max-width: 100%;
  height: auto;
  margin: 4px 0;
}

/* ----------------------------------------------------------------
   8. RUNNING MATCH — layout, canvas frame, sidebar
   ---------------------------------------------------------------- */
.scene .mp-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  padding: 0;
}
.scene #mp-canvas {
  width: 100%;
  height: auto;
  border: 3px solid var(--hm-cream-edge);
  border-radius: 18px;
  box-shadow: var(--hm-shadow-card), inset 0 2px 0 rgba(255, 220, 140, .12);
}
.scene #mp-sidebar {
  overflow-y: auto;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
}

@media (max-width: 820px) {
  .scene .mp-layout { grid-template-columns: 1fr; }
  .scene #mp-sidebar { max-height: none; }
}

/* ----------------------------------------------------------------
   9. IN-GAME SIDEBAR PANELS — cozy warm-parchment cards
   (slightly warmer than the bright menu cream; numbers stay legible)
   ---------------------------------------------------------------- */
.scene .mp-game-root { display: flex; flex-direction: column; gap: 14px; }
.scene .mp-game-head h2 {
  margin: 0 0 4px;
  font-family: var(--hm-display);
  font-weight: 700;
  color: var(--hm-honey-deep);
  font-size: 18px;
}

/* colony cards */
.scene .mp-hive-card {
  background: linear-gradient(160deg, var(--hm-cream-2) 0%, var(--hm-cream-edge) 100%);
  border: 2px solid #fff;
  outline: 1px solid var(--hm-cream-edge);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--hm-ink);
  box-shadow: var(--hm-shadow-soft);
}
.scene .mp-hive-card.own {
  border-color: var(--hm-gold);
  outline-color: var(--hm-honey);
  background: linear-gradient(160deg, var(--hm-gold-soft) 0%, var(--hm-cream-2) 100%);
  box-shadow: var(--hm-shadow-soft), var(--hm-ring);
}
.scene .mp-hive-card h3 {
  margin: 0 0 8px;
  font-family: var(--hm-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--hm-ink);
}

/* resource rows */
.scene .mp-res-row { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; color: var(--hm-ink-soft); }
.scene .mp-res {
  white-space: nowrap;
  background: rgba(255, 255, 255, .5);
  border: 1px solid var(--hm-cream-edge);
  border-radius: 10px;
  padding: 3px 9px;
  font-weight: 600;
}
.scene .mp-res b { color: var(--hm-honey-deep); font-weight: 800; font-variant-numeric: tabular-nums; }
.scene .mp-res small { color: var(--hm-ink-mute); font-size: 10px; font-weight: 700; }

/* other-player headings / meta */
.scene .mp-other-head {
  margin: 8px 0 4px;
  font-family: var(--hm-display);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--hm-ink-soft);
}
.scene .mp-other-head.mp-danger,
.scene .mp-danger { color: var(--red) !important; }
.scene .mp-other-meta { font-size: 11px; font-weight: 600; color: var(--hm-ink-mute); margin-top: 6px; }

/* nested collapsible sub-panels */
.scene .mp-subpanel {
  margin-top: 10px;
  background: rgba(255, 246, 224, .55);
  border: 1px solid var(--hm-cream-edge);
  border-radius: 12px;
  padding: 8px 12px;
}
.scene .mp-subpanel > summary {
  cursor: pointer;
  font-family: var(--hm-display);
  font-size: 12px;
  color: var(--hm-honey-deep);
  font-weight: 700;
  letter-spacing: .5px;
  padding: 2px 0;
}
.scene .mp-subpanel[open] { padding-bottom: 10px; }

/* roles grid + inputs */
.scene .mp-roles-grid { display: grid; grid-template-columns: 1fr 70px; gap: 6px 12px; margin: 8px 0; }
.scene .mp-role-row { display: contents; font-size: 12px; }
.scene .mp-role-row label { color: var(--hm-ink-soft); font-weight: 600; }
.scene .mp-role-row input,
.scene .mp-select {
  padding: 4px 7px;
  background: #fff;
  color: var(--hm-ink);
  border: 1px solid var(--hm-cream-edge);
  border-radius: 8px;
  font-size: 12px;
  font-family: var(--hm-body);
  transition: border-color var(--hm-t) var(--hm-ease), box-shadow var(--hm-t) var(--hm-ease);
}
.scene .mp-role-row input { text-align: right; font-variant-numeric: tabular-nums; }
.scene .mp-role-row input:focus,
.scene .mp-select:focus {
  outline: none;
  border-color: var(--hm-honey);
  box-shadow: var(--hm-ring);
}

/* build actions */
.scene .mp-build-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.scene .mp-build-desc { margin: 6px 0; font-size: 11px; font-weight: 600; color: var(--hm-ink-mute); line-height: 1.4; }

/* spy report — lavender parchment note */
.scene .mp-spy-report {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(183, 154, 224, .16);
  border: 1px solid var(--hm-lav);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #6a4c9c;
  font-variant-numeric: tabular-nums;
}

/* peace treaty card — leafy green parchment */
.scene .mp-peace-card {
  background: rgba(123, 179, 86, .16);
  border: 2px solid var(--hm-leaf);
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 8px;
  color: var(--hm-ink);
}
.scene .mp-peace-card h3 {
  margin: 0 0 6px;
  font-family: var(--hm-display);
  font-weight: 700;
  color: #4c7a2c;
}

/* ----------------------------------------------------------------
   10. EVENT LOG
   ---------------------------------------------------------------- */
.scene .mp-logbox { margin-top: 16px; }
.scene .mp-logbox > summary {
  cursor: pointer;
  font-family: var(--hm-display);
  color: var(--hm-ink-soft);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .5px;
  padding: 6px 0;
}
.scene .mp-match-log {
  background: rgba(255, 246, 224, .6);
  border: 1px solid var(--hm-cream-edge);
  border-radius: 14px;
  padding: 12px 14px;
  max-height: 400px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  color: var(--hm-ink-soft);
}
.scene .mp-match-log div { padding: 3px 0; border-bottom: 1px solid rgba(163, 132, 79, .18); }

/* ----------------------------------------------------------------
   11. END SCREEN — bright cream celebration
   ---------------------------------------------------------------- */
.scene .mp-endscreen { text-align: center; padding: 30px 20px; }
.scene .mp-endscreen h1 {
  font-family: var(--hm-display);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 36px);
  color: var(--hm-honey-deep);
  margin: 0 0 20px;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, .6));
}
.scene .mp-endscreen-scores {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 600px;
  margin: 20px auto;
}
.scene .mp-endscreen-row {
  display: grid;
  grid-template-columns: 40px 1fr 100px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(150deg, #fff 0%, var(--hm-cream) 100%);
  border: 2px solid var(--hm-cream-edge);
  border-radius: 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--hm-ink);
  box-shadow: var(--hm-shadow-soft);
}
.scene .mp-endscreen-row.me {
  border-color: var(--hm-honey);
  background: linear-gradient(150deg, #fff 0%, var(--hm-gold-soft) 100%);
}
.scene .mp-endscreen-row.winner {
  border-color: var(--hm-gold);
  background: linear-gradient(150deg, var(--hm-gold-soft) 0%, var(--hm-honey) 130%);
  box-shadow: var(--hm-shadow-soft), var(--hm-ring);
  animation: hm-pop .5s var(--hm-ease-bounce);
}
.scene .mp-endscreen-row.winner b:first-child { color: var(--hm-honey-deep); }
.scene .mp-endscreen-score {
  color: var(--hm-honey-deep);
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}

/* end-summary block + results table in #scene-mp-end */
.scene #mp-end-summary {
  color: var(--hm-ink);
  font-weight: 600;
  line-height: 1.5;
}
.scene #mp-end-scores {
  color: var(--hm-ink);
  font-variant-numeric: tabular-nums;
}
.scene #mp-end-scores thead th {
  font-family: var(--hm-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--hm-ink-soft);
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--hm-cream-edge);
}
.scene #mp-end-scores tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--hm-cream-edge);
  font-size: 13px;
  color: var(--hm-ink);
}
.scene #mp-end-scores tbody tr:hover td { background: rgba(255, 207, 92, .14); }
.scene #mp-end-scores tbody td:first-child { font-family: var(--hm-display); font-weight: 700; color: var(--hm-honey-deep); }

/* ----------------------------------------------------------------
   12. MOBILE (≤640px) — Menü-Screens auf Smartphones.
   Die 6-spaltige Ergebnistabelle in #scene-mp-end war breiter als der
   Viewport und wurde hart abgeschnitten (Spalten "Bienen"/"Honig"
   unerreichbar). Auf Mobil wird die Tabelle selbst zum horizontalen
   Scroll-Container mit kompakteren Zellen.
   ---------------------------------------------------------------- */
@media (max-width: 640px) {
  .scene #mp-end-scores {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .scene #mp-end-scores thead th,
  .scene #mp-end-scores tbody td {
    padding: 7px 8px;
    font-size: 12px;
    white-space: nowrap;
  }
}
