@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@400;500;700&family=Shippori+Mincho:wght@500;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg-0: #0d1422;
  --bg-1: #101a2d;
  --panel: rgba(18, 29, 45, 0.68);
  --line: rgba(164, 208, 190, 0.28);
  --text: #f2f6f7;
  --text-soft: #c8d7d6;
  --text-muted: #93aaa8;
  --matcha: #8fc7ab;
  --sakura: #f3b8b1;
  --amber: #d7b984;
  --danger: #f1a6a1;
  --ok: #98d6b5;
  --radius: 18px;
  --shadow: 0 24px 48px rgba(4, 8, 14, 0.46);
  --font-ui: 'Zen Kaku Gothic New', sans-serif;
  --font-title: 'Shippori Mincho', serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* {
  box-sizing: border-box;
}

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

body.hub-body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg-0);
  line-height: 1.6;
}

.hub-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.hub-bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 10%, rgba(143, 199, 171, 0.18), transparent 42%),
    radial-gradient(circle at 85% 5%, rgba(243, 184, 177, 0.16), transparent 38%),
    radial-gradient(circle at 50% 90%, rgba(215, 185, 132, 0.16), transparent 46%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1) 55%, #0b1220);
}

.hub-bg-grain {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='%23ffffff' fill-opacity='0.16'%3E%3Ccircle cx='20' cy='12' r='1.2'/%3E%3Ccircle cx='90' cy='54' r='1.1'/%3E%3Ccircle cx='143' cy='80' r='1.3'/%3E%3Ccircle cx='48' cy='112' r='1.2'/%3E%3Ccircle cx='126' cy='138' r='1.1'/%3E%3C/g%3E%3C/svg%3E");
}

.hub-bg-lines {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0) 2px,
    rgba(255, 255, 255, 0.03) 3px
  );
}

.hub-kanji {
  position: absolute;
  font-family: var(--font-title);
  font-size: clamp(7rem, 12vw, 13rem);
  color: rgba(201, 238, 219, 0.09);
  user-select: none;
  animation: float-y 7s ease-in-out infinite;
}

.hub-kanji-top {
  top: -1.5rem;
  right: 1.5rem;
}

.hub-kanji-bottom {
  bottom: -3rem;
  left: 1rem;
  animation-delay: -3s;
}

.hub-topbar,
.hub-main,
.hub-login-shell {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

.hub-topbar {
  padding: 2.2rem 0 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
}

.hub-title-group h1,
.hub-panel h2,
.hub-login-card h1 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hub-title-group h1 {
  font-size: clamp(1.55rem, 2.4vw, 2.05rem);
}

.hub-kicker {
  margin: 0 0 0.3rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.hub-topbar-actions {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.hub-user-badge {
  border: 1px solid rgba(152, 214, 181, 0.45);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  background: rgba(152, 214, 181, 0.1);
  color: var(--ok);
  font-size: 0.85rem;
}

.hub-main {
  display: grid;
  gap: 1rem;
  padding-bottom: 2.5rem;
}

.hub-panel,
.hub-login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hub-panel {
  padding: 1.2rem 1.2rem 1.3rem;
}

.hub-panel h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
}

.hub-subtitle {
  margin: 0.4rem 0 1rem;
  color: var(--text-soft);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.85rem;
}

.hub-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
}

.hub-stat-card {
  border: 1px solid rgba(160, 204, 187, 0.26);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background:
    linear-gradient(145deg, rgba(143, 199, 171, 0.1), rgba(243, 184, 177, 0.06)),
    rgba(12, 20, 32, 0.56);
  display: grid;
  gap: 0.15rem;
}

.hub-stat-value {
  font-family: var(--font-title);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.2;
  color: var(--text);
}

.hub-stat-label {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.hub-site-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border: 1px solid rgba(160, 204, 187, 0.26);
  border-radius: 14px;
  padding: 1rem;
  background:
    linear-gradient(145deg, rgba(143, 199, 171, 0.08), rgba(243, 184, 177, 0.06)),
    rgba(12, 20, 32, 0.56);
  transition: transform 0.26s ease, border-color 0.26s ease, box-shadow 0.26s ease;
}

.hub-site-card:hover {
  transform: translateY(-2px);
  border-color: rgba(205, 230, 218, 0.45);
  box-shadow: 0 14px 28px rgba(2, 7, 13, 0.34);
}

.hub-site-head {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.hub-site-head h3 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-site-head .hub-btn {
  flex: 0 0 auto;
}

.hub-site-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.15rem;
}

.hub-site-stat {
  border: 1px solid rgba(160, 204, 187, 0.22);
  border-radius: 10px;
  padding: 0.58rem 0.62rem;
  background: rgba(8, 15, 25, 0.42);
  display: grid;
  gap: 0.06rem;
}

.hub-site-stat-value {
  font-family: var(--font-title);
  font-size: 1.03rem;
  line-height: 1.25;
}

.hub-site-stat-label {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.hub-site-status {
  font-size: 0.82rem;
  color: var(--amber);
}

.hub-chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.hub-chip.ext {
  color: var(--sakura);
  border-color: rgba(243, 184, 177, 0.5);
  background: rgba(243, 184, 177, 0.12);
}

.hub-site-card p {
  margin: 0.55rem 0;
  color: var(--text-soft);
}

.hub-site-meta {
  display: grid;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.hub-site-meta code,
.hub-code,
code {
  font-family: var(--font-mono);
  color: #e8f0f4;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  padding: 0.2rem 0.5rem;
  overflow-wrap: anywhere;
}

.hub-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.52rem 0.95rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
  vertical-align: middle;
}

.hub-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.46);
}

.hub-btn.primary {
  border-color: rgba(143, 199, 171, 0.65);
  background: linear-gradient(135deg, rgba(143, 199, 171, 0.35), rgba(215, 185, 132, 0.3));
}

.hub-btn.ghost {
  background: rgba(255, 255, 255, 0.04);
}

.hub-code {
  margin: 0.4rem 0 0;
  padding: 0.8rem;
  white-space: pre-wrap;
  line-height: 1.45;
}

.hub-login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
}

.hub-login-card {
  width: min(460px, 100%);
  padding: 1.3rem;
}

.hub-login-card h1 {
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
}

.hub-login-card .hub-subtitle {
  margin-top: 0.35rem;
}

.hub-form {
  display: grid;
  gap: 0.85rem;
}

.hub-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--text-soft);
  font-size: 0.93rem;
}

.hub-input {
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  font-size: 1rem;
  padding: 0.7rem 0.76rem;
  outline: none;
}

.hub-input:focus {
  border-color: rgba(143, 199, 171, 0.8);
  box-shadow: 0 0 0 3px rgba(143, 199, 171, 0.19);
}

.hub-notice {
  margin: 0.7rem 0 0.8rem;
  padding: 0.62rem 0.75rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.92rem;
}

.hub-notice.error {
  border-color: rgba(241, 166, 161, 0.65);
  color: var(--danger);
  background: rgba(241, 166, 161, 0.11);
}

.hub-notice.warn {
  border-color: rgba(215, 185, 132, 0.65);
  color: var(--amber);
  background: rgba(215, 185, 132, 0.13);
}

.hub-meta {
  margin: 0.9rem 0 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fade-up {
  opacity: 0;
  transform: translateY(12px);
  animation: fade-up 560ms ease forwards;
  animation-delay: var(--delay, 0ms);
}

@keyframes fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-y {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(18px);
  }
}

@media (max-width: 800px) {
  .hub-topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 1.5rem;
  }

  .hub-title-group h1 {
    font-size: 1.5rem;
  }

  .hub-topbar-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 520px) {
  .hub-topbar,
  .hub-main,
  .hub-login-shell {
    width: min(1120px, 94vw);
  }

  .hub-login-card,
  .hub-panel {
    padding: 1rem;
  }

  .hub-user-badge {
    display: none;
  }

  .hub-site-stats {
    grid-template-columns: 1fr;
  }
}
