@font-face {
  font-family: "Estedad";
  src: url("fonts/Estedad-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #1a0815;
  --surface: #2b1224;
  --raised: #3a1a2e;
  --field: #210c1b;
  --edge: #59394e;
  --ink: #fff0d7;
  --sub: #d6becd;
  --lime: #c8fc19;
  --pink: #ff278c;
  --focus: #ff83bd;
  --paper: #faecd1;
  --mono: Consolas, "Courier New", monospace;
  --radius: 10px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.75 "Estedad","Segoe UI",Tahoma,sans-serif; overflow-wrap: anywhere; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.4; }
h1 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); }
h2 { font-size: clamp(1.35rem, 2vw, 1.7rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 .75em; }
p:last-child { margin-bottom: 0; }
a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.wrap { width: min(calc(100% - 88px), 1320px); margin-inline: auto; }
.main { padding-block: 26px 22px; min-height: 72vh; }
.main > * + :is(section, article, details, .grid) { margin-block-start: 18px; }
.skip { position: absolute; z-index: 3; inset-inline-start: 10px; top: -8rem; background: var(--lime); color: var(--bg); padding: .5em 1em; }
.skip:focus { top: 5px; }
.icon { display: inline-block; flex: none; vertical-align: middle; }
.site-header { background: #28051b; border-top: 4px solid var(--pink); border-bottom: 1px solid var(--edge); }
.site-bar, .site-nav, .site-footer { display: flex; align-items: center; }
.site-bar { min-height: 70px; gap: clamp(24px, 6vw, 94px); }
.brand { flex: none; line-height: 0; }
.brand img { width: 196px; }
.site-nav { gap: clamp(14px, 2.2vw, 32px); flex-wrap: wrap; }
.site-nav a { color: var(--sub); font-size: .95rem; white-space: nowrap; }
.site-nav a[aria-current] { color: var(--ink); font-weight: 700; }
.site-nav a[aria-current]::before { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--pink); margin-inline-end: 7px; }
.site-nav a:hover, .site-footer a:hover { color: var(--lime); }
.nav-action { margin: 0; margin-inline-start: auto; }
.nav-btn { display: inline-flex; align-items: center; gap: 9px; padding: 6px 16px; min-height: 40px; border: 1px solid #846578; background: transparent; color: var(--ink); border-radius: 5px; font-size: .94rem; font-weight: 650; white-space: nowrap; }
.nav-btn:hover { background: var(--raised); text-decoration: none; }
.site-footer { border-top: 1px solid var(--edge); padding-block: 14px 20px; justify-content: space-between; gap: 14px; color: var(--sub); font-size: .81rem; }
.site-footer a { color: inherit; }

.btn, button:not(.nav-btn), input[type=submit] { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--lime); color: var(--bg); border: 1px solid transparent; border-radius: 5px; padding: 8px 18px; font-weight: 700; line-height: 1.6; transition: background .15s, transform .15s; }
.btn:hover, button:not(:disabled):not(.nav-btn):hover, input[type=submit]:hover { filter: brightness(1.08); transform: translateY(-1px); text-decoration: none; }
.btn.primary { border-bottom: 4px solid #84ab20; }
.btn.secondary, button.secondary, button[data-warning], .panel form[data-confirm] button { color: var(--ink); border-color: #886b7d; background: var(--raised); }
button.danger, .panel button[value=REJECTED], .panel button[value=end] { background: #56233a; color: #ffcedf; border-color: #a35974; }
form { max-width: 100%; }
label { display: block; font-weight: 600; margin: 10px 0; }
label > :is(input, select, textarea) { margin-top: 5px; }
input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=submit]), select, textarea { display: block; min-width: 0; width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #79596e; background: var(--field); color: var(--ink); border-radius: 6px; line-height: 1.6; }
textarea { min-height: 110px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #b294a6; }
input[type=file] { font-size: .9rem; }
input::file-selector-button { border: 0; border-radius: 4px; background: var(--raised); color: var(--ink); margin-inline-end: 10px; padding: 6px 10px; }
fieldset { border: 1px solid var(--edge); border-radius: 8px; min-width: 0; margin: 13px 0; padding: 8px 16px 14px; }
legend { color: var(--lime); padding-inline: 8px; }
.panel, .card { min-width: 0; padding: clamp(16px, 2.2vw, 28px); border: 1px solid var(--edge); border-radius: var(--radius); background: var(--surface); }
.panel :is(summary, time, small), .card p, small { color: var(--sub); }
.panel summary { padding-block: 5px; font-weight: 650; }
.panel summary::marker { color: var(--pink); }
.panel details:not(.panel), .panel article + article, .panel form + form { border-block-start: 1px solid var(--edge); padding-block-start: 12px; margin-block-start: 12px; }
.panel form button { margin: 4px 0 4px 5px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 235px), 1fr)); gap: 14px; }
.card > strong:first-child { color: var(--lime); font-size: 2rem; }
.panel > :last-child, .card > :last-child { margin-bottom: 0; }
.page-head { background: linear-gradient(100deg,#44142f,var(--surface) 75%); padding: clamp(15px,2.4vw,28px); border: 1px solid var(--edge); border-inline-start: 4px solid var(--pink); border-radius: var(--radius); }
.page-head > :last-child { margin-bottom: 0; }
.page-head nav { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; }
.page-head nav a { color: var(--lime); }
.page-head p { color: var(--sub); }
.panel [data-clock]:not(:empty) { display: inline-block; direction: ltr; color: var(--lime); font: 700 1.1rem var(--mono); border: 1px solid var(--edge); border-radius: 5px; padding: .2em .5em; }
.auth-panel { overflow: hidden; max-width: 560px; margin-inline: auto; }
.auth-panel::before { content: ""; display: block; height: clamp(82px,12vw,128px); margin: calc(-1 * clamp(16px,2.2vw,28px)) calc(-1 * clamp(16px,2.2vw,28px)) 18px; background: #360a26 url("images/gozargah-landscape.webp") center 54% / cover; border-bottom: 3px solid var(--pink); }
.auth-panel form { margin-bottom: 12px; }
.device-tip { border-inline-start: 3px solid var(--lime); padding: 8px 12px; background: var(--field); border-radius: 5px; }
.auth-panel h1 { font-size: 2rem; }
.flash { margin: 0 0 16px; background: #27321b; border: 1px solid #688341; border-radius: 7px; padding: 9px 14px; color: #e3ffb9; }
.flash.error, .flash.danger { background: #4a1932; color: #ffd2df; border-color: #a95274; }
.prose, .preserve, pre { white-space: pre-wrap; overflow-wrap: anywhere; }
pre, code, kbd { direction: ltr; unicode-bidi: isolate; font-family: var(--mono); }
pre { text-align: left; border-radius: 6px; padding: 12px; background: var(--field); }
.theme-1 { --accent: #ff599e; --quest-img: url("images/quest-1.png"); }
.theme-2 { --accent: #ba89ff; --quest-img: url("images/quest-2.png"); }
.theme-3 { --accent: #98f584; --quest-img: url("images/quest-3.png"); }
.theme-4 { --accent: #64d9df; --quest-img: url("images/quest-4.png"); }
.theme-5 { --accent: #ffbd80; --quest-img: url("images/quest-5.png"); }
@media (prefers-reduced-motion: no-preference) {
  .theme-1 { --quest-img: url("images/quest-1.gif"); }
  .theme-2 { --quest-img: url("images/quest-2.gif"); }
  .theme-3 { --quest-img: url("images/quest-3.gif"); }
  .theme-4 { --quest-img: url("images/quest-4.gif"); }
  .theme-5 { --quest-img: url("images/quest-5.gif"); }
}
.team-quests { grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr)); align-items: start; }
.team-quests .card { overflow: hidden; padding: 15px; }
.team-quests .card::before { content: ""; display: block; margin: -15px -15px 12px; height: 98px; background: var(--quest-img) center / cover; image-rendering: pixelated; border-bottom: 2px solid var(--accent); }
.team-quests h2 { font-size: 1.25rem; }
.panel[class*="theme-"] { overflow: hidden; border-inline-start: 4px solid var(--accent); }
.panel[class*="theme-"]::before { content: ""; display: block; float: left; width: clamp(100px,24%,235px); aspect-ratio: 190/85; margin: 0 14px 12px 0; border-radius: 6px; background: var(--quest-img) center / cover; image-rendering: pixelated; }
.panel[class*="theme-"] h1 { color: var(--accent); }
.panel[class*="theme-"] .prose, .question-report, .arena-opening { clear: both; background: var(--field); padding: 16px; border-radius: 7px; margin-block: 12px; }
.panel.theme-3 .prose [dir=auto]:dir(ltr) { font-family: var(--mono); color: #baffab; }
.panel[id^="post-"] { max-width: 780px; border-inline-start: 4px solid var(--pink); }
.panel[id^="post-"] h2 { font-size: 1.3rem; margin-bottom: 0; }
.panel[id^="post-"] .prose { margin-block: 14px; }
.post-image { width: min(100%,320px); max-height: 280px; object-fit: contain; border-radius: 6px; }
.reactions { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--edge); padding-top: 10px; margin-top: 12px; }
.reactions button { color: var(--ink); background: var(--raised); border: 1px solid var(--edge); padding: 4px 12px; border-radius: 20px; }
.reactions button:disabled { cursor: default; }
hr { border: none; border-top: 1px solid var(--edge); }

@media (max-width: 950px) {
  .wrap { width: calc(100% - 40px); }
  .site-bar { gap: 20px; }
}
@media (max-width: 740px) {
  .wrap { width: calc(100% - 24px); }
  .main { padding-top: 15px; }
  .site-bar { flex-wrap: wrap; gap: 2px 10px; padding-top: 9px; }
  .brand img { width: clamp(136px,42vw,178px); }
  .site-nav { order: 3; flex-basis: 100%; gap: 6px 18px; min-height: 42px; }
  .site-nav a { font-size: .85rem; }
  .nav-btn { padding: 6px 10px; font-size: .85rem; }
  .site-footer { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
