@font-face {
  font-family: "Sunday Afternoon";
  src: url("../fonts/SundayAfternoon.ed0fff7f4ce2.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sunday Afternoon";
  src: url("../fonts/SundayAfternoon-Italic.bf1c68da3a11.woff") format("woff");
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

/*
 * Princess palette, converted from the book's CMYK swatches and adjusted for
 * screen use (raw CMYK->RGB conversion runs lighter/flatter on screen than in
 * print, so interactive colors got a deeper same-hue shade for contrast):
 *   Corinthian Pink  C0  M35 Y15 K0  -> #FFA6D9  (--blush)
 *   Sulphur Yellow   C4  M4  Y28 K0  -> #F5F5B8  (folded into --cream/--card)
 *   Cinnamon Buff    C0  M25 Y57 K0  -> #FFBF6E  (folded into --gold-pale)
 *   Brick Red        C22 M84 Y100 K18 -> #A32100 (--heading, exact)
 */
:root {
  --ink: #3b2a2e;
  --ink-soft: #7a6267;
  --heading: #a32100;
  --blush: #ffa6d9;
  --blush-deep: #d74296;
  --blush-pale: #ffdbf0;
  --gold: #b3864d;
  --gold-pale: #ffe2be;
  --sage: #8fb883;
  --cream: #fcfcea;
  --card: #fefef8;
  --border: #ffceea;
  --danger: #c0564f;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(59, 42, 46, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

h1, h2, h3, .display {
  font-family: "Sunday Afternoon", cursive;
  font-weight: normal;
  color: var(--heading);
  margin: 0 0 0.4em;
  line-height: 1.15;
}

h1 { font-size: 2.6rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.4rem; }

a { color: var(--blush-deep); }

p { margin: 0 0 0.75em; }

.muted { color: var(--ink-soft); }
.center { text-align: center; }

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 18px 48px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.brand img { width: 52px; height: auto; }
.brand span { font-family: "Sunday Afternoon", cursive; font-size: 2.2rem; color: var(--heading); }

.verse {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 24px;
}

/* Forms */
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
input[type="text"], input[type="password"], input[type="number"], input[type="email"],
input[type="url"], textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 14px;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--blush);
  border-color: var(--blush);
}
.errorlist { list-style: none; padding: 0; margin: -8px 0 12px; color: var(--danger); font-size: 0.85rem; }

.btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform 0.05s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--blush-deep); color: #fff; }
.btn-primary:hover { opacity: 0.92; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-ghost { background: transparent; color: var(--blush-deep); border: 1px solid var(--blush-deep); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-danger { background: var(--danger); color: #fff; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--blush-pale);
  color: var(--blush-deep);
}
.badge-gold { background: var(--gold-pale); color: #7a4a12; }
.badge-sage { background: #e6f0e3; color: #3f6b34; }
.badge-danger { background: #f6dcda; color: #8a3730; }

hr.rule { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* --- Participant mobile shell --- */
.stage {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}
.video-pinned {
  flex: 0 0 42vh;
  background: #2b1526;
  position: relative;
}
.video-pinned .video-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #d9b8cf; font-size: 0.9rem;
  z-index: 1;
}
.room-tag {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,0.45); color: #fff;
  padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; letter-spacing: 0.05em;
  z-index: 5;
}

.tabbar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.tabbar button {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 3px solid transparent;
}
.tabbar button.active {
  color: var(--blush-deep);
  border-bottom-color: var(--blush-deep);
}

.panels { flex: 1; overflow: hidden; position: relative; }
.panel {
  position: absolute; inset: 0;
  overflow-y: auto;
  padding: 16px;
  display: none;
}
.panel.active { display: block; }

/* Chat */
.chat-log { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.chat-msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--border); }
.chat-msg .who { font-size: 0.75rem; font-weight: 700; color: var(--blush-deep); }
.chat-msg.host { background: var(--gold-pale); border-color: var(--gold); align-self: center; }
.chat-form { display: flex; gap: 8px; position: sticky; bottom: 0; background: var(--cream); padding-top: 8px; }
.chat-form input { margin-bottom: 0; flex: 1; }

.empty-state { text-align: center; padding: 40px 10px; color: var(--ink-soft); }
.empty-state img { width: 96px; opacity: 0.85; margin-bottom: 12px; }

/* --- Host dashboard shell --- */
.host-shell { display: flex; min-height: 100vh; }
.host-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 20px 14px;
}
.host-sidebar .brand { justify-content: flex-start; margin-bottom: 24px; }
.host-sidebar .brand img { width: 40px; height: auto; }
.host-sidebar .brand span { font-size: 1.6rem; }
.host-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 4px;
  font-size: 0.95rem;
}
.host-nav a:hover, .host-nav a.active { background: var(--blush-pale); color: var(--blush-deep); }
.host-main { flex: 1; padding: 28px 32px; max-width: 1080px; }
.host-topbar {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) {
  .host-shell { flex-direction: column; }
  .host-sidebar { width: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .grid-2 { grid-template-columns: 1fr; }
  .host-main { padding: 18px; }
}

table.simple { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.simple th, table.simple td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.simple th { color: var(--ink-soft); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }

.game-switcher { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.game-switcher button {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-weight: 600; font-size: 0.9rem;
}
.game-switcher button.active { background: var(--blush-deep); border-color: var(--blush-deep); color: #fff; }

.room-code-display {
  font-family: "Segoe UI", Roboto, monospace;
  font-weight: 700;
  letter-spacing: 0.35em;
  font-size: 2rem;
  color: var(--ink);
  background: #fff;
  border: 2px dashed var(--blush);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  display: inline-block;
}

.toast-area { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 0.85rem; box-shadow: var(--shadow); }
