:root {
  --steel: #1a1d22;
  --steel-mid: #2a3038;
  --ember: #c47a2c;
  --ember-bright: #e8a045;
  --parchment: #e8dfc8;
  --parchment-dim: #b8ae96;
  --ink: #0e1014;
  --danger: #a33c2e;
  --ok: #3d6b4f;
  --font-display: "Cinzel", "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--parchment);
  background: var(--ink);
  line-height: 1.55;
  position: relative;
}

.bg-forge {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 90% 60% at 70% 10%, rgba(196, 122, 44, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 10% 80%, rgba(42, 48, 56, 0.9), transparent 50%),
    linear-gradient(165deg, #12151a 0%, #1c2128 45%, #151820 100%);
}

a {
  color: var(--ember-bright);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.75rem;
  border-bottom: 1px solid rgba(196, 122, 44, 0.25);
  background: rgba(14, 16, 20, 0.65);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  color: var(--parchment);
  text-decoration: none;
}
.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(196, 122, 44, 0.55);
  box-shadow: 0 0 0 1px rgba(14, 16, 20, 0.6);
}
.brand:hover {
  color: var(--ember-bright);
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.15rem;
  font-size: 0.95rem;
}
.nav a {
  color: var(--parchment-dim);
  text-decoration: none;
}
.nav a:hover,
.nav a.is-active {
  color: var(--ember-bright);
}
.nav-user {
  color: var(--parchment);
  font-weight: 600;
}
.nav-cta {
  border: 1px solid var(--ember);
  padding: 0.25rem 0.7rem;
  border-radius: 2px;
  color: var(--ember-bright) !important;
}
.nav-cta:hover {
  background: rgba(196, 122, 44, 0.15);
  text-decoration: none;
}

.flash-wrap {
  max-width: 1100px;
  margin: 1rem auto 0;
  padding: 0 1.5rem;
}
.flash {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--ember);
  background: rgba(42, 48, 56, 0.9);
}
.flash-error {
  border-color: var(--danger);
}
.flash-ok {
  border-color: var(--ok);
}

.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}

.page-home {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.page-home .main {
  max-width: none;
  padding: 0;
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-home .site-header {
  position: relative;
  flex-shrink: 0;
  background: rgba(10, 12, 16, 0.82);
  border-bottom: 1px solid rgba(196, 122, 44, 0.2);
  backdrop-filter: blur(8px);
}

.page-home .bg-forge {
  display: none;
}

.page-home .site-footer {
  flex-shrink: 0;
  padding: 1.1rem 1.5rem 1.35rem;
}

.site-footer {
  text-align: center;
  padding: 2rem 1.5rem 2.5rem;
  color: var(--parchment-dim);
  font-size: 0.9rem;
  border-top: 1px solid rgba(196, 122, 44, 0.2);
}

/* Hero fills viewport; copy stays near the top */
.hero-full {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  color: var(--parchment);
  min-height: 22rem;
}
.hero-cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 28%;
  transform: scale(1.03);
  animation: cover-drift 22s ease-in-out infinite alternate;
}
.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(8, 10, 14, 0.88) 0%, rgba(8, 10, 14, 0.62) 50%, rgba(8, 10, 14, 0.35) 100%),
    linear-gradient(to top, rgba(8, 10, 14, 0.82) 0%, transparent 50%);
  pointer-events: none;
}
.hero-frame {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.75rem 0 2rem;
}
.hero-copy {
  max-width: 40rem;
}
.hero-title-row {
  display: flex;
  align-items: center;
  gap: 1rem 1.2rem;
  margin-bottom: 1rem;
  animation: rise-in 0.7s ease-out both;
}
.hero-logo {
  width: 104px;
  height: 104px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(232, 160, 69, 0.75);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  margin: 0;
}
.hero-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ember-bright);
}
.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6.5vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 0.98;
  margin: 0;
  color: #f3ebda;
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.5);
}
.hero-lead {
  margin: 0 0 0.75rem;
  max-width: 32rem;
  font-size: 1.12rem;
  line-height: 1.4;
  color: rgba(232, 223, 200, 0.9);
  animation: rise-in 0.7s ease-out 0.08s both;
}
.hero-meta-line {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--parchment-dim);
  animation: rise-in 0.7s ease-out 0.12s both;
}
.hero-meta-line a {
  color: var(--ember-bright);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  animation: rise-in 0.7s ease-out 0.18s both;
}
@keyframes cover-drift {
  from { transform: scale(1.03) translate3d(0, 0, 0); }
  to { transform: scale(1.07) translate3d(-1%, -0.6%, 0); }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-strip {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(196, 122, 44, 0.25);
  background: #101318;
}
.home-strip-link {
  display: grid;
  gap: 0.2rem;
  padding: 1.05rem 1.25rem;
  color: inherit;
  text-decoration: none;
  border-right: 1px solid rgba(196, 122, 44, 0.15);
  transition: background 0.2s ease;
}
.home-strip-link:last-child {
  border-right: 0;
}
.home-strip-link strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  color: var(--parchment);
}
.home-strip-link span {
  color: var(--parchment-dim);
  font-size: 0.88rem;
}
.home-strip-link:hover {
  background: rgba(196, 122, 44, 0.08);
  text-decoration: none;
}
.home-strip-link:hover strong {
  color: var(--ember-bright);
}

@media (max-width: 700px) {
  .hero-frame {
    padding: 2rem 0 1.75rem;
  }
  .hero-title-row {
    align-items: flex-start;
  }
  .hero-logo {
    width: 84px;
    height: 84px;
  }
  .home-strip {
    grid-template-columns: 1fr;
  }
  .home-strip-link {
    border-right: 0;
    border-bottom: 1px solid rgba(196, 122, 44, 0.15);
  }
  .home-strip-link:last-child {
    border-bottom: 0;
  }
}

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  background: var(--ember);
  color: var(--ink);
}
.btn:hover {
  background: var(--ember-bright);
  text-decoration: none;
  color: var(--ink);
}
.btn-ghost {
  background: transparent;
  border-color: rgba(232, 160, 69, 0.55);
  color: var(--parchment);
}
.btn-ghost:hover {
  background: rgba(196, 122, 44, 0.15);
  color: var(--ember-bright);
}
.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: #e8b4ac;
}
.btn-danger:hover {
  background: rgba(163, 60, 46, 0.25);
  color: #fff;
}
.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 0.5rem;
  letter-spacing: 0.03em;
}
.page-lead {
  color: var(--parchment-dim);
  margin: 0 0 1.75rem;
  max-width: 40rem;
}

.panel {
  background: rgba(26, 29, 34, 0.85);
  border: 1px solid rgba(196, 122, 44, 0.2);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.5rem;
}
.panel h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 1rem;
  letter-spacing: 0.04em;
  color: var(--ember-bright);
}

.form-grid {
  display: grid;
  gap: 0.9rem;
  max-width: 28rem;
}
.form-grid.wide {
  max-width: 40rem;
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--parchment-dim);
  margin-bottom: 0.3rem;
}
input[type="text"],
input[type="password"],
input[type="url"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(184, 174, 150, 0.35);
  border-radius: 2px;
  background: rgba(14, 16, 20, 0.7);
  color: var(--parchment);
  font: inherit;
}
textarea {
  min-height: 5rem;
  resize: vertical;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.25rem;
}
.label-like {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--parchment-dim);
  margin-bottom: 0.3rem;
}
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.92rem;
  color: var(--parchment);
  font-weight: 500;
  margin: 0;
  cursor: pointer;
}
.check input {
  width: auto;
}
.char-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(196, 122, 44, 0.45);
  vertical-align: middle;
  background: #1a1d22;
}
.char-avatar-btn {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 50%;
  line-height: 0;
  text-decoration: none;
  color: inherit;
}
.char-avatar-btn:hover .char-avatar,
.char-avatar-btn:hover img {
  outline: 2px solid rgba(232, 160, 69, 0.7);
  outline-offset: 1px;
}
.portrait-preview .char-avatar-btn img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(232, 160, 69, 0.55);
}
.char-avatar-empty {
  display: inline-grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ember-bright);
  background: rgba(196, 122, 44, 0.15);
}
.char-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.char-cell .char-avatar {
  width: 32px;
  height: 32px;
}
.portrait-preview {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.55rem;
}
.portrait-preview img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(232, 160, 69, 0.55);
}
.char-pick-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}
.char-pick-preview .char-avatar {
  width: 36px;
  height: 36px;
}

.dl-facts {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
}
.dl-facts dt {
  color: var(--parchment-dim);
  font-weight: 600;
}
.dl-facts dd {
  margin: 0;
}

/* Gallery */
.gallery-hint {
  margin: -0.75rem 0 1.25rem;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.15rem;
}
.gallery-item {
  margin: 0;
  border: 1px solid rgba(196, 122, 44, 0.22);
  background: linear-gradient(180deg, rgba(42, 48, 56, 0.95), rgba(26, 29, 34, 0.98));
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.gallery-item:hover {
  border-color: rgba(232, 160, 69, 0.55);
  transform: translateY(-2px);
}
.gallery-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #0a0c10;
  cursor: zoom-in;
  overflow: hidden;
}
.gallery-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.45s ease, filter 0.35s ease;
  filter: saturate(0.92);
}
.gallery-item:hover .gallery-thumb img {
  transform: scale(1.05);
  filter: saturate(1.05);
}
.gallery-item figcaption {
  padding: 0.65rem 0.8rem 0.15rem;
  font-size: 0.88rem;
  color: var(--parchment);
}
.gallery-item .meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.8rem 0.75rem;
  font-size: 0.8rem;
  color: var(--parchment-dim);
}

body.lightbox-open {
  overflow: hidden;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.lightbox[hidden] {
  display: none !important;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.88);
  backdrop-filter: blur(6px);
  animation: lb-fade 0.2s ease;
}
.lightbox-stage {
  position: relative;
  z-index: 1;
  max-width: min(1100px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}
.lightbox-img {
  max-width: 96vw;
  max-height: calc(92vh - 5.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid rgba(196, 122, 44, 0.35);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  opacity: 1;
  background: #0a0c10;
}
.lightbox-caption {
  text-align: center;
  color: var(--parchment);
  max-width: 40rem;
}
.lightbox-cap-text {
  margin: 0;
  font-weight: 600;
}
.lightbox-meta,
.lightbox-counter {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--parchment-dim);
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(196, 122, 44, 0.45);
  background: rgba(26, 29, 34, 0.85);
  color: var(--parchment);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 2px;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(196, 122, 44, 0.25);
  color: var(--ember-bright);
}
.lightbox-nav[hidden],
.lightbox-counter[hidden] {
  display: none !important;
}
.lightbox-close {
  top: 1rem;
  right: 1rem;
  font-size: 1.8rem;
}
.lightbox-prev {
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}
.lightbox-next {
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}
@keyframes lb-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 640px) {
  .lightbox-nav {
    top: auto;
    bottom: 1rem;
    transform: none;
  }
  .lightbox-prev { left: 1rem; }
  .lightbox-next { right: 1rem; }
  .lightbox-img {
    max-height: calc(92vh - 8rem);
  }
}

/* Raid calendar month */
.raid-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.raid-head .page-lead {
  margin-bottom: 0;
}
.raid-export {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.raid-export-hint {
  margin: 0 0 1.25rem;
}
.raid-actions {
  vertical-align: middle;
  white-space: nowrap;
}
.raid-actions > a,
.raid-actions > form {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 0;
}
.raid-actions > form {
  margin-left: 0.4rem;
}
.raid-actions-bar {
  margin: -0.75rem 0 1.25rem;
}
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.cal-month {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--ember-bright);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 1.5rem;
  background: rgba(196, 122, 44, 0.15);
  border: 1px solid rgba(196, 122, 44, 0.25);
}
.cal-dow {
  padding: 0.45rem 0.25rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  background: rgba(14, 16, 20, 0.95);
}
.cal-day {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 5.5rem;
  padding: 0.4rem 0.35rem;
  background: rgba(22, 25, 30, 0.95);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease, outline-color 0.15s ease;
}
.cal-day:hover {
  background: rgba(196, 122, 44, 0.12);
  text-decoration: none;
}
.cal-day.is-out {
  opacity: 0.4;
}
.cal-day.is-today .cal-daynum {
  color: var(--ember-bright);
  box-shadow: inset 0 0 0 1px rgba(232, 160, 69, 0.7);
}
.cal-day.is-selected {
  background: rgba(196, 122, 44, 0.2);
  outline: 1px solid rgba(232, 160, 69, 0.55);
  outline-offset: -1px;
}
.cal-day.has-events .cal-daynum {
  font-weight: 700;
}
.cal-daynum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  font-size: 0.85rem;
}
.cal-dots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}
.cal-dots li {
  font-size: 0.68rem;
  line-height: 1.2;
  padding: 0.12rem 0.25rem;
  border-left: 2px solid var(--ember);
  background: rgba(14, 16, 20, 0.55);
  color: var(--parchment);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-dots .cal-more {
  border-left-color: transparent;
  background: transparent;
  color: var(--parchment-dim);
}
.cal-day-panel {
  border-color: rgba(232, 160, 69, 0.35);
}

@media (max-width: 700px) {
  .cal-day {
    min-height: 3.6rem;
    padding: 0.3rem 0.2rem;
  }
  .cal-dots li {
    font-size: 0;
    height: 0.35rem;
    padding: 0;
    border-left: 0;
    border-radius: 1px;
    background: var(--ember);
  }
  .cal-dots .cal-more {
    display: none;
  }
  .cal-dots {
    grid-auto-flow: column;
    grid-template-columns: repeat(3, 0.35rem);
    gap: 0.15rem;
  }
}

/* Raids */
.raid-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.raid-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(184, 174, 150, 0.15);
}
.raid-list a {
  font-weight: 700;
  color: var(--parchment);
  font-size: 1.05rem;
}
.raid-list a:hover {
  color: var(--ember-bright);
}
.raid-when {
  color: var(--parchment-dim);
  font-size: 0.9rem;
}

.signup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.signup-table th,
.signup-table td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(184, 174, 150, 0.15);
  vertical-align: middle;
}
.signup-table th {
  color: var(--parchment-dim);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.role-pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border: 1px solid rgba(196, 122, 44, 0.4);
  font-size: 0.8rem;
  color: var(--ember-bright);
}
.role-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--parchment-dim);
}
.empty {
  color: var(--parchment-dim);
  font-style: italic;
}

@media (max-width: 640px) {
  .site-header {
    padding: 1rem;
  }
  .dl-facts {
    grid-template-columns: 1fr;
  }
}
