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

:root {
  --bg: #090705;
  --bg-soft: rgba(17, 11, 8, 0.9);
  --panel: rgba(34, 22, 15, 0.92);
  --panel-bright: rgba(58, 36, 24, 0.96);
  --border: #7e5a32;
  --border-hot: #caa46a;
  --gold: #d8b167;
  --gold-hot: #f0d19a;
  --ink: #f6ead0;
  --muted: #cab998;
  --red: #a73d1f;
  --green: #3f7b34;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Marcellus", Georgia, serif;
  background:
    radial-gradient(circle at top, rgba(150, 84, 26, 0.22), transparent 30%),
    linear-gradient(180deg, rgba(6, 4, 3, 0.75), rgba(6, 4, 3, 0.96)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 211, 147, 0.03) 0,
      rgba(255, 211, 147, 0.03) 8px,
      rgba(0, 0, 0, 0) 8px,
      rgba(0, 0, 0, 0) 16px
    ),
    #0b0907;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(transparent 0%, rgba(10, 8, 6, 0.12) 50%, rgba(10, 8, 6, 0.45) 100%),
    radial-gradient(circle at 20% 0%, rgba(196, 143, 63, 0.12), transparent 25%),
    radial-gradient(circle at 100% 20%, rgba(104, 40, 18, 0.15), transparent 28%);
  pointer-events: none;
}

a {
  color: var(--gold-hot);
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.masthead {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
  padding: 20px 24px;
  border: 1px solid rgba(209, 164, 91, 0.28);
  background:
    linear-gradient(180deg, rgba(62, 39, 26, 0.92), rgba(27, 18, 12, 0.95)),
    radial-gradient(circle at top, rgba(221, 174, 96, 0.08), transparent 40%);
  box-shadow: var(--shadow);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-emblem {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 233, 184, 0.55), transparent 20%),
    linear-gradient(135deg, #94591d, #3b2312);
  border: 1px solid var(--border-hot);
  box-shadow: inset 0 0 0 2px rgba(255, 220, 152, 0.18), 0 10px 24px rgba(0, 0, 0, 0.35);
  position: relative;
}

.brand-emblem::before,
.brand-emblem::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 223, 172, 0.34);
  clip-path: polygon(50% 0%, 100% 40%, 82% 100%, 18% 100%, 0% 40%);
}

.brand-overline,
.hero-mark,
.panel-kicker,
.modal-kicker,
.session-role {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--gold);
}

.brand-title,
h1,
h2,
h3 {
  margin: 0;
  font-family: "Cinzel", "Palatino Linotype", serif;
  letter-spacing: 0.03em;
}

.brand-title {
  font-size: clamp(1.5rem, 2vw, 2.2rem);
}

.session-box {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(202, 164, 106, 0.35);
  background: rgba(17, 11, 8, 0.6);
}

.session-name {
  font-size: 1rem;
  color: var(--gold-hot);
}

.main-content {
  display: grid;
  gap: 24px;
}

.hero-card,
.panel,
.stat-card,
.modal-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(63, 41, 29, 0.94), rgba(31, 20, 14, 0.96)),
    linear-gradient(135deg, rgba(255, 244, 214, 0.02), transparent);
  border: 1px solid rgba(207, 167, 104, 0.3);
  box-shadow: var(--shadow);
}

.hero-card::before,
.panel::before,
.stat-card::before,
.modal-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(202, 164, 106, 0.17);
  pointer-events: none;
}

.hero-card {
  padding: 32px;
  min-height: 320px;
}

.hero-card--login {
  max-width: 680px;
}

.hero-card--loading {
  display: grid;
  place-items: center;
  text-align: center;
}

.hero-copy,
.panel-copy,
.modal-copy {
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.6;
}

.login-form,
.upload-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.login-form label,
.upload-form label {
  display: grid;
  gap: 8px;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(214, 169, 97, 0.34);
  background: rgba(7, 5, 4, 0.8);
  color: var(--ink);
  padding: 14px 16px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--border-hot);
  box-shadow: 0 0 0 1px rgba(240, 209, 154, 0.24);
}

textarea {
  min-height: 300px;
  resize: vertical;
  line-height: 1.5;
}

.wow-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(206, 165, 90, 0.4);
  background:
    linear-gradient(180deg, rgba(118, 79, 36, 0.92), rgba(67, 44, 24, 0.96));
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.wow-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.wow-button--primary {
  background:
    linear-gradient(180deg, rgba(173, 105, 39, 0.95), rgba(115, 61, 21, 0.98));
}

.wow-button--secondary {
  background:
    linear-gradient(180deg, rgba(82, 59, 37, 0.95), rgba(48, 34, 22, 0.98));
}

.wow-button--danger {
  background:
    linear-gradient(180deg, rgba(142, 49, 28, 0.96), rgba(88, 25, 15, 0.98));
}

.wow-button--wide {
  width: 100%;
}

.wow-button--small {
  min-height: 36px;
  padding: 0 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 22px;
}

.stat-label {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}

.stat-value {
  margin-top: 10px;
  font-family: "Cinzel", serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.stat-detail {
  margin-top: 8px;
  color: var(--muted);
}

.panel {
  padding: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.achievement-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.achievement-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 180px;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(206, 165, 90, 0.18);
  background:
    linear-gradient(180deg, rgba(50, 32, 22, 0.9), rgba(24, 16, 11, 0.94));
}

.achievement-card--done {
  opacity: 0.82;
}

.achievement-card--starred {
  box-shadow: inset 0 0 0 1px rgba(246, 218, 163, 0.22);
  border-color: rgba(246, 218, 163, 0.42);
}

.achievement-rank {
  display: grid;
  place-items: center;
  font-family: "Cinzel", serif;
  font-size: 1.2rem;
  color: var(--gold-hot);
  border: 1px solid rgba(206, 165, 90, 0.24);
  background: rgba(14, 9, 7, 0.65);
}

.achievement-main {
  min-width: 0;
}

.achievement-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.achievement-heading h3 {
  font-size: 1.1rem;
}

.achievement-meta,
.achievement-reward,
.achievement-date {
  margin-top: 6px;
}

.achievement-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.94rem;
}

.achievement-reward {
  color: var(--gold-hot);
}

.achievement-date {
  color: var(--muted);
  font-size: 0.92rem;
}

.achievement-side {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 6px;
  text-align: right;
}

.achievement-count {
  font-family: "Cinzel", serif;
  font-size: 1.7rem;
}

.achievement-caption,
.achievement-interest {
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(33, 22, 16, 0.78);
  border: 1px solid rgba(206, 165, 90, 0.22);
}

.status-badge--done {
  background: rgba(49, 92, 44, 0.42);
  border-color: rgba(111, 180, 88, 0.35);
}

.star-shell {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(206, 165, 90, 0.28);
  background: rgba(20, 13, 9, 0.88);
  color: #8e744f;
  font-size: 1.45rem;
  cursor: pointer;
}

.star-shell--active {
  color: var(--gold-hot);
  background: radial-gradient(circle, rgba(230, 188, 102, 0.2), rgba(20, 13, 9, 0.88));
  border-color: rgba(240, 209, 154, 0.52);
}

.star-shell--locked {
  color: #a9d39c;
  cursor: default;
}

.error-banner {
  padding: 12px 14px;
  border: 1px solid rgba(205, 79, 51, 0.4);
  background: rgba(92, 27, 15, 0.72);
  color: #ffd5c7;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 3, 2, 0.7);
}

.modal-card {
  width: min(900px, 100%);
  padding: 28px;
}

.modal-card--guide {
  width: min(760px, 100%);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(206, 165, 90, 0.28);
  background: rgba(20, 13, 9, 0.88);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.3rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.guide-list {
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.65;
}

.table-wrap {
  overflow-x: auto;
}

.guild-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.guild-table th,
.guild-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(206, 165, 90, 0.12);
  text-align: left;
}

.guild-table thead th {
  font-family: "Cinzel", serif;
  color: var(--gold-hot);
  font-weight: 600;
}

code {
  color: var(--gold-hot);
  font-family: "Courier New", monospace;
}

@media (max-width: 980px) {
  .masthead,
  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }

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

  .achievement-card {
    grid-template-columns: 1fr;
  }

  .achievement-rank {
    width: 56px;
    height: 56px;
  }

  .achievement-side {
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 14px 12px 42px;
  }

  .hero-card,
  .panel,
  .stat-card,
  .modal-card {
    padding: 18px;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-emblem {
    width: 52px;
    height: 52px;
  }

  .panel-actions,
  .session-box {
    flex-direction: column;
    align-items: stretch;
  }

  .wow-button {
    width: 100%;
  }

  .modal-actions {
    flex-direction: column;
  }
}
