/* === Custom Properties === */
:root {
  --bg-dark: #1a1a2e;
  --bg-darker: #12121f;
  --bg-card: #2a2a3e;
  --bg-card-hover: #33334a;
  --bg-parchment: #d4c5a9;
  --bg-parchment-dark: #c4b594;
  --text-primary: #e8e6e3;
  --text-secondary: #a8a5a0;
  --text-dark: #2c2416;
  --gold: #d4a843;
  --gold-bright: #f0c850;
  --gold-dim: #a07830;
  --red: #c0392b;
  --red-light: #e74c3c;
  --green: #27ae60;
  --green-light: #2ecc71;
  --yellow: #f39c12;
  --yellow-light: #f1c40f;
  --gray: #555;
  --border: #3a3a50;
  --radius: 8px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --bg-input: #2a2a3e;
  --font-heading: 'MedievalSharp', cursive;
  --font-body: 'Crimson Text', serif;
}

/* === Global Focus Indicator (WCAG Compliant + Fantasy Themed) === */
*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(212, 168, 67, 0.2);
}

/* Remove default focus outline */
*:focus {
  outline: none;
}

/* Ensure focus-visible works for keyboard navigation */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(212, 168, 67, 0.2);
}

/* === Light Theme === */
[data-theme="light"] {
  --bg-dark: #d9c9a5;
  --bg-darker: #c9b88e;
  --bg-card: #ede0c4;
  --bg-card-hover: #e4d5b5;
  --text-primary: #2a1a0a;
  --text-secondary: #5c4025;
  --gold: #8b6914;
  --gold-bright: #a07818;
  --gold-dim: #9e7e3a;
  --border: #b09870;
  --shadow: 0 4px 12px rgba(40, 25, 10, 0.15);
  --bg-input: #f2e8d0;
}

[data-theme="light"] .nav {
  background: linear-gradient(to bottom, #b8a478, #c9b88e);
  border-bottom-color: #9e7e3a;
}

[data-theme="light"] .btn-primary {
  color: #fff;
}

[data-theme="light"] .btn-primary:hover {
  color: #fff;
}

[data-theme="light"] .btn-outline {
  border-color: #b09870;
  color: #5c4025;
}

[data-theme="light"] .form-group input[type="text"],
[data-theme="light"] .form-group input[type="password"],
[data-theme="light"] .form-group input[type="datetime-local"],
[data-theme="light"] .form-group input[type="date"],
[data-theme="light"] .form-group textarea,
[data-theme="light"] .form-group select,
[data-theme="light"] .time-select,
[data-theme="light"] .board-reply-form input[type="text"] {
  background: #f2e8d0;
  border-color: #b09870;
  color: #2a1a0a;
}

[data-theme="light"] .slot-grid thead th,
[data-theme="light"] .summary-row td {
  background: #c9b88e;
}

[data-theme="light"] .vote-slot-card {
  background: #ede0c4;
  border-color: #b09870;
}

[data-theme="light"] .avatar-letter {
  background: #8b6914;
  color: #fff;
}

[data-theme="light"] .avatar-placeholder {
  background: #8b6914;
  color: #fff;
}

[data-theme="light"] .role-select {
  background: #f2e8d0;
  color: #2a1a0a;
  border-color: #b09870;
}

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-dark);
  min-height: 100vh;
}

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

a:hover {
  color: var(--gold-bright);
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--gold);
  line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; margin-top: 1.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; }

/* === Layout === */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* === Navigation === */
.nav {
  background: var(--bg-darker);
  border-bottom: 2px solid var(--gold-dim);
  padding: 0.75rem 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-brand:hover {
  color: var(--gold-bright);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.nav-user {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.inline-form {
  display: inline;
}

.nav-settings-icon {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-settings-icon:hover {
  color: var(--gold-bright);
}

/* === Hamburger Menu === */
.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--gold);
  cursor: pointer;
  font-size: 1.3rem;
  padding: 0.25rem 0.5rem;
  transition: all 0.2s;
  line-height: 1;
}

.hamburger-btn:hover {
  border-color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
}

.hamburger-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 998;
  overflow: hidden;
}

.hamburger-menu.open {
  display: block;
}

.hamburger-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
  font-family: var(--font-body);
}

.hamburger-item:hover {
  background: var(--bg-card-hover);
  color: var(--gold);
}

.hamburger-item svg {
  flex-shrink: 0;
  color: var(--text-secondary);
}

.hamburger-item:hover svg {
  color: var(--gold);
}

.hamburger-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

.hamburger-logout {
  color: var(--red-light);
}

.hamburger-logout:hover {
  background: rgba(192, 57, 43, 0.1);
  color: var(--red-light);
}

.hamburger-logout svg {
  color: var(--red-light);
}

.hamburger-logout-form {
  display: block;
}

/* === Hamburger Group (Collapsible) === */
.hamburger-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hamburger-group-toggle:hover {
  color: var(--gold);
  background: var(--bg-card-hover);
}

.hamburger-group-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hamburger-group-arrow {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-secondary);
}

.hamburger-group-toggle.open .hamburger-group-arrow {
  transform: rotate(180deg);
  color: var(--gold);
}

.hamburger-group-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-group-content.open {
  max-height: 500px;
}

.hamburger-item-nested {
  padding-left: 2.5rem;
  font-size: 0.85rem;
}

.hamburger-section-label {
  padding: 0.6rem 1rem 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  font-family: var(--font-body);
}

[data-theme="light"] .hamburger-menu {
  background: #ede0c4;
}

[data-theme="light"] .hamburger-btn {
  border-color: #b09870;
}

/* === Flash Messages === */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  font-weight: 600;
}

.flash-success {
  background: rgba(39, 174, 96, 0.2);
  border: 1px solid var(--green);
  color: var(--green-light);
}

.flash-error {
  background: rgba(192, 57, 43, 0.2);
  border: 1px solid var(--red);
  color: var(--red-light);
}

/* === Buttons === */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 1rem;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: var(--bg-darker);
  border-color: var(--gold);
  box-shadow:
    0 4px 12px rgba(212, 168, 67, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Shimmer effect */
.btn-primary::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 70%
  );
  transform: translateX(-100%) translateY(-100%) rotate(45deg);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover::before {
  transform: translateX(100%) translateY(100%) rotate(45deg);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 100%);
  border-color: var(--gold-bright);
  color: var(--bg-darker);
  transform: translateY(-3px);
  box-shadow:
    0 6px 20px rgba(212, 168, 67, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-primary:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow:
    0 2px 8px rgba(212, 168, 67, 0.4),
    inset 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: all 0.1s ease-out;
}

.btn-outline {
  position: relative;
  background: linear-gradient(135deg, transparent 0%, rgba(212, 168, 67, 0.03) 100%);
  color: var(--gold);
  border-color: var(--gold-dim);
}

/* Disable pseudo-element on selects — causes rendering artifacts */
select.btn-outline::after { display: none; }

/* Gradient border effect on hover */
.btn-outline::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  border: 2px solid transparent;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn-outline:hover::after {
  opacity: 1;
}

.btn-outline:hover {
  border-color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
  color: var(--gold-bright);
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(212, 168, 67, 0.15);
  color: var(--gold);
  border-color: var(--gold-dim);
}

.btn-secondary:hover {
  background: rgba(212, 168, 67, 0.3);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.btn-danger {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.btn-danger:hover {
  background: var(--red-light);
  border-color: var(--red-light);
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.5);
  transform: translateY(-2px);
}

.btn-small {
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
}

.btn-block {
  display: block;
  width: 100%;
}

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card:hover {
  border-color: var(--gold-dim);
}

/* === Auth Pages === */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(212, 168, 67, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(212, 168, 67, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(160, 120, 48, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(212, 168, 67, 0.2);
  -webkit-box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 60px rgba(212, 168, 67, 0.05);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 60px rgba(212, 168, 67, 0.05);
}

.auth-logo-wrap {
  text-align: center;
  margin-bottom: 1rem;
}

.auth-logo {
  display: inline-block;
  width: 96px;
  height: 96px;
  border-radius: 16px;
  -webkit-box-shadow: 0 4px 20px rgba(212, 168, 67, 0.3);
  box-shadow: 0 4px 20px rgba(212, 168, 67, 0.3);
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 0.25rem;
}

.subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.auth-link {
  text-align: center;
  margin-top: 1.25rem;
  color: var(--text-secondary);
}

/* Tavern fire glow particles */
.tavern-embers {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ember {
  position: absolute;
  bottom: -10px;
  width: 3px;
  height: 3px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  -webkit-animation: ember-rise linear infinite;
  animation: ember-rise linear infinite;
}

.ember:nth-child(1) { left: 15%; -webkit-animation-duration: 6s; animation-duration: 6s; -webkit-animation-delay: 0s; animation-delay: 0s; }
.ember:nth-child(2) { left: 30%; -webkit-animation-duration: 8s; animation-duration: 8s; -webkit-animation-delay: 1s; animation-delay: 1s; width: 2px; height: 2px; }
.ember:nth-child(3) { left: 50%; -webkit-animation-duration: 7s; animation-duration: 7s; -webkit-animation-delay: 2s; animation-delay: 2s; }
.ember:nth-child(4) { left: 70%; -webkit-animation-duration: 9s; animation-duration: 9s; -webkit-animation-delay: 0.5s; animation-delay: 0.5s; width: 2px; height: 2px; }
.ember:nth-child(5) { left: 85%; -webkit-animation-duration: 6.5s; animation-duration: 6.5s; -webkit-animation-delay: 3s; animation-delay: 3s; }
.ember:nth-child(6) { left: 40%; -webkit-animation-duration: 10s; animation-duration: 10s; -webkit-animation-delay: 1.5s; animation-delay: 1.5s; width: 2px; height: 2px; }
.ember:nth-child(7) { left: 60%; -webkit-animation-duration: 7.5s; animation-duration: 7.5s; -webkit-animation-delay: 4s; animation-delay: 4s; }
.ember:nth-child(8) { left: 25%; -webkit-animation-duration: 8.5s; animation-duration: 8.5s; -webkit-animation-delay: 2.5s; animation-delay: 2.5s; width: 2px; height: 2px; }

@-webkit-keyframes ember-rise {
  0%   { bottom: -10px; opacity: 0; -webkit-transform: translateX(0); }
  10%  { opacity: 0.4; }
  50%  { opacity: 0.15; }
  100% { bottom: 100vh; opacity: 0; -webkit-transform: translateX(20px); }
}

@keyframes ember-rise {
  0%   { bottom: -10px; opacity: 0; transform: translateX(0); }
  10%  { opacity: 0.4; }
  50%  { opacity: 0.15; }
  100% { bottom: 100vh; opacity: 0; transform: translateX(20px); }
}

/* Warm glow at bottom of auth page */
.tavern-glow {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to top, rgba(212, 168, 67, 0.04) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
  -webkit-animation: glow-pulse 4s ease-in-out infinite;
  animation: glow-pulse 4s ease-in-out infinite;
}

@-webkit-keyframes glow-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* === Activity Feed Bar === */
.activity-feed-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(37, 24, 15, 0.98) 0%, rgba(28, 18, 11, 0.98) 100%);
  border-top: 2px solid var(--gold);
  padding: 0.75rem 1rem;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  z-index: 9999;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 1;
}

.activity-feed-bar.hidden {
  transform: translateY(100%);
}

.activity-feed-bar.show {
  transform: translateY(0);
}

.activity-feed-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 1200px;
  margin: 0 auto;
  color: var(--text-primary);
  font-size: 0.9rem;
  overflow: hidden;
  position: relative;
}

.activity-icon {
  color: var(--gold);
  flex-shrink: 0;
  animation: activity-pulse 2s ease-in-out infinite;
  z-index: 2;
}

.activity-message {
  flex: 1;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.activity-message a {
  color: var(--text-primary);
  text-decoration: none;
  display: inline-block;
  transition: color 0.2s;
}

.activity-message a:hover {
  color: var(--gold);
}

.activity-message strong {
  color: var(--gold);
  font-weight: 600;
}

.activity-message-inner {
  display: inline-block;
  animation: scroll-left 15s linear;
  animation-fill-mode: forwards;
}

@keyframes scroll-left {
  0% {
    transform: translateX(100%);
  }
  70% {
    transform: translateX(0);
  }
  90% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(0);
    opacity: 0;
  }
}

@keyframes activity-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* === Forms === */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: normal;
  margin-bottom: 0;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="datetime-local"],
.form-group input[type="date"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.25);
}

.form-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

/* === Themed Form Controls (Checkboxes, Radios, Selects) === */

/* Custom Checkbox */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gold);
  border-radius: 4px;
  background: var(--bg-darker);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

input[type="checkbox"]:hover {
  border-color: var(--gold-bright);
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.3);
}

input[type="checkbox"]:checked {
  background: var(--gold);
  border-color: var(--gold-bright);
}

input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--bg-darker);
  font-size: 14px;
  font-weight: bold;
}

input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Custom Radio Button */
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: var(--bg-darker);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

input[type="radio"]:hover {
  border-color: var(--gold-bright);
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.3);
}

input[type="radio"]:checked {
  border-color: var(--gold-bright);
}

input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
}

input[type="radio"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Custom Select Dropdown */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4a843' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 12px;
  padding-right: 2.5rem;
  cursor: pointer;
}

select:hover {
  border-color: var(--gold-bright);
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.2);
}

/* Light theme adjustments */
[data-theme="light"] input[type="checkbox"],
[data-theme="light"] input[type="radio"] {
  background: #f2e8d0;
  border-color: #8b6914;
}

[data-theme="light"] input[type="checkbox"]:hover,
[data-theme="light"] input[type="radio"]:hover {
  border-color: #a07818;
}

[data-theme="light"] input[type="checkbox"]:checked {
  background: #8b6914;
  border-color: #a07818;
}

[data-theme="light"] input[type="checkbox"]:checked::after {
  color: #fff;
}

[data-theme="light"] input[type="radio"]:checked::after {
  background: #8b6914;
}

[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b6914' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* === Slot Picker (DM Form) === */
.slot-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: flex-start; /* Changed from center to accommodate datetime picker */
  flex-wrap: wrap;
  position: relative;
}

.slot-row input[type="datetime-local"],
.slot-row input[type="date"],
.slot-row .time-select,
.slot-row input[type="text"] {
  flex: 1;
}

.slot-row .datetime-input {
  flex: 2; /* DateTime picker needs more space */
  position: relative;
}

.slot-row input[name="slot_labels"] {
  flex: 1;
}

.remove-slot {
  flex-shrink: 0;
}

.remove-slot-placeholder {
  /* Invisible placeholder that matches remove button size */
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  visibility: hidden;
}

#add-slot {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

/* === Page Header === */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.5rem 0;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* === Session Grid (Dashboard) === */
.session-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.session-card {
  display: block;
  transition: transform 0.2s, border-color 0.2s;
  text-decoration: none;
  color: var(--text-primary);
}

.session-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  color: var(--text-primary);
}

.session-card h2 {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.session-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.session-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* === Status Badges === */
.session-status-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.session-status-badge-lg {
  font-size: 0.9rem;
  padding: 0.25rem 0.8rem;
  margin-bottom: 1rem;
}

/* === Share Button & Menu === */
.share-main-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(212, 168, 67, 0.15);
  border: 1px solid rgba(212, 168, 67, 0.4);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--gold);
  padding: 0;
  z-index: 11;
}

.share-main-btn:hover {
  background: rgba(212, 168, 67, 0.25);
  border-color: var(--gold);
  transform: scale(1.05);
}

.share-main-btn:active {
  transform: scale(0.95);
}

.share-main-btn svg {
  flex-shrink: 0;
}

.share-menu {
  position: absolute;
  top: 1rem;
  right: 5rem;
  display: flex;
  gap: 0.5rem;
  z-index: 10;
  animation: shareMenuSlide 0.3s ease-out;
}

@keyframes shareMenuSlide {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.share-menu-btn {
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--gold);
  padding: 0;
}

.share-menu-btn:hover {
  background: rgba(212, 168, 67, 0.2);
  border-color: var(--gold);
  transform: scale(1.1);
}

.share-menu-btn:active {
  transform: scale(0.95);
}

.share-menu-btn svg {
  flex-shrink: 0;
}

/* Responsive: Stack vertically on mobile */
@media (max-width: 640px) {
  .share-menu {
    top: 5rem;
    right: 1rem;
    flex-direction: column;
  }

  @keyframes shareMenuSlide {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Ensure card has relative positioning for absolute share button */
.card {
  position: relative;
}

.session-open .session-status-badge,
.session-status-badge-lg {
  background: rgba(212, 168, 67, 0.2);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
}

.session-confirmed .session-status-badge {
  background: rgba(39, 174, 96, 0.2);
  color: var(--green-light);
  border: 1px solid var(--green);
}

.session-cancelled {
  opacity: 0.6;
  filter: grayscale(20%);
  transition: opacity 0.2s;
}
.session-cancelled:hover {
  opacity: 0.85;
}
.session-cancelled .session-status-badge {
  background: rgba(192, 57, 43, 0.2);
  color: var(--red-light);
  border: 1px solid var(--red);
}

.session-completed .session-status-badge {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
  border: 1px solid #2980b9;
}

.session-confirmed-date {
  font-weight: 600;
  color: var(--green-light);
  margin-bottom: 0.5rem;
}

.confirmed-banner {
  background: rgba(39, 174, 96, 0.15);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
}

.confirmed-banner h3 {
  color: var(--green-light);
  margin-bottom: 0.25rem;
}

.voted-badge {
  background: rgba(39, 174, 96, 0.2);
  color: var(--green-light);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.needs-vote-badge {
  background: rgba(243, 156, 18, 0.2);
  color: var(--yellow-light);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

/* === Vote Slots (Player) === */
.vote-slots {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.vote-slot-card {
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.vote-slot-header {
  margin-bottom: 0.75rem;
}

.vote-slot-header .slot-date {
  font-weight: 600;
  font-size: 1.05rem;
}

.vote-slot-header .slot-time {
  color: var(--text-secondary);
}

.vote-slot-header .slot-label {
  color: var(--gold);
  font-size: 0.9rem;
}

.vote-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.vote-option {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  justify-content: center;
}

.vote-option input[type="radio"] {
  display: none;
}

.vote-option:has(input:checked) {
  border-width: 2px;
}

.vote-available:has(input:checked) {
  background: rgba(39, 174, 96, 0.2);
  border-color: var(--green);
  color: var(--green-light);
}

.vote-maybe:has(input:checked) {
  background: rgba(243, 156, 18, 0.2);
  border-color: var(--yellow);
  color: var(--yellow-light);
}

.vote-unavailable:has(input:checked) {
  background: rgba(192, 57, 43, 0.2);
  border-color: var(--red);
  color: var(--red-light);
}

.vote-option:hover {
  border-color: var(--gold-dim);
}

.vote-icon {
  font-size: 1.1rem;
}

.vote-result {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-weight: 600;
}

.vote-result.vote-available {
  color: var(--green-light);
}

.vote-result.vote-maybe {
  color: var(--yellow-light);
}

.vote-result.vote-unavailable {
  color: var(--red-light);
}

.vote-result.vote-none {
  color: var(--text-secondary);
}

/* === Slot Grid (DM Detail View) === */
.slot-grid-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
}

.slot-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.slot-grid th,
.slot-grid td {
  padding: 0.5rem 0.75rem;
  text-align: center;
  border: 1px solid var(--border);
}

.slot-grid thead th {
  background: var(--bg-darker);
  color: var(--gold);
  font-family: var(--font-heading);
}

.grid-corner {
  text-align: left !important;
}

.grid-player {
  text-align: left !important;
  white-space: nowrap;
}

.grid-slot-header .slot-date {
  font-weight: 600;
}

.grid-slot-header .slot-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.grid-slot-header .slot-label {
  font-size: 0.75rem;
  color: var(--gold);
}

.grid-cell {
  font-size: 1.1rem;
  font-weight: 700;
}

.vote-available {
  background: rgba(39, 174, 96, 0.2);
  color: var(--green-light);
}

.vote-maybe {
  background: rgba(243, 156, 18, 0.2);
  color: var(--yellow-light);
}

.vote-unavailable {
  background: rgba(192, 57, 43, 0.2);
  color: var(--red-light);
}

.vote-none {
  background: rgba(85, 85, 85, 0.15);
  color: var(--gray);
}

.summary-row td {
  background: var(--bg-darker);
  font-family: var(--font-heading);
}

.summary-available {
  color: var(--green-light);
}

.summary-maybe {
  color: var(--yellow-light);
}

.summary-cell {
  font-size: 0.95rem;
}

/* === DM Actions === */
.dm-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.dm-actions h3 {
  margin-bottom: 1rem;
}

.confirm-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.confirm-form .form-group {
  flex: 1;
  min-width: 200px;
  margin-bottom: 0;
}

/* === Empty States === */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-secondary);
}

.empty-state-text {
  color: var(--text-secondary);
  font-style: italic;
}

/* === Admin Table === */
.admin-table-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.admin-table th,
.admin-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border: 1px solid var(--border);
}

.admin-table thead th {
  background: var(--bg-darker);
  color: var(--gold);
  font-family: var(--font-heading);
}

.admin-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.admin-date {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.role-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-admin {
  background: rgba(212, 168, 67, 0.2);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
}

.role-dm {
  background: rgba(155, 89, 182, 0.2);
  color: #bb86fc;
  border: 1px solid #9b59b6;
}

.role-player {
  background: rgba(39, 174, 96, 0.2);
  color: var(--green-light);
  border: 1px solid var(--green);
}

.role-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.role-select {
  padding: 0.3rem 0.5rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.text-muted {
  color: var(--text-secondary);
}

/* === Preference === */
.preference-display {
  background: rgba(212, 168, 67, 0.08);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
}

.preference-display h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.preference-entry {
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.preference-star {
  color: var(--gold);
  font-size: 1.2rem;
}

/* === Footer === */
.app-footer {
  text-align: center;
  padding: 1.5rem 0;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.footer-about {
  margin-bottom: 0.4rem;
}

.footer-links {
  margin-bottom: 0.4rem;
}

.footer-links a {
  color: var(--gold);
  font-size: 0.8rem;
}

.footer-links a:hover {
  color: var(--gold-bright);
}

.footer-sep {
  margin: 0 0.3rem;
  color: var(--text-secondary);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* === Active Players Footer === */
.footer-players {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.footer-players:empty {
  display: none;
}

.footer-player {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-primary);
  transition: opacity 0.3s;
}

.footer-player.away {
  opacity: 0.45;
}

.footer-player-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.footer-player-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold-dim);
  color: var(--bg-darker);
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
}

.footer-player-name {
  font-weight: 600;
}

.footer-player-status {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* === Welcome Modal === */
.welcome-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.welcome-modal {
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.welcome-modal h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.welcome-modal p {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.welcome-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin: 1rem 0;
}

.welcome-modal #welcome-close {
  margin-top: 0.5rem;
}

/* === Avatar === */
.avatar-tiny {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 0.25rem;
}

.avatar-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold-dim);
  color: var(--bg-darker);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  vertical-align: middle;
  margin-right: 0.25rem;
}

.avatar-letter-sm {
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
}

.avatar-preview {
  margin-bottom: 1rem;
}

.avatar-preview-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-dim);
}

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gold-dim);
  color: var(--bg-darker);
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
}

.avatar-section {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

/* === Settings === */
.settings-section {
  margin-bottom: 1.5rem;
}

.settings-section h2 {
  margin-top: 0;
}

.calendar-url-input {
  font-size: 0.85rem !important;
  cursor: pointer;
}

/* === Unavailability === */
.unavail-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.unavail-form .form-group {
  flex: 1;
  min-width: 150px;
  margin-bottom: 0;
}

.unavail-list {
  margin-top: 1rem;
}

.unavail-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.unavail-item:last-child {
  border-bottom: none;
}

.unavail-date {
  color: var(--gold);
  font-weight: 600;
}

.unavail-reason {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.unavail-warning {
  color: var(--yellow-light);
  cursor: help;
}

.unavail-row td {
  background: rgba(243, 156, 18, 0.08);
}

.unavail-info-card {
  margin-bottom: 1.5rem;
  border-color: var(--yellow);
  background: rgba(243, 156, 18, 0.05);
}

.unavail-info-card h2 {
  color: var(--yellow-light);
  margin-top: 0;
}

/* === Notifications Bell === */
.notif-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-bell {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: color 0.2s;
}

.nav-bell:hover {
  color: var(--gold-bright);
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red-light);
  border: 2px solid var(--bg-darker);
}

.notif-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 999;
  overflow: hidden;
}

.notif-dropdown-header {
  padding: 0.6rem 0.8rem;
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-darker);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-mark-all-read {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  font-family: var(--font-body);
}

.notif-mark-all-read:hover {
  color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
}

.notif-list {
  max-height: 280px;
  overflow-y: auto;
}

.notif-item {
  display: block;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 1.4;
  transition: background 0.15s;
}

.notif-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item.unread {
  background: rgba(212, 168, 67, 0.08);
}

.notif-item-time {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.notif-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* === Mentions === */
.mention {
  color: var(--gold-bright);
  font-weight: 700;
  background: rgba(212, 168, 67, 0.15);
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
}

[data-theme="light"] .mention {
  color: #8b6914;
  background: rgba(139, 105, 20, 0.18);
}

[data-theme="light"] .notif-dropdown {
  background: #ede0c4;
}

[data-theme="light"] .notif-dropdown-header {
  background: #c9b88e;
}

[data-theme="light"] .notif-badge {
  border-color: #c9b88e;
}

/* === Nav Clock === */
.nav-clock {
  color: var(--text-secondary);
  font-size: 0.8rem;
  white-space: nowrap;
  font-family: var(--font-body);
}

/* === View Mode Toggle (DM/Player) === */
.view-mode-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}
.view-mode-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 20px;
  transition: 0.3s;
}
.toggle-slider:before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(16px);
}
.toggle-gold { background-color: var(--gold); }
.toggle-green { background-color: #27ae60; }

/* === Map Unpublished State === */
.map-index-card.map-unpublished {
  opacity: 0.5;
  position: relative;
}
.map-index-card.map-unpublished:hover {
  opacity: 0.75;
}
.map-hidden-badge {
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.08);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}
.map-select-checkbox {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 3;
  accent-color: var(--gold);
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  cursor: pointer;
  -webkit-appearance: checkbox;
  appearance: checkbox;
  outline: 2px solid rgba(255,255,255,0.3);
  outline-offset: 1px;
  border-radius: 3px;
}

@media (max-width: 480px) {
  .view-mode-label { display: none; }
}

/* === Nav Link === */
.nav-link {
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--gold-bright);
}

/* === Time Select === */
.time-select {
  padding: 0.6rem 0.8rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  min-width: 120px;
}

.time-select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.25);
}

/* === Slot Unavailability Warning === */
.slot-unavail-warning {
  width: 100%;
  color: var(--yellow-light);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0;
  display: none;
}

.slot-unavail-warning.visible {
  display: block;
}

/* === Bulletin Board === */
.board-post {
  margin-bottom: 1rem;
}

.board-post:last-child {
  margin-bottom: 0;
}

.board-post-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.board-post-content {
  margin-bottom: 0.5rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.board-replies {
  margin-left: 1.5rem;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
  margin-bottom: 0.5rem;
}

.board-reply {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.board-reply:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.board-reply-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.board-reply-form input[type="text"] {
  flex: 1;
  padding: 0.4rem 0.6rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.board-reply-form input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.25);
}

/* === Image Upload (Phase 4.4) === */
.image-upload-wrapper {
  margin-top: 1rem;
}

.image-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.image-upload-zone:hover {
  border-color: var(--gold);
  background: rgba(212, 168, 67, 0.05);
}

.image-upload-zone.drag-over {
  border-color: var(--gold-bright);
  background: rgba(212, 168, 67, 0.1);
  border-style: solid;
}

.image-upload-zone svg {
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.image-upload-zone:hover svg,
.image-upload-zone.drag-over svg {
  color: var(--gold);
}

.image-upload-zone p {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.image-upload-hint {
  font-size: 0.85rem !important;
  color: var(--text-secondary) !important;
}

.image-upload-link {
  color: var(--gold);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

.image-upload-link:hover {
  color: var(--gold-bright);
}

.image-preview-container {
  position: relative;
  margin-top: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--gold-dim);
  max-width: 500px;
}

.image-preview-container img {
  width: 100%;
  display: block;
}

.image-preview-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  transition: all 0.2s ease;
}

.image-preview-remove:hover {
  background: var(--red);
  transform: scale(1.1);
}

/* === Session Categories === */
.session-category {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}
.session-campaign-label {
  font-size: 0.75rem;
  color: var(--gold);
  padding-left: 0.5rem;
  margin-bottom: 0.2rem;
  font-family: var(--font-heading);
}

.session-cat-dnd {
  border-left: 4px solid var(--gold-bright);
}

.session-cat-rpg {
  border-left: 4px solid #9b59b6;
}

.session-cat-gamenight {
  border-left: 4px solid #3498db;
}

.session-cat-casual {
  border-left: 4px solid var(--green-light);
}

[data-theme="light"] .session-cat-dnd {
  border-left-color: #8b6914;
}

[data-theme="light"] .session-cat-rpg {
  border-left-color: #7b3fa0;
}

[data-theme="light"] .session-cat-gamenight {
  border-left-color: #1f6d99;
}

[data-theme="light"] .session-cat-casual {
  border-left-color: #1e8449;
}

/* === Session Recap === */
.recap-card {
  background: rgba(52, 152, 219, 0.08);
  border: 1px solid #2980b9;
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
}

.recap-card h3 {
  color: #3498db;
  margin-bottom: 0.5rem;
}

.recap-text {
  white-space: pre-wrap;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.recap-rendered {
  white-space: normal;
}

.recap-rendered h1,
.recap-rendered h2,
.recap-rendered h3 {
  color: var(--gold);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.recap-rendered h1:first-child,
.recap-rendered h2:first-child,
.recap-rendered h3:first-child {
  margin-top: 0;
}

.recap-rendered p {
  margin-bottom: 0.75rem;
}

.recap-rendered ul,
.recap-rendered ol {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}

.recap-rendered li {
  margin-bottom: 0.25rem;
}

.recap-rendered hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.recap-rendered strong {
  color: var(--text-primary);
}

.recap-rendered em {
  color: var(--text-secondary);
}

/* === Session History === */
.history-list {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

.history-card {
  padding-left: calc(1.5rem + 4px);
}

.history-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.history-date {
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 1rem;
}

.history-card h2 {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.history-summary {
  line-height: 1.6;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* === Mention Autocomplete === */
.mention-autocomplete {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1000;
  min-width: 160px;
  max-width: 280px;
  overflow: hidden;
}

.mention-ac-item {
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: background 0.15s;
}

.mention-ac-item:hover,
.mention-ac-item.active {
  background: var(--bg-card-hover);
  color: var(--gold);
}

[data-theme="light"] .mention-autocomplete {
  background: #ede0c4;
}

/* === Profile === */
.profile-card {
  margin-bottom: 1.5rem;
}

.profile-card-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.profile-avatar-lg {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold-dim);
  flex-shrink: 0;
}

.profile-avatar-lg-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--gold-dim);
  color: var(--bg-darker);
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.profile-section h3 {
  margin-bottom: 0.5rem;
}

.profile-section p {
  line-height: 1.6;
  white-space: pre-wrap;
}

.character-avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 2px solid var(--gold-dim);
}

.profile-link {
  color: inherit;
  text-decoration: none;
}

.profile-link:hover {
  color: var(--gold);
}

/* === Players Grid === */
.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.2s, border-color 0.2s;
}

.player-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  color: var(--text-primary);
}

.player-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-dim);
  flex-shrink: 0;
}

.player-card-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold-dim);
  color: var(--bg-darker);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.player-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.player-last-seen {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* === Announcement Banner === */
.announcement-banner {
  background: linear-gradient(90deg, rgba(212, 168, 67, 0.25) 0%, rgba(212, 168, 67, 0.4) 50%, rgba(212, 168, 67, 0.25) 100%);
  border-top: 2px solid var(--gold-bright);
  border-bottom: 2px solid var(--gold-bright);
  padding: 0.75rem 0;
  text-align: center;
  box-shadow: 0 2px 8px rgba(212, 168, 67, 0.3), inset 0 0 20px rgba(212, 168, 67, 0.1);
  animation: announcement-pulse 3s ease-in-out infinite;
}

@keyframes announcement-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(212, 168, 67, 0.3), inset 0 0 20px rgba(212, 168, 67, 0.1); }
  50% { box-shadow: 0 2px 12px rgba(212, 168, 67, 0.5), inset 0 0 30px rgba(212, 168, 67, 0.15); }
}

.announcement-banner .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.announcement-icon {
  font-size: 1.25rem;
  animation: announcement-icon-bounce 2s ease-in-out infinite;
}

@keyframes announcement-icon-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.announcement-text {
  color: var(--gold-bright);
  font-size: 1rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.02em;
}

[data-theme="light"] .announcement-banner {
  background: linear-gradient(90deg, rgba(139, 105, 20, 0.2) 0%, rgba(139, 105, 20, 0.35) 50%, rgba(139, 105, 20, 0.2) 100%);
  border-color: #8b6914;
  box-shadow: 0 2px 8px rgba(40, 25, 10, 0.2), inset 0 0 20px rgba(139, 105, 20, 0.1);
}

[data-theme="light"] .announcement-text {
  color: #5c3a10;
  text-shadow: 0 1px 2px rgba(237, 224, 196, 0.5);
}

/* === Reactions === */
.reaction-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.reply-reactions {
  margin-top: 0.25rem;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}

.reaction-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.reaction-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
}

.reaction-btn.active[data-type="dislike"] {
  border-color: var(--red);
  color: var(--red-light);
  background: rgba(192, 57, 43, 0.1);
}

.reaction-count {
  font-weight: 600;
}

/* === Polls === */
.poll-container {
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.poll-question {
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.poll-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-align: left;
  width: 100%;
}

.poll-option:hover {
  border-color: var(--gold-dim);
}

.poll-option.selected {
  border-color: var(--gold);
}

.poll-option-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(212, 168, 67, 0.15);
  transition: width 0.3s;
  z-index: 0;
}

.poll-option-text {
  position: relative;
  z-index: 1;
}

.poll-option-count {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.poll-total {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* === Board Post Images === */
.board-post-image {
  margin: 0.5rem 0;
}

.board-post-image img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* === Birthday Banner === */
.birthday-banner {
  background: rgba(212, 168, 67, 0.15);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gold-bright);
}

.birthday-icon {
  font-size: 1.3rem;
}

/* === Communications Center === */
.comms-section .form-group {
  margin-bottom: 1rem;
}

.comms-section label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.comms-section .form-input {
  width: 100%;
  padding: 0.5rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.provider-fieldset {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.1);
}

.provider-fieldset.active {
  display: block;
}

.comms-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.comms-test-result {
  margin-top: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.comms-test-success {
  color: var(--green-light);
}

.comms-test-error {
  color: var(--red-light);
}

/* === Map Styles === */
.map-container {
  height: 500px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-darker);
  user-select: none;
  -webkit-user-select: none;
}

.map-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.map-marker-icon {
  background: none !important;
  border: none !important;
}

.map-marker-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.map-loc-pin {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--bg-card);
  border: 2px solid #c0392b;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.2s;
  line-height: 1;
}

.map-loc-pin:hover {
  transform: scale(1.15);
}

.map-party-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold-bright);
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.6);
  animation: pulse-party 2s ease-in-out infinite;
}

@keyframes pulse-party {
  0%, 100% { box-shadow: 0 0 8px rgba(212, 168, 67, 0.6); }
  50% { box-shadow: 0 0 16px rgba(212, 168, 67, 0.9); }
}

.map-add-form {
  margin-top: 1rem;
}

.map-marker-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-family: var(--font-heading);
}

.map-marker-pin { background: rgba(192, 57, 43, 0.2); color: #e74c3c; }
.map-marker-city { background: rgba(41, 128, 185, 0.2); color: #3498db; }
.map-marker-dungeon { background: rgba(142, 68, 173, 0.2); color: #bb86fc; }
.map-marker-tavern { background: rgba(39, 174, 96, 0.2); color: #2ecc71; }

.btn-map-pin {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  padding: 0.15rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
}
.btn-map-pin:hover {
  color: var(--gold-bright);
  background: rgba(212, 168, 67, 0.15);
}

/* === Map Breadcrumb === */
.map-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.map-breadcrumb a {
  color: var(--gold);
  text-decoration: none;
}

.map-breadcrumb a:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

.map-breadcrumb-sep {
  color: var(--text-secondary);
  font-size: 1rem;
}

.map-breadcrumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

/* === Map Type Badge === */
.map-type-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-family: var(--font-heading);
  background: rgba(212, 168, 67, 0.15);
  color: var(--gold);
  white-space: nowrap;
}

.map-type-pin { background: rgba(192, 57, 43, 0.15); color: #e74c3c; }
.map-type-overworld { background: rgba(39, 174, 96, 0.15); color: #2ecc71; }
.map-type-city { background: rgba(41, 128, 185, 0.15); color: #3498db; }
.map-type-location { background: rgba(230, 126, 34, 0.15); color: #e67e22; }
.map-type-tavern { background: rgba(46, 204, 113, 0.15); color: #27ae60; }
.map-type-dungeon { background: rgba(142, 68, 173, 0.15); color: #bb86fc; }
.map-type-secret { background: rgba(155, 89, 182, 0.15); color: #9b59b6; }

/* === Map Tree View (Index) === */
.maps-tree-item {
  padding: 0.25rem 0;
}

.maps-tree-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.maps-tree-item:last-child > .maps-tree-row {
  border-bottom: none;
}

.maps-tree-child {
  border-left: 2px solid var(--border);
  padding-left: 0.75rem;
}

.maps-tree-thumb {
  flex-shrink: 0;
  width: 50px;
  height: 35px;
}

.maps-tree-thumb img {
  width: 50px;
  height: 35px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.maps-tree-placeholder {
  width: 50px;
  height: 35px;
  background: var(--bg-input);
  border-radius: 4px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.maps-tree-info {
  flex: 1;
  min-width: 0;
}

.maps-tree-name {
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
  display: block;
}

.maps-tree-name:hover {
  color: var(--gold-bright);
}

.maps-tree-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.maps-tree-actions {
  flex-shrink: 0;
}

/* === Map Add Tabs === */
.map-add-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.map-add-tab {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.map-add-tab:hover {
  color: var(--text-primary);
}

.map-add-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* === Child Map Pins === */
.map-child-pin {
  background: none !important;
  border: none !important;
}

.map-child-pin-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.2s;
}

.map-child-pin-icon:hover {
  transform: scale(1.15);
}

/* === Character Tokens === */
.map-token {
  background: none !important;
  border: none !important;
}

.map-token-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.map-token-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  box-shadow: 0 0 6px rgba(212, 168, 67, 0.4);
  object-fit: cover;
  background: var(--bg-card);
}

.map-token-no-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  background: var(--bg-darker);
}

.map-token-label {
  font-size: 0.6rem;
  color: #fff;
  background: rgba(0,0,0,0.7);
  padding: 0 4px;
  border-radius: 3px;
  white-space: nowrap;
  text-align: center;
  line-height: 1.3;
}

/* === Token Picker Modal === */
.token-picker-modal {
  margin-top: 1rem;
}

.token-picker-list {
  max-height: 60vh;
  overflow-y: auto;
}

.token-picker-group {
  margin-bottom: 0.75rem;
}

.token-picker-group-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  margin-bottom: 0.25rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--border);
}

.token-picker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-primary);
  text-align: left;
  transition: background 0.2s, border-color 0.2s;
}

.token-picker-item:hover:not(.disabled) {
  background: rgba(212, 168, 67, 0.1);
  border-color: var(--gold-dim);
}

.token-picker-item.disabled {
  opacity: 0.5;
  cursor: default;
}

.token-picker-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.token-picker-no-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
}

.token-picker-name {
  flex: 1;
  font-size: 0.9rem;
}

.token-picker-placed {
  font-size: 0.7rem;
  color: var(--green-light);
  padding: 0.1rem 0.4rem;
  background: rgba(39, 174, 96, 0.15);
  border-radius: 999px;
}

/* === Token Conditions === */
.token-conditions {
  position: absolute;
  right: -6px;
  top: -4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  pointer-events: none;
  z-index: 10;
}

.token-condition-badge {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  line-height: 1;
  border: 1px solid rgba(0,0,0,0.4);
  box-shadow: 0 0 4px rgba(0,0,0,0.3);
  animation: conditionPulse 2s ease-in-out infinite;
}

.token-condition-badge.cond-enter {
  animation: conditionEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, conditionPulse 2s ease-in-out infinite 0.7s;
}

.token-condition-overflow {
  background: rgba(0,0,0,0.7) !important;
  color: #fff;
  font-size: 7px;
  font-weight: 700;
}

.map-token-avatar.has-conditions {
  animation: conditionGlow 2s ease-in-out infinite;
}

@keyframes conditionEntrance {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  50% { transform: scale(1.4) rotate(10deg); opacity: 1; }
  70% { transform: scale(0.9) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes conditionPulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 4px rgba(0,0,0,0.3); }
  50% { opacity: 0.5; transform: scale(1.25); box-shadow: 0 0 8px rgba(255,255,255,0.3); }
}

@keyframes conditionGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(212, 168, 67, 0.4); }
  50% { box-shadow: 0 0 12px var(--condition-color, rgba(212, 168, 67, 0.8)), 0 0 20px var(--condition-color, rgba(212, 168, 67, 0.4)); }
}

/* Popup condition badges */
.token-popup-conditions {
  border-top: 1px solid var(--border);
  padding-top: 0.3rem;
}

.token-popup-cond-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.65rem;
  color: #fff;
  white-space: nowrap;
}

.token-popup-cond-remove {
  cursor: pointer;
  font-weight: 700;
  margin-left: 2px;
  opacity: 0.7;
}
.token-popup-cond-remove:hover {
  opacity: 1;
}

/* === Token Scale Panel === */
.token-scale-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 0.75rem;
  width: 200px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.token-scale-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--gold);
}

.token-scale-panel-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  line-height: 1;
}
.token-scale-panel-close:hover {
  color: var(--text-primary);
}

.token-scale-panel-body {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.token-scale-panel-body input[type="range"] {
  flex: 1;
}

#token-scale-value {
  font-size: 0.8rem;
  color: var(--gold);
  min-width: 2.5rem;
  text-align: right;
}

.scale-step-btn.active {
  background: var(--gold) !important;
  color: var(--bg-card) !important;
  border-color: var(--gold) !important;
}

/* === Condition Picker Overlay === */
.condition-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.condition-picker-card {
  max-width: 340px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.condition-picker-search {
  padding: 0.4rem 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.condition-picker-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.condition-picker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem 0.5rem;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-primary);
  text-align: left;
  font-size: 0.85rem;
  transition: background 0.2s, border-color 0.2s;
}
.condition-picker-item:hover:not(.disabled) {
  background: rgba(212, 168, 67, 0.1);
  border-color: var(--gold-dim);
}
.condition-picker-item.disabled {
  opacity: 0.5;
  cursor: default;
}

.condition-picker-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

/* === Fog of War === */
.fog-toolbar {
  position: fixed;
  top: 80px;
  left: 20px;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 0.75rem;
  width: 210px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.fog-toolbar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--gold);
}

.fog-toolbar-body .btn.active {
  background: var(--gold) !important;
  color: var(--bg-darker) !important;
  border-color: var(--gold) !important;
}

.fog-overlay-canvas {
  pointer-events: none;
}

/* === Combat Tracker Panel === */
.combat-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10001;
  background: var(--bg-card);
  border: 2px solid #c0392b;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  min-width: 280px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}
.combat-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(135deg, #2c1810 0%, #1a0f08 100%);
  border-bottom: 1px solid #c0392b;
  border-radius: var(--radius) var(--radius) 0 0;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: #e74c3c;
  cursor: move;
  user-select: none;
}
.combat-panel-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.combat-panel-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  line-height: 1;
}
.combat-panel-close-btn:hover { color: #e74c3c; }
.combat-panel-body {
  overflow-y: auto;
  max-height: 50vh;
  padding: 0.25rem 0;
}
.combat-panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-top: 1px solid var(--border);
  gap: 0.35rem;
}

/* Combat Participant Row */
.combat-panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.75rem;
  border-left: 3px solid transparent;
  transition: background 0.2s, border-color 0.2s;
  gap: 0.4rem;
}
.combat-panel-row:hover { background: rgba(255,255,255,0.03); }
.combat-panel-row.active {
  border-left-color: #f1c40f;
  background: rgba(241, 196, 15, 0.08);
}
.combat-row-left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}
.combat-row-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.combat-turn-arrow {
  color: #f1c40f;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.combat-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.combat-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-darker);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
}
.combat-row-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.combat-row-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.combat-init-display {
  font-size: 0.65rem;
  color: var(--text-secondary);
}
.combat-initiative-input {
  width: 50px;
  padding: 0.15rem 0.3rem;
  font-size: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-primary);
  font-family: 'Crimson Text', serif;
}

/* HP inline controls */
.combat-hp-inline {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.combat-hp-btn {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--bg-darker);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.combat-hp-btn:hover { border-color: var(--gold); color: var(--gold); }
.combat-hp-val {
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Legendary actions */
.combat-legendary {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.7rem;
  color: #f1c40f;
}
.combat-leg-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--text-secondary);
  padding: 0 0.1rem;
}
.combat-leg-btn:hover { color: #f1c40f; }

/* Conditions in combat panel */
.combat-conditions {
  display: flex;
  gap: 0.15rem;
  flex-wrap: wrap;
}
.combat-condition-badge {
  font-size: 0.6rem;
  padding: 0.05rem 0.2rem;
  border-radius: 3px;
  background: var(--bg-darker);
  color: var(--text-secondary);
  white-space: nowrap;
}
.combat-condition-badge sub {
  font-size: 0.5rem;
  color: #f1c40f;
}

/* Remove from combat */
.combat-remove-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.1rem;
  opacity: 0.5;
}
.combat-remove-btn:hover { color: #e74c3c; opacity: 1; }

/* Selection mode items */
.combat-sel-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Selection mode — crosshair cursor */
.combat-selection-mode {
  cursor: crosshair !important;
}
.combat-selection-mode * {
  cursor: crosshair !important;
}

/* Selected token highlight — pulsing gold border */
.combat-selected-token {
  animation: combat-select-pulse 1s ease-in-out infinite;
  filter: drop-shadow(0 0 6px #f1c40f) drop-shadow(0 0 12px #f1c40f80);
}
@keyframes combat-select-pulse {
  0%, 100% { filter: drop-shadow(0 0 4px #f1c40f) drop-shadow(0 0 8px #f1c40f60); }
  50% { filter: drop-shadow(0 0 8px #f1c40f) drop-shadow(0 0 16px #f1c40fa0); }
}

/* Active token indicator on map */
.combat-active-indicator {
  background: none !important;
  border: none !important;
}
.combat-active-ring {
  border: 3px solid #f1c40f;
  border-radius: 50%;
  animation: combat-ring-pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 12px #f1c40f80, inset 0 0 8px #f1c40f40;
}
@keyframes combat-ring-pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* Fullscreen mode: elevate combat panel z-index */
.map-fullscreen ~ .combat-panel,
body.map-fs-active .combat-panel {
  z-index: 10003 !important;
}

/* Responsive: mobile combat panel */
@media (max-width: 768px) {
  .combat-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    min-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 45vh;
  }
}

/* === Map Drag & Drop Reparenting === */
.maps-tree-item[draggable="true"] {
  cursor: grab;
}
.maps-tree-item.dragging {
  opacity: 0.4;
}
.maps-tree-item.drag-over > .maps-tree-row {
  outline: 2px dashed var(--green-light, #2ecc71);
  outline-offset: -2px;
  background: rgba(46, 204, 113, 0.08);
  border-radius: var(--radius);
}

/* === NPC Tokens === */
.map-npc-token-avatar {
  border-color: #c0392b !important;
  box-shadow: 0 0 6px rgba(192, 57, 43, 0.5) !important;
}

.npc-hp-bar {
  height: 4px;
  background: rgba(0,0,0,0.5);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 1px;
}

.npc-hp-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.npc-token-label {
  background: rgba(139, 0, 0, 0.8) !important;
}

.npc-hidden-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  font-size: 10px;
  z-index: 11;
  background: rgba(0,0,0,0.7);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-token.npc-hidden {
  opacity: 0.5;
}
.npc-dead-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  z-index: 12;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.8));
  pointer-events: none;
}
.map-token.npc-dead .map-token-avatar,
.map-token.npc-dead .map-npc-token-avatar {
  filter: grayscale(80%) brightness(0.6);
}
.map-token.npc-dead .npc-token-label {
  background: rgba(80, 80, 80, 0.8) !important;
  text-decoration: line-through;
}
.map-loot-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 20, 10, 0.95);
  color: var(--gold-bright);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-family: 'Crimson Text', serif;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.map-loot-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === Loot Chest Markers === */
.map-chest-token {
  background: none !important;
  border: none !important;
}
.chest-marker-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.chest-icon {
  width: 32px;
  height: 28px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
  animation: chest-glow 2s ease-in-out infinite;
}
.chest-icon svg {
  width: 100%;
  height: 100%;
}
@keyframes chest-glow {
  0%, 100% { filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6)); }
  50% { filter: drop-shadow(0 0 8px rgba(212,168,67,0.6)); }
}
/* Chest icon in toolbar buttons */
.chest-btn-icon {
  display: inline-block;
  width: 16px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 64 48' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='6' y='22' width='52' height='24' rx='2' fill='%235C2E0E' stroke='%233A1A06' stroke-width='1.5'/%3E%3Cline x1='10' y1='28' x2='54' y2='28' stroke='%234A2508' stroke-width='0.5' opacity='0.5'/%3E%3Cline x1='10' y1='34' x2='54' y2='34' stroke='%234A2508' stroke-width='0.5' opacity='0.5'/%3E%3Cpath d='M6 22 Q6 8 32 6 Q58 8 58 22 Z' fill='%237B3F19' stroke='%233A1A06' stroke-width='1.5'/%3E%3Crect x='4' y='20' width='56' height='5' rx='1' fill='%23C5952B' stroke='%238B6914' stroke-width='0.8'/%3E%3Ccircle cx='12' cy='22.5' r='1.2' fill='%23E8C252'/%3E%3Ccircle cx='52' cy='22.5' r='1.2' fill='%23E8C252'/%3E%3Crect x='4' y='38' width='56' height='4' rx='1' fill='%23C5952B' stroke='%238B6914' stroke-width='0.6'/%3E%3Crect x='26' y='19' width='12' height='14' rx='2' fill='%23C5952B' stroke='%238B6914' stroke-width='0.8'/%3E%3Ccircle cx='32' cy='26' r='2' fill='%233A1A06'/%3E%3Crect x='31' y='27' width='2' height='3' rx='0.5' fill='%233A1A06'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  vertical-align: middle;
}
.fs-chest-icon {
  width: 18px;
  height: 16px;
}
.chest-label {
  font-size: 0.65rem;
  color: var(--gold-bright);
  background: rgba(20, 15, 8, 0.85);
  padding: 0 4px;
  border-radius: 2px;
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: -2px;
}
.chest-hidden-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  font-size: 10px;
  z-index: 11;
  background: rgba(0,0,0,0.7);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-chest-token.chest-hidden {
  opacity: 0.5;
}
.chest-editor-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chest-editor {
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 420px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  color: var(--text-primary);
}
.chest-editor h3 {
  margin: 0 0 1rem;
  color: var(--gold);
}
.chest-editor input, .chest-editor textarea, .chest-editor select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 0.3rem 0.5rem;
  font-family: 'Crimson Text', serif;
  font-size: 0.9rem;
  width: 100%;
}
.chest-editor input[type="number"] {
  width: auto;
}
.chest-editor input[type="checkbox"] {
  width: auto;
}
/* Chest item autocomplete dropdown */
.chest-item-suggest {
  position: absolute;
  z-index: 10010;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  max-height: 160px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  min-width: 200px;
}
.chest-item-suggest-item {
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.chest-item-suggest-item:hover {
  background: rgba(212, 168, 67, 0.15);
}
.chest-item-suggest-rarity {
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  background: rgba(212, 168, 67, 0.2);
  color: var(--gold);
  white-space: nowrap;
}

/* Map detail modal (items & creatures) */
.map-detail-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.map-detail-content {
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
}
.map-detail-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
}
.map-detail-close:hover {
  color: var(--gold);
}
.map-detail-loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

#place-chest-btn.active,
#fs-chest-btn.active {
  background: rgba(212, 168, 67, 0.25);
  border-color: var(--gold) !important;
}

/* === NPC Sidebar === */
.npc-sidebar {
  position: absolute;
  left: 0;
  top: 0;
  width: 200px;
  height: 100%;
  background: rgba(26, 26, 46, 0.95);
  border-right: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(4px);
}
.npc-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: #e74c3c;
  border-bottom: 1px solid var(--border);
}
.npc-sidebar-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.2rem;
}
.npc-sidebar-close:hover { color: var(--text-primary); }
.npc-sidebar-search {
  width: 100%;
  padding: 0.3rem 0.5rem;
  background: var(--bg-input);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.75rem;
  outline: none;
}
.npc-sidebar-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.npc-sidebar-list::-webkit-scrollbar { width: 6px; }
.npc-sidebar-list::-webkit-scrollbar-track { background: transparent; }
.npc-sidebar-list::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }
.npc-sidebar-list::-webkit-scrollbar-thumb:hover { background: var(--gold); }
.npc-sidebar-cat-header {
  padding: 0.3rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border);
}
.npc-sidebar-cat-header.collapsed { opacity: 0.6; }
.npc-sidebar-cat-parent { font-weight: 700; }
.npc-sidebar-subcat-header {
  background: rgba(212, 175, 55, 0.04);
  color: var(--text-primary);
  font-weight: 600;
  border-left: 2px solid var(--gold-dim);
}
.npc-sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem;
  cursor: grab;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.npc-sidebar-item:hover { background: rgba(212, 175, 55, 0.1); }
.npc-sidebar-name {
  font-size: 0.75rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* === Multi-Select Token Highlight === */
.token-multi-selected {
  filter: brightness(1.2);
}
.token-multi-selected .map-token-wrapper::after {
  content: '✓';
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: #3498db;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: white;
  z-index: 12;
  border: 1px solid white;
}

/* Make token wrapper relative for condition badges */
.map-token-wrapper {
  position: relative;
}

/* === Loot Styles === */
.loot-quest-card {
  border: 2px solid var(--gold-dim) !important;
  background: rgba(212, 168, 67, 0.05);
}

.loot-quest-card:hover {
  border-color: var(--gold) !important;
}

.loot-table {
  font-size: 0.9rem;
}

.loot-category-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-family: var(--font-heading);
}

.loot-cat-weapon { background: rgba(192, 57, 43, 0.2); color: #e74c3c; }
.loot-cat-armor { background: rgba(41, 128, 185, 0.2); color: #3498db; }
.loot-cat-potion { background: rgba(39, 174, 96, 0.2); color: #2ecc71; }
.loot-cat-quest { background: rgba(212, 168, 67, 0.2); color: var(--gold); }
.loot-cat-gold { background: rgba(243, 156, 18, 0.2); color: var(--yellow-light); }
.loot-cat-item { background: rgba(142, 68, 173, 0.2); color: #bb86fc; }

.loot-add-form form {
  margin-top: 0.5rem;
}

.loot-holder {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* === Analytics Styles === */
.analytics-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.analytics-stat-card {
  text-align: center;
  padding: 1rem;
}

.analytics-stat-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--gold);
  line-height: 1.2;
}

.analytics-stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.analytics-stat-sublabel {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.analytics-chart-card {
  padding: 1.25rem;
}

.analytics-chart-card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.analytics-chart-card canvas {
  max-height: 280px;
}

.analytics-streak {
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

.analytics-section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gold);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.analytics-section-title:first-of-type {
  margin-top: 0.5rem;
}

.analytics-award-icon {
  font-size: 1.5rem;
  margin-bottom: 0.2rem;
}

.analytics-heatmap {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.analytics-heatmap th {
  padding: 0.4rem 0.5rem;
  color: var(--gold);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  font-size: 0.7rem;
}
.analytics-heatmap td {
  padding: 0.3rem 0.5rem;
  text-align: center;
}
.heatmap-username {
  text-align: left !important;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.heatmap-cell {
  width: 36px;
  min-width: 36px;
  font-weight: 700;
  border-radius: 4px;
}
.heatmap-available {
  background: rgba(39, 174, 96, 0.25);
  color: #27ae60;
}
.heatmap-maybe {
  background: rgba(230, 126, 34, 0.25);
  color: #e67e22;
}
.heatmap-unavailable {
  background: rgba(192, 57, 43, 0.25);
  color: #c0392b;
}
.heatmap-none {
  color: var(--text-muted);
  opacity: 0.3;
}

.analytics-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

/* === Map Fullscreen === */
.map-fullscreen {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999;
  border-radius: 0 !important;
  border: none !important;
  margin: 0;
  padding: 0 !important;
  box-shadow: none !important;
  background: var(--bg-darker);
}

.map-fullscreen .map-container {
  height: 100vh !important;
  border-radius: 0;
}

.map-fullscreen .map-hint {
  display: none;
}

.map-fullscreen-close {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1001;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--bg-card);
  color: var(--gold);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.map-fullscreen .map-fullscreen-close {
  display: flex;
}

/* Fullscreen floating toolbar */
.map-fs-toolbar {
  display: none;
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1002;
  background: rgba(20, 15, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  gap: 0.25rem;
  align-items: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.map-fullscreen .map-fs-toolbar {
  display: flex;
}
.map-fs-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: 'Crimson Text', serif;
  transition: all 0.2s;
  white-space: nowrap;
}
.map-fs-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
  border-color: var(--gold);
}
.map-fs-btn svg {
  flex-shrink: 0;
}
/* Collapse button */
.map-fs-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
  transition: all 0.2s;
  flex-shrink: 0;
}
.map-fs-collapse-btn:hover {
  color: var(--gold);
  background: rgba(212, 175, 55, 0.15);
}
.map-fs-toolbar-inner {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  overflow: hidden;
  transition: max-width 0.3s ease, opacity 0.2s ease;
}
.map-fs-toolbar.collapsed .map-fs-toolbar-inner {
  max-width: 0;
  opacity: 0;
  pointer-events: none;
}
.map-fs-toolbar.collapsed {
  padding: 0.35rem;
  gap: 0;
}
.map-fs-toolbar.collapsed .map-fs-collapse-btn {
  font-size: 1rem;
}
/* Draggable cursor */
.map-fs-toolbar.dragging {
  opacity: 0.85;
  cursor: grabbing;
}

.map-fs-btn-npc {
  color: #e74c3c;
}
.map-fs-btn-npc:hover {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  border-color: #c0392b;
}

/* Modals and panels visible above fullscreen */
.map-fullscreen ~ .token-picker-modal,
.map-fullscreen ~ .token-scale-panel,
.map-fullscreen ~ .fog-toolbar {
  z-index: 1003 !important;
}
body.map-fs-active .token-picker-modal {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 1003 !important;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}
body.map-fs-active .token-scale-panel {
  z-index: 1003 !important;
}
body.map-fs-active .fog-toolbar {
  z-index: 1003 !important;
}

/* === DM Tools === */
.dm-tools-size-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.dm-tools-size-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-right: 0.25rem;
}

.dm-tools-size-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.dm-tools-size-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.dm-tools-size-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
}

.dm-tools-grid {
  display: grid;
  gap: 1rem;
}

/* Default = 64 */
.dm-tools-grid,
.dm-tools-grid.dm-tools-size-64 {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.dm-tools-grid.dm-tools-size-16 {
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 0.5rem;
}

.dm-tools-grid.dm-tools-size-32 {
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.65rem;
}

.dm-tools-grid.dm-tools-size-128 {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}

.dm-tool-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}

.dm-tool-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
}

.dm-tool-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.5rem 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  gap: 0.4rem;
}

.dm-tool-icon {
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(212, 168, 67, 0.1);
}

.dm-tool-icon svg {
  display: block;
}

.dm-tool-name {
  font-family: var(--font-heading);
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}

.dm-tool-thumb {
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* Size-specific icon/thumb/name dimensions */
/* 64px (default) */
.dm-tools-grid .dm-tool-icon,
.dm-tools-grid.dm-tools-size-64 .dm-tool-icon {
  width: 64px; height: 64px;
}
.dm-tools-grid .dm-tool-icon svg,
.dm-tools-grid.dm-tools-size-64 .dm-tool-icon svg {
  width: 28px; height: 28px;
}
.dm-tools-grid .dm-tool-thumb,
.dm-tools-grid.dm-tools-size-64 .dm-tool-thumb {
  width: 64px; height: 64px;
}
.dm-tools-grid .dm-tool-name,
.dm-tools-grid.dm-tools-size-64 .dm-tool-name {
  font-size: 0.85rem;
}

/* 16px */
.dm-tools-size-16 .dm-tool-link {
  padding: 0.5rem 0.25rem 0.25rem;
  gap: 0.2rem;
}
.dm-tools-size-16 .dm-tool-icon {
  width: 16px; height: 16px; border-radius: 4px;
}
.dm-tools-size-16 .dm-tool-icon svg {
  width: 10px; height: 10px;
}
.dm-tools-size-16 .dm-tool-thumb {
  width: 16px; height: 16px; border-radius: 4px;
}
.dm-tools-size-16 .dm-tool-name {
  font-size: 0.65rem;
}
.dm-tools-size-16 .dm-tool-actions {
  padding: 0 0.25rem 0.25rem;
}
.dm-tools-size-16 .dm-tool-actions .btn {
  font-size: 0.65rem; padding: 0.1rem 0.4rem;
}

/* 32px */
.dm-tools-size-32 .dm-tool-link {
  padding: 0.6rem 0.35rem 0.35rem;
  gap: 0.25rem;
}
.dm-tools-size-32 .dm-tool-icon {
  width: 32px; height: 32px; border-radius: 8px;
}
.dm-tools-size-32 .dm-tool-icon svg {
  width: 16px; height: 16px;
}
.dm-tools-size-32 .dm-tool-thumb {
  width: 32px; height: 32px; border-radius: 8px;
}
.dm-tools-size-32 .dm-tool-name {
  font-size: 0.75rem;
}
.dm-tools-size-32 .dm-tool-actions .btn {
  font-size: 0.7rem; padding: 0.15rem 0.5rem;
}

/* 128px */
.dm-tools-size-128 .dm-tool-link {
  padding: 1.25rem 0.75rem 0.75rem;
  gap: 0.5rem;
}
.dm-tools-size-128 .dm-tool-icon {
  width: 128px; height: 128px; border-radius: 16px;
}
.dm-tools-size-128 .dm-tool-icon svg {
  width: 56px; height: 56px;
}
.dm-tools-size-128 .dm-tool-thumb {
  width: 128px; height: 128px; border-radius: 16px;
}
.dm-tools-size-128 .dm-tool-name {
  font-size: 1.05rem;
}

.dm-tool-actions {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  padding: 0 0.5rem 0.75rem;
}

/* === What's New Modal === */
.whatsnew-modal {
  max-width: 520px;
  text-align: left;
}

.whatsnew-modal h2 {
  text-align: center;
}

.whatsnew-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
}

.whatsnew-list li {
  padding: 0.4rem 0;
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.4;
}

.whatsnew-list li::before {
  content: '\2726';
  position: absolute;
  left: 0;
  color: var(--gold);
}

.whatsnew-links {
  display: flex;
  justify-content: center;
  margin: 0.75rem 0 0;
}

.whatsnew-support {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.whatsnew-support img {
  height: 28px;
  border-radius: 4px;
}

.whatsnew-content {
  max-height: 220px;
  overflow-y: auto;
}

/* === Character Sheet === */
.sheet-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}

.sheet-tab {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 1rem;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
  margin-bottom: -2px;
  outline: none;
  white-space: nowrap;
}

.sheet-tab:hover {
  color: var(--gold);
}

.sheet-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.sheet-panel {
  display: none;
}

.sheet-panel.active {
  display: block;
}

.sheet-header-grid {
  display: -webkit-grid;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .sheet-header-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.sheet-header-grid input[type="text"] {
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.sheet-header-grid input:disabled {
  opacity: 0.85;
  cursor: default;
}

.sheet-main-grid {
  display: -webkit-grid;
  display: grid;
  grid-template-columns: 180px 260px 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .sheet-main-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.sheet-col h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.sheet-ability-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.5rem;
}

.sheet-ability-label {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 0.8rem;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.sheet-ability-score {
  width: 48px;
  text-align: center;
  padding: 0.25rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
}

.sheet-ability-mod {
  width: 40px;
  text-align: center;
  padding: 0.25rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--gold);
  font-size: 0.85rem;
}

.sheet-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.sheet-section-header label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.sheet-small-input {
  width: 48px;
  text-align: center;
  padding: 0.2rem 0.3rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.sheet-save-row,
.sheet-skill-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0;
  font-size: 0.82rem;
}

.sheet-save-row span,
.sheet-skill-row span {
  color: var(--text-primary);
}

.sheet-skill-row small {
  color: var(--text-secondary);
}

.sheet-combat-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.sheet-combat-box {
  flex: 1;
  text-align: center;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
}

.sheet-combat-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.sheet-combat-val {
  width: 100%;
  text-align: center;
  padding: 0.3rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 700;
}

.sheet-hp-section {
  margin-bottom: 1rem;
}

.sheet-hp-row {
  display: flex;
  gap: 0.75rem;
}

.sheet-hp-row .form-group {
  flex: 1;
}

.sheet-hp-section input[type="text"] {
  width: 100%;
  padding: 0.35rem 0.5rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.sheet-textarea {
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  resize: vertical;
}

.sheet-textarea:focus,
.sheet-header-grid input:focus,
.sheet-ability-score:focus,
.sheet-ability-mod:focus,
.sheet-small-input:focus,
.sheet-combat-val:focus,
.sheet-hp-section input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.25);
}

.sheet-textarea:disabled,
.sheet-ability-score:disabled,
.sheet-ability-mod:disabled,
.sheet-small-input:disabled,
.sheet-combat-val:disabled,
.sheet-hp-section input:disabled {
  opacity: 0.85;
  cursor: default;
}

.sheet-attacks {
  margin-bottom: 1rem;
}

.sheet-attack-header {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.25rem;
  padding: 0 0.1rem;
}

.sheet-attack-row {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.sheet-attack-row input {
  width: 100%;
  padding: 0.25rem 0.4rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.82rem;
}

.sheet-attack-row input:focus {
  outline: none;
  border-color: var(--gold);
}

.sheet-attack-row input:disabled {
  opacity: 0.85;
  cursor: default;
}

.sheet-currency-row {
  display: flex;
  gap: 0.5rem;
}

.sheet-currency-box {
  flex: 1;
  text-align: center;
}

.sheet-currency-box label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--gold);
  margin-bottom: 0.2rem;
}

.sheet-currency-box input {
  width: 100%;
  text-align: center;
  padding: 0.3rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.sheet-currency-box input:focus {
  outline: none;
  border-color: var(--gold);
}

.sheet-currency-box input:disabled {
  opacity: 0.85;
  cursor: default;
}

.sheet-save-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg-darker);
  border-top: 2px solid var(--gold-dim);
  padding: 0.75rem 1rem;
  text-align: center;
  margin-top: 2rem;
  z-index: 50;
}

.sheet-spell-level {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.sheet-spell-level:last-child {
  border-bottom: none;
}

.sheet-spell-level-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.sheet-slots-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.sheet-spell-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.25rem;
}

.sheet-spell-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sheet-spell-row input[type="text"] {
  flex: 1;
  padding: 0.2rem 0.4rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.82rem;
}

.sheet-spell-row input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
}

.sheet-spell-row input:disabled {
  opacity: 0.85;
  cursor: default;
}

/* === Responsive === */
@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 1.6rem; }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .session-grid {
    grid-template-columns: 1fr;
  }

  .slot-row {
    flex-wrap: wrap;
  }

  .slot-row input[type="datetime-local"],
  .slot-row input[type="date"],
  .slot-row input[type="text"],
  .slot-row .time-select {
    flex: 1 1 100%;
  }

  .vote-options {
    flex-direction: column;
  }

  .confirm-form {
    flex-direction: column;
    align-items: stretch;
  }

  .hamburger-menu {
    position: fixed;
    top: 56px;
    right: 0;
    left: 0;
    width: 100%;
    border-radius: 0;
    margin-top: 0;
    z-index: 1000;
  }

  .notif-dropdown {
    position: fixed;
    top: 56px;
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    max-width: 100vw;
    z-index: 1001;
  }

  .analytics-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .analytics-charts-row {
    grid-template-columns: 1fr;
  }

  .analytics-chart-card canvas {
    max-height: 220px;
  }

  .map-container {
    height: 350px;
  }

  .sheet-header-grid {
    grid-template-columns: 1fr;
  }

  .sheet-main-grid {
    grid-template-columns: 1fr;
  }

  .sheet-spell-list {
    grid-template-columns: 1fr;
  }
}

/* === PWA Page === */
.pwa-benefits {
  padding-left: 1.25rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.pwa-platform {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.pwa-platform:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.pwa-platform h3 {
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.pwa-platform ol {
  padding-left: 1.25rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* === Characters Grid (Profile) === */
.characters-grid {
  display: -webkit-box;
  display: -webkit-flex;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.character-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  -webkit-border-radius: var(--radius);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  -webkit-transition: border-color 0.2s, transform 0.2s;
  transition: border-color 0.2s, transform 0.2s;
  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.character-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
}

.character-card-avatar {
  margin-bottom: 0.5rem;
}

.character-card-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid var(--border);
}

.character-card-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: var(--gold);
}

.character-card-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}

.character-card-meta {
  font-size: 0.75rem;
  color: var(--gold-dim);
  margin-bottom: 0.25rem;
  font-style: italic;
}

.character-card-actions {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.character-card-public .character-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  text-align: left;
}

.character-card-public .character-card-desc p {
  margin: 0.25rem 0;
}

/* Character detail page */
.character-detail-card {
  margin-bottom: 1.5rem;
}

.character-detail-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.character-detail-avatar {
  width: 128px;
  height: 128px;
  border-radius: 12px;
  object-fit: cover;
  border: 3px solid var(--gold-dim);
  flex-shrink: 0;
}

.character-detail-avatar-placeholder {
  width: 128px;
  height: 128px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 3px solid var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: bold;
  color: var(--gold);
  flex-shrink: 0;
}

.character-detail-meta {
  font-size: 0.95rem;
  color: var(--gold-dim);
  font-style: italic;
  margin-bottom: 0.25rem;
}

/* Clickable character card link */
a.character-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

a.character-card-link:hover .character-card {
  border-color: var(--gold);
  transform: translateY(-2px);
}

a.character-card-link:hover .character-card-name {
  color: var(--gold);
}

/* === Inline Character Creation (Phase 4.3) === */
.inline-char-form-wrapper {
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.08) 0%, rgba(212, 168, 67, 0.03) 100%);
  border: 2px dashed var(--gold-dim);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.inline-char-form-wrapper:hover {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.12) 0%, rgba(212, 168, 67, 0.05) 100%);
}

.inline-char-quick {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.inline-char-details {
  margin-top: 1rem;
}

.inline-char-details summary {
  cursor: pointer;
  color: var(--gold);
  font-size: 0.9rem;
  user-select: none;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}

.inline-char-details summary:hover {
  color: var(--gold-bright);
}

.inline-char-details[open] summary {
  margin-bottom: 1rem;
}

.inline-char-details-content {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .inline-char-quick {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-char-quick .form-group {
    margin-bottom: 1rem !important;
  }

  .inline-char-quick button {
    align-self: stretch !important;
  }
}

/* Profile card layout */
.profile-card-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.profile-avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold-dim);
}

.profile-avatar-lg-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 3px solid var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--gold);
}

.profile-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.profile-section h3 {
  color: var(--gold);
  margin-bottom: 0.75rem;
}

/* Profile Social Links */
.profile-socials {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-social-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.profile-social-item svg {
  flex-shrink: 0;
}

.profile-social-link {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s;
}

.profile-social-link:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

[data-theme="light"] .profile-social-item svg {
  opacity: 0.9;
}

@media (max-width: 600px) {
  .characters-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .character-card-img,
  .character-card-placeholder {
    width: 64px;
    height: 64px;
  }

  .profile-card-header {
    flex-direction: column;
    text-align: center;
  }

  .character-detail-header {
    flex-direction: column;
    text-align: center;
  }

  .character-detail-avatar,
  .character-detail-avatar-placeholder {
    width: 96px;
    height: 96px;
  }
}

/* === Spell Autocomplete === */
.spell-autocomplete-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.spell-autocomplete-wrapper input {
  width: 100%;
  box-sizing: border-box;
}

.spell-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.spell-autocomplete-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.spell-autocomplete-item:last-child {
  border-bottom: none;
}

.spell-autocomplete-item:hover,
.spell-autocomplete-item.selected {
  background: rgba(212, 168, 67, 0.15);
}

.spell-autocomplete-name {
  font-weight: 600;
  color: var(--gold-bright);
}

.spell-autocomplete-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

[data-theme="light"] .spell-autocomplete-dropdown {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="light"] .spell-autocomplete-item:hover,
[data-theme="light"] .spell-autocomplete-item.selected {
  background: rgba(139, 105, 20, 0.15);
}

/* Spell label (after selection) */
.spell-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: rgba(212, 168, 67, 0.15);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  min-height: 2rem;
}

.spell-label-link {
  flex: 1;
  color: var(--gold-bright);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
}

.spell-label-link:hover {
  text-decoration: underline;
}

.spell-label-clear {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.25rem;
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s;
}

.spell-label-clear:hover {
  opacity: 1;
  color: var(--red-light);
}

[data-theme="light"] .spell-label {
  background: rgba(139, 105, 20, 0.15);
}

[data-theme="light"] .spell-label-link {
  color: #5c3a10;
}

/* Spell Details Modal */
.spell-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.spell-modal {
  background: var(--bg-card);
  border: 2px solid var(--gold-dim);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.spell-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(212, 168, 67, 0.1);
}

.spell-modal-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--gold-bright);
  margin: 0;
}

.spell-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.spell-modal-close:hover {
  color: var(--text-primary);
}

.spell-modal-body {
  padding: 1.25rem;
}

.spell-source-header {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
  padding: 0.75rem 1rem;
  margin: -1.25rem -1.25rem 1.5rem -1.25rem;
  border-bottom: 2px solid var(--gold);
  border-radius: var(--radius) var(--radius) 0 0;
}

.spell-source-header .api-indicator {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  opacity: 0.8;
}

.spell-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.spell-modal-meta-item {
  color: var(--text-secondary);
}

.spell-modal-meta-item strong {
  color: var(--text-primary);
}

.spell-modal-desc {
  color: var(--text-primary);
  line-height: 1.6;
}

.spell-modal-desc p {
  margin: 0 0 0.75rem;
}

.spell-modal-desc table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
  font-size: 0.9rem;
  border: 1px solid var(--gold-dim);
  background: rgba(212, 168, 67, 0.05);
}

.spell-modal-desc th,
.spell-modal-desc td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border: 1px solid var(--gold-dim);
}

.spell-modal-desc th {
  background: rgba(212, 168, 67, 0.15);
  color: var(--gold-bright);
  font-weight: 600;
  font-family: var(--font-heading);
}

.spell-modal-desc td {
  color: var(--text-secondary);
}

.spell-modal-desc tr:nth-child(even) {
  background: rgba(212, 168, 67, 0.03);
}

.spell-modal-higher {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-style: italic;
  color: var(--text-secondary);
}

.spell-modal-classes {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

[data-theme="light"] .spell-modal {
  border-color: var(--border);
}

[data-theme="light"] .spell-modal-header {
  background: rgba(139, 105, 20, 0.15);
}

[data-theme="light"] .spell-modal-title {
  color: #5c3a10;
}

/* === D&D Data Modals (Classes, Races, etc.) === */
.dnd-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.dnd-modal {
  background: var(--bg-card);
  border: 2px solid var(--gold-dim);
  border-radius: var(--radius);
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s ease;
}

.dnd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(212, 168, 67, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}

.dnd-modal-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--gold-bright);
  margin: 0;
}

.dnd-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.dnd-modal-close:hover {
  color: var(--text-primary);
}

.dnd-modal-body {
  padding: 1.25rem;
}

.dnd-source-header {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
  padding: 0.75rem 1rem;
  margin: -1.25rem -1.25rem 1.5rem -1.25rem;
  border-bottom: 1px solid var(--gold-dim);
}

.dnd-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.dnd-modal-meta-item {
  color: var(--text-secondary);
}

.dnd-modal-meta-item strong {
  color: var(--gold-bright);
  font-weight: 600;
}

.dnd-modal-section {
  margin-bottom: 1.5rem;
}

.dnd-modal-section:last-child {
  margin-bottom: 0;
}

.dnd-modal-section h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gold);
  margin: 0 0 0.75rem 0;
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 0.5rem;
}

.dnd-modal-section p {
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0 0 0.75rem 0;
}

.dnd-modal-section p:last-child {
  margin-bottom: 0;
}

.dnd-indent {
  margin-left: 1.5rem;
  color: var(--text-secondary);
}

[data-theme="light"] .dnd-modal {
  border-color: var(--border);
}

[data-theme="light"] .dnd-modal-header {
  background: rgba(139, 105, 20, 0.15);
}

[data-theme="light"] .dnd-modal-title {
  color: #5c3a10;
}

/* D&D Class/Race Links */
.dnd-class-link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--gold-dim);
  transition: color 0.2s, text-decoration-color 0.2s;
}

.dnd-class-link:hover {
  color: var(--gold-bright);
  text-decoration-color: var(--gold-bright);
}

/* === The Vault of Ancient Lore === */
.vault-container {
  max-width: 1200px;
  margin: 0 auto;
}

.vault-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.vault-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.vault-tab:hover {
  border-color: var(--gold-dim);
  color: var(--text-primary);
}

.vault-tab.active {
  background: rgba(212, 168, 67, 0.15);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.vault-panel,
.vault-tab-content {
  display: none;
}

.vault-panel.active,
.vault-tab-content.active {
  display: block;
}

.vault-filters {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.vault-search {
  flex: 1;
  min-width: 200px;
  padding: 0.6rem 1rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.vault-search:focus {
  outline: none;
  border-color: var(--gold-dim);
}

.vault-filter-select {
  padding: 0.6rem 1rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
}

.vault-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.vault-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.vault-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.vault-card-magic {
  border-color: var(--gold-dim);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(212, 168, 67, 0.08) 100%);
}

.vault-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gold-bright);
  margin-bottom: 0.25rem;
}

.vault-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.vault-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.vault-spell-tags {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(212, 168, 67, 0.2);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.vault-loading,
.vault-empty,
.vault-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.vault-error {
  color: var(--red-light);
}

/* Vault Modal */
.vault-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.vault-modal {
  background: var(--bg-card);
  border: 2px solid var(--gold-dim);
  border-radius: var(--radius);
  max-width: 700px;
  width: 100%;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.vault-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(212, 168, 67, 0.1);
  position: sticky;
  top: 0;
  z-index: 1;
}

.vault-modal-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--gold-bright);
  margin: 0;
}

.vault-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.vault-modal-close:hover {
  color: var(--text-primary);
}

.vault-modal-body {
  padding: 1.25rem;
}

.vault-detail-source {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-style: italic;
}

.vault-source-header {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
  padding: 0.75rem 1rem;
  margin: -1.25rem -1.25rem 1.5rem -1.25rem;
  border-bottom: 2px solid var(--gold);
  border-radius: var(--radius) var(--radius) 0 0;
}

.api-indicator {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  opacity: 0.8;
}

.vault-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.vault-detail-meta strong {
  color: var(--text-primary);
}

.vault-detail-desc {
  color: var(--text-primary);
  line-height: 1.7;
}

.vault-detail-desc table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
  font-size: 0.9rem;
  border: 1px solid var(--gold-dim);
  background: rgba(212, 168, 67, 0.05);
}

.vault-detail-desc th,
.vault-detail-desc td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border: 1px solid var(--gold-dim);
}

.vault-detail-desc th {
  background: rgba(212, 168, 67, 0.15);
  color: var(--gold-bright);
  font-weight: 600;
  font-family: var(--font-heading);
}

.vault-detail-desc td {
  color: var(--text-secondary);
}

.vault-detail-desc tr:nth-child(even) {
  background: rgba(212, 168, 67, 0.03);
}

.vault-traits {
  margin-top: 0.5rem;
}

.vault-trait {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.vault-trait strong {
  color: var(--gold-bright);
}

.vault-feature-level {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(212, 168, 67, 0.2);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-right: 0.5rem;
}

.vault-higher-levels {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-style: italic;
  color: var(--text-secondary);
}

.vault-classes {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.vault-modal-body h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gold);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .vault-tab.active {
  background: rgba(139, 105, 20, 0.2);
}

[data-theme="light"] .vault-card-magic {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(139, 105, 20, 0.12) 100%);
}

[data-theme="light"] .vault-modal-header {
  background: rgba(139, 105, 20, 0.15);
}

[data-theme="light"] .vault-modal-title {
  color: #5c3a10;
}

@media (max-width: 600px) {
  .vault-tabs {
    flex-direction: column;
  }

  .vault-tab {
    text-align: center;
  }

  .vault-filters {
    flex-direction: column;
  }

  .vault-search {
    width: 100%;
  }

  .vault-results {
    grid-template-columns: 1fr;
  }
}

/* === D&D Beyond Style Cards === */
.dnd-card {
  font-family: 'Crimson Text', serif;
  line-height: 1.6;
  color: var(--text);
}

.dnd-title {
  font-family: 'MedievalSharp', cursive;
  font-size: 1.8rem;
  margin: 0 0 0.25rem 0;
  color: var(--primary);
}

.dnd-subtitle {
  font-style: italic;
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
}

.dnd-divider {
  border: none;
  border-top: 2px solid var(--primary);
  margin: 1rem 0;
  opacity: 0.3;
}

.dnd-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.dnd-stats p {
  margin: 0;
  font-size: 0.95rem;
}

.dnd-stats strong {
  display: block;
  color: var(--primary);
  font-family: 'MedievalSharp', cursive;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.dnd-section {
  font-family: 'MedievalSharp', cursive;
  font-size: 1.2rem;
  color: var(--primary);
  margin: 1rem 0 0.5rem 0;
}

.dnd-description {
  margin: 0.5rem 0;
}

.dnd-description p {
  margin: 0.75rem 0;
}

.dnd-tag {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: bold;
  margin-right: 0.25rem;
}

.dnd-small {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.dnd-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.dnd-table th,
.dnd-table td {
  padding: 0.5rem;
  text-align: left;
  border: 1px solid var(--border);
}

.dnd-table th {
  background: var(--primary);
  color: white;
  font-family: 'MedievalSharp', cursive;
  font-weight: normal;
}

.dnd-table tr:nth-child(even) {
  background: rgba(var(--primary-rgb), 0.05);
}

.dnd-source {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  font-style: italic;
}

.dnd-list {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.dnd-list li {
  margin: 0.25rem 0;
}


/* ============================================
   PHASE 1 - PREMIUM ENHANCEMENTS (2026-02-13)
   ============================================ */

/* === Enhanced Card Hover with Gold Line === */
.card {
  position: relative;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(42, 42, 62, 0.8) 100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 2px,
      rgba(212, 168, 67, 0.02) 2px,
      rgba(212, 168, 67, 0.02) 4px
    );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: var(--radius);
}

.card:hover::before {
  opacity: 1;
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius) var(--radius) 0 0;
}

.card:hover::after {
  transform: scaleX(1);
}

.card:hover {
  border-color: var(--gold-dim);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(212, 168, 67, 0.2),
    inset 0 1px 0 rgba(212, 168, 67, 0.1);
  transform: translateY(-4px);
}

[data-theme="light"] .card {
  background: linear-gradient(135deg, var(--bg-card) 0%, #e0d0a8 100%);
}

[data-theme="light"] .card:hover {
  box-shadow:
    0 8px 24px rgba(40, 25, 10, 0.18),
    0 0 0 1px rgba(139, 105, 20, 0.25),
    inset 0 1px 0 rgba(139, 105, 20, 0.1);
}

[data-theme="light"] .card::before {
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 2px,
      rgba(139, 105, 20, 0.03) 2px,
      rgba(139, 105, 20, 0.03) 4px
    );
}

/* Card entrance animation with stagger */
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: cardEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }

/* === 3. Page Entrance Animations === */
main {
  animation: pageEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  animation: fadeSlideUp 0.6s 0.1s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

h2 {
  animation: fadeSlideUp 0.6s 0.15s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === 4. Accessibility - Respect User Preferences === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   END PHASE 1 ENHANCEMENTS
   ============================================ */

/* ============================================
   PHASE 2.1 - QUICK POST SESSION CREATION
   ============================================ */

/* Title + Category Inline */
.quick-post-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-group-inline {
  flex: 1;
}

.form-group-category {
  width: 180px;
}

/* More Options Collapse */
.more-options {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  background: rgba(212, 168, 67, 0.03);
}

.more-options summary {
  padding: 1rem;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-heading);
  color: var(--gold);
  list-style: none;
  transition: all 0.2s;
}

.more-options summary::-webkit-details-marker {
  display: none;
}

.more-options summary:hover {
  background: rgba(212, 168, 67, 0.1);
  color: var(--gold-bright);
}

.more-options-content {
  padding: 0 1rem 1rem 1rem;
  border-top: 1px solid var(--border);
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
  .quick-post-header {
    grid-template-columns: 1fr;
  }

  .form-group-category {
    width: 100%;
  }
}


/* ============================================
   PHASE 2.3 - AUTO-SAVE PREFERENCES
   ============================================ */

.save-status {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
  transition: opacity 0.3s ease;
}

.save-status.saving {
  color: var(--yellow);
}

.save-status.saved {
  color: var(--green);
}

.save-status.error {
  color: var(--red);
}

.save-status .status-icon {
  font-style: normal;
}

/* Position status indicator inline with form controls */
.form-group {
  position: relative;
}

.form-group .save-status {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 0.85rem;
}

/* For radio/checkbox groups, position next to the label */
.form-group > .save-status {
  top: 0.25rem;
  right: 0;
}

/* === Premium DateTime Picker === */
.datetime-input {
  cursor: pointer;
  background: var(--bg-dark);
  border: 2px solid var(--gold-dim);
  color: var(--text);
  padding: 0.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  width: 100%;
}

.datetime-input:hover {
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.3);
}

.datetime-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.5);
}

/* Date-only picker uses same styling */
.date-only {
  cursor: pointer;
  background: var(--bg-dark);
  border: 2px solid var(--gold-dim);
  color: var(--text);
  padding: 0.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  width: 100%;
}

.date-only:hover {
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.3);
}

.date-only:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.5);
}

.datetime-picker {
  position: fixed;
  z-index: 10000;
  background: linear-gradient(135deg, rgba(45, 34, 28, 0.98), rgba(35, 26, 22, 0.98));
  backdrop-filter: blur(8px);
  border: 2px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8),
              0 0 0 1px rgba(212, 168, 67, 0.3),
              inset 0 1px 0 rgba(212, 168, 67, 0.15);
  padding: 1rem;
  min-width: 320px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.datetime-picker.visible {
  opacity: 1;
  transform: translateY(0);
}

.datetime-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gold-dim);
}

.picker-month-year {
  display: flex;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gold);
}

.picker-month-select,
.picker-year-select {
  background: var(--bg-dark);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-heading);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.picker-month-select {
  min-width: 120px;
}

.picker-year-select {
  min-width: 80px;
}

.picker-month-select:hover,
.picker-year-select:hover {
  border-color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
}

.picker-month-select:focus,
.picker-year-select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.4);
}

.picker-nav {
  background: var(--bg-dark);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  transition: all 0.2s ease;
}

.picker-nav:hover {
  background: var(--gold-dim);
  color: var(--bg-dark);
  transform: scale(1.1);
}

.datetime-picker-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.picker-day-name {
  text-align: center;
  font-size: 0.75rem;
  color: var(--gold-dim);
  font-family: var(--font-heading);
  padding: 0.25rem;
}

.datetime-picker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.picker-day {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-align: center;
}

.picker-day:hover:not(.other-month) {
  background: var(--gold-dim);
  color: var(--bg-dark);
  transform: scale(1.05);
}

.picker-day.selected {
  background: var(--gold);
  color: var(--bg-dark);
  font-weight: bold;
  border-color: var(--gold);
}

.picker-day.today {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px var(--gold-dim);
}

.picker-day.other-month {
  opacity: 0.3;
  cursor: default;
}

.datetime-picker-time {
  padding: 1rem 0;
  border-top: 2px solid var(--gold-dim);
  border-bottom: 2px solid var(--gold-dim);
  margin-bottom: 1rem;
}

.datetime-picker-time label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 0.9rem;
}

.time-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.time-input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.time-input {
  width: 3rem;
  height: 2.5rem;
  text-align: center;
  background: var(--bg-dark);
  border: 2px solid var(--gold-dim);
  color: var(--text);
  font-size: 1.2rem;
  font-family: var(--font-body);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.time-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.4);
}

.time-btn {
  background: var(--bg-dark);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  width: 3rem;
  height: 1.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.time-btn:hover {
  background: var(--gold-dim);
  color: var(--bg-dark);
}

.time-btn:active {
  transform: scale(0.95);
}

.time-separator {
  font-size: 1.5rem;
  color: var(--gold);
  font-weight: bold;
}

.ampm-select {
  background: var(--bg-dark);
  border: 2px solid var(--gold-dim);
  color: var(--text);
  padding: 0.5rem;
  border-radius: 4px;
  font-family: var(--font-body);
  cursor: pointer;
}

.datetime-picker-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.datetime-picker-footer .btn {
  flex: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .datetime-picker {
    min-width: unset;
    width: calc(100vw - 2rem);
    max-width: 320px;
    left: 50% !important;
    transform: translateX(-50%);
    font-size: 0.9rem;
    max-height: calc(100vh - 1rem);
    padding: 0.75rem;
  }

  .datetime-picker.visible {
    transform: translateX(-50%);
  }

  .picker-day {
    padding: 0.4rem;
    font-size: 0.8rem;
  }

  .time-input {
    width: 2.5rem;
    height: 2rem;
    font-size: 1rem;
  }

  .time-btn {
    width: 2.5rem;
    height: 1.25rem;
  }
}


/* ============================================================
   PHASE 3: PREMIUM POLISH - Toast Notifications
   ============================================================ */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  position: relative;
  min-width: 300px;
  max-width: 400px;
  padding: 1rem 3rem 1rem 1rem;
  background: linear-gradient(135deg, rgba(45, 34, 28, 0.98), rgba(35, 26, 22, 0.98));
  backdrop-filter: blur(8px);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(212, 168, 67, 0.3);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: bold;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
}

.toast-success .toast-icon {
  color: var(--green-light);
  background: rgba(46, 204, 113, 0.2);
  border: 2px solid var(--green-light);
}

.toast-error .toast-icon {
  color: var(--red-light);
  background: rgba(231, 76, 60, 0.2);
  border: 2px solid var(--red-light);
}

.toast-info .toast-icon {
  color: var(--gold-bright);
  background: rgba(212, 168, 67, 0.2);
  border: 2px solid var(--gold-bright);
}

.toast-message {
  flex: 1;
  color: var(--text-primary);
}

.toast-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: all 0.2s;
  opacity: 0.6;
}

.toast-close:hover {
  opacity: 1;
  color: var(--gold);
  transform: rotate(90deg);
}

/* Success toast accent */
.toast-success {
  border-color: var(--green-light);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(46, 204, 113, 0.3),
    0 0 20px rgba(46, 204, 113, 0.2);
}

/* Error toast accent */
.toast-error {
  border-color: var(--red-light);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(231, 76, 60, 0.3),
    0 0 20px rgba(231, 76, 60, 0.2);
}

/* Info toast accent */
.toast-info {
  border-color: var(--gold-bright);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(212, 168, 67, 0.3),
    0 0 20px rgba(212, 168, 67, 0.2);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .toast-container {
    left: 1rem;
    right: 1rem;
    top: 1rem;
  }

  .toast {
    min-width: unset;
    max-width: unset;
  }
}

/* ============================================================
   PHASE 3: PREMIUM POLISH - Floating Labels
   ============================================================ */

.form-group-floating {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-group-floating input,
.form-group-floating textarea,
.form-group-floating select {
  width: 100%;
  padding: 1rem 0.75rem 0.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-body);
  transition: all 0.3s;
}

.form-group-floating label {
  position: absolute;
  left: 0.75rem;
  top: 1rem;
  color: var(--text-secondary);
  font-size: 1rem;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform-origin: left top;
}

.form-group-floating input:focus,
.form-group-floating textarea:focus,
.form-group-floating select:focus {
  border-color: var(--gold);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px rgba(212, 168, 67, 0.15);
}

/* Float label when focused or has value */
.form-group-floating input:focus + label,
.form-group-floating input:not(:placeholder-shown) + label,
.form-group-floating textarea:focus + label,
.form-group-floating textarea:not(:placeholder-shown) + label,
.form-group-floating select:focus + label,
.form-group-floating select:not([value=""]) + label {
  top: 0.25rem;
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 600;
  transform: translateY(-0.25rem);
}

/* For select elements, check if not on default option */
.form-group-floating select:not(:focus):not([value=""]) + label,
.form-group-floating select:focus + label {
  top: 0.25rem;
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 600;
  transform: translateY(-0.25rem);
}

/* ============================================================
   PHASE 3: PREMIUM POLISH - Skeleton Loaders
   ============================================================ */

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 0%,
    var(--bg-card-hover) 50%,
    var(--bg-card) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: var(--radius);
}

.skeleton-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.skeleton-header {
  height: 1.5rem;
  width: 60%;
  margin-bottom: 1rem;
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.75rem;
}

.skeleton-text:last-child {
  width: 80%;
}

.skeleton-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.75rem;
}

.skeleton-btn {
  height: 2.5rem;
  width: 6rem;
  display: inline-block;
  margin-right: 0.5rem;
}

/* Session card skeleton */
.skeleton-session {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skeleton-session-title {
  height: 2rem;
  width: 70%;
}

.skeleton-session-meta {
  display: flex;
  gap: 1rem;
}

.skeleton-session-meta-item {
  height: 1.25rem;
  width: 5rem;
}

.skeleton-session-slots {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.skeleton-session-slot {
  height: 2.5rem;
  width: 100%;
}

/* Character card skeleton */
.skeleton-character {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
}

.skeleton-character-avatar {
  width: 6rem;
  height: 6rem;
  border-radius: var(--radius);
}

.skeleton-character-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-character-name {
  height: 1.5rem;
  width: 10rem;
}

.skeleton-character-class {
  height: 1rem;
  width: 8rem;
}

.skeleton-character-stats {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.skeleton-character-stat {
  height: 2rem;
  width: 3rem;
}

/* Post skeleton */
.skeleton-post {
  display: flex;
  gap: 1rem;
}

.skeleton-post-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-post-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skeleton-post-username {
  height: 1rem;
  width: 6rem;
}

.skeleton-post-time {
  height: 0.875rem;
  width: 4rem;
}

.skeleton-post-text {
  height: 1rem;
  width: 100%;
}

.skeleton-post-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.skeleton-post-action {
  height: 1.5rem;
  width: 3rem;
}

/* Pulsing animation for loading states */
@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.skeleton-pulse {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* Loading overlay */
.loading-overlay {
  position: relative;
  pointer-events: none;
}

.loading-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  z-index: 1;
}

/* ============================================
   PHASE 3: PREMIUM POLISH
   ============================================ */

/* === 3.3 TOAST NOTIFICATION SYSTEM === */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  pointer-events: none;
}

.toast {
  min-width: 300px;
  max-width: 500px;
  background: linear-gradient(135deg, rgba(42, 42, 62, 0.98) 0%, rgba(26, 26, 46, 0.98) 100%);
  border: 1px solid var(--gold-dim);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(212, 168, 67, 0.2);
  backdrop-filter: blur(12px);
  transform: translateX(calc(100% + 2rem));
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.toast.toast-visible {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  font-size: 1.25rem;
  font-weight: bold;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
}

.toast-message {
  flex: 1;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.toast-success {
  border-left-color: var(--green);
}

.toast-success .toast-icon {
  color: var(--green);
}

.toast-error {
  border-left-color: var(--red);
}

.toast-error .toast-icon {
  color: var(--red);
}

.toast-info .toast-icon {
  color: var(--gold);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .toast-container {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

[data-theme="light"] .toast {
  background: linear-gradient(135deg, rgba(237, 224, 196, 0.98) 0%, rgba(228, 213, 181, 0.98) 100%);
  border-color: #8b6914;
  box-shadow:
    0 8px 32px rgba(40, 25, 10, 0.2),
    0 0 0 1px rgba(139, 105, 20, 0.3);
}

[data-theme="light"] .toast-message {
  color: #2a1a0a;
}

/* === 3.2 ENHANCED EMPTY STATES === */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  animation: fadeSlideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.empty-state-icon {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
  font-size: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.empty-state-icon::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(212, 168, 67, 0.2) 0%, transparent 70%);
  animation: pulseGlow 2s ease-in-out infinite;
  border-radius: 50%;
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.empty-state h2 {
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.empty-state p {
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.empty-state .btn {
  margin-top: 1rem;
}

/* Light theme */
[data-theme="light"] .empty-state-icon::before {
  background: radial-gradient(circle, rgba(139, 105, 20, 0.2) 0%, transparent 70%);
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .empty-state-icon,
  .empty-state-icon::before {
    animation: none !important;
  }
}

/* ========================================
   Bulletin Board - Mini Feed (Dashboard)
   ======================================== */
.bb-mini-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.bb-mini-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.bb-mini-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.bb-mini-avatar img,
.bb-mini-avatar .avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.bb-mini-avatar .avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--bg);
  font-weight: 700;
  font-size: 1.1rem;
}
.bb-mini-content {
  flex: 1;
  min-width: 0;
}
.bb-mini-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}
.bb-mini-header strong {
  color: var(--gold);
}
.bb-mini-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-left: auto;
}
.bb-mini-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bb-mini-replies {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.bb-category-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  background: rgba(139, 105, 20, 0.2);
  color: var(--gold);
  white-space: nowrap;
}

/* ========================================
   Bulletin Board - Category List
   ======================================== */
.board-categories {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.board-category-row {
  display: grid;
  grid-template-columns: 3rem 1fr 5rem 5rem auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.board-category-row:hover {
  background: rgba(139, 105, 20, 0.05);
}
.board-category-row:last-child {
  border-bottom: none;
}
.board-cat-icon {
  font-size: 1.8rem;
  text-align: center;
}
.board-cat-info h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--gold);
  font-family: var(--font-heading);
}
.board-cat-info p {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.board-cat-stat {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.board-cat-stat strong {
  display: block;
  font-size: 1.1rem;
  color: var(--text);
}
.board-cat-last-activity {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 120px;
}
.board-cat-last-activity strong {
  color: var(--text);
}
@media (max-width: 600px) {
  .board-category-row {
    grid-template-columns: 2.5rem 1fr;
    gap: 0.5rem;
  }
  .board-cat-stat,
  .board-cat-last-activity {
    display: none;
  }
}

/* ========================================
   Bulletin Board - Topic List
   ======================================== */
.board-topics {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.board-topic-header-row {
  display: grid;
  grid-template-columns: 1fr 80px 140px;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  background: rgba(139, 105, 20, 0.1);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
}
.board-topic-row {
  display: grid;
  grid-template-columns: 1fr 80px 140px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.board-topic-row:hover {
  background: rgba(139, 105, 20, 0.05);
}
.board-topic-row:last-child {
  border-bottom: none;
}
.board-topic-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.board-topic-avatar {
  flex-shrink: 0;
}
.board-topic-avatar img,
.board-topic-avatar .avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.board-topic-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-topic-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}
.board-topic-replies {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.board-topic-activity {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: right;
}
@media (max-width: 600px) {
  .board-topic-header-row {
    display: none;
  }
  .board-topic-row {
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }
  .board-topic-activity {
    display: none;
  }
  .board-topic-title {
    white-space: normal;
  }
}

/* ========================================
   Bulletin Board - Topic View
   ======================================== */
.board-post {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.board-post:last-child {
  border-bottom: none;
}
.board-post-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.board-post-header .avatar-small {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.board-post-header .avatar-letter {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.board-post-avatar img,
.board-post-avatar .avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.board-post-avatar .avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--bg);
  font-weight: 700;
  font-size: 1.1rem;
}
.board-post-user {
  flex: 1;
}
.board-post-user strong {
  color: var(--gold);
}
.board-post-user .board-post-time {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.board-post-socials {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.2rem;
}
.board-post-socials a {
  opacity: 0.6;
  transition: opacity 0.15s;
}
.board-post-socials a:hover {
  opacity: 1;
}
.board-post-socials svg {
  width: 16px;
  height: 16px;
}
.board-post-body {
  line-height: 1.6;
}
.board-post-body p {
  margin: 0 0 0.5rem;
}
.board-post-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 0.5rem 0;
}
.board-post-body code {
  background: rgba(0,0,0,0.3);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
}
.board-post-body pre {
  background: rgba(0,0,0,0.3);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}
.board-post-body pre code {
  background: none;
  padding: 0;
}
.board-post-body blockquote {
  border-left: 3px solid var(--gold);
  margin: 0.5rem 0;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
}
.board-post-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* Breadcrumbs */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}
.breadcrumb a {
  color: var(--gold);
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb .separator {
  color: var(--text-secondary);
}

/* Board admin modal */
.board-admin-form .form-group {
  margin-bottom: 1rem;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.25rem;
  max-height: 200px;
  overflow-y: auto;
}
.emoji-option {
  padding: 0.4rem;
  text-align: center;
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: 4px;
  border: 2px solid transparent;
  transition: background 0.1s;
}
.emoji-option:hover {
  background: rgba(139, 105, 20, 0.2);
}
.emoji-option.selected {
  border-color: var(--gold);
  background: rgba(139, 105, 20, 0.15);
}

/* Board pagination */
.board-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
}
.board-pagination a,
.board-pagination span {
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
}
.board-pagination a {
  color: var(--gold);
  background: var(--card-bg);
  border: 1px solid var(--border);
}
.board-pagination a:hover {
  background: rgba(139, 105, 20, 0.15);
}
.board-pagination .current {
  background: var(--gold);
  color: var(--bg);
  font-weight: 700;
}

/* Board reply form */
.board-reply-form {
  padding: 1.25rem;
  border-top: 2px solid var(--border);
}
.board-reply-form textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
}
.markdown-preview {
  padding: 1rem;
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
  min-height: 60px;
  line-height: 1.6;
  display: none;
}
.markdown-preview.active {
  display: block;
}
.markdown-toolbar {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}
.markdown-toolbar button {
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
}
.markdown-toolbar button:hover {
  background: rgba(139, 105, 20, 0.15);
}

/* ========================================
   Previously On... Banner
   ======================================== */
.previously-on-banner {
  border-left: 4px solid var(--gold);
  margin-bottom: 1.5rem;
}
.previously-on-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.previously-on-header h3 {
  font-family: 'MedievalSharp', cursive;
  color: var(--gold);
  margin: 0;
  font-size: 0.95rem;
  white-space: nowrap;
}
.previously-on-title {
  font-weight: 600;
  color: var(--text);
  font-size: 0.85rem;
  word-break: break-word;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.recap-preview {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-height: 4.5em;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.recap-preview * { margin: 0; }
.recap-preview p { margin: 0; }
.recap-preview h1,
.recap-preview h2,
.recap-preview h3,
.recap-preview h4,
.recap-preview h5,
.recap-preview h6 {
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0;
}
.previously-on-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.previously-on-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================================
   Session Notes
   ======================================== */
.session-notes-section {
  margin-top: 1.5rem;
}
.session-notes-section h3 {
  margin-bottom: 0.5rem;
}
.session-notes-section textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 0.6rem 0.8rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
}
.notes-save-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  min-height: 1.2em;
}
.notes-save-status.saving { color: var(--gold); }
.notes-save-status.saved { color: #4caf50; }
.notes-save-status.error { color: #e74c3c; }

/* ========================================
   Attendance Tracking
   ======================================== */
.attendance-section {
  margin-top: 1.5rem;
}
.attendance-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.attendance-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.attendance-item label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
}
.attendance-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}
.attendance-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
}
.attendance-badge.missed {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

/* ========================================
   Quest Journal Timeline
   ======================================== */
.journal-timeline {
  position: relative;
  padding-left: 2rem;
}
.journal-timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gold);
  opacity: 0.3;
}
.journal-entry {
  position: relative;
  margin-bottom: 1.5rem;
}
.journal-entry::before {
  content: '';
  position: absolute;
  left: -1.75rem;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
}
.journal-date-marker {
  font-family: 'MedievalSharp', cursive;
  color: var(--gold);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}
.journal-card {
  border-left: 3px solid var(--gold);
}
.journal-card h2 {
  font-size: 1.1rem;
  margin: 0 0 0.25rem;
}
.journal-card h2 a {
  color: var(--text);
  text-decoration: none;
}
.journal-card h2 a:hover {
  color: var(--gold);
}
.journal-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.journal-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.journal-summary h1,
.journal-summary h2,
.journal-summary h3,
.journal-summary h4,
.journal-summary h5,
.journal-summary h6 {
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 0.25rem;
}
.journal-summary.collapsed {
  max-height: 4.5em;
  overflow: hidden;
  position: relative;
}
.journal-summary.collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2em;
  background: linear-gradient(transparent, var(--card-bg));
}
.journal-expand-btn {
  font-size: 0.8rem;
  color: var(--gold);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0;
  margin-top: 0.25rem;
}
.journal-expand-btn:hover {
  text-decoration: underline;
}
.journal-filter-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

/* ========================================
   Session Gallery
   ======================================== */
.session-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.gallery-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-thumb .gallery-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  font-size: 14px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.gallery-thumb:hover .gallery-delete-btn {
  display: flex;
}
.gallery-thumb .gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s;
  margin-top: 0.75rem;
}
.gallery-upload-zone:hover,
.gallery-upload-zone.dragover {
  border-color: var(--gold);
}
.gallery-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.gallery-lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
}
.gallery-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #fff;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
}

/* ==========================================================
   ENHANCED SCHEDULING — Recurring + Quorum
   ========================================================== */

.recurring-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
}
.recurring-toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.recurrence-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.recurrence-row select { flex: 1; min-width: 160px; }
.recurrence-row input[type="time"] { width: 110px; }
.recurrence-row span { color: var(--text-secondary); }

.session-recurring-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--gold);
  color: var(--bg-dark);
  margin: 0.25rem 0.25rem 0.25rem 0;
  vertical-align: middle;
}
.session-recurring-badge-sm {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
}

.quorum-status {
  font-weight: 700;
  font-size: 0.85rem;
}
.quorum-met { color: var(--success, #27ae60); }
.quorum-unmet { color: var(--danger, #c0392b); }

.attendance-report-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.4rem 0;
}
.attendance-report-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
  font-size: 0.9rem;
}
.attendance-bar {
  flex: 1;
  height: 10px;
  background: var(--bg-dark, #1a1a2e);
  border-radius: 5px;
  overflow: hidden;
}
.attendance-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 5px;
  transition: width 0.3s ease;
}
.attendance-report-stats {
  min-width: 80px;
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.attendance-report-stats strong {
  color: var(--gold);
  margin-left: 0.4rem;
}

/* ==========================================================
   ENCOUNTER BUILDER
   ========================================================== */

.encounter-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.encounter-party-config {
  padding: 1.25rem;
}
.encounter-party-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.encounter-levels-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.encounter-level-input {
  width: 52px !important;
  min-width: 52px;
  max-width: 52px;
  text-align: center;
  padding: 0.3rem 0.2rem;
  font-size: 0.9rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  color-scheme: dark;
}
.encounter-level-input::-webkit-inner-spin-button,
.encounter-level-input::-webkit-outer-spin-button {
  opacity: 1;
  filter: invert(0.85) sepia(1) saturate(5) hue-rotate(15deg) brightness(1.3);
}
.encounter-party-row .form-group input[type="number"] {
  width: 70px;
}

.encounter-xp-budget {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-dark, #1a1a2e);
  border-radius: 6px;
}
.encounter-xp-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0 0 0.5rem 0;
  font-style: italic;
}
.encounter-xp-labels {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.xp-label { padding: 0.2rem 0; }
.xp-label.xp-easy strong { color: #27ae60; }
.xp-label.xp-medium strong { color: #d4a843; }
.xp-label.xp-hard strong { color: #e67e22; }
.xp-label.xp-deadly strong { color: #c0392b; }

.encounter-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.encounter-browser,
.encounter-roster-card {
  padding: 1.25rem;
  max-height: 500px;
  overflow-y: auto;
}

.encounter-search-row {
  margin-bottom: 0.75rem;
}
.encounter-search-input {
  width: 100%;
}
.encounter-filter-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.encounter-filter-row select {
  flex: 1;
  min-width: 100px;
}

.encounter-monster-list {
  max-height: 300px;
  overflow-y: auto;
}

.encounter-browser-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--border-color, rgba(212,168,67,0.15));
  gap: 0.5rem;
}
.encounter-browser-item:last-child { border-bottom: none; }
.encounter-browser-info {
  flex: 1;
  font-size: 0.9rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.encounter-roster {
  min-height: 100px;
}
.encounter-empty-roster {
  text-align: center;
  padding: 2rem 1rem;
}
.encounter-monster-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--border-color, rgba(212,168,67,0.15));
}
.encounter-monster-item:last-child { border-bottom: none; }
.encounter-monster-info {
  flex: 1;
  font-size: 0.9rem;
}
.encounter-monster-count {
  font-weight: 700;
  color: var(--gold);
  margin-right: 0.25rem;
}
.encounter-monster-xp {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-left: 0.5rem;
}
.encounter-monster-actions {
  display: flex;
  gap: 0.25rem;
}
.encounter-monster-actions .btn-icon {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-color, rgba(212,168,67,0.15));
  background: transparent;
  color: var(--text-primary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.encounter-monster-actions .btn-icon:hover {
  background: var(--gold);
  color: var(--bg-dark);
}

.encounter-summary {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-dark, #1a1a2e);
  border-radius: 6px;
}
.encounter-xp-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.encounter-xp-row strong {
  color: var(--gold);
}

.encounter-difficulty-bar {
  height: 12px;
  background: var(--bg-dark, #111);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color, rgba(212,168,67,0.15));
  margin-bottom: 0.4rem;
}
.encounter-difficulty-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease, background 0.4s ease;
}
.encounter-difficulty-fill.trivial { background: #555; }
.encounter-difficulty-fill.easy { background: #27ae60; }
.encounter-difficulty-fill.medium { background: #d4a843; }
.encounter-difficulty-fill.hard { background: #e67e22; }
.encounter-difficulty-fill.deadly { background: #c0392b; }

.encounter-difficulty-label {
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
}
.encounter-difficulty-label.trivial { color: #888; }
.encounter-difficulty-label.easy { color: #27ae60; }
.encounter-difficulty-label.medium { color: #d4a843; }
.encounter-difficulty-label.hard { color: #e67e22; }
.encounter-difficulty-label.deadly { color: #c0392b; }

/* Encounter load item in map modal */
.encounter-load-item {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border, rgba(212,168,67,0.15));
  border-radius: 6px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-darker, #0d0d1a);
}
.encounter-load-item:hover {
  border-color: #9b59b6;
  background: rgba(155, 89, 182, 0.1);
}

/* Encounter form controls — dark theme */
.encounter-layout input[type="text"],
.encounter-layout input[type="number"],
.encounter-layout select {
  background: var(--bg-darker, #0d0d1a);
  border: 1px solid var(--border, rgba(212,168,67,0.15));
  border-radius: var(--radius, 6px);
  color: var(--text-primary, #e8e0d0);
  font-family: var(--font-body, 'Crimson Text', serif);
  font-size: 0.95rem;
  padding: 0.5rem 0.7rem;
}
.encounter-layout select {
  padding-right: 2.2rem;
}
.encounter-layout input[type="text"]:focus,
.encounter-layout input[type="number"]:focus,
.encounter-layout select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.25);
}
.encounter-layout input::placeholder {
  color: var(--text-secondary, #8a8070);
}

.encounter-templates {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.encounter-actions-card {
  padding: 1.25rem;
}
.encounter-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.encounter-save-row,
.encounter-load-row,
.encounter-map-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.encounter-save-row input,
.encounter-load-row select,
.encounter-map-row select {
  flex: 1;
  min-width: 180px;
}

/* Responsive: stack encounter columns on mobile */
@media (max-width: 768px) {
  .encounter-columns {
    grid-template-columns: 1fr;
  }
  .encounter-browser,
  .encounter-roster-card {
    max-height: 400px;
  }
  .encounter-xp-labels {
    gap: 0.5rem;
  }
  .encounter-filter-row select {
    min-width: 80px;
    font-size: 0.85rem;
  }
}

/* ========================================================
   P1 FEATURES: Currency, Loot, Arcs, Generators, Handouts
   ======================================================== */

/* Currency Dashboard */
.currency-dashboard { margin-bottom: 1.5rem; }
.currency-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.currency-section h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--gold);
}
.currency-form { display: flex; flex-direction: column; gap: 0.5rem; }
.coin-inputs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.coin-inputs label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  min-width: 80px;
}
.coin-inputs input[type="number"] {
  width: 100%;
  text-align: center;
  font-size: 0.9rem;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem;
}
.coin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: bold;
  flex-shrink: 0;
}
.coin-pp { background: #c0c0c8; color: #1a1a2e; }
.coin-gp { background: #d4a843; color: #1a1a2e; }
.coin-sp { background: #a8a5a0; color: #1a1a2e; }
.coin-cp { background: #b87333; color: #1a1a2e; }
.currency-reason {
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
}
.currency-wallets-toggle,
.currency-log-toggle {
  margin-top: 1rem;
}
.currency-wallets-toggle summary,
.currency-log-toggle summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.wallets-list, .currency-log-list {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.wallet-row {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
}
.currency-log-entry {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: baseline;
}

/* Rarity Badges */
.rarity-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: bold;
  color: #fff;
  text-transform: capitalize;
  vertical-align: middle;
}

/* Attunement Badge */
.attunement-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
  background: var(--accent-2, #3498db);
  color: #fff;
}

/* Staged items */
.staged-items-card { border-left: 3px solid var(--gold); }
.loot-staged-card {
  border: 1px dashed var(--gold);
  background: rgba(212, 168, 67, 0.05);
}
.staged-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  background: #555;
  color: #ccc;
}

/* Vault suggestions dropdown */
.vault-suggestions {
  position: absolute;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
}
.vault-suggest-item {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.vault-suggest-item:hover {
  background: rgba(212, 168, 67, 0.15);
}

/* Vault detail modal */
.vault-detail-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.vault-detail-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}
.vault-detail-close {
  position: absolute;
  top: 0.5rem; right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}
.vault-desc { font-size: 0.9rem; line-height: 1.5; margin-top: 0.5rem; }

/* Add relative positioning for form groups (for vault dropdown) */
.loot-add-form .form-group { position: relative; }

/* Journal: Arc dividers & badges */
.journal-arc-divider {
  border-left: 4px solid var(--gold);
  padding: 0.5rem 0.75rem;
  margin: 1.5rem 0 0.5rem;
  display: flex;
  align-items: center;
}
.journal-arc-label {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: bold;
  color: #1a1a2e;
}
.arc-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: bold;
  color: #1a1a2e;
}

/* Journal filters */
.journal-filters {
  padding: 0.75rem 1rem;
}

/* Generator tabs */
.generator-tabs { margin-bottom: 1rem; }

/* Name chips */
.name-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.name-chip-wrap {
  display: inline-flex;
  align-items: stretch;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.name-chip-wrap:hover { border-color: var(--gold); }
.name-chip {
  padding: 0.4rem 0.8rem;
  border: none;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.9rem;
}
.name-chip-npc {
  padding: 0.2rem 0.5rem;
  border: none;
  border-left: 1px solid var(--border);
  background: rgba(212, 168, 67, 0.1);
  color: var(--gold);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: bold;
  transition: background 0.2s;
}
.name-chip-npc:hover {
  background: rgba(212, 168, 67, 0.3);
}
.quickref-section summary {
  cursor: pointer;
  font-weight: bold;
  padding: 0.5rem 0;
  color: var(--gold);
}
.quickref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.quickref-card {
  padding: 0.75rem;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
  border-left: 3px solid var(--gold);
}
.quickref-card strong { color: var(--gold); }
.quickref-card p { font-size: 0.85rem; margin: 0.25rem 0 0; }
.quickref-content p { font-size: 0.85rem; margin: 0.4rem 0; }

/* Handout grid */
.handout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.handout-card {
  padding: 0;
  overflow: hidden;
}
.handout-thumb {
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 4/3;
}
.handout-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.handout-thumb:hover img { transform: scale(1.05); }
.handout-text-preview {
  padding: 1rem;
  cursor: pointer;
  min-height: 100px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.handout-info {
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.handout-link-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  background: rgba(212, 168, 67, 0.2);
  color: var(--gold);
}
.handout-actions {
  padding: 0.5rem 0.75rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}

/* Handout lightbox */
.handout-lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.handout-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}
.handout-lightbox-close {
  position: absolute;
  top: 1rem; right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10001;
}
.handout-lightbox-text {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 8px;
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Handout Reveal Popup */
.handout-reveal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: handoutRevealFadeIn 0.4s ease;
}
.handout-reveal-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.88);
}
.handout-reveal-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.handout-reveal-close {
  position: absolute;
  top: -2rem; right: -1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
}
.handout-reveal-close:hover { color: var(--gold); }
.handout-reveal-title {
  font-family: 'MedievalSharp', cursive;
  color: var(--gold);
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  animation: handoutRevealSlide 0.5s ease;
}
.handout-reveal-body {
  animation: handoutRevealScale 0.6s ease;
}
.handout-reveal-img {
  max-width: 85vw;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 6px;
  border: 3px solid var(--gold);
  box-shadow: 0 0 30px rgba(184, 134, 11, 0.4), 0 8px 32px rgba(0,0,0,0.6);
}
.handout-reveal-text {
  background: linear-gradient(135deg, #2a1f14 0%, #1a1209 100%);
  border: 2px solid var(--gold);
  border-radius: 8px;
  padding: 2rem 2.5rem;
  max-width: 650px;
  max-height: 55vh;
  overflow-y: auto;
  font-family: 'MedievalSharp', cursive;
  font-size: 1.2rem;
  line-height: 1.8;
  color: #e8d5b7;
  white-space: pre-wrap;
  text-align: left;
  box-shadow: 0 0 30px rgba(184, 134, 11, 0.3), inset 0 0 20px rgba(0,0,0,0.3);
}
.handout-reveal-footer {
  margin-top: 1.2rem;
  display: flex;
  gap: 0.75rem;
  animation: handoutRevealSlide 0.7s ease;
}
@keyframes handoutRevealFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes handoutRevealScale {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes handoutRevealSlide {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive: Currency + generators + handouts */
@media (max-width: 768px) {
  .currency-grid { grid-template-columns: 1fr; }
  .handout-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .quickref-grid { grid-template-columns: 1fr; }
}

/* =============================================
   Grid Overlay Toolbar
   ============================================= */
.grid-toolbar {
  position: fixed;
  top: 80px;
  left: 240px;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 0.75rem;
  width: 210px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.grid-toolbar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--gold);
}
.grid-toolbar-body input[type="range"] {
  width: 100%;
  margin: 0.2rem 0;
}
body.map-fs-active .grid-toolbar {
  z-index: 10002;
}

/* =============================================
   Sound Panel (Popup + Set as Default)
   ============================================= */
.sound-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sound-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg-darker);
  cursor: move;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.sound-panel-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}
.sound-panel-close:hover {
  color: var(--gold);
}
.sound-panel-body {
  padding: 0.75rem;
}
/* Now Playing bar */
.sound-now-playing {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.6rem;
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
}
.sound-now-icon {
  color: var(--gold);
  font-size: 1rem;
  animation: sound-pulse 1.5s ease-in-out infinite;
}
@keyframes sound-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.sound-now-name {
  flex: 1;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--gold);
}
.sound-panel-sites {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.sound-site-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.2s, border-color 0.2s;
}
.sound-site-btn:hover {
  background: var(--bg-card);
  border-color: var(--gold-dim);
}
.sound-site-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.sound-site-label {
  flex: 1;
}
.sound-set-default {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s, transform 0.2s;
}
.sound-set-default:hover {
  color: var(--gold);
  transform: scale(1.2);
}
.sound-set-default.active {
  color: var(--gold);
}
.sound-panel-divider {
  height: 1px;
  background: var(--border);
  margin: 0.6rem 0;
}
@media (max-width: 600px) {
  .sound-panel {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 10px;
  }
}

/* Sound toggle in nav */
.nav-sound-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem 0.4rem;
  vertical-align: middle;
  line-height: 1;
}
.nav-sound-btn:hover,
.nav-sound-btn.active {
  color: var(--gold);
}

/* =============================================
   Quest Board
   ============================================= */
.quest-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

.quest-card {
  position: relative;
  background: linear-gradient(135deg, #f5e6c8 0%, #ede0c8 50%, #e8d5b0 100%);
  border-radius: var(--radius);
  padding: 1.25rem 1rem 1rem;
  color: #3d2b1f;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15), inset 0 0 30px rgba(139,115,85,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}
.quest-card:nth-child(odd) { transform: rotate(-0.5deg); }
.quest-card:nth-child(even) { transform: rotate(0.5deg); }
.quest-card:hover {
  transform: rotate(0deg) translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.quest-pin {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: radial-gradient(circle at 40% 40%, #e74c3c, #c0392b);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.quest-pin::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 8px;
  background: #7f8c8d;
}

.quest-card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
  color: #2c1810;
}

.quest-card-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.quest-status-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.quest-status-available { background: #3498db; color: #fff; }
.quest-status-active { background: #27ae60; color: #fff; }
.quest-status-completed { background: #7f8c8d; color: #fff; }
.quest-status-failed { background: #e74c3c; color: #fff; }

.quest-difficulty-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.quest-diff-trivial { background: #95a5a6; color: #fff; }
.quest-diff-easy { background: #2ecc71; color: #fff; }
.quest-diff-medium { background: #f39c12; color: #fff; }
.quest-diff-hard { background: #e67e22; color: #fff; }
.quest-diff-deadly { background: #e74c3c; color: #fff; }

.quest-card-desc {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
  color: #4a3728;
}

.quest-card-meta {
  font-size: 0.75rem;
  color: #6b5a4e;
  margin-bottom: 0.3rem;
}
.quest-card-meta a {
  color: #8b4513;
  text-decoration: underline;
}

.quest-reward {
  color: #b8860b;
  font-weight: 600;
  font-size: 0.8rem;
}

.quest-objectives {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}
.quest-objectives li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  padding: 0.15rem 0;
  color: #4a3728;
}
.quest-objectives li.completed {
  text-decoration: line-through;
  opacity: 0.6;
}
.quest-objectives input[type="checkbox"] {
  accent-color: #8b4513;
}

.quest-dm-notes {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(139,115,85,0.1);
  border: 1px dashed #8b7355;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #6b5a4e;
}
.quest-dm-notes-label {
  font-weight: 600;
  color: #8b4513;
  font-size: 0.7rem;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.quest-card-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.quest-staged {
  border: 2px dashed var(--gold-dim);
  opacity: 0.8;
}

.quest-form-section {
  margin-bottom: 1.5rem;
}

.quest-arc-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  border: 1px solid;
  font-weight: 500;
}

/* Quest dashboard widget */
.quest-widget-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.quest-widget-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-darker);
  border-radius: var(--radius);
  border-left: 3px solid var(--gold);
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.2s;
}
.quest-widget-item:hover {
  background: var(--bg-card);
}
.quest-widget-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  flex: 1;
}
.quest-widget-status {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 8px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Quest map pins */
.map-quest-pin { background: transparent !important; border: none !important; }
.map-quest-pin-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 2px solid #3498db;
  border-radius: 50%;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* === Phase 2: Sticky Vote Submit === */
.vote-submit-container {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 1rem 0;
  margin-top: 1rem;
  background: linear-gradient(to top, var(--bg-card) 60%, transparent);
}

.vote-submit-container .btn {
  width: 100%;
  font-size: 1.1rem;
  padding: 0.85rem 1.5rem;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(212, 168, 67, 0.3);
}

@media (min-width: 768px) {
  .vote-submit-container .btn {
    width: auto;
  }
}

/* === Phase 3: Body Noise Texture === */
body {
  background-image:
    radial-gradient(circle at 50% 50%, rgba(212, 168, 67, 0.015) 1px, transparent 1px);
  background-size: 20px 20px;
}

[data-theme="light"] body {
  background-image:
    radial-gradient(circle at 50% 50%, rgba(90, 65, 20, 0.04) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* === Phase 3: Warm Nav Bar === */
.nav {
  background: linear-gradient(to bottom, #1e1814, var(--bg-darker));
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, transparent 5%, var(--gold-dim) 50%, transparent 95%) 1;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .nav {
  background: linear-gradient(to bottom, #b8a478, #c9b88e);
  border-image: linear-gradient(90deg, transparent 5%, #8b6914 50%, transparent 95%) 1;
  box-shadow: 0 2px 12px rgba(40, 25, 10, 0.15);
}

/* === Phase 3: Card gold top border always visible === */
.card::after {
  transform: scaleX(0.3);
  opacity: 0.4;
}

.card:hover::after {
  transform: scaleX(1);
  opacity: 1;
}

/* === Phase 3: Card crosshatch always visible === */
.card::before {
  opacity: 0.4;
}

.card:hover::before {
  opacity: 1;
}

/* === Phase 3: Section Divider === */
.section-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0 1rem;
  color: var(--gold-dim);
  font-size: 0.85rem;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.section-divider-icon {
  font-size: 1rem;
  color: var(--gold);
  line-height: 1;
}

/* === Phase 3: Footer gold line === */
.app-footer {
  border-top: none;
  position: relative;
}

.app-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

/* === Phase 3: Confirmed session corner ornaments === */
.session-confirmed {
  background-image:
    linear-gradient(135deg, rgba(39, 174, 96, 0.08) 8px, transparent 8px),
    linear-gradient(225deg, rgba(39, 174, 96, 0.08) 8px, transparent 8px),
    linear-gradient(315deg, rgba(39, 174, 96, 0.08) 8px, transparent 8px),
    linear-gradient(45deg, rgba(39, 174, 96, 0.08) 8px, transparent 8px);
  background-position: top left, top right, bottom right, bottom left;
  background-size: 20px 20px;
  background-repeat: no-repeat;
}

/* === Phase 3: Parchment inset for quest widget === */
.quest-widget-list {
  border: 1px solid rgba(212, 168, 67, 0.2);
  background: rgba(212, 168, 67, 0.04);
  border-radius: var(--radius);
  padding: 0.25rem;
}

[data-theme="light"] .quest-widget-list {
  border-color: rgba(139, 105, 20, 0.3);
  background: rgba(139, 105, 20, 0.08);
}

/* === Phase 4: Empty state styling === */
.empty-state-card {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.empty-state-card .empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* === Phase 5: What's New modal close button === */
.whatsnew-modal {
  position: relative;
}

.whatsnew-close-x {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
  z-index: 1;
  line-height: 1;
}

.whatsnew-close-x:hover {
  color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
}

.whatsnew-content {
  max-height: 50vh;
  overflow-y: auto;
}

/* === Phase 5: Loot page section nav === */
.loot-section-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
  background: var(--bg-dark);
}

.loot-section-nav a {
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  text-decoration: none;
  transition: all 0.2s;
  font-family: var(--font-heading);
}

.loot-section-nav a:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
}

/* === Phase 6: Password show/hide toggle === */
.password-toggle-wrap {
  position: relative;
}

.password-toggle-wrap input {
  padding-right: 2.5rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.password-toggle-btn:hover {
  color: var(--gold);
}

/* === Phase 6: Mobile board delete button === */
@media (max-width: 767px) {
  .board-post-header .inline-form {
    opacity: 0;
    transition: opacity 0.2s;
  }
  .board-post:focus-within .board-post-header .inline-form,
  .board-post-header:active .inline-form {
    opacity: 1;
  }
}

@media (hover: hover) {
  .board-post-header .inline-form {
    opacity: 0;
    transition: opacity 0.2s;
  }
  .board-post:hover .board-post-header .inline-form,
  .board-post:focus-within .board-post-header .inline-form {
    opacity: 1;
  }
}

/* ========================================
   Design Polish — Body Texture Overlay
   ======================================== */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

[data-theme="light"] body::after {
  opacity: 0.025;
}

/* ========================================
   Design Polish — Session Card Status Borders
   ======================================== */
.session-card.session-open {
  border-left: 4px solid var(--gold);
}

.session-card.session-confirmed {
  border-left: 4px solid var(--green);
}

.session-card.session-completed {
  border-left: 4px solid #3498db;
}

.session-card.session-cancelled {
  border-left: 4px solid var(--red);
}

/* ========================================
   Design Polish — Light Theme Contrast
   ======================================== */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3 {
  color: #5c3a10;
}

[data-theme="light"] .role-badge,
[data-theme="light"] .session-category,
[data-theme="light"] .loot-category-badge {
  font-weight: 700;
}

/* ========================================
   Design Polish — Footer Enhancement
   ======================================== */
.app-footer {
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.15));
}

[data-theme="light"] .app-footer {
  background: linear-gradient(to bottom, transparent, rgba(40, 25, 10, 0.06));
}

.footer-ornament {
  display: block;
  text-align: center;
  margin-bottom: 0.6rem;
  color: var(--gold-dim);
  font-size: 0.75rem;
  letter-spacing: 0.4em;
}

.footer-copy::before {
  content: '\2605 ';
  color: var(--gold-dim);
  font-size: 0.6rem;
  vertical-align: middle;
}

.footer-copy::after {
  content: ' \2605';
  color: var(--gold-dim);
  font-size: 0.6rem;
  vertical-align: middle;
}

/* ========================================
   Design Polish — Nav Bar Enhancement
   ======================================== */
.nav {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5), inset 0 -1px 0 rgba(212, 168, 67, 0.1);
}

.nav-brand:hover {
  text-shadow: 0 0 12px rgba(212, 168, 67, 0.5);
}

.hamburger-btn:hover {
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.3);
  transform: scale(1.05);
}

.hamburger-menu.open {
  animation: menuSlideIn 0.2s ease-out;
}

@keyframes menuSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   Design Polish — Hover States Enhancement
   ======================================== */
.card:hover {
  box-shadow: var(--shadow), 0 0 0 1px rgba(212, 168, 67, 0.15);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
}

.player-card:hover {
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.2);
}

/* ========================================
   Design Polish — Vote Submit Sticky Mobile
   ======================================== */
@media (max-width: 767px) {
  .vote-submit-container {
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: 0.75rem 0;
    background: linear-gradient(to top, var(--bg-dark) 60%, transparent);
  }

  .vote-submit-container .btn {
    width: 100%;
    font-size: 1.05rem;
    padding: 0.75rem 1rem;
  }
}

/* ========================================
   Design Polish — Recurring Badge Polish
   ======================================== */
.session-recurring-badge {
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ========================================
   Design Polish — File Input Styled
   ======================================== */
.file-input-styled input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.file-input-styled label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 2px dashed var(--gold-dim);
  border-radius: var(--radius);
  color: var(--gold);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  background: rgba(212, 168, 67, 0.04);
}

.file-input-styled label:hover {
  border-color: var(--gold);
  background: rgba(212, 168, 67, 0.08);
}

.file-input-styled .file-name {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-body);
}

/* ========================================
   Design Polish — Loot Table Mobile Cards
   ======================================== */
@media (max-width: 600px) {
  .loot-table thead {
    display: none;
  }

  .loot-table tbody tr {
    display: block;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
  }

  .loot-table tbody td {
    display: block;
    padding: 0.25rem 0;
    border: none;
    text-align: left;
  }

  .loot-table tbody td::before {
    content: attr(data-label);
    display: inline-block;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--gold);
    min-width: 5rem;
    margin-right: 0.5rem;
    font-size: 0.8rem;
  }

  .loot-table tbody td:first-child::before {
    display: none;
  }
}

/* ========================================
   Design Polish — Vault Tab Grouping
   ======================================== */
.vault-tab-separator {
  width: 1px;
  height: 1.5rem;
  background: var(--border);
  align-self: center;
  margin: 0 0.15rem;
}

.vault-tab.active {
  border-bottom: 3px solid var(--gold);
}

@media (max-width: 600px) {
  .vault-tab-separator {
    display: none;
  }
}

/* ========================================
   Design Polish — Board Categories Enhancement
   ======================================== */
.board-cat-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 168, 67, 0.1);
  border-radius: var(--radius);
}

.board-category-row:hover {
  border-left: 3px solid var(--gold-dim);
  padding-left: calc(1.25rem - 3px);
}

.board-cat-info h3 {
  font-family: var(--font-heading);
}

/* ========================================
   Design Polish — Map Index Card Grid
   ======================================== */
.map-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.map-card-group {
  display: flex;
  flex-direction: column;
}

/* Root map cards — large thumbnail on top */
.map-index-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.map-index-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.map-index-card.dragging {
  opacity: 0.5;
}

.map-index-card.drag-over {
  border-color: var(--gold-bright);
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.4);
}

.map-index-card-thumb {
  height: 160px;
  overflow: hidden;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-index-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-index-card-thumb .maps-tree-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
  font-size: 2.5rem;
}

.map-index-card-body {
  padding: 0.75rem;
}

.map-index-card-body h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.map-index-card-body h3 a {
  color: var(--gold);
  text-decoration: none;
}

.map-index-card-body h3 a:hover {
  color: var(--gold-bright);
}

/* Sub-map cards: smaller, indented tree style */
.map-index-card-sub {
  display: flex;
  flex-direction: row;
  border-color: var(--border);
}

.map-index-card-sub:hover {
  transform: none;
}

.map-index-card-sub .map-index-card-thumb {
  width: 80px;
  height: auto;
  min-height: 50px;
}

.map-index-card-sub .map-index-card-body h3 {
  font-size: 0.9rem;
}

.map-index-submaps {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
}

.map-index-card-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

/* ========================================
   Design Polish — Player Character Showcase
   ======================================== */
.player-card-character {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
  font-style: italic;
}

/* ========================================
   Design Polish — Vote Section Dividers
   ======================================== */
.vote-section-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--gold-dim);
  font-family: var(--font-heading);
  font-size: 0.85rem;
}

.vote-section-divider::before,
.vote-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

/* ========================================
   Campaigns
   ======================================== */
.campaign-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}
.campaign-filter-bar .btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
}

.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.campaign-grid-dashboard {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.campaign-card {
  display: block;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.campaign-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.campaign-cover {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.campaign-cover-sm {
  height: 100px;
}
.campaign-cover-default {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}
.campaign-cover-icon {
  font-size: 2.5rem;
  opacity: 0.5;
  filter: brightness(2);
}
.campaign-card-body {
  padding: 0.75rem 1rem 1rem;
}
.campaign-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin: 0 0 0.25rem;
}
.campaign-card-desc {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}
.campaign-card-stats {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--gold-dim);
}

/* Campaign detail page */
.campaign-hero {
  width: calc(100% + 2rem);
  margin: -1rem -1rem 1rem;
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
  border-radius: 8px 8px 0 0;
}
.campaign-hero-plain {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
}
.campaign-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
}
.campaign-hero-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  margin: 0;
}
.campaign-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.campaign-description {
  margin-bottom: 1.5rem;
}
.campaign-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.campaign-stat-box {
  text-align: center;
  padding: 0.75rem 0.5rem;
}
.campaign-stat-number {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--gold);
}
.campaign-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.campaign-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}
.arc-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.arc-item {
  padding: 0.75rem 1rem;
}
.arc-item h3 {
  margin: 0;
  font-size: 0.95rem;
}

@media (max-width: 600px) {
  .campaign-grid {
    grid-template-columns: 1fr;
  }
  .campaign-hero {
    height: 150px;
  }
  .campaign-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === NPC Manager === */
.npc-mgr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.npc-mgr-table th,
.npc-mgr-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--bg-dark);
  vertical-align: middle;
}
.npc-mgr-table th {
  background: var(--bg-darker);
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 1;
}
.npc-mgr-table tbody tr:hover {
  background: var(--bg-dark);
}
.npc-mgr-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gold-dim);
}
.npc-mgr-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-darker);
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 0.9rem;
}
.npc-mgr-name {
  font-weight: 600;
  color: var(--text-primary);
}
.npc-mgr-cat-badge {
  display: inline-block;
  background: var(--bg-darker);
  color: var(--gold);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
  margin: 0.1rem;
  border: 1px solid var(--gold-dim);
}
.npc-mgr-cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-darker);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}
.npc-mgr-cat-name {
  color: var(--gold);
  font-weight: 600;
}
.npc-mgr-cat-count {
  color: var(--text-secondary);
  font-size: 0.75rem;
}
.npc-mgr-cat-del,
.npc-mgr-cat-del-npcs {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0.2rem;
  font-size: 0.75rem;
  line-height: 1;
}
.npc-mgr-cat-del {
  color: var(--text-secondary);
  font-size: 1rem;
}
.npc-mgr-cat-del:hover {
  color: #e74c3c;
}
.npc-mgr-cat-del-npcs {
  color: #e74c3c;
  border: 1px solid #e74c3c;
  border-radius: 3px;
  padding: 0.1rem 0.3rem;
}
.npc-mgr-cat-del-npcs:hover {
  background: #e74c3c;
  color: #fff;
}
@media (max-width: 600px) {
  .npc-mgr-table th:nth-child(5),
  .npc-mgr-table td:nth-child(5),
  .npc-mgr-table th:nth-child(6),
  .npc-mgr-table td:nth-child(6) {
    display: none;
  }
}

