/* Mists of Ravenhollow — gothic theme.
   Extends /shared/style.css but overrides colors for atmosphere. */

:root {
  --rh-bg-0: #0a0612;
  --rh-bg-1: #14091e;
  --rh-bg-2: #1f0f2a;
  --rh-text: #e8e0f0;
  --rh-text-dim: #b9adc7;
  --rh-text-muted: #847394;
  --rh-blood: #6a1d3a;
  --rh-blood-bright: #b32a4f;
  --rh-bone: #d9c8a6;
  --rh-gold: #c89c4a;
  --rh-mist: rgba(180, 160, 220, 0.08);
  --rh-border: rgba(200, 180, 220, 0.14);
  --rh-card: rgba(20, 9, 30, 0.78);
  --rh-shadow: 0 10px 40px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);
  --rh-serif: "Cinzel", "Cormorant Garamond", Georgia, serif;
  --rh-body: "Crimson Pro", Georgia, "Plus Jakarta Sans", system-ui, serif;
  --rh-radius: 10px;
}

html, body.rh {
  background: radial-gradient(ellipse at top, var(--rh-bg-1) 0%, var(--rh-bg-0) 60%, #050309 100%) no-repeat fixed;
  background-color: var(--rh-bg-0);
  color: var(--rh-text);
  font-family: var(--rh-body);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  margin: 0;
  letter-spacing: 0.01em;
}

body.rh::before {
  /* Mist overlay */
  content: "";
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 30% 0%, var(--rh-mist), transparent 60%),
              radial-gradient(ellipse at 70% 100%, rgba(140, 90, 180, 0.05), transparent 60%);
  z-index: 0;
}

.rh h1, .rh h2, .rh h3, .rh h4 {
  font-family: var(--rh-serif);
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--rh-bone);
  margin: 0 0 12px;
}
.rh h1 { font-size: 2.2rem; }
.rh h2 { font-size: 1.5rem; }
.rh h3 { font-size: 1.2rem; }

.rh a { color: var(--rh-bone); text-decoration: none; border-bottom: 1px dotted var(--rh-border); }
.rh a:hover { color: #fff; }

.rh-container {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.rh-narrow { max-width: 720px; }

.rh-card {
  background: var(--rh-card);
  border: 1px solid var(--rh-border);
  border-radius: var(--rh-radius);
  padding: 22px;
  box-shadow: var(--rh-shadow);
  backdrop-filter: blur(8px);
}

.rh-card + .rh-card { margin-top: 16px; }

.rh-title-block {
  text-align: center;
  margin: 8px 0 28px;
}
.rh-title-block .ornament {
  color: var(--rh-blood);
  font-size: 1.5rem;
  letter-spacing: 0.8em;
}
.rh-title-block .tagline {
  color: var(--rh-text-dim);
  font-style: italic;
  font-size: 1.05rem;
}

.rh-btn {
  display: inline-block;
  background: linear-gradient(180deg, #2a1539, #1a0a24);
  color: var(--rh-bone);
  border: 1px solid var(--rh-border);
  padding: 12px 22px;
  border-radius: 8px;
  font-family: var(--rh-serif);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
}
.rh-btn:hover { background: linear-gradient(180deg, #3a1c4f, #2a0e3a); color: #fff; border-color: var(--rh-blood); }
.rh-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.rh-btn-blood {
  background: linear-gradient(180deg, #6a1d3a, #4a0f25);
  color: #fff;
  border-color: var(--rh-blood-bright);
}
.rh-btn-blood:hover { background: linear-gradient(180deg, #8a2548, #6a1530); }

.rh-btn-ghost {
  background: transparent;
  color: var(--rh-text-dim);
}

.rh-input, .rh-select, .rh-textarea {
  width: 100%;
  background: rgba(0,0,0,0.4);
  color: var(--rh-text);
  border: 1px solid var(--rh-border);
  border-radius: 8px;
  padding: 11px 14px;
  font-family: var(--rh-body);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.18s;
}
.rh-input:focus, .rh-select:focus, .rh-textarea:focus { border-color: var(--rh-blood-bright); }
.rh-textarea { resize: vertical; min-height: 84px; }
.rh-label { display: block; color: var(--rh-text-dim); font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
.rh-field { margin-bottom: 14px; }

.rh-row { display: flex; gap: 12px; flex-wrap: wrap; }
.rh-row > * { flex: 1; min-width: 0; }

.rh-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rh-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .rh-grid-2, .rh-grid-3 { grid-template-columns: 1fr; } }

.rh-pill {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.8rem;
  border-radius: 999px;
  background: rgba(200,180,220,0.08);
  border: 1px solid var(--rh-border);
  color: var(--rh-text-dim);
  letter-spacing: 0.05em;
}

/* Game layout */
.rh-game {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 960px) { .rh-game { grid-template-columns: 1fr; } }

.rh-scene-art {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--rh-radius);
  border: 1px solid var(--rh-border);
  object-fit: cover;
  display: block;
  box-shadow: var(--rh-shadow);
}

.rh-scene-art-skel {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--rh-radius);
  background: linear-gradient(90deg, #0a0612, #1a0d25, #0a0612);
  background-size: 200% 100%;
  animation: rhSkel 1.6s linear infinite;
  border: 1px solid var(--rh-border);
}
@keyframes rhSkel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.rh-narration {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--rh-text);
  white-space: pre-wrap;
}
.rh-narration .npc {
  display: block;
  margin: 10px 0;
  padding-left: 14px;
  border-left: 2px solid var(--rh-blood);
  font-style: italic;
  color: var(--rh-bone);
}
.rh-narration .npc-name {
  font-family: var(--rh-serif);
  letter-spacing: 0.06em;
  color: var(--rh-gold);
  text-transform: uppercase;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 4px;
  font-style: normal;
}

.rh-actions {
  display: flex; flex-direction: column; gap: 8px; margin-top: 18px;
}
.rh-action {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--rh-border);
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--rh-body);
  color: var(--rh-text);
  text-align: left;
  transition: all 0.15s;
}
.rh-action:hover { background: rgba(106, 29, 58, 0.25); border-color: var(--rh-blood); }
.rh-action .kind-tag { font-size: 0.7rem; color: var(--rh-text-muted); letter-spacing: 0.1em; text-transform: uppercase; }

.rh-side h3 { margin-bottom: 8px; font-size: 1rem; }

.rh-players {
  display: flex; flex-direction: column; gap: 10px;
}
.rh-player {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 8px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--rh-border);
}
.rh-player .pp {
  width: 44px; height: 44px; border-radius: 50%;
  background: #1a0c25 center/cover no-repeat;
  border: 1px solid var(--rh-border);
  flex-shrink: 0;
}
.rh-player .pp-online::after { content:""; display:block; width:8px; height:8px; background:#7be09c; border-radius:50%; margin: 32px 0 0 32px; box-shadow: 0 0 6px #7be09c; }
.rh-player .name { font-family: var(--rh-serif); color: var(--rh-bone); font-size: 0.95rem; }
.rh-player .meta { font-size: 0.8rem; color: var(--rh-text-muted); }
.rh-player .hpbar { width: 100%; height: 4px; background: #2a0e1c; border-radius: 999px; overflow: hidden; margin-top: 4px; }
.rh-player .hpbar > span { display: block; height:100%; background: linear-gradient(90deg, #8a1c30, #d23b5e); }

/* Chat / log */
.rh-log {
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--rh-border);
  border-radius: 8px;
  padding: 10px;
  max-height: 240px;
  overflow-y: auto;
  font-size: 0.86rem;
  color: var(--rh-text-dim);
}
.rh-log .ev { padding: 3px 0; border-bottom: 1px dashed rgba(255,255,255,0.04); }
.rh-log .ev-system { color: var(--rh-text-muted); font-style: italic; }
.rh-log .ev-narr { color: var(--rh-bone); }
.rh-log .ev-roll { color: var(--rh-gold); font-family: monospace; font-size: 0.85rem; }

.rh-chat-input { display: flex; gap: 8px; margin-top: 8px; }
.rh-chat-input input { flex: 1; }
.rh-chat-input button { padding: 8px 14px; }

/* Modals */
.rh-modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.rh-modal {
  background: var(--rh-card);
  border: 1px solid var(--rh-border);
  border-radius: var(--rh-radius);
  padding: 28px;
  max-width: 520px; width: 100%;
  box-shadow: var(--rh-shadow);
}
.rh-modal h2 { font-family: var(--rh-serif); margin-bottom: 12px; }

/* Combat panel */
.rh-combat {
  border: 2px solid var(--rh-blood);
  background: linear-gradient(180deg, rgba(106,29,58,0.18), var(--rh-card));
}
.rh-init-list { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.rh-init-token {
  padding: 8px 12px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--rh-border);
  border-radius: 8px;
  font-size: 0.85rem;
}
.rh-init-token.active { border-color: var(--rh-blood-bright); box-shadow: 0 0 12px rgba(179,42,79,0.4); }
.rh-init-token.down { opacity: 0.35; text-decoration: line-through; }

/* Dice */
.rh-die {
  display: inline-block;
  width: 38px; height: 38px;
  background: linear-gradient(180deg, #2a1539, #150823);
  border: 1px solid var(--rh-blood);
  border-radius: 8px;
  text-align: center;
  line-height: 38px;
  font-family: var(--rh-serif);
  font-size: 1.1rem;
  color: var(--rh-bone);
  animation: rhRoll 0.5s ease-out;
}
.rh-die.crit { background: linear-gradient(180deg, #c89c4a, #6a4a14); color: #fff; }
.rh-die.fumble { background: linear-gradient(180deg, #6a1d3a, #3a0b1f); color: #fff; }
@keyframes rhRoll { 0% { transform: rotate(-180deg) scale(0.5); opacity: 0; } 100% { transform: rotate(0) scale(1); opacity: 1; } }

/* Lobby card grid */
.rh-lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
}
@media (max-width: 720px) { .rh-lobby-grid { grid-template-columns: 1fr; } }

.rh-lobby-card {
  background: var(--rh-card);
  border: 1px solid var(--rh-border);
  border-radius: var(--rh-radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.rh-lobby-card:hover { transform: translateY(-2px); border-color: var(--rh-blood); }
.rh-lobby-card .ico { font-size: 2.4rem; color: var(--rh-bone); margin-bottom: 8px; }

/* Character creator */
.rh-step-bar { display: flex; gap: 4px; margin-bottom: 24px; }
.rh-step-bar .step { flex: 1; height: 3px; background: rgba(200,180,220,0.1); border-radius: 2px; }
.rh-step-bar .step.active { background: var(--rh-blood-bright); }
.rh-step-bar .step.done { background: var(--rh-gold); }

.rh-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.rh-option {
  padding: 14px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--rh-border);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.rh-option:hover { border-color: var(--rh-bone); }
.rh-option.selected { border-color: var(--rh-blood-bright); background: rgba(106,29,58,0.2); }
.rh-option .opt-title { font-family: var(--rh-serif); color: var(--rh-bone); margin-bottom: 4px; font-size: 1.05rem; }
.rh-option .opt-desc { font-size: 0.8rem; color: var(--rh-text-muted); }

.rh-portrait {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  background: #1a0d25 center/cover no-repeat;
  border: 2px solid var(--rh-blood);
  border-radius: var(--rh-radius);
  margin: 12px auto;
  box-shadow: var(--rh-shadow);
}

.rh-ability-row {
  display: grid; grid-template-columns: 80px 1fr 60px;
  align-items: center; gap: 8px; margin-bottom: 6px;
}
.rh-ability-row .lbl { font-family: var(--rh-serif); color: var(--rh-bone); }
.rh-ability-row select { background: rgba(0,0,0,0.4); color: var(--rh-text); border: 1px solid var(--rh-border); padding: 6px; border-radius: 6px; }
.rh-ability-row .mod { color: var(--rh-gold); font-family: monospace; }

/* Audio toggle */
.rh-audio-toggle {
  position: fixed; top: 16px; right: 16px;
  z-index: 100;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--rh-card);
  border: 1px solid var(--rh-border);
  color: var(--rh-bone);
  cursor: pointer;
  font-size: 1.1rem;
}
.rh-audio-toggle:hover { border-color: var(--rh-blood); }

.rh-footer {
  margin-top: 60px;
  text-align: center;
  color: var(--rh-text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}
.rh-footer a { color: var(--rh-text-muted); }

/* QR code */
.rh-qr {
  display: block;
  margin: 16px auto;
  width: 220px; height: 220px;
  background: #fff;
  padding: 12px;
  border-radius: 12px;
}

/* Mood-specific scene backgrounds */
.rh-mood-horror { box-shadow: inset 0 0 80px rgba(106,29,58,0.4); }
.rh-mood-combat { animation: rhPulse 2s infinite; }
@keyframes rhPulse { 0%,100% { box-shadow: 0 0 0 rgba(179,42,79,0); } 50% { box-shadow: 0 0 30px rgba(179,42,79,0.25); } }

/* Vote modal */
.rh-vote-progress {
  width: 100%; height: 4px; background: rgba(0,0,0,0.4);
  border-radius: 2px; overflow: hidden; margin: 12px 0;
}
.rh-vote-progress > span { display: block; height: 100%; background: var(--rh-blood-bright); transition: width 0.4s; }
