:root {
  --bg:       #0a0c10;
  --bg2:      #0f1218;
  --bg3:      #161b24;
  --border:   #1e2633;
  --accent:   #00e5ff;
  --accent2:  #7c3aed;
  --green:    #22c55e;
  --yellow:   #f59e0b;
  --red:      #ef4444;
  --text:     #e2e8f0;
  --muted:    #64748b;
  --font-mono: 'Space Mono', monospace;
  --font-body: 'Noto Sans JP', sans-serif;
}

html.light {
  --bg:       #f0f2f5;
  --bg2:      #ffffff;
  --bg3:      #f5f7fa;
  --border:   #dde1e9;
  --accent:   #0284c7;
  --accent2:  #7c3aed;
  --text:     #0f172a;
  --muted:    #64748b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  transition: background .25s, color .25s;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 60%, rgba(0,229,255,.07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 80% 20%, rgba(124,58,237,.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transition: opacity .25s;
}

html.light body::after { opacity: 0; }

.header {
  position: sticky; top: 0; z-index: 100;
  height: 56px;
  background: rgba(10,12,16,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  transition: background .25s, border-color .25s;
}
html.light .header { background: rgba(255,255,255,.9); }

.header .title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
}

.title-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px 6px 7px;
  font-size: 13px;
  font-weight: 500;
  transition: background .25s, border-color .25s;
}

.icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  flex-shrink: 0;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, transform .2s, background .25s;
}
.theme-toggle:hover {
  border-color: var(--accent);
  transform: rotate(22deg);
}

.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 60px;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.35);
  animation: fadeUp .35s ease both;
  transition: background .25s, border-color .25s;
}

html.light .auth-card { box-shadow: 0 8px 40px rgba(0,0,0,.1); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 16px;
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: color .13s, background .13s;
  letter-spacing: .04em;
  position: relative;
}

.tab:hover { color: var(--text); background: var(--bg3); }

.tab.active {
  color: var(--accent);
  background: transparent;
}

/* アクティブタブの下線 */
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.input-form {
  display: none;
  flex-direction: column;
  gap: 20px;
  padding: 32px 28px;
}

.input-form.active { display: flex; animation: fadeIn .2s ease both; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* 「ほかのログイン方法」テキスト */
.other-note {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  font-family: var(--font-mono);
}

.separator {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: .08em;
}

.separator::before,
.separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.discord-login-wrapper { display: flex; flex-direction: column; gap: 10px; }

.discord-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: 10px;
  background: #5865f2;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .03em;
  transition: background .13s, transform .12s, box-shadow .13s;
}

.discord-btn:hover {
  background: #4752c4;
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(88,101,242,.4);
}

.discord-btn::before {
  content: '';
  width: 20px; height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127.14 96.36'%3E%3Cpath fill='%23fff' d='M107.7 8.07A105.15 105.15 0 0 0 81.47 0a72.06 72.06 0 0 0-3.36 6.83 97.68 97.68 0 0 0-29.11 0A72.37 72.37 0 0 0 45.64 0a105.89 105.89 0 0 0-26.25 8.09C2.79 32.65-1.71 56.6.54 80.21a105.73 105.73 0 0 0 32.17 16.15 77.7 77.7 0 0 0 6.89-11.11 68.42 68.42 0 0 1-10.85-5.18c.91-.66 1.8-1.34 2.66-2a75.57 75.57 0 0 0 64.32 0c.87.71 1.76 1.39 2.66 2a68.68 68.68 0 0 1-10.87 5.19 77 77 0 0 0 6.89 11.1 105.25 105.25 0 0 0 32.19-16.14c2.64-27.38-4.51-51.11-18.9-72.15zM42.45 65.69C36.18 65.69 31 60 31 53s5-12.74 11.43-12.74S54 46 53.89 53s-5.05 12.69-11.44 12.69zm42.24 0C78.41 65.69 73.25 60 73.25 53s5-12.74 11.44-12.74S96.23 46 96.12 53s-5.04 12.69-11.43 12.69z'/%3E%3C/svg%3E") center/contain no-repeat;
  flex-shrink: 0;
}

/* 準備中バッジ */
.coming-soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  background: transparent;
  cursor: not-allowed;
  opacity: .6;
}

.auth-footer {
  padding: 16px 28px 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
}

.auth-footer a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

@media (max-width: 480px) {
  .auth-card    { border-radius: 12px; }
  .input-form   { padding: 24px 20px; }
  .auth-footer  { padding: 14px 20px 18px; }
}