*{
  box-sizing:border-box;
}

:root{
  --bg:#020611;
  --panel:rgba(5,16,34,0.72);
  --line:rgba(110,225,255,0.2);
  --cyan:#79eaff;
  --cyan-strong:#8df3ff;
  --sub:#a8c1cf;
  --pink:#ff6a9b;
  --danger:#ff708e;
  --text:#eaffff;

  --stress-accent:#79eaff;
  --stress-glow:rgba(0,225,255,0.14);
}

html, body{
  margin:0;
  width:100%;
  height:100%;
  overflow:hidden;
  font-family:Arial, sans-serif;
  background:#020611;
  color:#eaffff;
}

body{
  position:relative;
}

.screen{
  position:fixed;
  inset:0;
  display:none;
}

.screen.active{
  display:block;
}

.hidden{
  display:none !important;
}

.global-vignette{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:5;
  background:radial-gradient(circle, transparent 52%, rgba(0,0,0,0.38) 100%);
}

/* ノイズ */
.noise,
.scanlines{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:50;
}

.noise{
  opacity:0.04;
  background-image:radial-gradient(rgba(255,255,255,0.35) 0.6px, transparent 0.6px);
  background-size:4px 4px;
  mix-blend-mode:screen;
}

.scanlines{
  opacity:0.06;
  background:repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(255,255,255,0.08) 3px
  );
}

/* 寝音亜衣 */
.ai-mascot{
  position:fixed;
  right:18px;
  bottom:18px;
  width:220px;
  z-index:120;
  pointer-events:none;
}

.ai-aura{
  position:absolute;
  inset:10px 20px 60px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(121,234,255,0.22), transparent 68%);
  filter:blur(14px);
  animation:aiAura 3s ease-in-out infinite;
}

@keyframes aiAura{
  0%,100%{ opacity:0.55; transform:scale(0.95); }
  50%{ opacity:1; transform:scale(1.04); }
}

.ai-character{
  position:relative;
  width:180px;
  margin-left:auto;
  animation:aiFloat 3.2s ease-in-out infinite;
  filter:drop-shadow(0 0 22px rgba(121,234,255,0.22));
}

@keyframes aiFloat{
  0%,100%{ transform:translateY(0); }
  50%{ transform:translateY(-6px); }
}

.ai-body{
  display:block;
  width:100%;
  height:auto;
}

.ai-status{
  position:relative;
  overflow:hidden;
  margin-top:10px;
  margin-left:auto;
  width:100%;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(4,14,28,0.94);
  border:1px solid rgba(110,225,255,0.24);
  box-shadow:0 0 20px rgba(0,225,255,0.1);
}

.ai-status-label{
  display:block;
  margin-bottom:6px;
  color:#8df3ff;
  font-size:11px;
  letter-spacing:0.14em;
}

.ai-status p{
  margin:0;
  color:#eaffff;
  line-height:1.6;
  font-size:13px;
}

.ai-mascot.smile .ai-body{
  filter:brightness(1.04) saturate(1.08);
}

.ai-mascot.warning .ai-aura{
  background:radial-gradient(circle, rgba(255,100,140,0.16), transparent 68%);
}

.ai-mascot.warning .ai-status{
  border-color:rgba(255,130,150,0.35);
  box-shadow:0 0 22px rgba(255,130,150,0.14);
}

.ai-mascot.glitch .ai-character,
.ai-mascot.glitch .ai-status{
  animation:aiGlitch 0.16s steps(2) infinite;
}

@keyframes aiGlitch{
  0%{ transform:translate(0,0); }
  25%{ transform:translate(-2px,1px); }
  50%{ transform:translate(2px,-1px); }
  75%{ transform:translate(-1px,-2px); }
  100%{ transform:translate(0,0); }
}

/* 認証 */
.auth-screen{
  background:
    radial-gradient(circle at center, rgba(0,180,255,0.15), transparent 35%),
    linear-gradient(180deg, #050b16, #01030a);
}

.auth-card{
  position:relative;
  overflow:hidden;
  width:min(560px, calc(100% - 24px));
  padding:32px 24px;
  border-radius:20px;
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%, -50%);
  background:rgba(5,16,34,0.72);
  border:1px solid rgba(110,225,255,0.2);
  box-shadow:0 0 30px rgba(0,215,255,0.08);
  text-align:center;
  z-index:10;
}

.mini-label{
  margin:0 0 10px;
  color:#79eaff;
  font-size:12px;
  letter-spacing:0.16em;
}

.auth-card h1{
  margin:0 0 12px;
  font-size:40px;
  color:#8df3ff;
  letter-spacing:0.08em;
}

.auth-copy{
  color:#a8c1cf;
  line-height:1.8;
  margin-bottom:20px;
}

.form-group{
  text-align:left;
  margin-bottom:16px;
}

.form-group label{
  display:block;
  margin-bottom:8px;
  color:#8bb5c7;
  font-size:12px;
  letter-spacing:0.12em;
}

.form-group input{
  width:100%;
  padding:14px 16px;
  border-radius:14px;
  border:1px solid rgba(110,225,255,0.18);
  background:rgba(2,9,19,0.9);
  color:#fff;
  font-size:15px;
  outline:none;
}

.form-group input:focus{
  border-color:rgba(110,225,255,0.6);
  box-shadow:0 0 0 4px rgba(110,225,255,0.08);
}

.auth-message{
  margin-top:14px;
  color:#7defff;
  min-height:24px;
}

/* IDカード */
.id-select-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}

.id-card{
  text-align:left;
  padding:14px 14px 12px;
  border-radius:16px;
  border:1px solid rgba(110,225,255,0.18);
  background:rgba(2,9,19,0.92);
  color:#eaffff;
  cursor:pointer;
  transition:0.2s ease;
}

.id-card:hover{
  transform:translateY(-2px);
  border-color:rgba(110,225,255,0.45);
  box-shadow:0 0 18px rgba(0,225,255,0.10);
}

.id-card.selected{
  border-color:rgba(110,225,255,0.72);
  box-shadow:
    0 0 18px rgba(0,225,255,0.16),
    inset 0 0 20px rgba(0,225,255,0.05);
  background:linear-gradient(
    180deg,
    rgba(8,20,36,0.98),
    rgba(4,12,24,0.96)
  );
}

.id-card-label{
  display:block;
  margin-bottom:8px;
  color:#79eaff;
  font-size:11px;
  letter-spacing:0.14em;
}

.id-card strong{
  display:block;
  font-size:16px;
  margin-bottom:6px;
  letter-spacing:0.04em;
}

.id-card small{
  color:#9cb9c8;
  font-size:12px;
}

/* ボタン */
.neo-btn{
  border:none;
  border-radius:14px;
  padding:12px 18px;
  cursor:pointer;
  font-weight:700;
  color:#eaffff;
  background:linear-gradient(90deg, rgba(0,134,255,0.18), rgba(0,255,225,0.18));
  border:1px solid rgba(110,225,255,0.25);
  transition:0.2s ease;
}

.neo-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 0 18px rgba(0,225,255,0.14);
}

.neo-btn.small{
  padding:10px 14px;
  font-size:12px;
}

/* MAP */
.map-screen{
  background:#000;
}

.map-header{
  position:absolute;
  top:18px;
  left:0;
  width:100%;
  z-index:20;
  text-align:center;
}

.map-header h1{
  margin:0;
  color:#77eeff;
  letter-spacing:0.08em;
}

.hud{
  position:absolute;
  top:0;
  right:18px;
  display:flex;
  flex-direction:column;
  gap:6px;
  color:#dffcff;
  font-size:14px;
  text-align:right;
}

.map-wrap{
  position:absolute;
  inset:90px 40px 90px 40px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.map-image{
  width:100%;
  height:100%;
  object-fit:contain;
  filter:brightness(0.92);
}

/* リング */
.ring-overlay,
.ring-scan{
  position:absolute;
  pointer-events:none;
  z-index:1;
  left:50%;
  top:50%;
  transform:translate(-50%, -50%);
  mix-blend-mode:screen;
}

.ring-overlay{
  border-radius:50%;
}

.ring-outer{
  width:72%;
  aspect-ratio:1 / 1;
  border:1px solid rgba(90,235,255,0.35);
  box-shadow:
    0 0 28px rgba(0,255,255,0.18),
    0 0 60px rgba(0,255,255,0.10);
  animation:ringRotate 30s linear infinite;
}

.ring-outer::before,
.ring-outer::after{
  content:"";
  position:absolute;
  inset:-10px;
  border-radius:50%;
}

.ring-outer::before{
  border:1px dashed rgba(90,235,255,0.18);
  animation:ringRotateReverse 18s linear infinite;
}

.ring-outer::after{
  inset:8%;
  border:1px solid rgba(90,235,255,0.08);
}

.ring-inner{
  width:42%;
  aspect-ratio:1 / 1;
  border:1px solid rgba(90,235,255,0.18);
  box-shadow:
    0 0 14px rgba(90,235,255,0.08),
    inset 0 0 18px rgba(90,235,255,0.04);
  animation:ringRotateReverse 22s linear infinite;
}

.ring-inner::before,
.ring-inner::after{
  content:"";
  position:absolute;
  border-radius:50%;
}

.ring-inner::before{
  inset:10%;
  border:1px dashed rgba(90,235,255,0.15);
}

.ring-inner::after{
  inset:-16%;
  border:1px solid rgba(90,235,255,0.06);
}

.ring-scan{
  width:74%;
  aspect-ratio:1 / 1;
  border-radius:50%;
  background:
    conic-gradient(
      from 0deg,
      transparent 0deg,
      rgba(0,255,255,0.05) 200deg,
      rgba(0,255,255,0.35) 250deg,
      rgba(0,255,255,0.08) 300deg,
      transparent 330deg
    );
  filter:blur(3px);
  animation:scanRotate 8s linear infinite;
}

@keyframes ringRotate{
  from{ transform:translate(-50%, -50%) rotate(0deg); }
  to{ transform:translate(-50%, -50%) rotate(360deg); }
}

@keyframes ringRotateReverse{
  from{ transform:translate(-50%, -50%) rotate(360deg); }
  to{ transform:translate(-50%, -50%) rotate(0deg); }
}

@keyframes scanRotate{
  from{ transform:translate(-50%, -50%) rotate(0deg); }
  to{ transform:translate(-50%, -50%) rotate(360deg); }
}

/* ノード */
.map-node{
  position:absolute;
  padding:12px 18px;
  border-radius:18px;
  border:2px solid rgba(118,239,255,0.72);
  background:rgba(6,20,36,0.58);
  color:#eaffff;
  font-weight:800;
  cursor:pointer;
  z-index:3;
  transition:0.2s ease;
}

.map-node:hover{
  transform:translate(-50%,-50%) scale(1.06);
  box-shadow:0 0 24px rgba(0,225,255,0.22);
}

.map-node::before{
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%, -50%);
  width:180%;
  height:240%;
  border-radius:50%;
  background:radial-gradient(circle, rgba(0,255,255,0.25), transparent 70%);
  z-index:-1;
  filter:blur(8px);
}

.node-core{
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
}

.node-core::before{
  background:radial-gradient(circle, rgba(0,255,255,0.35), transparent 70%);
  filter:blur(10px);
}

.node-upper{
  top:38%;
  left:50%;
  transform:translate(-50%,-50%);
}

.node-gate{
  top:50%;
  left:72%;
  transform:translate(-50%,-50%);
}

.node-d4{
  top:50%;
  left:25%;
  transform:translate(-50%,-50%);
}

.node-d5{
  top:70%;
  left:40%;
  transform:translate(-50%,-50%);
}

.node-d6{
  top:78%;
  left:50%;
  transform:translate(-50%,-50%);
}

.node-slum{
  top:18%;
  left:50%;
  transform:translate(-50%,-50%);
  border-color:#ff6a9b;
  color:#ff9fbf;
  animation:slumFlicker 1.2s infinite;
}

.node-slum::before{
  background:radial-gradient(circle, rgba(255,60,120,0.35), transparent 70%);
  filter:blur(10px);
}

@keyframes slumFlicker{
  0%,100%{ opacity:1; transform:translate(-50%,-50%) scale(1); }
  50%{ opacity:0.72; transform:translate(-50%,-50%) scale(1.03); }
}

/* 線 */
.map-line{
  position:absolute;
  height:4px;
  border-radius:999px;
  background:linear-gradient(90deg, rgba(118,239,255,0.18), rgba(118,239,255,0.05));
  opacity:0.45;
  transition:opacity 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  z-index:2;
}

.map-line.active{
  opacity:1;
  background:linear-gradient(
    90deg,
    rgba(118,239,255,1),
    rgba(118,239,255,0.55),
    rgba(118,239,255,0.08)
  );
  box-shadow:
    0 0 12px rgba(118,239,255,0.45),
    0 0 24px rgba(118,239,255,0.22);
}

.map-line.pulse{
  animation:linePulseFlow 1.1s ease-in-out infinite;
}

@keyframes linePulseFlow{
  0%,100%{ filter:brightness(1); }
  50%{ filter:brightness(1.45); }
}

.line-core-upper{
  top:44%;
  left:50%;
  width:120px;
  transform:translateX(-50%) rotate(-90deg);
}

.line-upper-gate{
  top:45%;
  left:57%;
  width:165px;
  transform:rotate(-8deg);
}

.line-upper-d4{
  top:44%;
  left:29%;
  width:165px;
  transform:rotate(182deg);
}

.line-upper-d5{
  top:58%;
  left:41%;
  width:120px;
  transform:rotate(120deg);
}

.line-upper-d6{
  top:61%;
  left:47%;
  width:145px;
  transform:rotate(90deg);
}

.line-outside{
  top:50%;
  left:76%;
  width:210px;
  transform:translateY(-50%);
  background:linear-gradient(
    90deg,
    rgba(118,239,255,0.35),
    rgba(118,239,255,0.18),
    transparent
  );
}

.line-outside.active{
  background:linear-gradient(
    90deg,
    rgba(118,239,255,1),
    rgba(118,239,255,0.45),
    transparent
  );
}

/* 管区 */
.district-screen{
  background:#000;
}

.district-header{
  position:absolute;
  top:16px;
  left:16px;
  right:16px;
  z-index:10;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
}

.district-image{
  width:100%;
  height:100%;
  object-fit:cover;
  transition:opacity 0.35s ease, filter 0.3s ease;
}

.district-overlay{
  position:absolute;
  overflow:hidden;
  left:24px;
  bottom:90px;
  z-index:10;
  width:min(520px, 62vw);
  max-width:520px;
  padding:26px 30px 30px;
  border-radius:20px;
  background:rgba(0,0,0,0.68);
  backdrop-filter:blur(14px);
  border:1px solid rgba(0,255,255,0.15);
  box-shadow:0 0 25px rgba(0,255,255,0.1);
}

.district-overlay .mini-label{
  font-size:12px;
  letter-spacing:0.2em;
  color:#7beaff;
  margin-bottom:10px;
}

.district-overlay h2{
  margin:0 0 14px;
  font-size:46px;
  font-weight:700;
  color:#9beeff;
}

.district-overlay p{
  margin:0;
  font-size:16px;
  line-height:1.8;
  color:#cfefff;
}

/* 決済 */
.payment-ui{
  position:absolute;
  right:260px;
  bottom:110px;
  z-index:300;
  width:min(360px, calc(100% - 48px));
  padding:18px 18px 16px;
  border-radius:18px;
  background:rgba(4, 18, 34, 0.92);
  border:1px solid rgba(118,239,255,0.35);
  box-shadow:
    0 0 24px rgba(0,225,255,0.18),
    inset 0 0 20px rgba(0,225,255,0.05);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  overflow:hidden;
  animation:paymentFade 0.22s ease;
}

.payment-ui p{
  margin:0 0 14px;
  color:#eaffff;
  font-size:15px;
  line-height:1.7;
  position:relative;
  z-index:2;
}

.payment-actions{
  display:flex;
  gap:10px;
  position:relative;
  z-index:2;
}

.payment-ui button{
  flex:1;
  border:none;
  border-radius:12px;
  padding:12px 14px;
  font-weight:700;
  cursor:pointer;
  transition:0.2s ease;
}

.payment-ui.success{
  border-color:rgba(120,255,180,0.45);
  box-shadow:
    0 0 30px rgba(120,255,180,0.22),
    inset 0 0 24px rgba(120,255,180,0.08);
}

.payment-ui.success .payment-scan{
  opacity:1;
  background:linear-gradient(
    to bottom,
    rgba(120,255,180,0),
    rgba(120,255,180,0.24),
    rgba(120,255,180,0)
  );
  animation:paymentScanMove 0.7s linear 1;
}

.payment-ui.error{
  border-color:rgba(255,120,150,0.45);
  box-shadow:
    0 0 30px rgba(255,120,150,0.18),
    inset 0 0 24px rgba(255,120,150,0.06);
}

#payYes{
  background:linear-gradient(90deg, rgba(0,210,255,0.22), rgba(0,255,225,0.18));
  color:#eaffff;
  border:1px solid rgba(118,239,255,0.28);
}

#payNo{
  background:rgba(255,255,255,0.06);
  color:#d7f7ff;
  border:1px solid rgba(255,255,255,0.12);
}

.payment-scan{
  position:absolute;
  left:0;
  top:-30%;
  width:100%;
  height:34%;
  background:linear-gradient(
    to bottom,
    rgba(0,255,255,0),
    rgba(0,255,255,0.22),
    rgba(0,255,255,0)
  );
  opacity:0;
  pointer-events:none;
  z-index:1;
}

.payment-ui.scanning .payment-scan{
  opacity:1;
  animation:paymentScanMove 1s linear infinite;
}

.payment-ui.scanning button{
  pointer-events:none;
  opacity:0.7;
}

@keyframes paymentScanMove{
  0%{ top:-30%; }
  100%{ top:100%; }
}

@keyframes paymentFade{
  from{
    opacity:0;
    transform:translateY(8px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

.ai-console{
  position:absolute;
  left:0;
  bottom:0;
  width:100%;
  padding:14px 18px;
  background:rgba(0,0,0,0.62);
  z-index:20;
  border-top:1px solid rgba(118,239,255,0.12);
}

.ai-console p{
  margin:0;
  color:#eaffff;
  letter-spacing:0.04em;
}

/* スラム */
.slum-glitch{
  position:fixed;
  inset:0;
  z-index:999;
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0.03) 0 2px,
      rgba(0,0,0,0.08) 2px 4px
    ),
    radial-gradient(circle, rgba(255,40,110,0.12), rgba(0,0,0,0.88)),
    rgba(0,0,0,0.82);
  backdrop-filter:blur(2px);
  animation:slumGlitchFlash 0.18s steps(2) infinite;
}

.slum-glitch-inner{
  width:min(560px, calc(100% - 30px));
  padding:28px 22px;
  border-radius:18px;
  text-align:center;
  background:rgba(20, 0, 10, 0.82);
  border:1px solid rgba(255, 80, 130, 0.35);
  box-shadow:0 0 28px rgba(255, 80, 130, 0.16);
  animation:slumBoxJitter 0.22s linear infinite;
}

.slum-glitch h2{
  margin:0 0 12px;
  font-size:clamp(30px, 6vw, 48px);
  letter-spacing:0.14em;
  color:#fff;
}

#slumGlitchText{
  margin:0;
  color:#ffd7e3;
  line-height:1.8;
}

@keyframes slumGlitchFlash{
  0%{ opacity:0.95; filter:hue-rotate(0deg); }
  50%{ opacity:1; filter:hue-rotate(-12deg); }
  100%{ opacity:0.92; filter:hue-rotate(6deg); }
}

@keyframes slumBoxJitter{
  0%{ transform:translate(0,0); }
  25%{ transform:translate(-2px,1px); }
  50%{ transform:translate(2px,-1px); }
  75%{ transform:translate(-1px,-2px); }
  100%{ transform:translate(0,0); }
}

/* テーマ */
.theme-default{}
.theme-core .district-image{ filter:grayscale(0.75) brightness(0.72); }
.theme-upper .district-image{ filter:hue-rotate(180deg) brightness(1.02); }
.theme-transit .district-image{ filter:brightness(1.04) contrast(1.06); }
.theme-commercial .district-image{ filter:brightness(1.14) contrast(1.05); }
.theme-entertainment .district-image{ filter:saturate(1.22) brightness(1.05); }
.theme-life .district-image{ filter:contrast(0.96) saturate(1.06); }

/* ストレス */
.stress-high .global-vignette{
  background:radial-gradient(circle, transparent 48%, rgba(255,0,70,0.12) 100%);
}

.stress-critical{
  animation:criticalPulse 1.8s ease-in-out infinite;
}

@keyframes criticalPulse{
  0%,100%{ filter:contrast(1); }
  50%{ filter:contrast(1.08) saturate(1.08); }
}

.screen-shake{
  animation:shake 0.22s linear 2;
}

.body-glitch{
  animation:bodyGlitch 0.22s linear 4;
}

@keyframes shake{
  0%{ transform:translate(2px,2px); }
  50%{ transform:translate(-2px,-2px); }
  100%{ transform:translate(0,0); }
}

@keyframes bodyGlitch{
  0%{ transform:translate(0,0); filter:contrast(1); }
  20%{ transform:translate(-2px,1px); }
  40%{ transform:translate(2px,-1px); filter:contrast(1.08) saturate(1.15); }
  60%{ transform:translate(-1px,-2px); }
  80%{ transform:translate(1px,2px); }
  100%{ transform:translate(0,0); filter:contrast(1); }
}

/* 強化演出 */
.stress-overlay{
  position:fixed;
  inset:0;
  z-index:6;
  pointer-events:none;
  opacity:0;
  background:
    radial-gradient(circle at center, transparent 45%, rgba(255,0,60,0.06) 100%),
    linear-gradient(180deg, rgba(255,0,70,0.00), rgba(255,0,70,0.06));
  transition:opacity 0.35s ease;
}

.stress-high .stress-overlay{
  opacity:0.55;
}

.stress-critical .stress-overlay{
  opacity:0.9;
  animation:stressFlash 1.2s ease-in-out infinite;
}

@keyframes stressFlash{
  0%,100%{ filter:brightness(1); opacity:0.75; }
  50%{ filter:brightness(1.15); opacity:1; }
}

.stress-high .hud span{
  text-shadow:0 0 10px rgba(255,70,110,0.32);
}

.stress-critical .hud span{
  animation:hudJitter 0.18s steps(2) infinite;
  color:#ffd9e2;
  text-shadow:
    0 0 10px rgba(255,70,110,0.4),
    0 0 18px rgba(255,70,110,0.25);
}

@keyframes hudJitter{
  0%{ transform:translate(0,0); }
  25%{ transform:translate(-1px,1px); }
  50%{ transform:translate(1px,-1px); }
  75%{ transform:translate(-1px,-1px); }
  100%{ transform:translate(0,0); }
}

.auth-card::before,
.district-overlay::before,
.ai-status::before,
.payment-ui::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  border-radius:inherit;
  background:
    linear-gradient(
      135deg,
      rgba(121,234,255,0.08),
      transparent 32%,
      transparent 70%,
      rgba(121,234,255,0.05)
    );
  opacity:0.9;
}

.cyber-scanbar{
  position:fixed;
  left:0;
  top:-12%;
  width:100%;
  height:14%;
  z-index:7;
  pointer-events:none;
  opacity:0;
  background:linear-gradient(
    to bottom,
    rgba(0,255,255,0),
    rgba(0,255,255,0.10),
    rgba(0,255,255,0)
  );
}

.scanbar-on{
  opacity:1;
  animation:scanSweep 3.8s linear infinite;
}

@keyframes scanSweep{
  0%{ top:-18%; }
  100%{ top:110%; }
}

.map-wrap::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  border:1px solid rgba(0,255,255,0.08);
  box-shadow:
    inset 0 0 24px rgba(0,255,255,0.05),
    0 0 30px rgba(0,255,255,0.04);
}

.ai-mascot::before{
  content:"";
  position:absolute;
  inset:-8px -8px 52px -8px;
  pointer-events:none;
  border-radius:24px;
  border:1px solid rgba(121,234,255,0.08);
  box-shadow:0 0 24px rgba(121,234,255,0.05);
}

.ai-mascot.warning .ai-status-label{
  color:#ffb6c8;
}

.ai-mascot.glitch .ai-status-label{
  color:#ffd8e2;
  text-shadow:0 0 8px rgba(255,80,130,0.35);
}

.watch-reticle{
  position:fixed;
  width:84px;
  height:84px;
  border-radius:50%;
  border:1px solid rgba(121,234,255,0.26);
  z-index:8;
  pointer-events:none;
  opacity:0;
  transform:translate(-50%, -50%) scale(0.9);
  transition:opacity 0.2s ease, transform 0.2s ease;
  box-shadow:0 0 18px rgba(121,234,255,0.08);
}

.watch-reticle::before,
.watch-reticle::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%, -50%);
  pointer-events:none;
}

.watch-reticle::before{
  width:28px;
  height:28px;
  border-radius:50%;
  border:1px solid rgba(121,234,255,0.28);
}

.watch-reticle::after{
  width:8px;
  height:8px;
  border-radius:50%;
  background:rgba(121,234,255,0.75);
  box-shadow:0 0 10px rgba(121,234,255,0.4);
}

.watch-reticle.active{
  opacity:1;
  transform:translate(-50%, -50%) scale(1);
}

.stress-critical .watch-reticle{
  border-color:rgba(255,100,140,0.34);
}

.stress-critical .watch-reticle::before{
  border-color:rgba(255,100,140,0.34);
}

.stress-critical .watch-reticle::after{
  background:rgba(255,100,140,0.8);
  box-shadow:0 0 12px rgba(255,100,140,0.36);
}

/* ストレス段階 */
.stress-stage-0 .hud span,
.stress-stage-0 .ai-status-label,
.stress-stage-0 .district-overlay h2,
.stress-stage-0 .map-header h1{
  color:#79eaff;
}

.stress-stage-1 .hud span,
.stress-stage-1 .ai-status-label,
.stress-stage-1 .district-overlay h2,
.stress-stage-1 .map-header h1{
  color:#8cf7ff;
  text-shadow:0 0 10px rgba(80,220,255,0.12);
}

.stress-stage-2 .hud span,
.stress-stage-2 .ai-status-label,
.stress-stage-2 .district-overlay h2,
.stress-stage-2 .map-header h1{
  color:#ffb5c1;
  text-shadow:0 0 12px rgba(255,100,140,0.16);
}

.stress-stage-3 .hud span,
.stress-stage-3 .ai-status-label,
.stress-stage-3 .district-overlay h2,
.stress-stage-3 .map-header h1{
  color:#ff8ea6;
  text-shadow:
    0 0 12px rgba(255,70,110,0.22),
    0 0 22px rgba(255,70,110,0.12);
}

.stress-stage-4 .hud span,
.stress-stage-4 .ai-status-label,
.stress-stage-4 .district-overlay h2,
.stress-stage-4 .map-header h1{
  color:#ff6d90;
  text-shadow:
    0 0 12px rgba(255,40,90,0.28),
    0 0 26px rgba(255,40,90,0.16);
}

.stress-stage-1 .map-node{
  border-color:rgba(140,247,255,0.72);
}

.stress-stage-2 .map-node{
  border-color:rgba(255,170,190,0.72);
}

.stress-stage-3 .map-node{
  border-color:rgba(255,120,150,0.78);
}

.stress-stage-4 .map-node{
  border-color:rgba(255,90,130,0.88);
}

.stress-stage-1 .district-overlay,
.stress-stage-1 .ai-status,
.stress-stage-1 .payment-ui{
  box-shadow:0 0 18px rgba(80,220,255,0.10);
}

.stress-stage-2 .district-overlay,
.stress-stage-2 .ai-status,
.stress-stage-2 .payment-ui{
  box-shadow:0 0 18px rgba(255,100,140,0.10);
}

.stress-stage-3 .district-overlay,
.stress-stage-3 .ai-status,
.stress-stage-3 .payment-ui{
  box-shadow:0 0 22px rgba(255,70,110,0.14);
}

.stress-stage-4 .district-overlay,
.stress-stage-4 .ai-status,
.stress-stage-4 .payment-ui{
  box-shadow:0 0 26px rgba(255,40,90,0.18);
}

/* レスポンシブ */
@media (max-width: 900px){
  .ai-mascot{
    width:180px;
    right:10px;
    bottom:8px;
  }

  .ai-character{
    width:145px;
  }

  .map-wrap{
    inset:92px 18px 90px 18px;
  }
}

@media (max-width: 640px){
  .auth-card{
    width:min(94vw, 560px);
    padding:24px 16px;
  }

  .auth-card h1{
    font-size:32px;
    line-height:1.15;
  }

  .auth-copy{
    font-size:14px;
    line-height:1.7;
  }

  .id-select-grid{
    grid-template-columns:1fr;
    gap:10px;
  }

  .id-card{
    padding:12px 12px 10px;
  }

  .id-card strong{
    font-size:15px;
  }

  .id-card small{
    font-size:11px;
    line-height:1.5;
  }

  .hud{
    right:10px;
    top:2px;
    font-size:12px;
    gap:4px;
    text-align:right;
  }

  .map-header{
    top:14px;
  }

  .map-header h1{
    font-size:26px;
    line-height:1.2;
    padding:0 12px;
  }

  .map-wrap{
    inset:88px 10px 82px 10px;
  }

  .map-node{
    padding:9px 12px;
    font-size:12px;
    border-radius:14px;
  }

  .district-header{
    top:12px;
    left:12px;
    right:12px;
  }

  .district-overlay{
    left:12px;
    bottom:120px;
    width:58%;
    max-width:none;
    padding:14px 14px 16px;
    border-radius:14px;
    background:rgba(0,0,0,0.74);
    border:1px solid rgba(118,239,255,0.16);
    box-shadow:0 0 18px rgba(0,225,255,0.07);
  }

  .district-overlay .mini-label{
    margin-bottom:8px;
    font-size:10px;
    letter-spacing:0.14em;
  }

  .district-overlay h2{
    font-size:30px;
    line-height:1.15;
    margin:0 0 10px;
  }

  .district-overlay p{
    font-size:14px;
    line-height:1.7;
  }

  .payment-ui{
    left:12px;
    right:12px;
    bottom:118px;
    width:auto;
    padding:14px 14px 13px;
    border-radius:14px;
  }

  .payment-ui p{
    font-size:14px;
    line-height:1.6;
  }

  .payment-ui button{
    padding:11px 12px;
    font-size:13px;
  }

  .ai-mascot{
    width:110px;
    right:4px;
    bottom:70px;
  }

  .ai-character{
    width:100%;
    margin-left:auto;
  }

  .ai-aura{
    inset:8px 12px 44px;
    filter:blur(10px);
  }

  .ai-status{
    width:140px;
    padding:7px 9px;
    border-radius:12px;
    margin-top:6px;
  }

  .ai-status-label{
    font-size:8px;
    margin-bottom:4px;
    letter-spacing:0.12em;
  }

  .ai-status p{
    font-size:10px;
    line-height:1.45;
  }

  .ai-console{
    padding:12px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .ai-console p{
    font-size:13px;
    line-height:1.6;
  }

  .watch-reticle{
    width:64px;
    height:64px;
  }

  .watch-reticle::before{
    width:20px;
    height:20px;
  }

  .watch-reticle::after{
    width:6px;
    height:6px;
  }
}