/* ============================================================
   Titan Enshrouded portal — original survival-fantasy styling.
   Palette: shrouded night violet, ancient-flame amber, ember glow.
   Original artwork; not affiliated with Keen Games.
   ============================================================ */
:root {
  --night-1:  #0e0a16;
  --night-2:  #161020;
  --night-3:  #1d1530;
  --flame:    #ff8c42;
  --flame-dk: #e0662a;
  --flame-dkr:#c1531f;
  --ember:    #ffb35c;
  --shroud:   #9a6dff;
  --shroud-dk:#6f45d6;
  --ink:      #efe9f6;
  --ink-soft: #a99fbd;
  --card:     #201830;
  --card-2:   #271e3a;
  --field:    #171021;
  --line:     #372c50;
  --ok:       #57c06a;
  --ok-dk:    #3d9550;
  --danger:   #ff6b5e;
  --discord:  #5865f2;
  --shadow:    0 20px 44px -18px rgba(0,0,0,.7);
  --shadow-sm: 0 10px 22px -12px rgba(0,0,0,.65);
  --radius:    20px;
  --radius-sm: 13px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background: var(--night-1);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}
h1, h2, h3, .brand span { font-family: "Cinzel", "Baloo 2", serif; letter-spacing: .4px; }
a { color: var(--ember); text-decoration: none; }
a:hover { color: var(--flame); }
img { max-width: 100%; }

/* ---------- Fixed night scenery ---------- */
.scenery { position: fixed; inset: 0; z-index: -2; }
.nightsky {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 45%, var(--night-3) 100%);
}
/* warm flame glow rising from the horizon */
.glow {
  position: absolute; left: 50%; bottom: -8vh; transform: translateX(-50%);
  width: 120vw; height: 60vh;
  background: radial-gradient(ellipse at center, rgba(255,140,66,.22) 0%, rgba(154,109,255,.10) 40%, transparent 72%);
  filter: blur(6px);
}
/* drifting shroud fog */
.fog {
  position: absolute; inset: 0; overflow: hidden; opacity: .5;
}
.fog span {
  position: absolute; display: block; height: 130px; width: 60vw; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(154,109,255,.18), transparent 70%);
  filter: blur(10px); animation: drift linear infinite;
}
.fog .f1 { top: 20%; left: -60vw; animation-duration: 90s; }
.fog .f2 { top: 46%; left: -60vw; animation-duration: 130s; animation-delay: -40s; opacity: .7; }
.fog .f3 { top: 68%; left: -60vw; animation-duration: 160s; animation-delay: -80s; }
@keyframes drift { to { transform: translateX(180vw); } }
/* rising embers */
.embers { position: absolute; inset: 0; overflow: hidden; }
.embers span {
  position: absolute; bottom: -12px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--ember); box-shadow: 0 0 8px 2px rgba(255,140,66,.6);
  animation: rise linear infinite; opacity: 0;
}
.embers .e1 { left: 12%; animation-duration: 9s;  animation-delay: 0s; }
.embers .e2 { left: 27%; animation-duration: 13s; animation-delay: -3s; }
.embers .e3 { left: 43%; animation-duration: 11s; animation-delay: -6s; }
.embers .e4 { left: 61%; animation-duration: 15s; animation-delay: -2s; }
.embers .e5 { left: 74%; animation-duration: 10s; animation-delay: -8s; }
.embers .e6 { left: 88%; animation-duration: 14s; animation-delay: -5s; }
@keyframes rise {
  0%   { transform: translateY(0) scale(1);   opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translateY(-104vh) scale(.3); opacity: 0; }
}
/* jagged ridge silhouette along the bottom */
.ridge { position: absolute; bottom: 0; left: 0; width: 100%; height: 40vh; min-height: 260px; }
.ridge .r1 { fill: #0c0813; }
.ridge .r2 { fill: #120c1c; opacity: .85; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 5vw, 48px);
  background: rgba(20,14,30,.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 1.2rem; }
.brand img { filter: drop-shadow(0 0 8px rgba(255,140,66,.5)); }
.nav-links { display: flex; align-items: center; gap: clamp(10px, 2.4vw, 26px); font-weight: 700; }
.nav-links a { color: var(--ink-soft); }
.nav-links a:hover { color: var(--ember); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: "Cinzel", "Baloo 2", serif; font-weight: 700; font-size: .98rem; letter-spacing: .3px;
  color: #2a1608; background: linear-gradient(180deg, var(--ember), var(--flame));
  border: none; border-radius: 999px; padding: 12px 24px; cursor: pointer;
  box-shadow: 0 5px 0 var(--flame-dkr), var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--flame-dkr), var(--shadow); filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--flame-dkr); }
.btn-lg { padding: 15px 32px; font-size: 1.08rem; }
.btn-sm { padding: 9px 18px; font-size: .9rem; box-shadow: 0 4px 0 var(--flame-dkr); }
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent; color: var(--shroud); border: 1.5px solid var(--shroud-dk);
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(154,109,255,.12); box-shadow: none; filter: none; }
.btn-ghost:active { transform: translateY(1px); }
.btn-ok { background: linear-gradient(180deg, #6fd082, var(--ok)); color: #08240f; box-shadow: 0 5px 0 var(--ok-dk); }
.btn-no { background: transparent; color: var(--danger); border: 1.5px solid #6b3540; box-shadow: none; }
.btn-discord { background: var(--discord); color: #fff; box-shadow: 0 5px 0 #3f4ad1; }
.btn-discord:hover { box-shadow: 0 7px 0 #3f4ad1, var(--shadow); }

/* ---------- Layout ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 32px) 60px; }
body.page-narrow main { max-width: 640px; }
body.page-wide main { max-width: 1000px; }
.section-title { font-size: clamp(1.6rem, 3.5vw, 2.3rem); text-align: center; margin: 8px 0 28px; }
.section-title.left { text-align: left; }

/* ---------- Flash ---------- */
.flash-wrap { margin: 18px 0; display: grid; gap: 8px; }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 700; border: 1px solid; }
.flash-error { background: rgba(255,107,94,.12); color: #ff9c92; border-color: #5c2b2b; }
.flash-success { background: rgba(87,192,106,.12); color: #8fe0a0; border-color: #2e5c36; }

/* ---------- Hero ---------- */
.hero { padding: clamp(30px, 6vw, 64px) 0 20px; }
.hero-inner { display: grid; grid-template-columns: 1.25fr .75fr; gap: 24px; align-items: center; }
.eyebrow {
  display: inline-block; background: rgba(154,109,255,.14); color: var(--shroud);
  font-weight: 800; font-size: .8rem; letter-spacing: .8px; text-transform: uppercase;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 16px; border: 1px solid var(--line);
}
.hero h1 { font-size: clamp(2.1rem, 5.6vw, 3.7rem); line-height: 1.06; margin: 0 0 16px; color: var(--ink); text-shadow: 0 2px 20px rgba(255,140,66,.25); }
.lede { font-size: clamp(1.05rem, 2.3vw, 1.24rem); color: var(--ink-soft); max-width: 36ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 24px 0 14px; }
.hero-note { font-size: .95rem; color: var(--ink-soft); background: rgba(154,109,255,.1); display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); }
.hero-art { display: flex; justify-content: center; }
.float-sphere { width: min(320px, 72%); filter: drop-shadow(0 0 40px rgba(255,140,66,.4)); animation: bob 5s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(-8px); } 50% { transform: translateY(10px); } }

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  background: var(--card); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); margin: 20px 0 44px; border: 1px solid var(--line);
}
.stat { text-align: center; }
.stat-num { display: block; font-family: "Cinzel", serif; font-weight: 700; font-size: clamp(1.7rem, 4vw, 2.5rem); color: var(--ember); line-height: 1; }
.stat-label { font-size: .88rem; color: var(--ink-soft); font-weight: 700; }

/* ---------- Features ---------- */
.features { margin: 40px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--shroud-dk); }
.card-ico {
  width: 52px; height: 52px; display: grid; place-items: center; font-size: 1.6rem;
  background: linear-gradient(160deg, rgba(154,109,255,.25), rgba(255,140,66,.18));
  border: 1px solid var(--line); border-radius: 16px; margin-bottom: 14px;
}
.card h3 { margin: 0 0 6px; font-size: 1.22rem; }
.card p { margin: 0; color: var(--ink-soft); }

/* ---------- Rules ---------- */
.rules { margin: 50px 0; }
.rules-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 30px; box-shadow: var(--shadow-sm); max-width: 780px; margin: 0 auto;
}
.rules-card ol { padding-left: 22px; }
.rules-card li { margin: 14px 0; color: var(--ink-soft); }
.rules-card strong { color: var(--ink); }

/* ---------- Apply ---------- */
.apply { margin: 50px 0 10px; }
.apply-inner { display: grid; grid-template-columns: .85fr 1.15fr; gap: 30px; align-items: start; }
.apply-copy p { color: var(--ink-soft); }
.apply-steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.apply-steps li { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--ink); }
.apply-steps span {
  flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--ember), var(--flame)); color: #2a1608; border-radius: 50%; font-family: "Cinzel", serif; box-shadow: 0 3px 0 var(--flame-dkr);
}
.apply-form {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); display: grid; gap: 16px;
}
.apply-form label { display: grid; gap: 6px; font-weight: 700; color: var(--ink); }
.apply-form small { font-weight: 600; color: var(--ink-soft); }
.apply-form .opt, .apply-form .form-fine { color: var(--ink-soft); font-weight: 600; }
.apply-form input, .apply-form select, .apply-form textarea {
  font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--field); color: var(--ink); transition: border-color .12s ease, box-shadow .12s ease;
}
.apply-form input::placeholder, .apply-form textarea::placeholder { color: #6b6180; }
.apply-form input:focus, .apply-form select:focus, .apply-form textarea:focus {
  outline: none; border-color: var(--shroud); box-shadow: 0 0 0 4px rgba(154,109,255,.2);
}
.apply-form textarea { resize: vertical; }
.apply-form option { background: var(--field); color: var(--ink); }
.form-fine { text-align: center; font-size: .9rem; margin: 2px 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Status page ---------- */
.status-wrap { padding: clamp(24px, 6vw, 56px) 0; }
.status-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(24px, 5vw, 40px); box-shadow: var(--shadow); text-align: center;
}
.status-card h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 12px 0 10px; }
.status-card p { color: var(--ink-soft); }
.status-badge {
  display: inline-block; font-weight: 800; font-size: .88rem; letter-spacing: .4px;
  padding: 7px 16px; border-radius: 999px; background: rgba(154,109,255,.14); color: var(--shroud); border: 1px solid var(--line);
}
.status-badge.ok { background: rgba(87,192,106,.14); color: #8fe0a0; border-color: #2e5c36; }
.status-badge.no { background: rgba(255,107,94,.12); color: #ff9c92; border-color: #5c2b2b; }
.muted { color: var(--ink-soft); font-size: .96rem; }
.muted.center, .center { text-align: center; }

.connect { text-align: left; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 24px 0; }
.connect h2 { margin: 0 0 12px; font-size: 1.25rem; }
.connect-steps { color: var(--ink-soft); padding-left: 20px; margin: 0 0 18px; }
.cred { margin: 12px 0; }
.cred-label { display: block; font-weight: 700; font-size: .82rem; color: var(--ink-soft); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .5px; }
.cred-row { display: flex; gap: 8px; align-items: stretch; }
.cred-row code {
  flex: 1; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.05rem;
  background: var(--field); border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--ember); word-break: break-all;
}
.copy {
  border: none; background: linear-gradient(180deg, var(--ember), var(--flame)); color: #2a1608; font-weight: 700; font-family: "Cinzel", serif;
  border-radius: var(--radius-sm); padding: 0 18px; cursor: pointer; box-shadow: 0 4px 0 var(--flame-dkr);
  transition: transform .1s ease;
}
.copy:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--flame-dkr); }
.copy.done { filter: brightness(.85); }
.back-link { display: inline-block; margin-top: 20px; font-weight: 700; }

/* ---------- Admin ---------- */
.admin { padding: 30px 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-head h1 { margin: 0; }
.admin-sub { margin: 30px 0 14px; display: flex; align-items: center; gap: 10px; font-size: 1.3rem; }
.pill { background: linear-gradient(180deg, var(--ember), var(--flame)); color: #2a1608; font-family: "Cinzel", serif; font-size: .9rem; padding: 2px 12px; border-radius: 999px; }
.admin-list { display: grid; gap: 14px; }
.app-row {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 18px 20px; display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap;
}
.app-name { font-family: "Cinzel", serif; font-weight: 700; font-size: 1.18rem; }
.app-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--ink-soft); font-size: .92rem; font-weight: 600; margin-top: 4px; }
.app-msg { background: var(--card-2); border-left: 3px solid var(--shroud); padding: 8px 12px; border-radius: 8px; color: var(--ink-soft); margin: 10px 0 6px; }
.app-link { font-size: .85rem; font-weight: 700; }
.app-actions { display: flex; gap: 10px; }
.empty { color: var(--ink-soft); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; }
.decided { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.decided th, .decided td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.decided th { background: var(--card-2); color: var(--ink-soft); font-family: "Cinzel", serif; }
.decided tr:last-child td { border-bottom: none; }
.tag { font-weight: 700; font-size: .82rem; padding: 3px 10px; border-radius: 999px; }
.tag-approved { background: rgba(87,192,106,.14); color: #8fe0a0; }
.tag-denied { background: rgba(255,107,94,.12); color: #ff9c92; }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 30px clamp(16px,5vw,32px) 40px; color: var(--ink-soft); }
.site-footer .disclaimer { max-width: 640px; margin: 8px auto 0; font-size: .78rem; opacity: .8; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .float-sphere { width: 170px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .apply-inner { grid-template-columns: 1fr; }
  .nav-links a:not(.btn) { display: none; }
}
