:root {
  --bg: #0f0d13;
  --bg-soft: #191520;
  --panel: rgba(29, 22, 38, 0.94);
  --panel-border: rgba(231, 198, 120, 0.2);
  --gold: #e3c37a;
  --gold-strong: #f2d28a;
  --text: #f7f2e8;
  --muted: #cbbda0;
  --accent: #8f3d2f;
  --accent-2: #5a2336;
  --danger: #8e2f3a;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top, rgba(227, 195, 122, 0.12), transparent 30%),
    linear-gradient(180deg, #130f18 0%, #0a0910 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black, transparent 85%);
}

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

p {
  margin: 0;
}

button, input, textarea {
  font: inherit;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 24px auto 40px;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(227, 195, 122, 0.24);
  min-height: 260px;
  background:
    radial-gradient(circle at 20% 20%, rgba(227, 195, 122, 0.18), transparent 18%),
    radial-gradient(circle at 80% 30%, rgba(143, 61, 47, 0.18), transparent 24%),
    linear-gradient(120deg, rgba(10, 9, 16, 0.92), rgba(37, 20, 32, 0.88) 45%, rgba(16, 12, 22, 0.96));
  box-shadow: var(--shadow);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15), rgba(0,0,0,0.55));
}

.hero__content {
  position: relative;
  z-index: 1;
  padding: 40px;
  max-width: 720px;
}

.eyebrow {
  color: var(--gold-strong);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  margin-bottom: 10px;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: 14px;
}

.hero__text {
  font-size: 1.03rem;
  line-height: 1.7;
  color: #f3ead7;
}

.layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  margin-top: 22px;
}

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

.panel__header {
  padding: 24px 24px 0;
}

.panel__header p {
  margin-top: 8px;
  color: var(--muted);
}

.quest-form {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.quest-form label {
  display: grid;
  gap: 8px;
}

.quest-form span {
  color: var(--gold-strong);
  font-weight: 600;
}

input, textarea {
  width: 100%;
  border: 1px solid rgba(227, 195, 122, 0.18);
  background: rgba(9, 8, 14, 0.62);
  color: var(--text);
  padding: 14px 15px;
  border-radius: 14px;
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus {
  border-color: rgba(242, 210, 138, 0.8);
  box-shadow: 0 0 0 4px rgba(227, 195, 122, 0.12);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
  min-height: 140px;
}

.form-actions,
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-panel {
  padding-bottom: 24px;
}

.toolbar {
  padding: 24px;
}

.btn {
  appearance: none;
  border: 1px solid rgba(227, 195, 122, 0.22);
  background: linear-gradient(180deg, rgba(74, 53, 35, 0.9), rgba(44, 29, 18, 0.95));
  color: var(--text);
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(242, 210, 138, 0.7);
}

.btn--primary {
  background: linear-gradient(180deg, #7a5a2f, #5f431f);
}

.btn--accent {
  background: linear-gradient(180deg, #7d2d2a, #561d23);
}

.btn--ghost {
  background: rgba(19, 15, 24, 0.95);
}

.btn--danger {
  background: linear-gradient(180deg, #7b1e2d, #52131c);
}

.file-label input {
  display: none;
}

.tips-box {
  margin: 0 24px;
  border: 1px solid rgba(227, 195, 122, 0.16);
  border-radius: 16px;
  background: rgba(10, 9, 15, 0.5);
  padding: 18px;
}

.tips-box h3 {
  margin-bottom: 10px;
}

.tips-box ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.register-panel {
  margin-top: 22px;
  padding-bottom: 24px;
}

.register-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quest-list {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.quest-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(33, 24, 45, 0.98), rgba(18, 15, 25, 0.98));
  border: 1px solid rgba(227, 195, 122, 0.14);
  min-height: 250px;
}

.quest-card__glow {
  position: absolute;
  inset: -40% auto auto -20%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(227, 195, 122, 0.18), transparent 70%);
}

.quest-card__content {
  position: relative;
  z-index: 1;
  padding: 20px;
  display: grid;
  gap: 14px;
}

.quest-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.quest-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(227, 195, 122, 0.12);
  color: var(--gold-strong);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quest-card__actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(227, 195, 122, 0.15);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
}

.quest-title {
  font-size: 1.25rem;
  line-height: 1.3;
}

.quest-description {
  color: #eadfca;
  line-height: 1.65;
  white-space: pre-wrap;
}

.boss-box {
  margin-top: auto;
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(100, 31, 35, 0.35), rgba(44, 16, 23, 0.42));
  border: 1px solid rgba(227, 195, 122, 0.1);
}

.boss-box span {
  color: #f2c5b1;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.empty-state {
  margin: 24px;
  padding: 40px 24px;
  text-align: center;
  border: 1px dashed rgba(227, 195, 122, 0.18);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(13, 12, 18, 0.45);
}

.empty-state__icon {
  font-size: 2rem;
  color: var(--gold-strong);
  margin-bottom: 10px;
}

.pdf-export-area {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: -1;
}

.pdf-sheet {
  width: 794px;
  background: #f7f1e5;
  color: #2b1d12;
  padding: 28px;
}

.pdf-sheet__header {
  border-bottom: 2px solid #c4a35c;
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.pdf-sheet__header p,
.pdf-sheet__header span {
  color: #6b5231;
}

.pdf-sheet__header h2 {
  color: #442c18;
  margin: 6px 0;
}

.pdf-quest-container {
  display: grid;
  gap: 16px;
}

.pdf-quest-card {
  border: 1px solid #d6c0a0;
  border-radius: 12px;
  padding: 14px;
  background: #fffaf2;
}

.pdf-quest-card h3 {
  color: #4a2d1b;
  margin-bottom: 8px;
}

.pdf-quest-card p {
  white-space: pre-wrap;
  line-height: 1.6;
}

.pdf-boss {
  margin-top: 10px;
  font-weight: 700;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1220px);
    margin-top: 10px;
  }

  .hero__content,
  .panel__header,
  .quest-form,
  .toolbar,
  .quest-list {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero {
    min-height: 220px;
  }
}
