/* ═══════════════════════════════════════════════════════
   VARIABILI STAGIONALI
═══════════════════════════════════════════════════════ */
:root {
  /* HARU */
  --haru-sky-dawn:   linear-gradient(180deg, #FEF2F4 0%, #FADADD 38%, #F8C8DC 68%, #F4A7B9 100%); /* sakura-iro */
  --haru-sky-day:    linear-gradient(160deg, #FDEFF2 0%, #F8C3CD 42%, #DDA0A8 72%, #B56C7D 100%);
  --haru-sky-dusk:   linear-gradient(180deg, #C85179 0%, #E1988A 34%, #F2C9A0 64%, #F7E1C6 100%);
  --haru-sky-night:  linear-gradient(180deg, #1E0F2F 0%, #4A1B45 44%, #7E2D5D 72%, #A85B78 100%);

  /* NATSU */
  --natsu-sky-dawn:  linear-gradient(180deg, #F8B862 0%, #FAD689 35%, #FFF1CF 68%, #F6F2E8 100%); /* kuchinashi */
  --natsu-sky-day:   radial-gradient(circle at 62% 14%, rgba(255,248,180,0.24) 0%, transparent 20%), linear-gradient(180deg, #12345A 0%, #1F6FA5 34%, #40B9DE 70%, #B7E3DF 100%); /* ai / sora */
  --natsu-sky-dusk:  linear-gradient(180deg, #180614 0%, #66327C 28%, #C1324E 58%, #F08300 82%, #F8B862 100%);
  --natsu-sky-night: radial-gradient(ellipse at 62% 22%, rgba(78,125,255,0.18) 0%, transparent 34%), linear-gradient(180deg, #050711 0%, #0B1434 42%, #10294B 76%, #123A4F 100%);

  /* AKI */
  --aki-sky-dawn:    linear-gradient(180deg, #B54434 0%, #D7542B 32%, #E98B2A 62%, #F6C6A2 100%); /* momiji */
  --aki-sky-day:     linear-gradient(160deg, #F7E7CE 0%, #F6C555 32%, #D98C24 62%, #7B3B1A 100%);
  --aki-sky-dusk:    linear-gradient(180deg, #2B1107 0%, #7B2D12 32%, #BA4A1C 58%, #D98C24 82%, #E6B422 100%);
  --aki-sky-night:   linear-gradient(180deg, #100A05 0%, #2A160A 42%, #4B1E10 72%, #6A2D13 100%);

  /* FUYU */
  --fuyu-sky-dawn:   linear-gradient(180deg, #D7E7F2 0%, #EAF4FC 42%, #F7FBFD 72%, #FFFFFF 100%);
  --fuyu-sky-day:    linear-gradient(160deg, #F3F8FB 0%, #C7D7E3 32%, #7B90A6 72%, #2B4B65 100%);
  --fuyu-sky-dusk:   linear-gradient(180deg, #162447 0%, #274A78 34%, #6A7F99 66%, #BBC8D6 100%);
  --fuyu-sky-night:  linear-gradient(180deg, #181B26 0%, #101841 42%, #0B1026 72%, #1A2742 100%); /* kachi-iro */

  --c1: #f8c8d4;
  --c2: #e8a0b0;
  --c3: #c0667f;
  --text-main: #3a1a25;
  --glass: rgba(30,10,20,0.42);
  --glass-border: rgba(255,255,255,0.38);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { touch-action: manipulation; }

html {
  width: 100%; height: 100%;
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--sky-top, #04090f);
}
body {
  width: 100%; height: 100%;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════
   CANVAS
═══════════════════════════════════════════════════════ */
#particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* ═══════════════════════════════════════════════════════
   STAGE
═══════════════════════════════════════════════════════ */
#stage {
  position: fixed;
  inset: 0;
  bottom: 0;
  background: var(--haru-sky-day);
  transition: background 1.4s cubic-bezier(0.4,0,0.2,1);
  z-index: 0;
}

/* Silhouette paesaggio */
#landscape {
  position: fixed;
  bottom: 0; left: 0;
  width: 100%; height: 38%;
  z-index: 1;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

/* Vignette bordi */
#vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
  border-radius: 0;
}

/* Luna / Sole */
#celestial {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  transition: all 1.4s cubic-bezier(0.4,0,0.2,1);
  border-radius: 50%;
}

/* ═══════════════════════════════════════════════════════
   SEASON SELECTOR
═══════════════════════════════════════════════════════ */
#season-bar {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(16px);
  border-radius: 50px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 4px 24px rgba(0,0,0,0.14);
}

.season-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  background: rgba(255,255,255,0.25);
  position: relative;
}
.season-btn::after {
  content: attr(data-label);
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  opacity: 0;
  transition: all 0.2s;
  font-family: 'Noto Serif JP', serif;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.season-btn:hover::after { opacity: 1; transform: translateX(-50%) scale(1); }
.season-btn:hover, .season-btn.active {
  transform: scale(1.22);
  border-color: white;
  box-shadow: 0 0 18px rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.4);
}

/* Time of day selector */
#time-bar {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
  display: flex;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(16px);
  border-radius: 50px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 4px 24px rgba(0,0,0,0.14);
}

#season-bar,
#time-bar {
  display: none !important;
}

.time-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.45);
  cursor: pointer;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  background: rgba(255,255,255,0.2);
}
.time-btn:hover, .time-btn.active {
  transform: scale(1.2);
  border-color: white;
  box-shadow: 0 0 14px rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.4);
}

/* ═══════════════════════════════════════════════════════
   CONTENITORE PRINCIPALE
═══════════════════════════════════════════════════════ */
#main-wrapper {
  position: relative;
  z-index: 10;
  width: 100%; height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateY(-52px);
}

/* ═══════════════════════════════════════════════════════
   LOGO + INTESTAZIONE
═══════════════════════════════════════════════════════ */
.header-area {
  text-align: center;
  margin-bottom: 20px;
  animation: fadeSlideDown 1.1s cubic-bezier(0.22,1,0.36,1) both;
}

.logo-img {
  height: 72px;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.45));
  border-radius: 0;
  background: transparent;
  padding: 0;
  animation: logoBreathe 4s ease-in-out infinite;
  transform-origin: center center;
}
@keyframes logoBreathe {
  0%,100% { transform: scale(1.00); filter: drop-shadow(0 2px 12px rgba(0,0,0,0.45)); }
  50%      { transform: scale(1.03); filter: drop-shadow(0 4px 18px rgba(0,0,0,0.55)); }
}

/* Wrapper logo: senza sfondo, solo centrato */
.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 12px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  backdrop-filter: none;
  box-shadow: none;
}

.title-jp {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(20px, 3vw, 28px);
  color: white;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 16px rgba(0,0,0,0.35);
  line-height: 1.3;
}
.title-jp span {
  display: block;
  font-size: 0.65em;
  font-weight: 300;
  letter-spacing: 0.2em;
  opacity: 0.9;
}
.subtitle {
  font-family: 'Cinzel', serif;
  font-size: clamp(11px, 1.5vw, 14px);
  color: rgba(255,255,255,0.88);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0,0,0,0.25);
}

/* ═══════════════════════════════════════════════════════
   LOGIN CARD
═══════════════════════════════════════════════════════ */
.login-card {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1.5px solid var(--glass-border);
  border-radius: 22px;
  padding: 30px 38px;
  width: min(360px, 90vw);
  box-shadow:
    0 24px 64px rgba(0,0,0,0.22),
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(0,0,0,0.05);
  animation: fadeSlideUp 1.1s 0.25s cubic-bezier(0.22,1,0.36,1) both;
  position: relative;
  overflow: hidden;
}

/* Frost overlay per fuyu */
.login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.22) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* Frost border per fuyu */
.login-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22px;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
  z-index: 0;
  background:
    url("data:image/svg+xml,%3Csvg width='80' height='80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='0.07' stroke='%23a0c8e8' fill='none'%3E%3Cpath d='M40 5 L40 75 M5 40 L75 40 M12 12 L68 68 M68 12 L12 68 M40 5 L50 18 M40 5 L30 18 M40 75 L50 62 M40 75 L30 62 M5 40 L18 50 M5 40 L18 30 M75 40 L62 50 M75 40 L62 30'/%3E%3C/g%3E%3C/svg%3E") repeat;
}
body.fuyu .login-card::after { opacity: 1; }

/* ── Benvenuto JP ── */
#welcome-jp {
  text-align: center;
  font-family: 'Noto Serif JP', serif;
  font-size: 18px;
  font-weight: 500;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.25em;
  margin-bottom: 6px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
  animation: fadeSlideDown 1s 0.2s ease both;
  min-height: 1.5em;
}

/* ── Contatore online ── */
#online-counter {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 100;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.82);
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 20px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  animation: fadeSlideDown 1s 1s ease both;
  pointer-events: none;
}
#online-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
  animation: onlinePulse 2s ease-in-out infinite;
}
@keyframes onlinePulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.8); }
}

/* ── Raggi alba SVG ── */
#dawn-rays {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease;
}
body.dawn-active #dawn-rays { opacity: 1; }

/* ── Nebbia animata (alba/mattino) ── */
#fog-overlay {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 35%;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
}
#fog-overlay.visible { opacity: 1; }
.fog-layer {
  position: absolute;
  bottom: 0; left: -20%; width: 140%;
  height: 100%;
  border-radius: 50%;
  animation: fogDrift 18s ease-in-out infinite;
}
.fog-layer:nth-child(1) { animation-duration: 20s; animation-delay: 0s; }
.fog-layer:nth-child(2) { animation-duration: 26s; animation-delay: -7s; }
.fog-layer:nth-child(3) { animation-duration: 32s; animation-delay: -14s; }
@keyframes fogDrift {
  0%,100% { transform: translateX(0) scaleX(1); }
  33%     { transform: translateX(3%) scaleX(1.02); }
  66%     { transform: translateX(-3%) scaleX(0.98); }
}

/* ── Elementi Ghibli ── */
#ghibli-soot {
  position: fixed;
  pointer-events: none;
  z-index: 5;
  font-size: 10px;
  color: rgba(40,40,40,0.85);
  font-family: sans-serif;
  text-shadow: 0 0 3px rgba(0,0,0,0.4);
  transition: opacity 0.5s;
  user-select: none;
}


.card-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.92);
  text-align: center;
  letter-spacing: 0.15em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative; z-index: 1;
}
.card-title::before, .card-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.35);
}

.alpha-badge {
  width: fit-content;
  margin: 0 auto 12px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.26);
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.82);
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.form-group {
  margin-bottom: 14px;
  position: relative; z-index: 1;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 11px 16px;
  background: rgba(255,255,255,0.2);
  border: 1.5px solid rgba(255,255,255,0.28);
  border-radius: 12px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 15px;
  color: white;
  outline: none;
  transition: all 0.3s;
}
.form-input::placeholder { color: rgba(255,255,255,0.42); }
.form-input:focus {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.65);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.12);
}

.btn-login {
  width: 100%;
  padding: 13px;
  background: rgba(255,255,255,0.92);
  color: var(--c3);
  border: none;
  border-radius: 14px;
  font-family: 'Noto Serif JP', serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  margin-top: 6px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.btn-login::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.55) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.65s ease;
}
.btn-login:hover::after { transform: translateX(100%); }
.btn-login:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 10px 28px rgba(0,0,0,0.22);
}
.btn-login:active { transform: translateY(0) scale(0.99); }

.btn-secondary-home,
.btn-install-home {
  width: 100%;
  padding: 11px 13px;
  margin-top: 10px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,0.32);
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  z-index: 1;
}
.btn-secondary-home:hover,
.btn-install-home:hover {
  background: rgba(255,255,255,0.22);
  transform: translateY(-2px);
}
.btn-install-home {
  color: #f5f8ff;
  border-color: rgba(170,220,255,0.42);
}
.mobile-install-only {
  display: none;
}
@media (hover: none) and (pointer: coarse), (max-width: 1024px) {
  .mobile-install-only {
    display: block;
  }
}

.error-msg {
  background: rgba(200,50,50,0.28);
  border: 1px solid rgba(255,100,100,0.45);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #ffe0e0;
  margin-top: 14px;
  text-align: center;
  display: none;
  position: relative; z-index: 1;
}
.error-msg.show { display: block; animation: shake 0.4s; }
.error-msg.ok-msg {
  background: rgba(40,150,90,0.28);
  border-color: rgba(100,230,160,0.45);
  color: #e0ffe9;
}

.home-modal-bg {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,0.48);
  backdrop-filter: blur(10px);
}
.home-modal {
  width: min(420px, 94vw);
  max-height: 92dvh;
  overflow-y: auto;
  padding: 26px;
  border-radius: 22px;
  background: rgba(12,22,42,0.88);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 24px 70px rgba(0,0,0,0.38);
}
.home-modal-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 20px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}
.home-modal-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.68);
  margin-bottom: 18px;
  line-height: 1.5;
}
.home-textarea {
  resize: vertical;
  min-height: 84px;
}
.home-privacy-note {
  margin: -2px 0 14px;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(255,255,255,0.62);
}
.home-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
}
.home-modal-actions .btn-login,
.home-modal-actions .btn-secondary-home {
  margin-top: 0;
}

.demo-info {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.18);
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.52);
  line-height: 1.8;
  position: relative; z-index: 1;
}

.project-credit {
  margin-top: 16px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.75;
  color: rgba(255,255,255,0.66);
  text-shadow: 0 1px 8px rgba(0,0,0,0.45);
  animation: fadeSlideUp 1.1s 0.35s cubic-bezier(0.22,1,0.36,1) both;
}
.project-credit strong {
  color: rgba(255,255,255,0.78);
  font-weight: 600;
}
.project-credit a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.26);
}
.project-credit a:hover {
  color: #fff;
  border-bottom-color: rgba(255,255,255,0.62);
}
.footer-sep {
  margin: 0 6px;
  color: rgba(255,255,255,0.45);
}

/* ═══════════════════════════════════════════════════════
   TRANSIZIONE STAGIONALE — RIPPLE RADIALE
═══════════════════════════════════════════════════════ */
#ripple-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  overflow: hidden;
}
.ripple-circle {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════
   ANIMAZIONI
═══════════════════════════════════════════════════════ */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-32px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideUpFixed {
  from { opacity: 0; transform: translateY(30px) translateX(-50%); }
  to   { opacity: 1; transform: translateY(0) translateX(-50%); }
}
@keyframes fadeSlideUpLeft {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%     { transform: translateX(-8px); }
  75%     { transform: translateX(8px); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--c3);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

/* ═══════════════════════════════════════════════════════
   STAGIONI — OVERRIDE VARIABILI
═══════════════════════════════════════════════════════ */
body.natsu {
  --c1: #4fc3c3; --c2: #2a8fa0; --c3: #1a6070;
  --glass: rgba(10,30,35,0.45);
  --glass-border: rgba(200,240,255,0.38);
  --text-main: #0a2a35;
}
body.natsu #particle-canvas {
  filter: saturate(1.18) drop-shadow(0 0 5px rgba(190,255,170,0.28));
}
body.natsu #landscape {
  filter: saturate(1.08) contrast(1.04);
}
body.aki {
  --c1: #e8943a; --c2: #c0621a; --c3: #8b3a0a;
  --glass: rgba(30,15,5,0.45);
  --glass-border: rgba(255,220,180,0.38);
  --text-main: #3a1a05;
}
body.fuyu {
  --c1: #8ab4d4; --c2: #4a7fa0; --c3: #1a3a5c;
  --glass: rgba(10,20,40,0.48);
  --glass-border: rgba(200,225,255,0.42);
  --text-main: #0a1a2e;
}

/* Pulsazione bloom haru */
body.haru #vignette {
  background: radial-gradient(ellipse at 50% 100%, transparent 55%, rgba(220,80,120,0.22) 100%);
  opacity: 1;
  animation: haruBloom 5s ease-in-out infinite alternate;
}
@keyframes haruBloom { from{opacity:0.5} to{opacity:1} }

@keyframes furinSway {
  0%{transform:rotate(0deg)} 20%{transform:rotate(5deg)} 50%{transform:rotate(-4deg)} 75%{transform:rotate(2deg)} 100%{transform:rotate(0deg)}
}
.faq-modal-bg{position:fixed;inset:0;background:rgba(0,0,0,0.55);z-index:2000;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(4px);}
.faq-modal{background:white;border-radius:24px;padding:32px;width:min(620px,92vw);max-height:88vh;overflow-y:auto;box-shadow:0 24px 80px rgba(0,0,0,0.3);}
.faq-title{font-family:'Noto Serif JP',serif;font-size:22px;font-weight:700;margin-bottom:4px;color:#1a1a2e;}
.faq-sub{font-size:13px;color:#888;margin-bottom:24px;}
.faq-item{margin-bottom:12px;border:1px solid #eee;border-radius:12px;overflow:hidden;}
.faq-q{padding:13px 16px;font-size:13px;font-weight:600;cursor:pointer;display:flex;justify-content:space-between;align-items:center;background:#faf8f5;transition:background .2s;gap:8px;}
.faq-q:hover{background:#f0ece4;}
.faq-q .arr{font-size:11px;color:#aaa;transition:transform .2s;flex-shrink:0;}
.faq-item.open .arr{transform:rotate(90deg);}
.faq-a{padding:0 16px;max-height:0;overflow:hidden;transition:max-height .35s ease,padding .35s;font-size:13px;color:#555;line-height:1.8;}
.faq-item.open .faq-a{padding:12px 16px;max-height:500px;}
.faq-close{width:100%;margin-top:20px;padding:13px;background:#1a1a2e;color:white;border:none;border-radius:12px;font-size:14px;font-weight:600;cursor:pointer;font-family:'Noto Serif JP',serif;transition:background .2s;}
.faq-close:hover{background:#c0392b;}

@media (max-width: 599px) {
  #main-wrapper {
    justify-content: flex-start;
    padding: 86px 10px 76px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: none;
  }

  .header-area {
    margin-bottom: 12px;
  }

  #welcome-jp {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .logo-wrap {
    margin-bottom: 8px;
  }

  .logo-img {
    height: 58px;
    max-width: 82vw;
    object-fit: contain;
    filter:
      drop-shadow(0 2px 10px rgba(0,0,0,0.72))
      drop-shadow(0 0 10px rgba(255,245,230,0.18));
  }

  .title-jp {
    font-size: 22px;
    line-height: 1.22;
    letter-spacing: 0.05em;
  }

  .title-jp span {
    font-size: 0.58em;
    letter-spacing: 0.16em;
    margin-top: 3px;
  }

  .subtitle {
    display: none;
  }

  .login-card {
    width: min(92vw, 360px);
    padding: 18px 18px;
    border-radius: 16px;
  }

  .login-card::after {
    border-radius: 16px;
  }

  .card-title {
    font-size: 11px;
    gap: 8px;
    margin-bottom: 12px;
    letter-spacing: 0.1em;
  }

  .alpha-badge {
    margin: -6px auto 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,0.58);
    font-size: 8px;
    letter-spacing: 0.18em;
  }

  .form-group {
    margin-bottom: 10px;
  }

  .form-label {
    font-size: 10px;
    margin-bottom: 5px;
  }

  .form-input {
    padding: 10px 13px;
    border-radius: 9px;
    font-size: 13px;
  }

  .btn-login {
    padding: 11px;
    border-radius: 11px;
    font-size: 13px;
    margin-top: 4px;
  }

  .btn-secondary-home,
  .btn-install-home {
    padding: 9px 10px;
    margin-top: 7px;
    border-radius: 10px;
    font-size: 11px;
    letter-spacing: 0.02em;
  }

  .error-msg {
    margin-top: 9px;
    padding: 8px 10px;
    font-size: 11px;
  }

  .project-credit {
    margin-top: 12px;
    font-size: 9px;
    letter-spacing: 0.01em;
    line-height: 1.65;
    color: rgba(255,255,255,0.56);
    text-align: center;
  }

  #audio-btn {
    right: 16px !important;
    bottom: 16px !important;
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
  }

  #bell-demo-btn {
    display: none !important;
  }

  .faq-modal-bg {
    align-items: flex-end;
    padding: 12px;
  }

  .faq-modal {
    width: 100%;
    max-height: 76vh;
    padding: 22px 18px 18px;
    border-radius: 20px;
  }

  .faq-title {
    font-size: 19px;
    line-height: 1.25;
  }

  .faq-sub {
    font-size: 12px;
    margin-bottom: 16px;
  }

  .faq-item {
    margin-bottom: 9px;
  }

  .faq-q {
    padding: 11px 12px;
    font-size: 12px;
  }

  .faq-a {
    font-size: 12px;
    line-height: 1.65;
  }

  .faq-close {
    margin-top: 14px;
    padding: 12px;
  }

  #online-counter {
    display: none !important;
  }

  body.mobile-essential-scene #landscape {
    height: 22%;
    opacity: 0.82;
  }

  body.mobile-essential-scene #furin {
    display: none !important;
  }
}
.faq-section-tag{display:inline-block;padding:2px 8px;border-radius:6px;font-size:10px;font-weight:700;margin-right:6px;vertical-align:middle;}
.tag-quiz{background:#fdebd0;color:#784212;}
.tag-flash{background:#e8f8f5;color:#1a6644;}
.tag-vocab{background:#e8f4fd;color:#1a5276;}
.tag-kanji{background:#f4ecf7;color:#6c3483;}
.tag-xp{background:#fef9e7;color:#7d6608;}
.tag-lb{background:#fdebd0;color:#784212;}
