/* Yomikaze HUB — dark, purple/pink brand. */
:root {
  --bg: #0b0b12;
  --bg2: #10101a;
  --panel: #16161f;
  --panel2: #1c1c28;
  --line: #2a2a3d;
  --line2: #34344a;
  --txt: #ecedf5;
  --txt2: #c3c3d6;
  --muted: #8f8fab;
  --p1: #7c3aed;
  --p2: #db2777;
  --grad: linear-gradient(90deg, #7c3aed, #db2777);
  --grad-br: linear-gradient(135deg, #7c3aed, #db2777);
  --danger: #ef4444;
  --ok: #22c55e;
  --radius: 16px;
  --shadow: 0 24px 60px -20px rgba(124, 58, 237, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: "Segoe UI", Roboto, system-ui, Arial, sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
/* Slow-drifting aurora blobs behind everything. */
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(38vw 38vw at 14% 8%, rgba(124, 58, 237, .28), transparent 60%),
    radial-gradient(34vw 34vw at 86% 10%, rgba(219, 39, 119, .22), transparent 60%),
    radial-gradient(44vw 44vw at 62% 108%, rgba(99, 102, 241, .18), transparent 60%);
  filter: blur(8px);
  animation: auroraDrift 24s ease-in-out infinite alternate;
}
/* Barely-there film grain so flat panels don't look sterile. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes auroraDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(0, -4%, 0) scale(1.1) rotate(2deg); }
}
a { color: inherit; text-decoration: none; }
input, textarea, button { font-family: inherit; }

/* ---------------- header ---------------- */
.hub-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(11, 11, 18, .72); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.hub-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; letter-spacing: .2px; }
.hub-brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--grad-br); color: #fff; }
.hub-brand-mark svg { width: 18px; height: 18px; }
.hub-brand-text b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hub-head-actions { display: flex; align-items: center; gap: 10px; }
.hub-head-user { display: inline-flex; align-items: center; gap: 7px; color: var(--txt2); font-size: 14px; }
.hub-head-user svg, .hub-head-link svg, .hub-head-btn svg { width: 17px; height: 17px; }
.hub-head-link { display: inline-flex; align-items: center; gap: 7px; color: var(--txt2); font-size: 14px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); }
.hub-head-link:hover { color: #fff; border-color: var(--line2); }
.hub-head-btn { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 14px; color: var(--txt); background: var(--panel2); border: 1px solid var(--line); padding: 8px 14px; border-radius: 10px; }
.hub-head-btn:hover { border-color: var(--p1); color: #fff; }

.hub-main { flex: 1; width: 100%; max-width: 920px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 32px) 64px; }
.hub-footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 26px 16px 34px; border-top: 1px solid var(--line); }

/* ---------------- buttons ---------------- */
.hub-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px; border-radius: 12px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: transform .12s, box-shadow .2s, background .2s, border-color .2s;
}
.hub-btn svg { width: 18px; height: 18px; }
.hub-btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 26px -10px rgba(219, 39, 119, .6); }
.hub-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 34px -12px rgba(219, 39, 119, .7); }
.hub-btn-ghost { background: transparent; border-color: var(--line2); color: var(--txt); }
.hub-btn-ghost:hover { border-color: var(--p1); color: #fff; }
.hub-btn-danger { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .4); color: #fca5a5; }
.hub-btn-danger:hover { background: rgba(239, 68, 68, .2); color: #fff; }
.hub-btn-sm { padding: 9px 14px; font-size: 13.5px; border-radius: 10px; }
.hub-btn.loading { opacity: .65; pointer-events: none; }
.hub-btn:disabled { opacity: .55; pointer-events: none; }

/* ---------------- landing hero ---------------- */
.hub-hero { position: relative; text-align: center; padding: clamp(20px, 6vw, 60px) 0 10px; }
.hub-hero-glow { position: absolute; inset: -10% 10% auto 10%; height: 320px; background: radial-gradient(closest-side, rgba(124, 58, 237, .35), transparent); filter: blur(30px); z-index: -1; }
.hub-badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 2px; color: #d9c8ff; background: rgba(124, 58, 237, .14); border: 1px solid rgba(124, 58, 237, .4); padding: 7px 14px; border-radius: 999px; }
.hub-hero-title { font-size: clamp(34px, 8vw, 62px); line-height: 1.03; margin: 22px 0 0; letter-spacing: -1.5px; font-weight: 800; }
.hub-hero-title .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hub-hero-sub { max-width: 620px; margin: 20px auto 0; color: var(--txt2); font-size: clamp(15px, 2.2vw, 17px); line-height: 1.7; }
.hub-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }
.hub-worlds-preview { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 40px; }
.hub-world-chip { display: inline-flex; align-items: center; gap: 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; text-align: left; }
.hub-world-chip b { display: block; font-size: 14.5px; }
.hub-world-chip small { color: var(--muted); font-size: 12.5px; }
.hub-world-ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(124, 58, 237, .16); color: #c4b5fd; }
.hub-world-ic svg { width: 19px; height: 19px; }

/* ---------------- member home (2 buttons) ---------------- */
.hub-home { text-align: center; }
.hub-home-hi { color: var(--p2); font-weight: 600; letter-spacing: .3px; margin: 6px 0 4px; }
.hub-home-title { font-size: clamp(28px, 6vw, 44px); margin: 0; letter-spacing: -1px; font-weight: 800; }
.hub-home-sub { color: var(--muted); margin: 12px 0 0; }
.hub-world-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; text-align: left; }
.hub-world-card {
  position: relative; overflow: hidden; padding: 30px 26px; border-radius: 20px;
  background: var(--panel); border: 1px solid var(--line);
  transition: transform .16s, border-color .2s, box-shadow .25s;
}
.hub-world-card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); opacity: .0; transition: opacity .25s; }
.hub-world-card:hover { transform: translateY(-4px); border-color: var(--line2); box-shadow: var(--shadow); }
.hub-world-card:hover::after { opacity: 1; }
.hub-world-card-ic { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 15px; background: var(--grad-br); color: #fff; margin-bottom: 18px; }
.hub-world-card-ic svg { width: 30px; height: 30px; }
.hub-world-card h2 { margin: 0 0 6px; font-size: 22px; }
.hub-world-card p { margin: 0; color: var(--txt2); font-size: 14.5px; line-height: 1.6; }
.hub-world-card-cta { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; color: #c4b5fd; font-weight: 600; font-size: 14.5px; }
.hub-world-card-cta svg { width: 17px; height: 17px; transition: transform .18s; }
.hub-world-card:hover .hub-world-card-cta svg { transform: translateX(4px); }
.world-tv .hub-world-card-ic { background: linear-gradient(135deg, #db2777, #f472b6); }

/* ---------------- generic page ---------------- */
.hub-page { max-width: 680px; margin: 0 auto; }
.hub-page-narrow { max-width: 420px; }
.hub-center { text-align: center; max-width: 480px; margin: 30px auto; }
.hub-page-title { font-size: clamp(24px, 5vw, 34px); margin: 10px 0 0; letter-spacing: -.6px; font-weight: 800; }
.hub-page-sub { color: var(--txt2); line-height: 1.7; margin: 12px 0 26px; font-size: 15px; }
.hub-back { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.hub-back:hover { color: var(--txt); }
.hub-back svg { width: 16px; height: 16px; }
.hub-fineprint { color: var(--muted); font-size: 13.5px; margin-top: 22px; text-align: center; }
.hub-fineprint a { color: #c4b5fd; }
.hub-loading { color: var(--muted); text-align: center; padding: 40px 0; }
.hub-big-ic { width: 68px; height: 68px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 18px; }
.hub-big-ic svg { width: 34px; height: 34px; }
.hub-big-ic.ok { background: rgba(124, 58, 237, .16); color: #c4b5fd; }
.hub-big-ic.bad { background: rgba(239, 68, 68, .14); color: #fca5a5; }

/* ---------------- forms ---------------- */
.hub-form { display: flex; flex-direction: column; gap: 16px; }
.hub-form-narrow { max-width: 380px; }
.hub-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hub-field { display: flex; flex-direction: column; gap: 7px; }
.hub-field-full { grid-column: 1 / -1; }
.hub-field-label { font-size: 13.5px; font-weight: 600; color: var(--txt2); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.hub-input {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 11px;
  color: var(--txt); font-size: 15px; padding: 12px 14px; transition: border-color .15s, box-shadow .15s;
}
.hub-input::placeholder { color: #6a6a86; }
.hub-input:focus { outline: none; border-color: var(--p1); box-shadow: 0 0 0 3px rgba(124, 58, 237, .18); }
.hub-textarea { resize: none; min-height: 84px; line-height: 1.6; }
.hub-counter { font-size: 12px; font-weight: 600; color: var(--muted); }
.hub-counter.ok { color: var(--ok); }
.hub-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hub-agrees { display: flex; flex-direction: column; gap: 11px; margin-top: 4px; }
.hub-check { display: flex; align-items: flex-start; gap: 11px; font-size: 14px; color: var(--txt2); line-height: 1.5; cursor: pointer; }
.hub-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--p2); flex: 0 0 auto; }
.hub-form-err { background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .35); color: #fca5a5; border-radius: 11px; padding: 12px 14px; font-size: 14px; }
.hub-form-hint { background: rgba(124, 58, 237, .12); border: 1px solid rgba(124, 58, 237, .4); color: #c4b5fd; border-radius: 11px; padding: 12px 14px; font-size: 14px; }
.hub-form-submit { margin-top: 6px; align-self: flex-start; }
.hub-readonly { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.hub-ro-label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.hub-ro-val { font-size: 15px; font-weight: 600; }

/* ---------------- admin ---------------- */
.hub-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 20px; }
.hub-tab { display: inline-flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--line); color: var(--txt2); border-radius: 999px; padding: 8px 16px; font-size: 13.5px; cursor: pointer; }
.hub-tab:hover { color: #fff; border-color: var(--line2); }
.hub-tab.active { background: var(--grad); border-color: transparent; color: #fff; }
.hub-tab-count { background: rgba(255, 255, 255, .22); border-radius: 999px; padding: 1px 7px; font-size: 11.5px; }
.hub-app-list { display: flex; flex-direction: column; gap: 14px; }
.hub-app-card { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 20px; }
.hub-app-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.hub-app-name { margin: 0; font-size: 18px; }
.hub-app-email { color: var(--muted); font-size: 13px; }
.hub-app-actions { display: flex; gap: 8px; flex-shrink: 0; }
.hub-app-meta { color: var(--muted); font-size: 12.5px; margin: 10px 0 14px; }
.hub-ans { margin-top: 12px; }
.hub-ans-q { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #a78bfa; font-weight: 700; }
.hub-ans-a { margin: 4px 0 0; color: var(--txt2); font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.hub-app-status { font-size: 12.5px; font-weight: 700; text-transform: capitalize; padding: 6px 12px; border-radius: 999px; }
.st-accepted { background: rgba(34, 197, 94, .14); color: #86efac; }
.st-rejected { background: rgba(239, 68, 68, .14); color: #fca5a5; }
.st-completed { background: rgba(124, 58, 237, .16); color: #c4b5fd; }
.st-pending { background: rgba(234, 179, 8, .14); color: #fde047; }
.hub-empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ---------------- toast ---------------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50; background: #22222f; border: 1px solid var(--line2); color: var(--txt); padding: 13px 20px; border-radius: 12px; font-size: 14px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6); transition: opacity .2s, transform .2s; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-bad { border-color: rgba(239, 68, 68, .5); }

/* ---------------- responsive ---------------- */
@media (max-width: 620px) {
  .hub-world-grid, .hub-form-grid, .hub-readonly { grid-template-columns: 1fr; }
  .hub-head-user { display: none; }
  .hub-app-head { flex-direction: column; }
}

/* ============================================================= */
/*  Polish layer — motion, glow & finer detailing                */
/* ============================================================= */

/* Custom scrollbar. */
* { scrollbar-color: #5b3aa6 transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--p1), var(--p2)); border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(#8b52f5, #e94ba0); }
::selection { background: rgba(219, 39, 119, .35); color: #fff; }

/* Entrance animations (re-run on every route change since #app is rebuilt). */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.9); } 100% { opacity: 1; transform: scale(1); } }
.hub-home, .hub-page { animation: fadeUp .5s cubic-bezier(.22, .61, .36, 1) both; }

/* Staggered hero reveal. */
.hub-hero > * { animation: fadeUp .6s cubic-bezier(.22, .61, .36, 1) both; }
.hub-hero .hub-badge { animation: fadeUp .6s cubic-bezier(.22, .61, .36, 1) .02s both, badgePulse 3.4s ease-in-out 1.1s infinite; }
.hub-hero-title { animation-delay: .09s; }
.hub-hero-sub { animation-delay: .17s; }
.hub-hero-actions { animation-delay: .25s; }
.hub-worlds-preview { animation-delay: .33s; }
.hub-hero-glow { animation: fadeIn 1.4s ease both, glowPulse 7s ease-in-out infinite; }

@keyframes glowPulse { 0%, 100% { opacity: .8; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes badgePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); } 50% { box-shadow: 0 0 26px -4px rgba(124, 58, 237, .55); } }

/* Shimmering gradient headline. */
.hub-hero-title .grad {
  background: linear-gradient(100deg, #c4b5fd, #db2777 45%, #f0abfc 60%, #c4b5fd);
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer { to { background-position: 220% center; } }

/* Brand mark gentle float + glow. */
.hub-brand-mark { box-shadow: 0 8px 22px -8px rgba(124, 58, 237, .8); }
.hub-brand:hover .hub-brand-mark { animation: floatY 1.6s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* Header hairline gradient. */
.hub-header { position: sticky; }
.hub-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, .6), rgba(219, 39, 119, .6), transparent);
}

/* Shine sweep across primary buttons on hover. */
.hub-btn-primary { position: relative; overflow: hidden; isolation: isolate; }
.hub-btn-primary::after {
  content: ""; position: absolute; inset: 0 auto 0 -140%; width: 55%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: skewX(-18deg); pointer-events: none;
}
.hub-btn-primary:hover::after { animation: sheen .85s ease; }
@keyframes sheen { to { left: 160%; } }

/* Landing world chips lift a touch. */
.hub-world-chip { transition: transform .16s, border-color .2s, background .2s; }
.hub-world-chip:hover { transform: translateY(-2px); border-color: var(--line2); background: var(--panel2); }

/* Member world cards — richer glow, animated gradient frame, staggered reveal. */
.hub-world-card { animation: fadeUp .55s cubic-bezier(.22, .61, .36, 1) both; }
.hub-world-card:nth-child(1) { animation-delay: .08s; }
.hub-world-card:nth-child(2) { animation-delay: .18s; }
.hub-world-card::before {
  content: ""; position: absolute; right: -40px; bottom: -50px; width: 190px; height: 190px;
  background: radial-gradient(circle, rgba(124, 58, 237, .28), transparent 68%);
  opacity: 0; transition: opacity .35s; pointer-events: none;
}
.world-tv.hub-world-card::before { background: radial-gradient(circle, rgba(219, 39, 119, .3), transparent 68%); }
.hub-world-card:hover::before { opacity: 1; }
.hub-world-card:hover .hub-world-card-ic { transform: rotate(-4deg) scale(1.05); }
.hub-world-card-ic { transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); box-shadow: 0 12px 26px -12px rgba(219, 39, 119, .7); }

/* Big status icons get a soft ring + entrance pop. */
.hub-big-ic { animation: popIn .45s cubic-bezier(.34, 1.56, .64, 1) both; position: relative; }
.hub-big-ic.ok { box-shadow: 0 0 0 6px rgba(124, 58, 237, .08), 0 0 40px -8px rgba(124, 58, 237, .5); }
.hub-big-ic.bad { box-shadow: 0 0 0 6px rgba(239, 68, 68, .08); }

/* Inputs: gradient focus ring + lift. */
.hub-input { position: relative; }
.hub-input:focus { border-color: transparent; box-shadow: 0 0 0 1.5px var(--p1), 0 0 0 4px rgba(124, 58, 237, .16), 0 8px 22px -14px rgba(124, 58, 237, .7); }
.hub-check input { transition: transform .12s; }
.hub-check:hover input { transform: scale(1.08); }

/* Panels get a faint top sheen so they read as glass. */
.hub-app-card, .hub-world-card, .hub-world-chip {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 42%);
}

/* Counter turns celebratory when the minimum is met. */
.hub-counter.ok { animation: popIn .3s ease both; }

/* Toast slides + glows. */
.toast { box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6), 0 0 0 1px rgba(124, 58, 237, .2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
