/* ===========================
   MaskTheFear — Global Styles
   =========================== */

:root{
  --bg: #0b1222;
  --panel: #111a2e;
  --panel-2: #0d1630;
  --text: #dbe7ff;
  --muted: #b4c3e1;
  --link: #66a8ff;
  --link-2: #4ca3ff;
  --accent: #2f79ff;
  --accent-2: #2a66cf;
  --warning: #e8b04c;
  --danger: #ff5e66;
  --ok: #37d39b;
  --chip: #20314f;
  --chip-text: #cfe2ff;
  --border: rgba(255,255,255,.08);
  --shadow: rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1100px 500px at 10% -10%, rgba(128,170,255,.06), transparent 70%),
              radial-gradient(900px 500px at 110% 110%, rgba(90,150,255,.06), transparent 70%),
              var(--bg);
  line-height: 1.45;
}

a{ color: var(--link); text-decoration: none; }
a:hover{ color: #b6d3ff; text-decoration: underline; }

.container{
  width: min(1100px, 92%);
  margin: 0 auto;
}

.small{ font-size: .92rem; color: var(--muted); }
hr.sep{
  height: 1px; border: 0; background: var(--border);
  margin: 16px 0;
}

/* ===========================
   Header & Navigation
   =========================== */
.site-header{
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(6px);
  background: rgba(8,12,24,.6);
  border-bottom: 1px solid var(--border);
}
.header-inner{
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}
.brand{ display: flex; align-items: center; gap: 12px; }
.logo{
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2f79ff, #6aa8ff);
  color: white; font-weight: 700; letter-spacing: .5px;
}
.brand strong{ font-weight: 700; letter-spacing: .3px; }
.tagline{ color: var(--muted); font-size: .92rem; margin-left: 6px; }
.userbox{ display: flex; align-items: center; gap: 10px; }
.hello a{ color: var(--text); text-decoration: underline; }

nav ul{
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 14px;
}
nav a{
  color: var(--text); text-decoration: none; opacity: .9;
  padding: 8px 10px; border-radius: 8px;
}
nav a:hover{ background: rgba(255,255,255,.06); }

/* ===========================
   Main layout
   =========================== */
.site-main{ padding: 18px 0 40px; }

/* Cards & grids */
.grid{
  display: grid; gap: 14px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 980px){ .grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px){ .grid{ grid-template-columns: 1fr; } }

.card{
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 30px var(--shadow);
}
.card h3{ margin: 0 0 6px; }
.card .actions{
  margin-top: 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}

/* Buttons */
.btn{
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 14px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff; border: 0; border-radius: 10px;
  cursor: pointer; font-weight: 600; letter-spacing: .2px;
  box-shadow: 0 6px 16px rgba(47,121,255,.35);
}
.btn:hover{ filter: brightness(1.05); text-decoration: none; }
.btn:disabled{ opacity: .6; cursor: not-allowed; }
.btn.small{ height: 30px; padding: 0 10px; font-size: .92rem; }
.btn.outline{
  background: transparent; color: var(--text);
  border: 1px solid var(--border); box-shadow: none;
}
.btn.warn{ background: linear-gradient(180deg, #f1b455, #c98a2f); box-shadow: 0 6px 16px rgba(241,180,85,.35); }
.btn.danger{ background: linear-gradient(180deg, #ff6a71, #d84b52); box-shadow: 0 6px 16px rgba(255,106,113,.35); }

/* Chips / tags */
.tags{ display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag{
  display: inline-block; padding: 5px 10px; border-radius: 999px;
  background: var(--chip); color: var(--chip-text);
  border: 1px solid var(--border); font-size: .9rem;
}

/* Forms */
.form-page h1, .form-page h2{ margin-top: 0; }
.form-grid{ display: grid; gap: 12px; grid-template-columns: 1fr; }
.form-field label{ display:block; margin-bottom:6px; color: var(--muted); }
.input{
  width: 100%; background: #0a1428; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  height: 38px; padding: 8px 10px;
}
textarea.input{ height: auto; }
.form-row{ margin-bottom: 12px; }
.form-actions{ display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.help{ color: var(--muted); font-size: .9rem; margin-top: 6px; }

/* Alerts */
.alert{
  border-radius: 10px; padding: 10px 12px;
  border: 1px solid var(--border); background: rgba(255,255,255,.04);
  margin: 10px 0;
}
.alert.good{ border-color: rgba(55,211,155,.35); color: #bff1dc; }
.alert.bad{ border-color: rgba(255,106,113,.35); color: #ffd6d8; }

/* Toolbar / hero */
.toolbar{ display: flex; justify-content: flex-end; margin-bottom: 14px; }
.marquee{
  background: linear-gradient(180deg, #15223e, #14243f);
  border: 1px solid var(--border); border-radius: 16px; padding: 18px;
  box-shadow: 0 10px 30px var(--shadow);
}

/* Group layout */
.group-layout{
  display: grid; gap: 16px;
  grid-template-columns: 240px 1fr;
}
@media (max-width: 960px){ .group-layout{ grid-template-columns: 1fr; } }
.float-menu{
  position: sticky; top: 76px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border); border-radius: 14px; padding: 12px;
  height: max-content;
}
.stack{ display: grid; gap: 10px; }

/* Modal */
.modal-backdrop{
  position: fixed; inset: 0; display: none; z-index: 1000;
  background: rgba(8,12,24,.65); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal{
  width: min(720px, 92%); max-height: 86vh; overflow: auto;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-radius: 16px; border: 1px solid var(--border);
  padding: 16px; box-shadow: 0 20px 60px var(--shadow);
}

/* ===========================
   Footer
   =========================== */
.site-footer{
  margin-top: 30px;
  background: rgba(8,12,24,.55);
  border-top: 1px solid var(--border);
}
.footer-inner{
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 20px;
  padding: 18px 0;
}
@media (max-width: 900px){
  .footer-inner{ grid-template-columns: 1fr; }
}
.site-footer h4{
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 600;
}
.footer-links,
.footer-bullets{
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: 8px;
}
.footer-bullets{ list-style: disc inside; }
.footer-bottom{
  border-top: 1px solid var(--border);
  padding: 10px 0;
  color: var(--muted);
  font-size: .92rem;
}
.footer-bottom-inner{
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.footer-bottom .sep{ opacity: .6; }

/* ===========================
   One-time Splash Screen
   =========================== */
/* Lock scroll when splash is up */
body.no-scroll { overflow: hidden; }

/* Full overlay splash */
.splash-screen{
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  background-color: rgba(8, 14, 28, 0.94);
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(139,211,255,0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(77,163,255,0.14), transparent 70%),
    linear-gradient(135deg, #0A1328 0%, #081020 100%);
  background-blend-mode: overlay;
}
.splash-inner{
  width: min(920px, 92%);
  padding: 28px 28px 22px;
  border-radius: 22px;
  background: rgba(13, 22, 48, 0.78);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 20px 60px var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.06);
  text-align: left;
  backdrop-filter: blur(8px);
  transform: translateY(0);
  animation: splashPop .45s ease-out;
}
@keyframes splashPop { from{ transform: translateY(10px); opacity:0;} to{ transform:none; opacity:1; } }

.splash-title{
  font-family: "Cinzel", serif;
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  letter-spacing: .6px;
  margin: 0 0 8px;
}
.splash-body{
  font-size: clamp(1rem, 1.05vw, 1.12rem);
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 10px;
  white-space: pre-wrap;
}
.splash-note{
  margin-top: 6px;
  font-size: .92rem;
  color: var(--muted);
  opacity: .9;
}
.splash-btn{ margin-top: 10px; }

.splash-hide{
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
}

/* Helpful defaults for group index content */
.gindex-content img { max-width: 100%; height: auto; }
.gindex-content a { text-decoration: underline; }

/* ===========================
   Header – upgraded styles
   =========================== */

/* Slim gradient bar on top */
.header-accent{
  height: 3px;
  background: linear-gradient(90deg, #6aa8ff, #9ed0ff 30%, #6aa8ff 60%, #2f79ff);
  filter: saturate(1.2);
}

/* Glassy header row */
.site-header{
  position: sticky; top: 0; z-index: 70;
  backdrop-filter: blur(8px);
  background: rgba(8,12,24,.55);
  border-bottom: 1px solid var(--border);
}
.header-inner{
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}

/* Brand glow */
.brand.fancy{ display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-lines{ display: grid; }
.brand-lines strong{
  font-weight: 700; letter-spacing: .2px;
  text-shadow: 0 2px 12px rgba(106,168,255,.22);
}

/* Compact, glossy pill buttons */
.btn-pill{
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 14px; margin-left: 8px;
  border-radius: 999px; font-weight: 600; letter-spacing: .2px;
  color: #fff; background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border: 0; box-shadow: 0 6px 16px rgba(47,121,255,.35);
}
.btn-pill:hover{ filter: brightness(1.06); text-decoration: none; }
.btn-pill.outline{
  background: transparent; color: var(--text);
  border: 1px solid var(--border); box-shadow: none;
}
.btn-pill.ghost{
  background: rgba(255,255,255,.06);
  color: var(--text); box-shadow: none; border: 1px solid var(--border);
}
.header-actions{ display: flex; align-items: center; }

/* Avatar chip (initial bubble + name) */
.avatar-chip{
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: 8px; padding: 2px 10px 2px 2px;
  border-radius: 999px; border: 1px solid var(--border);
  background: rgba(255,255,255,.05); color: var(--text); text-decoration: none;
}
.avatar-chip:hover{ background: rgba(255,255,255,.08); }
.avatar{
  width: 28px; height: 28px; border-radius: 999px;
  display: grid; place-items: center; font-weight: 700;
  color: #0a1428;
  background: linear-gradient(135deg, #a8c7ff, #6aa8ff);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}
.avatar-chip .name{ max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sub-bar below header for logged-in quick links */
.header-subbar{
  border-top: 1px solid var(--border);
  background: rgba(12,18,34,.45);
}
.subbar-inner{
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
}
.quick-links{ display: flex; gap: 10px; }
.quick-links .ql{
  padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  font-size: .95rem;
}
.quick-links .ql:hover{ background: rgba(255,255,255,.07); }

/* ========== Mobile-friendly enhancements ========== */

/* 3.1 Header tune-ups */
.hamburger{
  display: none; width: 40px; height: 36px; margin-right: 6px;
  border: 1px solid var(--border); background: rgba(255,255,255,.05);
  border-radius: 10px; cursor: pointer;
}
.hamburger span{ display:block; height:2px; background: var(--text); margin:6px 8px; border-radius:2px; }
@media (max-width: 900px){
  .hamburger{ display: inline-block; }
  .tagline{ display:none; }
  .header-actions{ display:none; }         /* actions move into drawer on phones */
}

/* Drawer nav (mobile) / inline on desktop */
.site-nav{ /* desktop default: inline */
  position: static; transform: none; height: auto; display: block;
}
.site-nav .drawer{ max-width: 1100px; margin: 0 auto; padding: 8px 0; }
.site-nav nav ul{ display:flex; gap:14px; flex-wrap: wrap; padding:0; margin:0; list-style:none; }
.site-nav nav a{ color: var(--text); padding:8px 10px; border-radius:8px; text-decoration:none; }
.site-nav nav a:hover{ background: rgba(255,255,255,.06); }

/* On mobile: turn into overlay drawer */
@media (max-width: 900px){
  .site-nav{
    position: fixed; inset: 0; z-index: 9998; display: none;
    background: transparent; /* backdrop is a separate element */
  }
  body.nav-open .site-nav{ display: block; }
  .site-nav .drawer{
    position: absolute; top:0; left:0; height:100%; width:86vw; max-width:360px;
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border-right: 1px solid var(--border);
    box-shadow: 0 20px 60px var(--shadow);
    padding: 16px; overflow:auto; transform: translateX(-100%); transition: transform .25s ease;
  }
  body.nav-open .site-nav .drawer{ transform: translateX(0); }

  .drawer-backdrop{
    position: absolute; inset:0; background: rgba(5,8,16,.55); border:0;
  }

  /* Stack nav links vertically */
  .site-nav nav ul{ flex-direction: column; gap:10px; }
  .site-nav nav a{ display:block; padding:10px 12px; background: rgba(255,255,255,.04); border:1px solid var(--border); }
}

/* 3.2 Quick links: scrollable row on phones */
@media (max-width: 900px){
  .header-subbar{ display:none; } /* keep things simple; drawer carries links */
}
/* If you prefer to keep it, use:
.quick-links{ overflow:auto; -webkit-overflow-scrolling: touch; gap:8px; }
.quick-links .ql{ white-space: nowrap; }
*/

/* 3.3 Grids & cards */
@media (max-width: 980px){ .grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px){ .grid{ grid-template-columns: 1fr; } }
.card h3{ font-size: clamp(1rem, 2.5vw, 1.1rem); }

/* 3.4 Group layout collapses */
@media (max-width: 960px){
  .group-layout{ grid-template-columns: 1fr; }
  .float-menu{ position: static; }
}

/* 3.5 Forms & modals on phones */
@media (max-width: 640px){
  .modal{ width: 96vw; max-height: 90vh; }
  .input{ height: 40px; }
  .btn, .btn-pill{ height: 40px; padding: 0 16px; }
}

/* 3.6 Footer stacks neatly */
@media (max-width: 900px){
  .footer-inner{ grid-template-columns: 1fr; gap: 12px; }
}

/* 3.7 Splash spacing on phones */
@media (max-width: 640px){
  .splash-inner{ padding: 22px; }
  .splash-title{ font-size: clamp(1.4rem, 6vw, 2rem); }
  .splash-body{ font-size: 1rem; }
}

