/* God's Town — marble and sunlit stone. All colors flow from CSS variables the
   active civilization skin sets at runtime, so a new skin re-themes the whole
   UI without touching this file. */
:root {
  --bg: #f4efe6;
  --panel: #fbf8f1;
  --ink: #2b2620;
  --muted: #6d6152;
  --stone: #d9cfbe;
  --stone-2: #e7dfd0;
  --accent: #9c6b3f;
  --accent-soft: #c9a06a;
  --gold: #b8894b;
  --shadow: rgba(58, 45, 32, 0.16);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Figtree", system-ui, sans-serif;
  --good: #4f7a4a;
  --bad: #a5462f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100%;
}

body {
  background-image:
    radial-gradient(1200px 500px at 70% -10%, rgba(255, 251, 240, 0.9), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--stone-2));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 300px at 15% 0%, rgba(184, 137, 75, 0.10), transparent 70%);
  z-index: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--gold); }

/* header */
.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--stone);
  background: rgba(251, 248, 241, 0.75);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.brand .mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--accent-soft), var(--accent));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4), 0 3px 10px var(--shadow);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; letter-spacing: 0.3px; }
.brand-text em { font-style: italic; color: var(--muted); font-size: 0.82rem; }
nav { display: flex; gap: 22px; }
nav a { font-weight: 600; color: var(--muted); padding-bottom: 2px; border-bottom: 2px solid transparent; }
nav a.on, nav a:hover { color: var(--ink); border-color: var(--gold); }

/* layout */
.view {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 24px 60px;
  flex: 1;
}
.foot { text-align: center; padding: 22px; color: var(--muted); font-family: var(--serif); font-style: italic; z-index: 1; }

.panel {
  background: var(--panel);
  border: 1px solid var(--stone);
  border-radius: 14px;
  box-shadow: 0 10px 30px -18px var(--shadow);
  padding: 22px;
}
.grid { display: grid; gap: 20px; }
.cols-2 { grid-template-columns: 1.5fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0 0 10px; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.5rem; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* buttons + inputs */
button, .btn {
  font-family: var(--sans);
  font-weight: 600;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.05s ease, filter 0.15s ease;
}
@media (hover: hover) and (pointer: fine) {
  button:hover, .btn:hover { filter: brightness(1.05); }
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--accent); }
button.stone { background: var(--stone-2); color: var(--ink); border-color: var(--stone); }
input, select, textarea {
  font-family: var(--sans);
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid var(--stone);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
label { font-weight: 600; font-size: 0.85rem; color: var(--muted); display: block; margin-bottom: 6px; }
.field { margin-bottom: 16px; }

/* hero / create */
.hero { text-align: center; padding: 40px 10px 24px; }
.hero h1 { font-size: 3rem; margin-bottom: 6px; }
.hero p { max-width: 640px; margin: 0 auto 8px; color: var(--muted); font-size: 1.05rem; }
.tag { display: inline-block; font-size: 0.75rem; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold); border-radius: 999px; padding: 4px 12px; margin-bottom: 14px; }

/* founder picker */
.founder-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 800px) { .founder-grid { grid-template-columns: repeat(2, 1fr); } }
.founder-card { background: var(--panel); border: 1px solid var(--stone); border-radius: 14px; padding: 14px; text-align: center; }
.founder-card .portrait { width: 100%; aspect-ratio: 1; border-radius: 12px; object-fit: cover; background: var(--stone-2); margin-bottom: 10px; border: 2px solid var(--stone); }
.founder-card .portrait.chosen { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,137,75,0.25); }
.face-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
  pointer-events: auto;
}
.founder-card .face-strip img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  margin: 0;
  display: block;
  pointer-events: auto;
  touch-action: manipulation;
}
.face-strip img.on { border-color: var(--gold); }
.sex-toggle { display: flex; gap: 6px; margin-top: 8px; }
.sex-toggle button { flex: 1; padding: 6px; font-size: 0.8rem; }
.sex-toggle button.on { background: var(--gold); border-color: var(--gold); }

/* bars */
.bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 700px) { .bars { grid-template-columns: repeat(2, 1fr); } }
.bar { background: var(--panel); border: 1px solid var(--stone); border-radius: 12px; padding: 12px 14px; }
.bar .k { font-size: 0.72rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.bar .v { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.meter { height: 7px; background: var(--stone-2); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-soft), var(--accent)); }
.meter.mood > span { background: linear-gradient(90deg, #cdb27e, var(--gold)); }
.meter.health > span { background: linear-gradient(90deg, #8fae7f, var(--good)); }

/* map */
.map-wrap { overflow: hidden; border-radius: 12px; border: 1px solid var(--stone); background:
  linear-gradient(180deg, #e9e0cf, #d8ceba);
  padding: 10px; }
.map {
  display: grid;
  gap: 3px;
  width: 100%;
}
.cell {
  aspect-ratio: 1;
  border-radius: 5px;
  background: repeating-linear-gradient(45deg, rgba(140,120,90,0.07), rgba(140,120,90,0.07) 4px, transparent 4px, transparent 8px);
  background-color: #cdc3ac;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.cell.built { background: linear-gradient(160deg, #fdfbf5, #eae0cd); box-shadow: inset 0 0 0 1px rgba(184,137,75,0.4), 0 2px 6px -3px var(--shadow); }
.cell.progress { background: linear-gradient(160deg, #efe7d5, #ddd2ba); }
.cell .glyph { font-size: clamp(12px, 2.4vw, 22px); color: var(--accent); }
.cell.progress .glyph { color: var(--muted); opacity: 0.6; }
.cell .pmeter { position: absolute; bottom: 2px; left: 4px; right: 4px; height: 3px; background: rgba(0,0,0,0.12); border-radius: 2px; overflow: hidden; }
.cell .pmeter > span { display: block; height: 100%; background: var(--gold); }
.cell .tip { display: none; position: absolute; bottom: 105%; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 0.7rem; padding: 3px 7px; border-radius: 6px; white-space: nowrap; z-index: 5; }
.cell:hover .tip { display: block; }

/* verbs */
.verbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 820px) { .verbs { grid-template-columns: repeat(2, 1fr); } }
.verb-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--panel); color: var(--ink); border: 1px solid var(--stone); padding: 12px 8px; border-radius: 12px; }
.verb-btn:hover { border-color: var(--gold); }
.verb-btn.on { background: var(--gold); color: #fff; border-color: var(--gold); }
.verb-btn .vname { font-family: var(--serif); font-size: 1.05rem; font-weight: 700; }
.verb-btn .vcost { font-size: 0.72rem; color: inherit; opacity: 0.8; }
.verb-panel { margin-top: 14px; padding: 16px; border: 1px dashed var(--stone); border-radius: 12px; background: rgba(255,255,255,0.5); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--stone); background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 0.85rem; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip small { display: block; color: inherit; opacity: 0.7; font-size: 0.7rem; }

/* residents */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.person { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--stone); border-radius: 12px; padding: 10px; }
.person.dead { opacity: 0.45; }
.person.exiled { opacity: 0.5; filter: grayscale(0.6); }
.person img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid var(--stone); }
.person .nm { font-weight: 700; font-size: 0.9rem; }
.person .meta { font-size: 0.72rem; color: var(--muted); }
.person .tr { font-size: 0.68rem; color: var(--gold); font-weight: 600; }
.pill { display: inline-block; font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; background: var(--stone-2); color: var(--muted); margin-left: 6px; }
.pill.gold { background: var(--gold); color: #fff; }

/* evolutions */
.evo-list { display: flex; flex-wrap: wrap; gap: 8px; }
.evo { border: 1px solid var(--gold); color: var(--accent); border-radius: 999px; padding: 5px 12px; font-size: 0.82rem; font-weight: 600; background: rgba(184,137,75,0.08); }

/* feed */
.feed { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.feed .row { display: flex; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--stone-2); font-size: 0.9rem; }
.feed .row.notable { background: rgba(184,137,75,0.06); }
.feed .yr { color: var(--gold); font-family: var(--serif); font-weight: 700; min-width: 44px; }
.feed .kind { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); align-self: center; min-width: 66px; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; box-shadow: 0 10px 30px -10px var(--shadow); opacity: 0; transition: all 0.25s ease; z-index: 50; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--bad); }
#toast.good { background: var(--good); }

/* rivals */
.rival { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid var(--stone); border-radius: 12px; background: var(--panel); margin-bottom: 10px; }
.rival .info .nm { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; }
.result-card { text-align: center; padding: 24px; }
.result-card .score { font-family: var(--serif); font-size: 2.6rem; font-weight: 700; }
.result-card.win { border: 2px solid var(--good); }
.result-card.loss { border: 2px solid var(--bad); }

.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; }
.loading { text-align: center; padding: 60px; color: var(--muted); }
table.admin { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.admin th, table.admin td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--stone-2); }

/* founders pricing */
.kicker {
  font-size: 0.75rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin: 0 0 6px;
}
.pricing { margin: 56px auto 8px; max-width: 760px; }
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 20px;
}
.price-card {
  border: 1px solid var(--stone);
  border-radius: 14px;
  padding: 24px;
  background: var(--panel);
  box-shadow: 0 10px 30px -18px var(--shadow);
}
.price-card.featured {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 12px 40px rgba(184, 137, 75, 0.16);
}
.price {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--ink);
  margin: 8px 0;
}
.price span { font-size: 1rem; color: var(--muted); font-weight: 400; }
.spots { color: var(--gold); font-weight: 600; margin: 8px 0; min-height: 1.2em; }
.price-card form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.price-card input[type="email"] { width: 100%; }
a.shopify-btn {
  display: inline-block;
  margin-top: 12px;
  text-align: center;
  color: #fff;
}
a.shopify-btn:hover { color: #fff; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* marble marketing landing — Roman mockup */
body.marketing {
  --bg: #f3eee4;
  --panel: #fbf8f1;
  --ink: #2b2620;
  --muted: #6d6152;
  --stone: #e4d9c6;
  --accent: #9c6b3f;
  --accent-soft: #c4a265;
  --gold: #c4a265;
  --shadow: rgba(58, 45, 32, 0.16);
  background-color: #f3eee4;
  background-image:
    radial-gradient(1200px 420px at 8% -10%, rgba(255, 255, 255, 0.85), transparent 55%),
    radial-gradient(900px 380px at 92% 0%, rgba(232, 220, 198, 0.7), transparent 50%),
    linear-gradient(180deg, #f7f2e8, #efe6d6);
  color: var(--ink);
}
body.marketing .sky { display: none; }
body.marketing .top {
  background: rgba(250, 246, 238, 0.96);
  border-bottom: 0;
  padding: 16px 40px;
}
body.marketing .brand { color: var(--gold); }
body.marketing .brand-text strong {
  font-family: "Cinzel", var(--serif);
  letter-spacing: 0.2em;
  font-size: 1.02rem;
  font-weight: 600;
  color: #b8894b;
}
body.marketing .brand-text em { display: none; }
body.marketing nav { gap: 28px; }
body.marketing nav a { color: #7a6e5e; border: 0; font-weight: 500; }
body.marketing nav a.on, body.marketing nav a:hover { color: #2b2620; border-color: transparent; }
body.marketing nav a[href="/"] { text-underline-offset: 6px; }
body.marketing:has(.lp-hero) nav a[href="/"] { text-decoration: underline; text-decoration-color: #b8894b; text-underline-offset: 7px; }
body.marketing .play-now {
  background: linear-gradient(180deg, #d4b06a, #c4a265);
  color: #fff !important;
  border: 0;
  padding: 8px 18px;
  border-radius: 999px;
  box-shadow: 0 6px 16px -10px #b8894b;
}
body.marketing .view {
  max-width: none;
  padding: 0 0 8px;
  width: 100%;
}
body.marketing .foot {
  background: #3a2f24;
  color: #d9cfbe;
  padding: 14px 16px;
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.82rem;
}

.lp-hero {
  position: relative;
  min-height: 430px;
  margin: 0 28px;
  overflow: hidden;
  background: #1a140c;
  display: grid;
  align-items: center;
}
.lp-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
}
.lp-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(18, 12, 8, 0.94) 0%, rgba(18, 12, 8, 0.72) 28%, rgba(18, 12, 8, 0.18) 58%, transparent 78%);
  pointer-events: none;
}
.lp-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 540px;
  padding: 48px 44px;
  text-align: left;
}
.lp-hero-copy h1 {
  font-family: "Cinzel", var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.7rem);
  letter-spacing: 0.06em;
  color: #d4b06a;
  margin: 0 0 8px;
  font-weight: 600;
}
.lp-italic {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.45rem;
  color: #f0e2c4;
  margin: 0 0 14px;
}
.lp-lead {
  color: #ddd2c0;
  font-size: 1.02rem;
  line-height: 1.55;
  margin: 0 0 22px;
  max-width: 38ch;
}
.lp-bullets {
  margin: 16px 0 0;
  color: #b7aa96;
  font-size: 0.86rem;
}
.lp-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #d4b06a, #c4a265);
  color: #fff !important;
  font-weight: 700;
  border-radius: 10px;
  padding: 12px 20px;
}
.lp-cta:hover { filter: brightness(1.07); color: #fff !important; }

.lp-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding: 36px 40px 28px;
  max-width: none;
  margin: 0;
}
.lp-features article {
  background: rgba(255, 252, 246, 0.92);
  border: 1px solid #eadfcb;
  border-radius: 18px;
  padding: 32px 24px 28px;
  text-align: center;
  box-shadow: 0 12px 28px -24px var(--shadow);
}
.lp-lore,
.lp-community {
  background: rgba(255, 252, 246, 0.92);
  border: 1px solid #eadfcb;
  border-radius: 16px;
  padding: 22px;
}
.lp-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border: 1px solid #d4b06a;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fbf6ec;
}
.lp-icon img { width: 30px; height: 30px; }
.lp-features h2, .lp-residents h2, .lp-lore h2, .lp-community h2 {
  font-family: "Cinzel", var(--serif);
  color: #9a7040;
  letter-spacing: 0.03em;
  font-weight: 600;
}
.lp-features p { color: #6d6152; }
.lp-card-link { font-weight: 700; display: inline-block; margin-top: 8px; }
.lp-residents {
  max-width: none;
  margin: 0;
  padding: 8px 40px 28px;
}
.lp-lore, .lp-community {
  margin: 0 40px 28px;
  padding: 22px 28px;
  max-width: none;
}
.lp-sub { color: var(--muted); }
.lp-civ {
  font-family: "Cinzel", var(--serif);
  color: #9a7040;
  letter-spacing: 0.08em;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  margin: 22px 0 0;
}
.lp-civ + .lp-faces { margin-top: 10px; }
.lp-faces {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.lp-faces figure {
  margin: 0;
  background: #fff;
  border: 1px solid var(--stone);
  border-radius: 14px;
  overflow: hidden;
}
.lp-faces img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.lp-faces figcaption {
  padding: 8px 10px 12px;
  font-family: var(--serif);
  font-size: 0.95rem;
}
body.marketing .pricing { color: var(--ink); max-width: 1180px; padding: 0 36px; }
body.marketing .price-card { background: #fff; }
body.marketing .hero { padding: 48px 24px 8px; }
body.marketing .hero h1 { font-family: "Cinzel", var(--serif); color: var(--gold); }

.lp-wordmark {
  margin: 8px 28px 0;
  overflow: hidden;
  background: #0b0705;
}
.lp-wordmark img {
  display: block;
  width: 100%;
  max-height: 720px;
  object-fit: cover;
  object-position: center 40%;
}

body.marketing.in-game .top,
body.marketing.in-game .foot { display: none; }
body.marketing.in-game .view {
  max-width: none;
  padding: 0;
  width: 100%;
}
.play-hero {
  position: relative;
  min-height: 280px;
  margin: 0 28px 8px;
  overflow: hidden;
  background: #1a140c;
  display: grid;
  align-items: end;
}
.play-hero-slim { min-height: 220px; }
.play-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% center;
}
.play-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(18,12,8,0.92) 0%, rgba(18,12,8,0.55) 42%, transparent 78%);
  pointer-events: none;
}
.play-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding: 36px 40px;
  color: #f4efe6;
}
.play-hero-copy h1 {
  font-family: "Cinzel", var(--serif);
  letter-spacing: 0.08em;
  color: #e8d7b0;
  margin-bottom: 8px;
}
.back-link {
  display: inline-block;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: none;
  color: #e8d7b0;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-align: left;
}
.back-link:hover { color: #fff; }
.play-hero-copy p { color: #d9cfbe; max-width: 520px; }
.play-hero-actions {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 10px;
  padding: 0 40px 24px;
  flex-wrap: wrap;
}
.play-stage { width: min(1180px, calc(100% - 56px)); margin: 0 auto; }
.civ-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 8px 0 22px;
}
.civ-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 16px;
  text-align: left;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--stone);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 12px 30px -20px var(--shadow);
  cursor: pointer;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(184, 137, 75, 0.35);
  -webkit-touch-callout: none;
  user-select: none;
}
.civ-card > input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.civ-card > img, .civ-card > span { pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .civ-card:hover { border-color: var(--gold); }
}
.civ-card img { width: 132px; height: 132px; object-fit: cover; border-radius: 12px; }
.civ-card h2 { font-family: "Cinzel", var(--serif); margin: 8px 0 4px; font-size: 1.35rem; }
.civ-card em { display: block; color: var(--gold); font-style: italic; margin-bottom: 8px; }
.civ-card p { color: var(--muted); font-weight: 400; margin: 0; }
.civ-card.on,
.civ-card:has(input:checked) {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 12px 30px -18px var(--shadow);
}
.civ-card.on::after,
.civ-card:has(input:checked)::after {
  content: "Selected";
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.found-bar {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  margin: 8px 0 28px;
}
.found-bar button { height: 44px; padding: 0 22px; }
.founder-card .portrait {
  border-radius: 4px 4px 0 0;
  border: 0;
  box-shadow: 0 0 0 1px rgba(184,137,75,0.35);
}
.cell {
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.cell.earth {
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.14), transparent 50%),
    repeating-linear-gradient(45deg, rgba(90,70,40,0.08), rgba(90,70,40,0.08) 4px, transparent 4px, transparent 9px),
    #c3b48e;
}
.cell.built, .cell.progress { background-color: #3a2f24; }
.cell .blabel {
  position: relative;
  z-index: 1;
  font-family: "Cinzel", var(--serif);
  font-size: clamp(8px, 1.1vw, 11px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f7f1e4;
  text-shadow: 0 1px 4px rgba(0,0,0,0.65);
  background: rgba(18,12,8,0.45);
  padding: 2px 5px;
}
.cell.built::before, .cell.progress::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(18,12,8,0.55));
}
.person {
  flex-direction: column;
  align-items: stretch;
  padding: 0 0 10px;
  overflow: hidden;
}
.person img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 12px 12px 0 0;
  border: 0;
}
.person > div { padding: 0 10px; }

@media (max-width: 900px) {
  .lp-features { grid-template-columns: 1fr; padding: 28px 18px; }
  .lp-faces { grid-template-columns: repeat(2, 1fr); }
  .lp-hero { margin: 0; min-height: 460px; }
  .lp-hero-copy { padding: 32px 22px; }
  .lp-residents, .lp-lore, .lp-community { margin-left: 18px; margin-right: 18px; padding-left: 0; padding-right: 0; }
  .lp-wordmark { margin: 8px 0 0; }
  .civ-grid, .founder-grid { grid-template-columns: 1fr; }
  .civ-card { grid-template-columns: 96px 1fr; }
  .play-hero, .play-stage { margin-left: 0; margin-right: 0; }
  .play-stage { width: calc(100% - 32px); }
  .play-hero-copy, .play-hero-actions { padding-left: 20px; padding-right: 20px; }
  body.marketing .top { padding: 14px 18px; }
  nav { flex-wrap: wrap; gap: 12px; }
}

/* Play-loop templates: census discs, pre-PvP door, talking-head reply */
.census-disc {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.7rem; height: 1.7rem; padding: 0 6px;
  border-radius: 50%; background: #f4ead4; color: #6a4e1e;
  border: 1px solid var(--gold); font-family: var(--serif);
  font-weight: 700; letter-spacing: 0.04em;
}
.census-disc.on { background: var(--gold); color: #fff8e8; }
.pre-pvp, .god-talk, .pvp-arena {
  max-width: 960px; margin: 24px auto; padding: 28px 24px;
  background: var(--panel); border: 1px solid var(--stone);
  border-radius: 16px; box-shadow: 0 12px 32px var(--shadow); text-align: center;
}
.pre-pvp h1, .god-talk h1, .pvp-arena h1 {
  font-family: var(--serif); font-size: 2rem; margin: 0 0 8px;
}
.whisper-row, .whisper-evos, .god-tools, .founder-strip {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px;
}
.whisper-pick, .whisper-evos button, .god-tool, .pie-tile {
  background: #f7f1e4; border: 1px solid var(--stone); border-radius: 12px;
  padding: 12px 16px; font-family: var(--serif); cursor: pointer; color: var(--ink);
}
.whisper-pick img, .whisper-face {
  width: 140px; height: 160px; object-fit: cover; border-radius: 10px; display: block; margin: 0 auto 8px;
  pointer-events: none;
}
.whisper-pick { cursor: pointer; touch-action: manipulation; }
.whisper-pick > * { pointer-events: none; }
.whisper-face { width: 220px; height: 260px; }
.play-regular { max-width: 1100px; margin: 0 auto 40px; padding: 12px 18px 28px; }
.play-regular-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.play-regular-top h1 { font-family: var(--serif); font-size: 2.4rem; margin: 0; }
.play-regular-top p { margin: 4px 0 0; color: var(--muted); }
.lot-field {
  position: relative; min-height: 420px; border-radius: 18px; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.15), transparent 40%),
    url("/assets/hero.jpg") center/cover;
  box-shadow: 0 16px 40px -24px var(--shadow);
}
.lot {
  position: absolute; min-width: 88px; padding: 6px 8px 10px; border-radius: 8px;
  background: rgba(251,248,241,0.88); border: 1px solid var(--stone); font-size: 0.72rem;
  font-family: var(--serif); text-align: center;
}
.lot.raising i { display: block; height: 4px; background: var(--gold); margin-top: 4px; }
.soul {
  position: absolute; width: 78px; background: transparent; border: 0; color: var(--ink); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0;
  z-index: 3; touch-action: manipulation;
}
.soul > * { pointer-events: none; }
.lot { z-index: 1; }
.soul img, .soul-card img {
  width: 58px; height: 68px; object-fit: cover; border-radius: 10px; border: 2px solid #fff;
  box-shadow: 0 6px 14px -8px #000;
}
.soul.on img, .soul-card.on img { border-color: var(--gold); }
.soul em { font-size: 0.72rem; font-style: normal; font-weight: 600; text-shadow: 0 1px 0 #fff; }
.soul-strip { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.soul-card { background: #f7f1e4; border: 1px solid var(--stone); border-radius: 12px; padding: 8px; cursor: pointer; }
.talk-stage { position: relative; width: min(72vw, 420px); margin: 0 auto; }
.talk-portrait { width: 100%; border-radius: 12px; display: block; }
.talk-portrait.talking { animation: talk-bob 0.55s ease-in-out infinite; }
.talk-mouth { display: none; }
@keyframes talk-bob { 0%,100% { transform: translateY(0) rotate(-0.4deg); } 50% { transform: translateY(-6px) rotate(0.6deg); } }
@keyframes talk-mouth { 0%,100% { transform: scaleY(0.45); } 50% { transform: scaleY(1); } }
.talk-who { font-family: var(--serif); color: var(--gold); letter-spacing: 0.08em; }
.pvp-field { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; min-height: 280px; margin: 18px 0; }
.pvp-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.pvp-side img { width: 120px; height: 140px; object-fit: cover; border-radius: 12px; }
.pvp-side.fighting img { animation: talk-bob 0.4s linear infinite; }
.pvp-pick { margin: 12px auto 40px; max-width: 720px; }
.god-tool.challenge { background: #2b2620; color: #f4ead4; }
.god-tool.challenge small { display: block; font-family: var(--sans); opacity: 0.75; font-size: 0.72rem; }
.needs-card { text-align: left; background: #f7f1e4; padding: 14px 16px; border-radius: 12px; }
.need-bar { display: block; height: 6px; background: var(--stone-2); border-radius: 99px; margin: 4px 0 10px; }
.need-bar i { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.need-low .need-bar i { background: #c47a2c; }
.need-critical .need-bar i { background: #a33a2c; }
.pie-menu { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 8px 0; }

/* Sims neighborhood: house lots, not portraits stuck on a photo */
.sims-town { max-width: none; margin: 0; padding: 0; min-height: 100vh; display: flex; flex-direction: column; background: #8fbf6a; }
.sims-top {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; background: #fbf8f1; border-bottom: 1px solid var(--stone); flex-wrap: wrap;
}
.sims-top h1 { font-family: var(--serif); font-size: 1.45rem; margin: 0; }
.sims-top p { margin: 2px 0 0; color: var(--muted); font-size: 0.82rem; }
.sims-map {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  padding: 12px; flex: 1;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0 12px, transparent 12px 48px),
    linear-gradient(180deg, #9ecf78, #7aaf55);
}
.sims-lot {
  background: #6ea34a;
  border: 3px solid #4e7a32;
  border-radius: 10px;
  min-height: 210px;
  padding: 8px 8px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.12);
}
.sims-house { width: 78%; max-width: 180px; }
.sims-house .roof {
  display: block; height: 0; border-left: 48px solid transparent; border-right: 48px solid transparent;
  border-bottom: 36px solid #8b3a2a; margin: 0 auto -2px; width: 0;
}
.tone-1 .sims-house .roof { border-bottom-color: #6b2d22; }
.tone-2 .sims-house .roof { border-bottom-color: #a34a28; }
.tone-3 .sims-house .roof { border-bottom-color: #5a3a2a; }
.sims-house .wall {
  display: flex; align-items: flex-end; justify-content: space-evenly;
  height: 58px; background: #f3e6c8; border: 2px solid #c9b48a; border-radius: 2px 2px 0 0;
}
.tone-1 .sims-house .wall { background: #e8d4b0; }
.tone-2 .sims-house .wall { background: #f7efe0; }
.sims-house .win { width: 16px; height: 16px; background: #7ec8e0; border: 2px solid #5a4a32; margin-bottom: 18px; }
.sims-house .door { width: 18px; height: 28px; background: #6b4226; border: 2px solid #3d2616; }
.sims-yard { display: flex; gap: 8px; justify-content: center; min-height: 78px; margin-top: 4px; }
.sim {
  position: relative;
  width: 64px; background: transparent; border: 0; color: #1d2a12; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0;
  touch-action: manipulation;
}
.plumbob {
  width: 14px; height: 14px; background: #7dff4a;
  transform: rotate(45deg);
  box-shadow: 0 0 8px #7dff4a;
  margin-bottom: 2px;
}
.sims-lot:has(.sim.on) { outline: 3px solid #d4e05a; }
.sim > * { pointer-events: none; }
.sim img { width: 48px; height: 56px; object-fit: cover; border-radius: 8px; border: 2px solid #fff; box-shadow: 0 4px 10px -6px #000; }
.sim.on img { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.sim em { font-size: 0.68rem; font-style: normal; font-weight: 700; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
.lot-name { margin: 4px 0 0; font-family: var(--serif); font-size: 0.78rem; color: #243318; }
.sims-civic {
  width: 70%; height: 72px; margin: auto 0 8px; background: #d9cfbe; border: 2px solid #9c8b70;
  border-radius: 8px; display: grid; place-items: center; font-size: 1.8rem;
}
.sims-dock {
  position: sticky; bottom: 0; z-index: 8;
  background: #fbf8f1; border-top: 1px solid var(--stone);
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
}
.sims-dock .needs-card { padding: 8px 10px; margin: 0 0 8px; }
.sims-dock .needs-card h3 { margin: 0 0 6px; font-size: 1rem; }
.sims-dock .need-bar { margin: 2px 0 6px; }
.sims-dock .god-tools { margin-top: 8px; gap: 8px; }
.sims-dock .pie-tile, .sims-dock .god-tool { padding: 10px 8px; font-size: 0.9rem; }
@media (max-width: 700px) {
  .sims-map { grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px; }
  .sims-lot { min-height: 188px; }
  .sims-house .roof { border-left-width: 36px; border-right-width: 36px; border-bottom-width: 26px; }
}

/* ---- 2.5D living town map layer ---- */
.tmap-stage {
  position: relative; width: 100%; aspect-ratio: 3 / 2;
  overflow: hidden; background: #241c10; touch-action: pan-y;
}
.tmap-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; user-select: none; -webkit-user-drag: none;
}
.tmap-spot {
  position: absolute; transform: translate(-50%, -50%);
  min-width: 52px; min-height: 52px; padding: 4px 8px;
  border-radius: 12px; border: 2px solid rgba(212, 175, 55, 0.85);
  background: rgba(18, 13, 7, 0.62); color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; touch-action: manipulation; z-index: 2;
}
.tmap-spot:active { transform: translate(-50%, -50%) scale(0.94); }
.tmap-glyph { font-size: 1.35rem; line-height: 1; }
.tmap-spot-label { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.02em; }
.tmap-token {
  position: absolute; transform: translate(-50%, -92%);
  width: 60px; background: transparent; border: 0; padding: 0; cursor: pointer;
  touch-action: manipulation; z-index: 3;
  transition: left 2.8s ease-in-out, top 2.8s ease-in-out;
}
.tmap-token > * { pointer-events: none; }
.tmap-token img, .tmap-face-fallback {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  border: 3px solid #f5ecd9; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.55);
  display: block; margin: 0 auto; background: #6b5a43; color: #fff;
  font-size: 1.3rem; font-weight: 700; line-height: 42px; text-align: center;
  animation: tmap-bob 1.8s ease-in-out infinite;
}
.tmap-token.sel img, .tmap-token.sel .tmap-face-fallback {
  border-color: #d4af37; box-shadow: 0 0 0 3px #d4af37, 0 4px 10px rgba(0, 0, 0, 0.55);
}
.tmap-name {
  display: block; margin-top: 2px; font-size: 0.62rem; font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px #000, 0 0 6px rgba(0, 0, 0, 0.8); white-space: nowrap;
}
@keyframes tmap-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.tmap-overlay {
  position: absolute; inset: 0; z-index: 10; background: rgba(8, 6, 4, 0.55);
  display: flex; align-items: flex-end; justify-content: center; padding: 12px;
}
.tmap-overlay[hidden] { display: none; }
.tmap-card {
  position: relative; width: 100%; max-width: 520px; max-height: 88%;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #fbf8f1; border-radius: 14px; padding: 16px 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.tmap-card h3 { font-family: Georgia, serif; margin: 0 40px 6px 0; font-size: 1.15rem; }
.tmap-close {
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid #d8cdb8; background: #fff;
  font-size: 1.05rem; cursor: pointer; touch-action: manipulation;
}
.tmap-who { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.tmap-who-face { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid #d4af37; }
.tmap-who h3 { margin: 0 0 2px; }
.tmap-evos { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.tmap-evos button {
  padding: 11px 14px; font-size: 0.92rem; border-radius: 10px;
  border: 1px solid #c9b98f; background: #fff; cursor: pointer; touch-action: manipulation;
}
.tmap-evos button:disabled { opacity: 0.45; }
.tmap-reply { margin-top: 8px; }
.tmap-loc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tmap-loc-actions button {
  padding: 12px 16px; font-size: 0.95rem; border-radius: 10px;
  border: 1px solid #8a6d2f; background: #2e2417; color: #f5ecd9;
  cursor: pointer; touch-action: manipulation; font-weight: 600;
}
.tmap-loc-actions button:disabled { opacity: 0.45; }
@media (max-width: 700px) {
  .tmap-stage { aspect-ratio: 4 / 3; }
  .tmap-token { width: 56px; }
}
/* resident activity badge: shows current interaction state (working, resting...) */
.tmap-act {
  position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%);
  margin-bottom: 4px; padding: 3px 9px; border-radius: 999px;
  background: rgba(20, 14, 8, 0.88); color: #ffd98a;
  font-size: 0.62rem; font-weight: 700; white-space: nowrap;
  border: 1px solid #d4af37; pointer-events: none; z-index: 4;
}

/* panic badge: pulsing red while a resident urgently fixes a critical need */
.tmap-act.tmap-panic {
  color: #ff7b7b; border-color: #ff7b7b;
  animation: tmap-panic-pulse 0.8s ease-in-out infinite;
}
@keyframes tmap-panic-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
  50% { transform: translateX(-50%) scale(1.14); opacity: 0.82; }
}

/* ---- dev placement editor (dev-only; invisible unless .tmap-dev) ---- */
.tmap-stage.tmap-dev { outline: 2px dashed #4da3ff; outline-offset: -3px; }
.tmap-stage.tmap-dev .tmap-spot { border-style: dashed; border-color: #4da3ff; cursor: grab; touch-action: none; }
.tmap-stage.tmap-dev .tmap-spot:active { cursor: grabbing; }
.tmap-devcoord {
  display: block; margin-top: 2px; padding: 2px 7px; border-radius: 6px;
  background: rgba(8, 18, 38, 0.85); color: #cfe6ff;
  font: 700 0.62rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap; pointer-events: none;
}
.tmap-devwp {
  position: absolute; transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px dashed #ffb84d; background: rgba(46, 28, 6, 0.72); color: #ffe1a8;
  cursor: grab; touch-action: none; z-index: 6; padding: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.tmap-devwp .tmap-devcoord { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; }
.tmap-devbadge {
  position: absolute; top: 6px; left: 6px; z-index: 23;
  background: #b3261e; color: #fff; border-radius: 8px;
  font: 700 0.66rem/1 ui-monospace, monospace; letter-spacing: 0.1em;
  padding: 6px 9px; pointer-events: none;
}
.tmap-devpanel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 22;
  max-height: 64%; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: rgba(10, 13, 20, 0.97); color: #e8ecf4;
  border-top: 2px dashed #4da3ff; padding: 10px 12px 16px; font-size: 0.8rem;
}
.tmap-devpanel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tmap-devpanel-head button, .tmap-devcopy {
  padding: 10px 14px; border-radius: 10px; border: 1px solid #4da3ff;
  background: #12233d; color: #dbe9ff; font-weight: 700; cursor: pointer;
  touch-action: manipulation;
}
.tmap-devhint { color: #9fb3d1; font-size: 0.72rem; margin: 4px 0 8px; }
.tmap-devrow { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid #1e2a40; }
.tmap-devrow-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tmap-devrow label { display: flex; align-items: center; gap: 4px; color: #9fb3d1; font-size: 0.72rem; }
.tmap-devrow input[type="number"] {
  width: 62px; padding: 8px 6px; border-radius: 8px; border: 1px solid #2c3d5e;
  background: #0b1220; color: #e8ecf4; font: 700 0.78rem ui-monospace, monospace;
}
.tmap-devx {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid #7a2e2e;
  background: #3d1414; color: #ffb3b3; font-weight: 700; cursor: pointer;
  touch-action: manipulation;
}
.tmap-devcopy { width: 100%; margin-top: 10px; }
.tmap-devout {
  width: 100%; min-height: 96px; margin-top: 8px; padding: 8px; box-sizing: border-box;
  border-radius: 8px; border: 1px solid #2c3d5e; background: #070b14; color: #b8f5c8;
  font: 0.66rem/1.45 ui-monospace, monospace; white-space: pre;
}

/* dev no-walk zones: dashed red discs, percent-positioned (see positionBlockedEl) */
.tmap-devblocked {
  position: absolute;
  border: 2px dashed rgba(255, 70, 70, 0.9);
  border-radius: 50%;
  background: rgba(255, 70, 70, 0.08);
  cursor: grab; touch-action: none; z-index: 6;
}
.tmap-devblocked:active { cursor: grabbing; }
.tmap-devblocked .tmap-devcoord {
  position: absolute; top: -2px; left: 50%; transform: translate(-50%, -100%);
  margin-top: 0;
}

/* resident motive bars (needs HUD on the resident card) */
.tmap-motives {
  display: grid; gap: 5px; margin: 10px 0 4px; padding: 10px 12px;
  background: #f3ecdd; border: 1px solid #d8cdb8; border-radius: 10px;
}
.tmap-mrow { display: grid; grid-template-columns: 88px 1fr 34px; align-items: center; gap: 8px; font-size: 0.72rem; }
.tmap-mlab { color: #6d6152; font-weight: 600; white-space: nowrap; }
.tmap-mbar { height: 7px; background: #e2d7bd; border-radius: 999px; overflow: hidden; }
.tmap-mbar > span { display: block; height: 100%; background: linear-gradient(90deg, #cdb27e, #b8894b); border-radius: 999px; }
.tmap-mbar > span.warn { background: linear-gradient(90deg, #d8b45a, #c98f2d); }
.tmap-mbar > span.bad { background: linear-gradient(90deg, #c96a4a, #b3261e); }
.tmap-mval { text-align: right; color: #6d6152; font-variant-numeric: tabular-nums; }

/* ---- day/night clock + night tint ---- */
.tmap-night {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: rgba(10, 15, 40, 0.28);
}
.tmap-night[hidden] { display: none; }
.tmap-clock {
  position: absolute; top: 8px; right: 8px; z-index: 24; pointer-events: none;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(20, 14, 8, 0.62); color: #e8c87a;
  border: 1px solid rgba(212, 175, 55, 0.5);
}

/* ---- weekly 3v3 battle ---- */
.tmap-token.battling { transition: none; }
.tmap-raider .tmap-face-fallback { border-color: #c0392b; }
.tmap-fadeout { opacity: 0; transition: opacity 0.6s ease; }
.tmap-hpbar {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 5px; border-radius: 3px; background: rgba(60, 12, 12, 0.85);
  pointer-events: none;
}
.tmap-hpbar > span { display: block; height: 100%; border-radius: 3px; background: #43d14e; transition: width 0.2s; }
.tmap-pop {
  position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
  font-weight: 800; font-size: 13px; pointer-events: none; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  animation: tmap-pop-float 0.9s ease-out forwards;
}
.tmap-pop-dmg { color: #ffd24d; }
.tmap-pop-miss { color: #cfcfcf; font-size: 11px; }
@keyframes tmap-pop-float { to { transform: translate(-50%, -16px); opacity: 0; } }
.tmap-battlebar {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 9;
  background: rgba(20, 8, 6, 0.85); color: #f3d9a4; border: 1px solid #8a6d3b;
  border-radius: 999px; padding: 6px 14px; font-size: 0.8rem; font-weight: 700;
  pointer-events: none; white-space: nowrap;
}
.tmap-threat {
  background: linear-gradient(180deg, #2b0f0d, #1c0a08); color: #f5e7c8;
  border: 1px solid #8a6d3b; border-radius: 12px; padding: 14px;
}
.tmap-threat-kicker {
  font-family: Georgia, serif; letter-spacing: 0.08em; color: #f0c96a;
  font-weight: 700; margin-bottom: 8px;
}
.tmap-threat p { margin: 0 0 4px; }
.tmap-threat-actions { display: flex; gap: 10px; margin-top: 12px; }
.tmap-threat-actions button {
  flex: 1; padding: 12px; border-radius: 10px; border: 1px solid #8a6d3b;
  background: #8a2b1d; color: #ffe9b0; font-weight: 700; cursor: pointer;
  touch-action: manipulation;
}
.tmap-threat-actions .tmap-ghost { background: transparent; color: #d8c49a; }
.tmap-win .tmap-threat-kicker { color: #9fe6a0; }
.tmap-loss .tmap-threat-kicker { color: #ff9a8a; }
.tmap-overlay.selmode {
  background: transparent; align-items: flex-start; pointer-events: none;
}
.tmap-overlay.selmode .tmap-card { pointer-events: auto; background: rgba(251, 248, 241, 0.96); }
.tmap-picks { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.tmap-pick {
  background: #f0e6cf; border: 1px solid #c9b68a; border-radius: 999px;
  padding: 4px 10px; font-size: 0.8rem; font-weight: 700; color: #5a4a2e;
}
.tmap-honor { font-style: italic; color: #7a5c2e; font-size: 0.85rem; margin: 6px 0; }
