/*
 * mpstyle.css — chrome for the multiplayer page only.
 * Loaded AFTER the unmodified style.css; the single-player page never sees it.
 */

.hidden { display: none !important; }

/* --- header ------------------------------------------------------------- */
#mpheader {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255, 255, 255, .93);
  border-bottom: 1px solid #d4d4d8;
  padding: .4rem .6rem;
  font: 13px/1.4 system-ui, sans-serif;
}
#mpheader .hdr-row { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
#mpheader .hdr-row.small { margin-top: .25rem; font-size: 12px; color: #52525b; }
#mpheader .sep { color: #a1a1aa; }
.chip {
  border-radius: 999px; padding: .1rem .5rem; font-weight: 600;
  border: 1px solid #52525b;
}
.chip.black { background: #18181b; color: #fff; }
.chip.white { background: #fff; color: #18181b; }
.cd { font-variant-numeric: tabular-nums; }
.cd.ready { color: #15803d; font-weight: 600; }
.cd.waiting { color: #b45309; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; margin-left: auto; }
.dot.online { background: #16a34a; }
.dot.offline { background: #d4d4d8; }
#frametoggle {
  font-size: 12px; padding: .1rem .45rem; border-radius: 4px;
  border: 1px solid #a1a1aa; background: #fff; cursor: pointer;
}
#newgame {
  margin-left: auto; font-size: 12px; padding: .1rem .45rem; border-radius: 4px;
  border: 1px solid #a1a1aa; background: #fff; cursor: pointer;
}
#scaleinfo { color: #b45309; }

/* --- panels ------------------------------------------------------------- */
.panel {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(250, 250, 250, .97);
  overflow-y: auto;
  font: 14px/1.5 system-ui, sans-serif;
}
.panel-inner { max-width: 26rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

/* A sheet docks to the bottom instead of covering everything, for steps that
   need the map to stay visible and tappable underneath. */
.panel.sheet {
  inset: auto 0 0 0;
  max-height: 55vh;
  background: #fff;
  border-top: 1px solid #d4d4d8;
  box-shadow: 0 -2px 14px rgba(0, 0, 0, .16);
}
.panel.sheet .panel-inner { padding: .7rem 1rem .9rem; }
.panel.sheet h1 { font-size: 1rem; margin-bottom: .2rem; }
.panel.sheet .btnrow { margin-top: .6rem; }
.fieldrow { display: flex; gap: .6rem; }
.fieldrow label { flex: 1; margin-top: .5rem; }
.setting { margin-top: .5rem; }
.setting-label { font-weight: 600; display: block; margin-bottom: .3rem; }
.radiorow { display: flex; gap: .35rem; }
.radiorow label { flex: 1; margin: 0; }
.radiorow input { position: absolute; opacity: 0; pointer-events: none; }
.radiorow span {
  display: block; text-align: center; padding: .38rem 0; cursor: pointer;
  border: 1px solid #a1a1aa; border-radius: 5px; background: #fff;
  font-weight: 600; font-size: 15px;
}
.radiorow input:checked + span { background: #18181b; color: #fff; border-color: #18181b; }
.radiorow input:focus-visible + span { outline: 2px solid #2563eb; outline-offset: 2px; }

.slider-label { display: block; margin-top: .45rem; }
.slider-label > span { display: flex; justify-content: space-between; align-items: baseline; }
.slider-label output { font-variant-numeric: tabular-nums; font-weight: 400; color: #52525b; }
.panel input[type="range"] { padding: 0; border: 0; margin-top: .35rem; width: 100%; }
.panel h1 { font-size: 1.15rem; margin: 0 0 .5rem; }
.panel label { display: block; margin: .7rem 0 0; font-weight: 600; }
.panel input, .panel select {
  width: 100%; box-sizing: border-box; margin-top: .2rem;
  padding: .45rem .5rem; font-size: 16px;   /* 16px stops iOS zooming on focus */
  border: 1px solid #a1a1aa; border-radius: 5px; font-weight: 400;
}
.panel input[readonly] { background: #f4f4f5; font-size: 13px; }
.panel .checkbox-label { display: flex; align-items: center; gap: .5rem; }
.panel .checkbox-label input { width: auto; margin: 0; }
.panel .checkbox-label + .muted { margin: -.35rem 0 0 1.5rem; }
.muted { color: #52525b; font-size: 13px; }
.warn { color: #b45309; font-size: 13px; }
.btnrow { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
button {
  padding: .55rem .9rem; font-size: 15px; border-radius: 6px;
  border: 1px solid #a1a1aa; background: #fff; cursor: pointer;
}
button.primary { background: #18181b; color: #fff; border-color: #18181b; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* --- bottom bars -------------------------------------------------------- */
#scorebar, #overbar, #proposalbar, #movedialog {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid #d4d4d8;
  padding: .7rem .9rem;
  font: 14px/1.45 system-ui, sans-serif;
}
#proposalbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
#s_summary, #o_result { font-weight: 700; font-size: 1.05rem; }
#actions {
  position: fixed; right: .6rem; bottom: 1.5rem; z-index: 1050;
  display: flex; flex-direction: column; gap: .4rem;
}
#actions button { font-size: 13px; padding: .35rem .6rem; opacity: .92; }

/* --- toast -------------------------------------------------------------- */
#toast {
  position: fixed; top: 4.2rem; left: 50%; transform: translateX(-50%);
  z-index: 1300; max-width: 90vw;
  font: 14px/1.4 system-ui, sans-serif;
  padding: .55rem .85rem; border-radius: 6px;
  background: #18181b; color: #fff;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
#toast.show { opacity: .95; }
#toast.error { background: #b91c1c; }

/* The map fills the viewport; style.css already positions #map. */
#map { position: absolute; inset: 0; }

/*
 * Leaflet puts its zoom buttons and attribution at the map corners, which our
 * fixed header and action buttons sit on top of — leaving the zoom control
 * present but unclickable. --hdr-h is kept in sync by mpui.js.
 */
.leaflet-top { padding-top: var(--hdr-h, 0px); }
.leaflet-bottom.leaflet-right { padding-bottom: var(--actions-h, 0px); }
