/* World chooser, lobby, and admin seed editor — styles for world-chooser.js
   and seed-editor.js (public/). New file; style.css is untouched.

   Everything below is scoped under .ewc-root (present on both #ewcOverlay
   and #ewcSeedEditor, the two mount points named in the paste-in snippet)
   so nothing here can leak onto the rest of the game's chrome — the custom
   properties are declared on that class rather than :root, and every rule
   in this file is either that class itself or a descendant of it.

   Stone, hairline and type are ported from .music-controls in style.css:
   the same wall-plain.png stone, the same amber border, the same Iowan Old
   Style — proto/seed-browser.html and proto/seed-forge.html already found
   this vocabulary, this file just gives it real selectors. --ewc-moon is
   the prototype's secondary blue-grey (#c8d4de), not style.css's --moon
   (#eef1e6, a different role there — primary ink) — named separately here
   on purpose so setting it can't be confused with overriding the game's
   own variable. */

.ewc-root {
  --ewc-ink: #e8e2d6;
  --ewc-dim: #a49c8e;
  --ewc-faint: #6d675e;
  --ewc-lantern: #e8b24d;
  --ewc-moon: #c8d4de;
  --ewc-edge: rgba(232, 178, 77, 0.28);
}

.ewc-root {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  background: #0d0f11;
  background: radial-gradient(ellipse at 50% 20%, rgba(232, 178, 77, 0.05), transparent 60%), rgba(6, 8, 9, 0.97);
  color: var(--ewc-ink);
  font: 15px/1.6 "Iowan Old Style", Palatino, Georgia, serif;
  padding: 2.4rem 1.4rem 5rem;
  cursor: auto;
}

#ewcSeedEditor.ewc-root { z-index: 51; }

.ewc-root * { box-sizing: border-box; }
.ewc-root button { font: inherit; }

.ewc-frame { max-width: 1120px; margin: 0 auto; position: relative; }
#ewcSeedEditor .ewc-frame { max-width: 1000px; }

.ewc-close-btn {
  position: fixed; top: 16px; right: 16px; z-index: 1;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(238, 241, 230, 0.06); border: 1px solid var(--ewc-edge);
  color: var(--ewc-dim); font-size: 0.85rem; line-height: 1; cursor: pointer;
}
.ewc-close-btn:hover { color: var(--ewc-lantern); border-color: var(--ewc-lantern); }

.ewc-header { text-align: center; margin-bottom: 2rem; position: relative; }
.ewc-eyebrow {
  margin: 0 0 6px; font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ewc-lantern); opacity: 0.7;
}
.ewc-header h1 {
  font-size: 1.9rem; font-weight: 600; margin: 0 0 0.3rem; letter-spacing: 0.02em;
  color: #f0e4c8; text-shadow: 0 2px 18px rgba(232, 178, 77, 0.22);
}
.ewc-sub { color: var(--ewc-dim); margin: 0; font-size: 0.95rem; }

.ewc-back {
  font-family: inherit; font-size: 0.78rem; background: none; border: none;
  color: var(--ewc-dim); text-decoration: underline; cursor: pointer; padding: 0 0 10px;
}
.ewc-back:hover { color: var(--ewc-lantern); }

.ewc-forge-btn {
  position: absolute; top: 0; right: 0;
  font-size: 0.8rem; padding: 0.4rem 0.85rem; cursor: pointer; border-radius: 16px;
  background: rgba(232, 178, 77, 0.14); color: #f4e2bb; border: 1px solid var(--ewc-edge);
}
.ewc-forge-btn:hover { background: rgba(232, 178, 77, 0.24); }

/* ---- the stone, reused for every card/panel/section in both files ---- */
.ewc-stone {
  background: linear-gradient(rgba(10, 12, 10, 0.7), rgba(5, 7, 6, 0.84)), url("assets/ui/wall-plain.png") center / 260px;
  border: 1px solid var(--ewc-edge);
  border-radius: 20px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.ewc-err {
  color: #edc6c6; background: rgba(224, 138, 138, 0.12); border: 1px solid #7d4a4a;
  padding: 0.6rem 0.75rem; border-radius: 10px; font-size: 0.86rem;
}

/* ---- chooser grid ---- */
.ewc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1.3rem; }
@media (max-width: 460px) { .ewc-grid { grid-template-columns: 1fr; } }

.ewc-card { overflow: hidden; display: flex; flex-direction: column; }

.ewc-plate { position: relative; height: 200px; background: #14171a; overflow: hidden; }
.ewc-plate img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ewc-plate .ewc-unpainted {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.4rem; color: var(--ewc-faint); font-size: 0.88rem; text-align: center; padding: 1rem;
  background: repeating-linear-gradient(45deg, #14171a, #14171a 12px, #171b1f 12px, #171b1f 24px);
}
.ewc-plate .ewc-zone-tabs { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 1px; background: rgba(0, 0, 0, 0.5); }
.ewc-plate .ewc-zone-tabs button {
  flex: 1; font: inherit; font-size: 0.74rem; padding: 0.4rem 0.3rem; border: none; cursor: pointer;
  background: rgba(10, 12, 14, 0.72); color: var(--ewc-dim);
}
.ewc-plate .ewc-zone-tabs button[aria-pressed="true"] { background: rgba(232, 178, 77, 0.2); color: #f4e2bb; }

.ewc-body { padding: 1rem 1.1rem 1.15rem; flex: 1; display: flex; flex-direction: column; gap: 0.7rem; }
.ewc-title { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.ewc-title h2 { margin: 0; font-size: 1.24rem; font-weight: 600; }
.ewc-title .ewc-tongue-name { font-size: 0.8rem; color: var(--ewc-lantern); font-style: italic; }
.ewc-tagline { color: var(--ewc-dim); font-size: 0.92rem; margin: 0; }

.ewc-facts { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ewc-fact {
  font-size: 0.74rem; padding: 0.2rem 0.5rem; border-radius: 20px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.09); color: var(--ewc-dim);
}
.ewc-fact.warn { border-color: #7d4a4a; color: #e6bcbc; background: rgba(224, 138, 138, 0.1); }
.ewc-fact.good { border-color: rgba(232, 178, 77, 0.4); color: #f0dcae; background: rgba(232, 178, 77, 0.08); }

.ewc-listen { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.ewc-listen button {
  font: inherit; font-size: 0.8rem; padding: 0.32rem 0.65rem; cursor: pointer; border-radius: 16px;
  background: rgba(255, 255, 255, 0.06); color: var(--ewc-moon); border: 1px solid rgba(255, 255, 255, 0.14);
}
.ewc-listen button:hover { border-color: var(--ewc-lantern); color: #f4e2bb; }
.ewc-listen button[aria-pressed="true"] { background: rgba(232, 178, 77, 0.22); color: #f4e2bb; border-color: var(--ewc-lantern); }
.ewc-listen .ewc-label { font-size: 0.74rem; color: var(--ewc-faint); letter-spacing: 0.1em; text-transform: uppercase; }

.ewc-tongue-strip { display: flex; flex-wrap: wrap; gap: 0.35rem; min-height: 1.6rem; align-items: center; }
.ewc-coin { font-size: 0.82rem; padding: 0.22rem 0.5rem; border-radius: 5px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); }
.ewc-coin b { font-weight: 600; letter-spacing: 0.02em; }
.ewc-coin span { color: var(--ewc-faint); font-size: 0.72rem; }

.ewc-root details { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 0.55rem; }
.ewc-root details summary { cursor: pointer; font-size: 0.82rem; color: var(--ewc-dim); }
.ewc-root details summary:hover { color: var(--ewc-ink); }
.ewc-kin-row { display: flex; gap: 0.6rem; padding: 0.4rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.ewc-kin-row b { min-width: 100px; font-weight: 600; font-size: 0.88rem; }
.ewc-kin-row span { color: var(--ewc-dim); font-size: 0.83rem; }
.ewc-boundary { font-size: 0.85rem; color: var(--ewc-dim); white-space: pre-wrap; max-height: 220px; overflow: auto; }
.ewc-blocked-row { font-size: 0.8rem; color: var(--ewc-dim); padding: 0.28rem 0; }
.ewc-blocked-row b { color: #e6bcbc; font-weight: 600; }

.ewc-act { margin-top: auto; padding-top: 0.4rem; }
.ewc-act .ewc-enter {
  width: 100%; font: inherit; font-size: 0.92rem; padding: 0.5rem 1rem; cursor: pointer; border-radius: 16px;
  background: rgba(232, 178, 77, 0.18); border: 1px solid var(--ewc-lantern); color: #f7e8c4;
}
.ewc-act .ewc-enter:hover { background: rgba(232, 178, 77, 0.28); }

/* ---- lobby ---- */
.ewc-lobby-body { max-width: 480px; margin: 0 auto; padding: 1.4rem 1.5rem 1.6rem; text-align: center; }
.ewc-lobby-count { font-size: 2.2rem; font-weight: 600; color: var(--ewc-lantern); line-height: 1.1; }
.ewc-lobby-count-label { font-size: 0.8rem; color: var(--ewc-dim); margin: 0 0 1rem; }
.ewc-lobby-roster { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; text-align: left; }
.ewc-lobby-member {
  font-size: 0.86rem; padding: 0.4rem 0.7rem; border-radius: 10px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); color: var(--ewc-ink);
}
.ewc-lobby-member.self { border-color: var(--ewc-lantern); color: #f4e2bb; }
.ewc-lobby-empty { font-size: 0.86rem; color: var(--ewc-faint); font-style: italic; padding: 0.4rem 0.2rem; text-align: center; }
.ewc-lobby-countdown {
  font-size: 0.86rem; color: #f4e2bb; background: rgba(232, 178, 77, 0.1);
  border: 1px solid var(--ewc-edge); border-radius: 10px; padding: 0.5rem 0.7rem; margin-bottom: 1rem;
}
.ewc-lobby-min-note { font-size: 0.76rem; color: var(--ewc-faint); margin: -0.5rem 0 1rem; }

.ewc-lobby-actions { display: flex; gap: 0.7rem; }
.ewc-btn {
  flex: 1; font: inherit; font-size: 0.92rem; padding: 0.6rem 1rem; cursor: pointer; border-radius: 16px;
  background: rgba(255, 255, 255, 0.06); color: var(--ewc-moon); border: 1px solid rgba(255, 255, 255, 0.16);
}
.ewc-btn:hover:not(:disabled) { border-color: var(--ewc-lantern); color: #f4e2bb; }
.ewc-btn:disabled { opacity: 0.55; cursor: default; }
.ewc-btn-solo { background: rgba(232, 178, 77, 0.16); border-color: var(--ewc-lantern); color: #f4e2bb; }
.ewc-btn-solo:hover:not(:disabled) { background: rgba(232, 178, 77, 0.26); }

/* ---- seed editor (forge) ---- */
#ewcSeedEditor .ewcfg-section { margin-bottom: 1.1rem; overflow: hidden; }
#ewcSeedEditor .ewcfg-head { padding: 0.7rem 1rem; border-bottom: 1px solid rgba(232, 178, 77, 0.16); display: flex; align-items: baseline; gap: 0.6rem; }
#ewcSeedEditor .ewcfg-head .ewcfg-n { font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ewc-faint); }
#ewcSeedEditor .ewcfg-head h2 { margin: 0; font-size: 1.04rem; font-weight: 600; }
#ewcSeedEditor .ewcfg-head .ewcfg-hint { margin-left: auto; font-size: 0.76rem; color: var(--ewc-faint); }
#ewcSeedEditor .ewcfg-body { padding: 1rem; }

#ewcSeedEditor label {
  display: block; font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ewc-faint); margin: 0.6rem 0 0.25rem;
}
#ewcSeedEditor input[type="text"], #ewcSeedEditor textarea {
  width: 100%; font: inherit; font-size: 0.9rem; padding: 0.5rem 0.6rem; color: var(--ewc-ink);
  background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 5px;
}
#ewcSeedEditor textarea { min-height: 60px; resize: vertical; }
#ewcSeedEditor input:focus, #ewcSeedEditor textarea:focus { outline: none; border-color: var(--ewc-lantern); }
#ewcSeedEditor .ewcfg-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
@media (max-width: 640px) { #ewcSeedEditor .ewcfg-two { grid-template-columns: 1fr; } }

#ewcSeedEditor button {
  font: inherit; font-size: 0.82rem; padding: 0.36rem 0.75rem; cursor: pointer; border-radius: 16px;
  background: rgba(255, 255, 255, 0.06); color: var(--ewc-moon); border: 1px solid rgba(255, 255, 255, 0.14);
}
#ewcSeedEditor button:hover:not(:disabled) { border-color: var(--ewc-lantern); color: #f4e2bb; }
#ewcSeedEditor button:disabled { opacity: 0.4; cursor: default; }
#ewcSeedEditor button.ewcfg-go { background: rgba(232, 178, 77, 0.18); border-color: var(--ewc-lantern); color: #f7e8c4; }
#ewcSeedEditor button.ewcfg-danger { border-color: #7d4a4a; color: #e6bcbc; }
#ewcSeedEditor button.ewcfg-danger:hover:not(:disabled) { background: rgba(224, 138, 138, 0.12); border-color: #a86464; color: #f0d0d0; }
#ewcSeedEditor .ewcfg-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.7rem; }

#ewcSeedEditor .ewcfg-presets button[aria-pressed="true"] { background: rgba(232, 178, 77, 0.22); border-color: var(--ewc-lantern); color: #f4e2bb; }
#ewcSeedEditor .ewcfg-roots { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }
#ewcSeedEditor .ewcfg-root {
  display: flex; align-items: center; gap: 0.3rem; background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 5px; padding: 0.2rem 0.3rem 0.2rem 0.5rem;
}
#ewcSeedEditor .ewcfg-root b { font-size: 0.9rem; letter-spacing: 0.02em; }
#ewcSeedEditor .ewcfg-root input {
  width: 112px; font: inherit; font-size: 0.76rem; padding: 0.15rem 0.3rem; color: var(--ewc-dim);
  background: transparent; border: none; border-bottom: 1px dotted rgba(255, 255, 255, 0.2);
}
#ewcSeedEditor .ewcfg-root input:focus { outline: none; border-bottom-color: var(--ewc-lantern); color: var(--ewc-ink); }
#ewcSeedEditor .ewcfg-root .ewcfg-x { cursor: pointer; color: var(--ewc-faint); padding: 0 0.25rem; }
#ewcSeedEditor .ewcfg-root .ewcfg-x:hover { color: #e6bcbc; }
#ewcSeedEditor .ewcfg-root.bad { border-color: #7d4a4a; background: rgba(224, 138, 138, 0.12); }

#ewcSeedEditor .ewcfg-verdict { margin-top: 0.8rem; padding: 0.55rem 0.7rem; border-radius: 5px; font-size: 0.84rem; }
#ewcSeedEditor .ewcfg-verdict.ok { background: rgba(232, 178, 77, 0.08); border: 1px solid rgba(232, 178, 77, 0.35); color: #f0dcae; }
#ewcSeedEditor .ewcfg-verdict.bad { background: rgba(224, 138, 138, 0.12); border: 1px solid #7d4a4a; color: #edc6c6; }
#ewcSeedEditor .ewcfg-samples { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.7rem; }
#ewcSeedEditor .ewcfg-samp { font-size: 0.82rem; padding: 0.22rem 0.5rem; border-radius: 5px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); }
#ewcSeedEditor .ewcfg-samp span { color: var(--ewc-faint); font-size: 0.72rem; }
#ewcSeedEditor .ewcfg-note { color: var(--ewc-faint); font-size: 0.8rem; margin-top: 0.5rem; }
#ewcSeedEditor pre.ewcfg-out {
  margin: 0.8rem 0 0; padding: 0.8rem; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px; font-family: ui-monospace, Menlo, monospace; font-size: 0.72rem; color: var(--ewc-dim);
  max-height: 240px; overflow: auto; white-space: pre-wrap;
}

#ewcSeedEditor .ewcfg-seed-list { display: flex; flex-direction: column; gap: 6px; margin-top: 0.6rem; }
#ewcSeedEditor .ewcfg-seed-row {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.7rem; border-radius: 8px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
}
#ewcSeedEditor .ewcfg-seed-row .ewcfg-seed-name { flex: 1; font-size: 0.88rem; }
#ewcSeedEditor .ewcfg-seed-row .ewcfg-seed-id { color: var(--ewc-faint); font-size: 0.76rem; }
