/* Mug & Map — "Ember Hearth" visual style (approved direction A).
   Warm walnut and amber, serif display type, candlelit panels.
   House style for Mug & Map (named by the owner, 2026-11-20). */

:root {
  --bg: #17100a;
  --bg-deep: #100a06;
  --panel: #241708;
  --panel-2: #2e1d0e;
  --edge: #4a3520;
  --amber: #e8a33d;
  --amber-bright: #ffb36b;
  --amber-dim: #9a6a28;
  --cream: #f3e5cf;
  --cream-dim: #c9b28f;
  --ink: #0d0805;
  --danger: #e0684b;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1100px 500px at 50% -120px, rgba(232, 163, 61, 0.16), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--cream);
  font-family: var(--sans);
  line-height: 1.55;
  min-height: 100vh;
}

h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; }

a { color: var(--amber-bright); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

header.site {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--cream); }
.brand .flame {
  width: 38px; height: 38px; border-radius: 50%;
  background: radial-gradient(circle at 50% 72%, #ffd98a 0 18%, var(--amber) 42%, #8a4d16 78%, #5a2f0d 100%);
  box-shadow: 0 0 22px rgba(255, 179, 107, 0.45);
  flex: none;
}
.brand .name { font-family: var(--serif); font-size: 1.35rem; letter-spacing: 0.02em; }
.brand .tag { display: block; font-family: var(--sans); font-size: 0.72rem; color: var(--cream-dim); letter-spacing: 0.14em; text-transform: uppercase; }

nav.site a {
  color: var(--cream); text-decoration: none; margin-left: 18px; font-size: 0.95rem;
}
nav.site a:hover { color: var(--amber-bright); }
nav.site a.btn { margin-left: 22px; }

.btn {
  display: inline-block; padding: 10px 20px; border-radius: 999px;
  background: linear-gradient(180deg, var(--amber-bright), var(--amber));
  color: var(--ink); font-weight: 650; text-decoration: none; border: 1px solid #c07f24;
  box-shadow: 0 2px 14px rgba(232, 163, 61, 0.35); cursor: pointer; font-size: 0.95rem;
}
.btn:hover { filter: brightness(1.07); }
.btn.ghost {
  background: transparent; color: var(--amber-bright);
  border: 1px solid var(--amber-dim); box-shadow: none;
}
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.hero { text-align: center; padding: 56px 0 30px; }
.hero h1 { font-size: clamp(2rem, 5.4vw, 3.4rem); line-height: 1.12; margin: 0 0 14px; }
.hero h1 .glow { color: var(--amber-bright); text-shadow: 0 0 26px rgba(255, 179, 107, 0.5); }
.hero p { color: var(--cream-dim); max-width: 640px; margin: 0 auto 26px; font-size: 1.06rem; }
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px; padding: 26px 0 10px;
}
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--edge); border-radius: var(--radius);
  padding: 20px 18px;
}
.card h3 { margin: 0 0 8px; font-size: 1.12rem; color: var(--amber-bright); }
.card p { margin: 0; color: var(--cream-dim); font-size: 0.94rem; }

.notice {
  border: 1px solid var(--amber-dim); background: rgba(232, 163, 61, 0.09);
  border-radius: var(--radius); padding: 14px 18px; margin: 22px 0;
  color: var(--cream); font-size: 0.95rem;
}
.notice strong { color: var(--amber-bright); }

.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--edge); border-radius: var(--radius); padding: 26px;
}

form.shell label { display: block; margin: 14px 0 6px; font-size: 0.9rem; color: var(--cream-dim); }
form.shell input {
  width: 100%; padding: 11px 13px; border-radius: 9px; border: 1px solid var(--edge);
  background: #1a0f06; color: var(--cream); font-size: 1rem;
}
form.shell input:focus { outline: 2px solid var(--amber-dim); border-color: var(--amber); }

footer.site {
  margin-top: 54px; padding: 22px 0 30px; border-top: 1px solid var(--edge);
  color: var(--cream-dim); font-size: 0.85rem;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}

.center-col { max-width: 430px; margin: 34px auto 0; }
.center-col h1 { text-align: center; margin-bottom: 6px; }
.center-col .sub { text-align: center; color: var(--cream-dim); margin-top: 0; }

/* v0.02 — accounts & campaigns */
.err { color: var(--danger); font-size: 0.92rem; min-height: 1.2em; margin: 10px 0 0; }
.ok-msg { color: var(--amber-bright); font-size: 0.92rem; min-height: 1.2em; margin: 10px 0 0; }
form.shell select {
  width: 100%; padding: 11px 13px; border-radius: 9px; border: 1px solid var(--edge);
  background: #1a0f06; color: var(--cream); font-size: 1rem;
}
.wide-col { max-width: 760px; margin: 30px auto 0; }
.member-list, .invite-list { list-style: none; margin: 14px 0; padding: 0; }
.member-list li, .invite-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--edge); border-radius: 9px; margin-bottom: 8px;
  background: rgba(0,0,0,0.18); flex-wrap: wrap;
}
.role-badge {
  font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--amber-dim); color: var(--amber-bright);
  border-radius: 999px; padding: 2px 10px;
}
.btn.small { padding: 6px 14px; font-size: 0.85rem; }
.invite-link { word-break: break-all; font-size: 0.88rem; color: var(--cream-dim); }
.row-flex { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row-flex > div { flex: 1 1 150px; }

@media (max-width: 560px) {
  .hero { padding: 36px 0 20px; }
  nav.site a { margin-left: 12px; }
}

/* v0.03 — live table */
body.table-body { min-height: 100dvh; }
#table-app { display: flex; flex-direction: column; height: 100dvh; }
#table-top {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--edge);
  background: rgba(16, 10, 6, 0.72);
}
.table-back { color: var(--cream-dim); text-decoration: none; font-size: 0.92rem; white-space: nowrap; }
.table-back:hover { color: var(--amber-bright); }
.table-title { font-size: 1.08rem; color: var(--cream); white-space: nowrap; }
.conn { font-size: 0.82rem; color: var(--cream-dim); white-space: nowrap; }
.conn::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber-dim); margin-right: 7px; vertical-align: 1px;
}
.conn[data-state="online"] { color: var(--amber-bright); }
.conn[data-state="online"]::before { background: #8fc46a; box-shadow: 0 0 8px rgba(143, 196, 106, 0.8); }
.conn[data-state="offline"] { color: var(--danger); }
.conn[data-state="offline"]::before { background: var(--danger); }
#roster { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 auto; }
.roster-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--edge); border-radius: 999px; padding: 3px 11px 3px 8px;
  font-size: 0.83rem; color: var(--cream); background: rgba(0,0,0,0.25); white-space: nowrap;
}
.roster-chip .roster-dot { width: 8px; height: 8px; border-radius: 50%; background: #8fc46a; flex: none; }
.roster-chip.gm { border-color: var(--amber-dim); color: var(--amber-bright); }
.roster-chip.gm .roster-dot { background: var(--amber); }
.table-actions { display: inline-flex; gap: 8px; margin-left: auto; }
#btn-chat-toggle { display: none; }

#table-main { flex: 1 1 auto; display: grid; grid-template-columns: 1fr 330px; min-height: 0; }
#stage { position: relative; min-width: 0; min-height: 0; background: #0a0503; }
canvas#board { display: block; touch-action: none; cursor: grab; }
#zoom-controls { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; }
#table-toast {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%) translateY(-6px);
  background: rgba(16, 10, 6, 0.92); border: 1px solid var(--amber-dim); color: var(--cream);
  border-radius: 999px; padding: 7px 16px; font-size: 0.88rem; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease; max-width: 88%; text-align: center;
}
#table-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#table-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(7, 4, 3, 0.78); padding: 20px; z-index: 5;
}
#table-overlay .panel { max-width: 430px; }

#chat-panel {
  display: flex; flex-direction: column; min-height: 0;
  border-left: 1px solid var(--edge); background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
#chat-log { flex: 1 1 auto; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-row { background: rgba(0,0,0,0.22); border: 1px solid rgba(74, 53, 32, 0.6); border-radius: 10px; padding: 8px 11px; }
.chat-row.gm { border-color: var(--amber-dim); }
.chat-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.8rem; }
.chat-who { color: var(--amber-bright); font-weight: 650; }
.chat-meta { color: var(--cream-dim); }
.chat-text { font-size: 0.94rem; overflow-wrap: break-word; }
#chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--edge); }
#chat-form select {
  padding: 9px 8px; border-radius: 9px; border: 1px solid var(--edge);
  background: #1a0f06; color: var(--cream); font-size: 0.9rem; max-width: 108px;
}
#chat-form input {
  flex: 1 1 auto; min-width: 0; padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--edge); background: #1a0f06; color: var(--cream); font-size: 1rem;
}
#chat-form input:focus { outline: 2px solid var(--amber-dim); border-color: var(--amber); }
#table-foot {
  display: flex; justify-content: space-between; gap: 12px; padding: 8px 16px;
  border-top: 1px solid var(--edge); color: var(--cream-dim); font-size: 0.8rem;
}

@media (max-width: 820px) {
  #table-main { grid-template-columns: 1fr; }
  #btn-chat-toggle { display: inline-block; }
  #chat-panel {
    position: fixed; left: 0; right: 0; bottom: 0; height: 62dvh; z-index: 20;
    border-left: none; border-top: 1px solid var(--amber-dim);
    border-radius: 16px 16px 0 0; box-shadow: 0 -12px 40px rgba(0,0,0,0.6);
    transform: translateY(105%); transition: transform 0.25s ease;
  }
  #chat-panel.open { transform: translateY(0); }
  .table-title { display: none; }
}

/* Dice bar + roll entries (v0.04) */
#dice-bar { padding: 10px 12px; border-bottom: 1px solid var(--edge); display: flex; flex-direction: column; gap: 8px; }
.dice-quick { display: flex; flex-wrap: wrap; gap: 6px; }
#dice-form { display: flex; gap: 6px; }
#dice-form input {
  flex: 1 1 auto; min-width: 0; padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--edge); background: #1a0f06; color: var(--cream); font-size: 0.95rem;
}
#dice-form select {
  padding: 8px 6px; border-radius: 9px; border: 1px solid var(--edge);
  background: #1a0f06; color: var(--cream); font-size: 0.85rem; max-width: 96px;
}
.dice-macro-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dice-macro-row select {
  flex: 1 1 auto; min-width: 110px; padding: 7px 6px; border-radius: 9px; border: 1px solid var(--edge);
  background: #1a0f06; color: var(--cream); font-size: 0.85rem;
}
.rolls-filter { font-size: 0.85rem; color: var(--cream-dim); display: inline-flex; gap: 5px; align-items: center; min-height: 32px; }
.chat-row.dice { border-color: rgba(232, 163, 61, 0.45); }
.chat-row.local { border-style: dashed; color: var(--cream-dim); font-style: italic; }
.dice-body { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 3px; }
.dice-expr-label { font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; color: var(--cream-dim); }
.dice-pips { display: inline-flex; gap: 4px; }
.pip {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px;
  padding: 0 4px; border-radius: 6px; background: #2a1a0a; border: 1px solid var(--amber-dim);
  color: var(--amber-bright); font-weight: 700; font-size: 0.85rem;
}
.pip.dropped { opacity: 0.45; text-decoration: line-through; }
.pip.exploded { border-color: var(--amber-bright); box-shadow: 0 0 6px rgba(255, 179, 107, 0.5); }
.dice-hidden { font-size: 0.82rem; color: var(--cream-dim); font-style: italic; }
.dice-total { font-size: 1.12rem; font-weight: 800; color: var(--amber-bright); }
