@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Cinzel:wght@700&display=swap');

:root {
  --primary: #2d5a27;
  --accent: #a65e2e;
  --bg-light: #fdfbf7;
  --text-dark: #2d2d2d;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  margin: 0;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: 'Cinzel', serif;
  color: var(--primary);
}

.page-background {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(249, 250, 251, 0.65), rgba(249, 250, 251, 0.65)), url('/filer/Background.png');
  background-size: cover;
  background-position: center;
  filter: blur(5px);
  z-index: -1;
}

.card {
  background: white;
  border-radius: 1.5rem;
  box-shadow: 0 10px 25px rgba(45, 90, 39, 0.08);
  border: 1px solid rgba(45, 90, 39, 0.1);
}

.btn-primary {
  background: var(--primary);
  color: white !important;
  padding: 0.85rem 1.5rem;
  border-radius: 9999px;
  font-weight: 700;
  transition: 0.3s;
  box-shadow: 0 4px 15px rgba(45, 90, 39, 0.2);
  cursor: pointer;
  border: none;
}

.btn-primary:hover {
  background: #1e3d1a;
  transform: scale(1.03);
}

.btn-primary:disabled {
  background: #b8b8b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: white;
  color: var(--primary);
  padding: 0.85rem 1.5rem;
  border-radius: 9999px;
  font-weight: 700;
  border: 2px solid rgba(45, 90, 39, 0.2);
  cursor: pointer;
  transition: 0.3s;
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: #f5faf4;
}

.input-field {
  width: 100%;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.9rem;
  outline: none;
  transition: 0.2s;
  background: white;
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.12);
}

.tab-btn {
  padding: 0.75rem 1rem;
  border-radius: 9999px;
  font-weight: 700;
  color: #6b7280;
  transition: 0.2s;
}

.tab-btn.active {
  background: var(--primary);
  color: white;
}

.loader {
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

.hidden-section {
  display: none !important;
}

.character-card {
  width: 100%;
  text-align: left;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  padding: 1rem;
  background: #f9fafb;
  transition: 0.2s;
}

.character-card:hover {
  background: #f0f8ef;
  border-color: var(--primary);
}

.status-pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-green {
  background: #dcfce7;
  color: #166534;
}

.status-gray {
  background: #e5e7eb;
  color: #374151;
}

.status-orange {
  background: #ffedd5;
  color: #9a3412;
}

.sheet-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 1.5rem;
}

.sheet-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.sheet-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.checkbox-custom {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary);
}

.spell-level-box {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 1rem;
  padding: 1rem;
}

.sheet-check-list {
  display: grid;
  gap: 0.55rem;
}

.sheet-check-list.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.25rem;
}

.sheet-check-row {
  display: grid;
  grid-template-columns: 1.2rem 3rem 1fr;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: #374151;
  min-height: 1.85rem;
}

.calc-input {
  width: 3rem;
  padding: 0.25rem 0.35rem;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  background: #f8fafc;
  color: #111827;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.calc-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(45, 90, 39, 0.12);
  background: white;
}

.ability-tag {
  color: #9ca3af;
  font-size: 0.78rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 800px) {
  .sheet-check-list.two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .card {
    border-radius: 1.25rem;
  }

  h1 {
    font-size: 2rem !important;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
  }
}
/* Scheduler additions */

.event-list-scroll {
  max-height: 34rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.event-card {
  transition: 0.2s;
}

.event-card:hover {
  background: #f0f8ef;
  border-color: var(--primary);
}

.status-purple {
  background: #ede9fe;
  color: #5b21b6;
}

.status-blue {
  background: #dbeafe;
  color: #1e40af;
}

.btn-danger {
  background: #b91c1c;
  color: white !important;
  padding: 0.85rem 1.5rem;
  border-radius: 9999px;
  font-weight: 700;
  transition: 0.3s;
  cursor: pointer;
  border: none;
}

.btn-danger:hover {
  background: #7f1d1d;
  transform: scale(1.03);
}

.vote-btn {
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: white;
  color: #374151;
}

.vote-btn:hover,
.vote-btn.vote-active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}


/* Character editor side navigation */
.character-editor-side-nav {
  position: fixed;
  /* Align to the left edge of the centered character sheet instead of the browser corner. */
  left: max(1rem, calc((100vw - 72rem) / 2 - 14.25rem));
  top: 5.25rem;
  z-index: 80;
  width: 13rem;
  max-height: calc(100vh - 6.5rem);
  overflow-y: auto;
  padding: 0.85rem;
  border: 1px solid rgba(45, 90, 39, 0.16);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 25px rgba(45, 90, 39, 0.12);
  backdrop-filter: blur(8px);
}

.character-editor-side-nav-title {
  margin: 0 0 0.65rem 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.character-editor-side-nav-links {
  display: grid;
  gap: 0.35rem;
}

.character-editor-side-nav-links button {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0.75rem;
  padding: 0.55rem 0.65rem;
  background: transparent;
  color: #374151;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.character-editor-side-nav-links button:hover {
  background: #f0f8ef;
  color: var(--primary);
}

#character-editor-modal .sheet-section {
  scroll-margin-top: 1.25rem;
}

@media (max-width: 1620px) {
  .character-editor-side-nav {
    display: none;
  }
}

/* Character portrait presentation */
#character-picture-preview {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

#character-picture-preview img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: transparent !important;
}

#characters-list .character-card {
  padding-left: 7.5rem !important;
}

#characters-list .character-card [data-character-picture-card] {
  left: 0.4rem !important;
  top: 0.35rem !important;
  width: auto !important;
  height: calc(100% - 0.7rem) !important;
  aspect-ratio: 1 / 1;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

#characters-list .character-card [data-character-picture-card] img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: transparent !important;
}

/* Initiative Tracker: HP is already editable in the compact combatant row. */
.tdd-initiative__sheet .tdd-initiative__sheet-stats > span:nth-child(2) {
  display: none !important;
}

.tdd-initiative__sheet .tdd-initiative__sheet-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

@media (max-width: 760px) {
  .tdd-initiative__sheet .tdd-initiative__sheet-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
