/* ==========================================================================
   La Table des Batailles — site stylesheet
   Theme: a general's map table at night. Dark felt background with a faint
   hex grid; battles rendered as cardboard wargame counters.
   ========================================================================== */

:root {
  --ink-night: #14170f;      /* page background, dark green-black felt   */
  --map-panel: #1e2317;      /* raised panels                             */
  --parchment: #e6dcc3;      /* primary text                              */
  --parchment-dim: #a49a80;  /* secondary text                            */
  --brass: #c9a24b;          /* Napoleonic accent, buttons                */
  --union-steel: #7d9cbd;    /* American Civil War accent                 */
  --counter-board: #d9c9a3;  /* cardboard counter face                    */
  --counter-ink: #2a2415;    /* printing ink on counters                  */
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  color: var(--parchment);
  background-color: var(--ink-night);
  /* Faint hex grid drawn as an inline SVG tile. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cg fill='none' stroke='%23e6dcc3' stroke-opacity='0.05' stroke-width='1'%3E%3Cpath d='M28 0 L56 16 L56 48 L28 64 L0 48 L0 16 Z'/%3E%3Cpath d='M28 64 L56 80 L56 97 M28 64 L0 80 L0 97'/%3E%3C/g%3E%3C/svg%3E");
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.6;
}

h1, h2 {
  font-family: "Cinzel", "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.5rem;
}

h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); }

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

a:focus-visible,
.counter:focus-visible,
.cta:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

main {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

/* --------------------------------------------------------------------------
   Masthead / footer
   -------------------------------------------------------------------------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(230, 220, 195, 0.15);
}

.masthead-brand {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--parchment);
  text-decoration: none;
}

.masthead-motto {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--parchment-dim);
}

.footing {
  padding: 1.5rem;
  text-align: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  border-top: 1px solid rgba(230, 220, 195, 0.15);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: 3.5rem 0 2rem;
  max-width: 40rem;
}

.hero-eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--brass);
  margin: 0 0 0.75rem;
}

.hero-lede {
  color: var(--parchment-dim);
  font-size: 1.15rem;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Era sections and counter grid
   -------------------------------------------------------------------------- */

.era { margin-top: 2.75rem; }

.era-title {
  border-bottom: 1px solid rgba(230, 220, 195, 0.2);
  padding-bottom: 0.4rem;
}

.era-title { color: var(--era-accent, var(--brass)); }

.counter-grid {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 1.4rem;
}

/* A battle rendered as a cardboard counter. */
.counter {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  aspect-ratio: 1 / 1;
  padding: 0.9rem;
  justify-content: center;
  background: var(--counter-board);
  color: var(--counter-ink);
  text-decoration: none;
  border-radius: 6px;
  border: 2px solid var(--counter-ink);
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.55);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.counter:hover {
  transform: translate(-2px, -3px);
  box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.55);
}

.counter-year {
  position: absolute;
  top: 0.45rem;
  right: 0.6rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
}

/* NATO-style infantry symbol: a crossed rectangle. */
.counter-symbol {
  width: 3.4rem;
  height: 2.1rem;
  border: 2px solid var(--counter-ink);
  background:
    linear-gradient(to top right,
      transparent calc(50% - 1px), var(--counter-ink) 50%,
      transparent calc(50% + 1px)),
    linear-gradient(to bottom right,
      transparent calc(50% - 1px), var(--counter-ink) 50%,
      transparent calc(50% + 1px));
}

.era .counter, .battle-sheet .counter {
  background: linear-gradient(160deg,
      color-mix(in srgb, var(--era-accent, var(--brass)) 22%, #e9e1c8),
      color-mix(in srgb, var(--era-accent, var(--brass)) 42%, #d6c9a4));
}

.counter-name {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 1.02rem;
  text-align: center;
  line-height: 1.15;
}

.counter-location {
  font-size: 0.82rem;
  text-align: center;
  color: #55492e;
}

/* --------------------------------------------------------------------------
   Battle detail page
   -------------------------------------------------------------------------- */

.battle-sheet { padding-top: 2.25rem; }

.crumb { margin-bottom: 2rem; font-size: 0.95rem; }

.battle-head {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}

.counter-static {
  width: 10.5rem;
  flex: 0 0 auto;
  cursor: default;
}

.counter-static:hover {
  transform: none;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.55);
}

.battle-facts {
  margin: 1rem 0 0;
  display: grid;
  gap: 0.3rem;
}

.battle-facts div { display: flex; gap: 0.6rem; }

.battle-facts dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--parchment-dim);
  min-width: 7.5rem;
  padding-top: 0.35rem;
}

.battle-facts dd { margin: 0; }

.battle-summary {
  max-width: 42rem;
  margin: 2rem 0;
  font-size: 1.15rem;
}

.cta {
  display: inline-block;
  padding: 0.8rem 1.9rem;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink-night);
  background: var(--brass);
  text-decoration: none;
  border-radius: 4px;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.55);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.battle-sheet .cta { background: var(--era-accent, var(--brass)); }

.cta:hover {
  transform: translate(-1px, -2px);
  box-shadow: 5px 7px 0 rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------------------------------
   Play page (full-screen frame)
   -------------------------------------------------------------------------- */

.play-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-image: none;
}

.play-bar {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid rgba(230, 220, 195, 0.15);
  font-size: 0.95rem;
}

.play-title {
  font-family: "Cinzel", serif;
  font-weight: 500;
  color: var(--parchment-dim);
}

.play-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}

/* --------------------------------------------------------------------------
   Accessibility / responsive
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .counter, .cta { transition: none; }
  .counter:hover, .cta:hover { transform: none; }
}

@media (max-width: 480px) {
  .counter-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .battle-facts dt { min-width: 6rem; }
}

/* --------------------------------------------------------------------------
   Masthead navigation (auth links)
   -------------------------------------------------------------------------- */

.masthead-nav {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  font-size: 0.95rem;
}

.masthead-user {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--parchment-dim);
}

/* --------------------------------------------------------------------------
   Auth pages (login / registration) and admin panel
   -------------------------------------------------------------------------- */

.auth-card {
  max-width: 26rem;
  margin: 3.5rem auto 0;
  padding: 2rem 2.25rem 2.25rem;
  background: var(--map-panel);
  border: 1px solid rgba(230, 220, 195, 0.15);
  border-radius: 8px;
}

.auth-lede {
  color: var(--parchment-dim);
  margin-top: 0;
}

.auth-card form {
  display: grid;
  gap: 0.35rem;
  margin-top: 1.25rem;
}

.auth-card label,
.hint {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--parchment-dim);
}

.hint { font-weight: 500; text-transform: none; letter-spacing: 0.04em; }

.auth-card input,
.user-table select {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.05rem;
  color: var(--parchment);
  background: var(--ink-night);
  border: 1px solid rgba(230, 220, 195, 0.25);
  border-radius: 4px;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.9rem;
}

.auth-card input:focus,
.user-table select:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
}

.auth-card .cta {
  border: 0;
  cursor: pointer;
  justify-self: start;
  margin-top: 0.4rem;
}

.auth-alt {
  margin: 1.5rem 0 0;
  font-size: 0.95rem;
  color: var(--parchment-dim);
}

.flash {
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  font-size: 0.98rem;
}

.flash-error {
  background: rgba(166, 75, 63, 0.18);
  border: 1px solid var(--musket-red, #a64b3f);
}

.flash-ok {
  background: rgba(99, 153, 34, 0.15);
  border: 1px solid #639922;
}

.admin-panel { padding-top: 2.5rem; }

.user-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.25rem;
}

.user-table th {
  text-align: left;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--parchment-dim);
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(230, 220, 195, 0.2);
}

.user-table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid rgba(230, 220, 195, 0.1);
}

.role-form {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.role-form select { margin-bottom: 0; }

.role-form button {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 0.95rem;
  color: var(--ink-night);
  background: var(--brass);
  border: 0;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Lobby (game creation and lists)
   -------------------------------------------------------------------------- */

.lobby { padding-top: 2.5rem; }

.lobby-block { margin-top: 2.25rem; }

.lobby-block h2 {
  border-bottom: 1px solid rgba(230, 220, 195, 0.2);
  padding-bottom: 0.35rem;
}

.lobby-empty { color: var(--parchment-dim); font-size: 1rem; margin: 0.75rem 0 0; }

.new-game-form {
  display: grid;
  gap: 0.5rem;
  max-width: 34rem;
  margin-top: 1rem;
}

.new-game-form label[for="bataille"] {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--parchment-dim);
}

.new-game-form select {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.05rem;
  color: var(--parchment);
  background: var(--ink-night);
  border: 1px solid rgba(230, 220, 195, 0.25);
  border-radius: 4px;
  padding: 0.5rem 0.7rem;
}

.new-game-form select:focus { outline: 2px solid var(--brass); outline-offset: 1px; }

.mode-choice {
  border: 1px solid rgba(230, 220, 195, 0.2);
  border-radius: 6px;
  padding: 0.9rem 1.1rem 1.1rem;
  margin: 0.5rem 0 0.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.6rem;
}

.mode-choice legend {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--parchment-dim);
  padding: 0 0.4rem;
}

.mode-choice label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  font-size: 1.05rem;
}

.mode-choice input[type="radio"] { accent-color: var(--brass); }

.new-game-form .cta { border: 0; cursor: pointer; justify-self: start; margin-top: 0.4rem; }

.lobby-action {
  display: inline-block;
  font-family: "EB Garamond", Georgia, serif;
  font-size: 0.95rem;
  color: var(--ink-night);
  background: var(--brass);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Scenario workshop (author edition, validation queue)
   -------------------------------------------------------------------------- */

.badge {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  border: 1px solid;
}

.badge-draft     { color: var(--parchment-dim); border-color: rgba(230, 220, 195, 0.35); }
.badge-proposed  { color: #e0b45c; border-color: #a5843f; }
.badge-validated { color: #9dc06a; border-color: #639922; }

.player-input {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.05rem;
  color: var(--parchment);
  background: var(--ink-night);
  border: 1px solid rgba(230, 220, 195, 0.25);
  border-radius: 4px;
  padding: 0.45rem 0.7rem;
}

.player-input:focus { outline: 2px solid var(--brass); outline-offset: 1px; }

.cta-button { border: 0; cursor: pointer; margin: 1rem 0 0.5rem; }

.scenario-form {
  display: grid;
  gap: 0.35rem;
  max-width: 44rem;
  margin-top: 1.25rem;
}

.scenario-form label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--parchment-dim);
  margin-top: 0.5rem;
}

.scenario-form input,
.scenario-form select,
.scenario-form textarea {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.05rem;
  color: var(--parchment);
  background: var(--ink-night);
  border: 1px solid rgba(230, 220, 195, 0.25);
  border-radius: 4px;
  padding: 0.5rem 0.7rem;
}

.scenario-form input:focus,
.scenario-form select:focus,
.scenario-form textarea:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
}

.definition-area {
  font-family: "IBM Plex Mono", monospace !important;
  font-size: 0.85rem !important;
}

.scenario-form .cta { border: 0; cursor: pointer; justify-self: start; margin-top: 1rem; }

.propose-form { margin-top: 1rem; }

.cta-secondary {
  border: 0;
  cursor: pointer;
  background: transparent;
  color: var(--brass);
  box-shadow: none;
  border: 1px solid var(--brass);
}

.button-danger {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 0.95rem;
  color: var(--parchment);
  background: transparent;
  border: 1px solid var(--musket-red, #a64b3f);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.role-form form { display: inline; }

/* --------------------------------------------------------------------------
   Battle thumbnails, admin sub-navigation, rich-text editor
   -------------------------------------------------------------------------- */

.counter-thumb {
  width: 5.2rem;
  height: 3.2rem;
  object-fit: cover;
  border: 2px solid var(--counter-ink);
  border-radius: 2px;
}

.thumb-preview { width: 10rem; height: 6rem; margin: 0.5rem 0; display: block; }

.era-add-title { margin-top: 2.25rem; }

.mono { font-family: "IBM Plex Mono", monospace; font-size: 0.85rem; }

.summary-editor {
  background: var(--ink-night);
  border: 1px solid rgba(230, 220, 195, 0.25);
  border-radius: 0 0 4px 4px;
  min-height: 8rem;
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.05rem;
}

.scenario-form .ql-toolbar {
  background: var(--map-panel);
  border: 1px solid rgba(230, 220, 195, 0.25);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.scenario-form .ql-toolbar .ql-stroke { stroke: var(--parchment-dim); }
.scenario-form .ql-toolbar .ql-fill { fill: var(--parchment-dim); }
.scenario-form .ql-toolbar .ql-picker { color: var(--parchment-dim); }

.battle-summary p { margin: 0 0 0.75rem; }
.battle-summary blockquote {
  border-left: 3px solid var(--brass);
  margin: 0.75rem 0;
  padding-left: 1rem;
  color: var(--parchment-dim);
}

/* --------------------------------------------------------------------------
   Search pickers, hex-map scenario editor, thumbnail block
   -------------------------------------------------------------------------- */

.picker-hidden { display: none !important; }

.picker { display: grid; gap: 0.4rem; max-width: 26rem; }

.picker-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  justify-self: start;
  background: var(--map-panel);
  border: 1px solid var(--brass);
  border-radius: 999px;
  padding: 0.35rem 0.6rem 0.35rem 1rem;
  font-size: 1rem;
}

.chip-remove {
  background: transparent;
  border: 0;
  color: var(--brass);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
}

.picker-results { display: grid; gap: 2px; }

.picker-result {
  text-align: left;
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1rem;
  color: var(--parchment);
  background: var(--map-panel);
  border: 1px solid rgba(230, 220, 195, 0.15);
  border-radius: 4px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.picker-result:hover, .picker-result:focus-visible { border-color: var(--brass); }

.picker-empty { color: var(--parchment-dim); font-size: 0.95rem; margin: 0.2rem 0 0; }

.mode-detail { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; }

/* The opponent picker is the one detail wide enough to take a line of its own. */
#detail-joueur { flex-basis: 100%; }

.ai-option { font-size: 1rem; }

.hexmap-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.1rem;
  background: var(--map-panel);
  border: 1px solid rgba(230, 220, 195, 0.25);
  border-radius: 4px 4px 0 0;
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
  color: var(--parchment-dim);
}

.hexmap-group { display: inline-flex; align-items: center; gap: 0.4rem; }

.hexmap-toolbar input[type="number"] {
  width: 3.2rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  color: var(--parchment);
  background: var(--ink-night);
  border: 1px solid rgba(230, 220, 195, 0.25);
  border-radius: 3px;
  padding: 0.25rem 0.35rem;
}

.hexmap-toolbar select {
  font-size: 0.9rem;
  color: var(--parchment);
  background: var(--ink-night);
  border: 1px solid rgba(230, 220, 195, 0.25);
  border-radius: 3px;
  padding: 0.3rem 0.4rem;
}

.hexmap-toolbar button {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 0.9rem;
  color: #14170f;
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 3px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  background: var(--parchment-dim);
}

.hexmap-toolbar button.ed-active { outline: 2px solid var(--brass); outline-offset: 1px; }

.hexmap-host {
  border: 1px solid rgba(230, 220, 195, 0.25);
  border-top: 0;
  border-radius: 0 0 4px 4px;
  background: var(--ink-night);
  padding: 0.6rem;
  overflow-x: auto;
}

.hexmap .hex-cell { cursor: crosshair; }

.thumb-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
  margin-top: 1rem;
}

.counter-small { width: 9rem; height: 9rem; }

.thumb-form { display: grid; gap: 0.7rem; justify-items: start; }

.thumb-help { margin: 0; color: var(--parchment-dim); font-size: 0.98rem; max-width: 24rem; }

.thumb-choose { cursor: pointer; }

.thumb-filename {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--parchment-dim);
}

.badge-disabled { color: #d98a80; border-color: #a64b3f; }

.row-actions { display: flex; gap: 0.5rem; }

.validate-actions { margin-top: 1.5rem; display: flex; gap: 0.8rem; }

/* --------------------------------------------------------------------------
   Game-style presentation of the scenario viewer and editor
   -------------------------------------------------------------------------- */

/* Full-bleed stage: the battle plan is presented like the play page. */
.game-stage {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0 1.5rem;
  box-sizing: border-box;
}

.game-stage .hexmap-host {
  min-height: 55vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.game-stage .hexmap-toolbar {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  background: rgba(20, 23, 15, 0.92);
}

/* The read-only viewer fills the viewport under the play bar. */
.play-stage { flex: 1; display: flex; overflow: auto; background: var(--ink-night); }

.play-stage .hexmap-host {
  border: 0;
  border-radius: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.play-infoline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.5rem;
  padding: 0.45rem 1.5rem;
  background: var(--map-panel);
  border-bottom: 1px solid rgba(230, 220, 195, 0.15);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--parchment-dim);
}

.play-summary { position: relative; }

.play-summary summary { cursor: pointer; color: var(--brass); }

.play-summary .battle-summary {
  position: absolute;
  z-index: 10;
  top: 1.8rem;
  left: 0;
  width: min(34rem, 80vw);
  background: var(--map-panel);
  border: 1px solid var(--brass);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  font-size: 1rem;
}

.play-actions { margin-left: auto; display: flex; gap: 0.6rem; }

.play-actions form { display: inline; }

.play-actions button {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--parchment);
  background: transparent;
  border: 1px solid var(--brass);
  border-radius: 3px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}

.play-actions button:hover { background: var(--brass); color: #14170f; }

/* --------------------------------------------------------------------------
   Full-page scenario edition (play-style)
   -------------------------------------------------------------------------- */

.play-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.play-stage-edit {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--ink-night);
}

.play-stage-edit .hexmap-toolbar { border-radius: 0; border-left: 0; border-right: 0; }

.play-stage-edit .hexmap-host {
  flex: 1;
  border: 0;
  border-radius: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem;
}

.play-panel {
  position: absolute;
  z-index: 10;
  top: 1.8rem;
  left: 0;
  width: min(38rem, 92vw);
  max-height: 70vh;
  overflow-y: auto;
  background: var(--map-panel);
  border: 1px solid var(--brass);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  display: grid;
  gap: 0.4rem;
}

.play-panel label { margin-top: 0.5rem; }

.play-panel input[type="text"], .play-panel select {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1rem;
  color: var(--parchment);
  background: var(--ink-night);
  border: 1px solid rgba(230, 220, 195, 0.25);
  border-radius: 4px;
  padding: 0.5rem 0.7rem;
}

.panel-subtitle { margin: 1.25rem 0 0.25rem; font-size: 1.15rem; }

.flash-bar { margin: 0; border-radius: 0; }


/* --------------------------------------------------------------------------
   Era administration: reorder arrows, color swatch and palette input
   -------------------------------------------------------------------------- */

.era-arrows { display: flex; gap: 0.3rem; }

.era-arrows form { display: inline; }

.arrow-button {
  font-size: 0.9rem;
  color: var(--parchment);
  background: transparent;
  border: 1px solid rgba(230, 220, 195, 0.35);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
}

.arrow-button:hover { border-color: var(--brass); color: var(--brass); }

.color-swatch {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 3px;
  border: 1px solid rgba(230, 220, 195, 0.4);
  vertical-align: -0.2rem;
  margin-right: 0.4rem;
}

.color-input {
  width: 4rem;
  height: 2.2rem;
  padding: 0.15rem;
  background: var(--ink-night);
  border: 1px solid rgba(230, 220, 195, 0.25);
  border-radius: 4px;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Forum
   -------------------------------------------------------------------------- */

.forum-table td:first-child a { color: var(--parchment); }

.forum-posts { display: grid; gap: 1rem; margin: 1.5rem 0; }

.forum-post {
  background: var(--map-panel);
  border: 1px solid rgba(230, 220, 195, 0.15);
  border-radius: 4px;
  padding: 0.9rem 1.2rem;
}

.forum-post-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--parchment-dim);
  margin-bottom: 0.5rem;
}

.forum-author { color: var(--brass); font-weight: 600; }

.forum-delete { margin-left: auto; }

.forum-content { margin: 0; white-space: pre-line; }

.new-game-form textarea {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.05rem;
  color: var(--parchment);
  background: var(--ink-night);
  border: 1px solid rgba(230, 220, 195, 0.25);
  border-radius: 4px;
  padding: 0.6rem 0.8rem;
  resize: vertical;
}

.forum-category { margin: 2rem 0 0.6rem; color: var(--brass); }

/* --------------------------------------------------------------------------
   Player avatars (displayed with every player name)
   -------------------------------------------------------------------------- */

.avatar-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  vertical-align: middle;
}

.avatar {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(230, 220, 195, 0.4);
  flex: none;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--map-panel);
  color: var(--brass);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  font-weight: 600;
}

.avatar-large { width: 3.5rem; height: 3.5rem; font-size: 1.4rem; }

.avatar-chip-large { gap: 1rem; font-size: 1.3rem; }

a.masthead-user { text-decoration: none; }

.picker-result { display: flex; align-items: center; gap: 0.45rem; }

.picker-chip .avatar { width: 1.3rem; height: 1.3rem; }

/* Image drop zones (avatar, scenario thumbnail) */
.dropzone {
  border: 2px dashed rgba(230, 220, 195, 0.3);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone-over {
  border-color: var(--brass);
  background: rgba(201, 162, 75, 0.08);
}

/* Embedded engine editor (workshop and validation preview) */
iframe.play-stage-edit, iframe.play-stage { border: 0; width: 100%; flex: 1; min-height: 0; }

/* Scenario versions */
.version-hint {
  font-size: 0.75rem;
  color: rgba(230, 220, 195, 0.6);
  margin-left: 0.6rem;
}

.version-list { flex-wrap: wrap; gap: 0.4rem; }

/* Language selector & administration */
.lang-select { display: inline-flex; gap: 0.35rem; margin-left: 0.8rem; }

.lang-option {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid rgba(230, 220, 195, 0.25);
  border-radius: 4px;
  text-decoration: none;
  color: rgba(230, 220, 195, 0.7);
}

.lang-option-active { border-color: var(--brass); color: var(--brass); }

.lang-tabs { display: flex; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; }

.lang-tab {
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(230, 220, 195, 0.25);
  border-radius: 4px;
  text-decoration: none;
}

.lang-tab-active { border-color: var(--brass); color: var(--brass); }

.translation-table input { width: 100%; box-sizing: border-box; }
