:root {
  --bg: #02050a;
  --surface: rgba(7, 13, 22, .82);
  --surface-strong: rgba(8, 16, 27, .94);
  --line: rgba(255, 255, 255, .12);
  --text: #f4f8ff;
  --muted: #8190a6;
  --positive: #38f2bd;
  --neutral: #72a7ff;
  --negative: #ff4778;
  --unknown: #8b97a8;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background: transparent;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.space-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 0%, rgba(19, 79, 120, .32), transparent 38%),
    radial-gradient(circle at 92% 58%, rgba(91, 26, 80, .25), transparent 34%),
    linear-gradient(145deg, #040a12 0%, #02050a 58%, #07030b 100%);
}
#space { display: block; width: 100%; height: 100%; }
.space-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 38%, transparent 0, rgba(2, 5, 10, .08) 32%, rgba(2, 5, 10, .72) 100%);
  pointer-events: none;
}
.scan-field {
  position: absolute;
  inset: 0;
  opacity: .16;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(122, 181, 255, .045) 4px),
    linear-gradient(90deg, transparent, rgba(91, 150, 255, .07), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 84%, transparent);
  pointer-events: none;
  animation: scan-drift 14s linear infinite;
}
@keyframes scan-drift { to { transform: translateY(12px); } }

.sentiment-shell {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 80px;
}
.hero {
  max-width: 860px;
  margin: 0 auto 28px;
  text-align: center;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: #91a3bb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  justify-content: center;
}
.eyebrow span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 18px var(--positive);
  animation: live 2s ease-in-out infinite;
}
@keyframes live { 50% { opacity: .4; transform: scale(.72); } }
.hero h1 {
  margin: 0;
  font-size: clamp(38px, 6.4vw, 82px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -.045em;
}
.hero-lead {
  display: block;
  margin-bottom: 10px;
  color: #b8c5d6;
  font-size: clamp(15px, 1.9vw, 23px);
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: .08em;
}
.hero h1 strong {
  display: block;
  font-weight: 760;
  background: linear-gradient(90deg, #fff 0%, #9fc5ff 44%, #ff9ab6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-copy {
  max-width: 600px;
  margin: 20px auto 0;
  color: #a8b5c7;
  font-size: clamp(13px, 1.7vw, 16px);
  line-height: 1.8;
}
.stamp {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 16px 0 0;
  color: #fff;
  font-size: 9px;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  white-space: nowrap;
}
.stamp-track {
  position: relative;
  display: block;
  width: 100%;
  height: 1.5em;
}
.stamp-item {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: max-content;
  will-change: transform;
}
.stamp-colon {
  display: inline-block;
  margin: 0 .04em;
  color: #fff;
  animation: stamp-colon-blink .9s steps(1, end) infinite;
}
.stamp-divider {
  margin: 0 2.2em;
  color: rgba(255,255,255,.28);
}
.stamp-index {
  margin: 0 .35em;
  font-size: 1.12em;
  font-weight: 800;
}
.stamp-index-jp {
  color: #62b5ff;
  text-shadow: 0 0 10px rgba(98,181,255,.55);
}
.stamp-index-world {
  color: #ff477e;
  text-shadow: 0 0 10px rgba(255,71,126,.55);
}
.stamp-change {
  margin-left: .35em;
  font-weight: 800;
}
.stamp-change-up {
  color: #38f2bd;
  text-shadow: 0 0 9px rgba(56,242,189,.45);
}
.stamp-change-down {
  color: #ff658e;
  text-shadow: 0 0 9px rgba(255,71,120,.42);
}
.stamp-change-flat { color: #aab7c8; }
@keyframes stamp-colon-blink { 50% { opacity: .12; } }
.stamp-static { text-align: center; }
.stamp-static .stamp-track {
  display: inline-block;
  width: auto;
  height: auto;
}
.stamp-static .stamp-item {
  position: static;
  width: auto;
}

.sentiment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.sentiment-card,
.skeleton {
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(12, 23, 38, .92), rgba(5, 9, 16, .82));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.skeleton {
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.05) 48%, transparent 66%);
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.sentiment-card {
  --accent: var(--unknown);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  clip-path: inset(0 round 26px);
  padding: clamp(24px, 3.5vw, 38px);
}
.sentiment-card > * {
  position: relative;
  z-index: 1;
}
.sentiment-card::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -160px;
  top: -190px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .16;
  filter: blur(45px);
  pointer-events: none;
  z-index: 0;
}
.sentiment-card[data-level="positive"] { --accent: var(--positive); }
.sentiment-card[data-level="neutral"] { --accent: var(--neutral); }
.sentiment-card[data-level="negative"] { --accent: var(--negative); }

.card-top,
.tone-row,
.ratio-labels,
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-top {
  min-height: 48px;
  justify-content: center;
}
.region {
  margin: 0;
  text-align: center;
  line-height: 1;
}
.region span,
.region strong {
  display: block;
}
.region span {
  color: rgba(237, 243, 251, .5);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .18em;
}
.region strong {
  margin-top: 6px;
  color: #f4f8ff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .04em;
}
.mode {
  position: absolute;
  top: 3px;
  right: 13px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 99px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}
.mode i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: live 1.6s ease-in-out infinite;
}
.energy-core {
  position: relative;
  z-index: 1;
  top: auto;
  right: auto;
  width: 250px;
  height: 250px;
  margin: 4px auto -100px;
  pointer-events: none;
  filter: drop-shadow(0 0 28px color-mix(in srgb, var(--accent) 38%, transparent));
}
.life-sphere {
  display: block;
  width: 100%;
  height: 100%;
}
.core-ring,
.core-fire,
.core-dot {
  position: absolute;
  inset: 50% auto auto 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.core-ring {
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--accent) 18%, transparent);
}
.core-ring.r1 { width: 100%; height: 100%; animation: core-spin 12s linear infinite; border-style: dashed; }
.core-ring.r2 { width: 72%; height: 72%; animation: core-spin 7s linear infinite reverse; border-width: 2px 1px 1px 2px; }
.core-ring.r3 { width: 44%; height: 44%; animation: core-pulse 2.8s ease-in-out infinite; }
.core-fire {
  width: 62%;
  height: 62%;
  background:
    radial-gradient(circle at 45% 56%, #fff 0 3%, var(--accent) 8%, transparent 45%),
    conic-gradient(from 40deg, transparent, var(--accent), transparent 35%, var(--accent), transparent 70%);
  filter: blur(5px);
  opacity: .65;
  animation: plasma 4.2s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}
.core-dot {
  width: 13px;
  height: 13px;
  background: #fff;
  box-shadow: 0 0 8px #fff, 0 0 30px 12px var(--accent);
  animation: core-pulse 1.8s ease-in-out infinite;
}
@keyframes core-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes core-pulse {
  50% { transform: translate(-50%, -50%) scale(.82); opacity: .55; }
}
@keyframes plasma {
  0% { transform: translate(-50%, -50%) rotate(0) scale(.82, 1.08); }
  100% { transform: translate(-50%, -50%) rotate(110deg) scale(1.1, .88); }
}
.verdict {
  margin-top: 10px;
  position: relative;
  z-index: 1;
  max-width: none;
  text-align: center;
}
.verdict-label {
  display: block;
  color: var(--accent);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 780;
  line-height: 1.12;
  letter-spacing: -.035em;
}
.verdict-en {
  display: block;
  margin-top: 8px;
  color: #68788f;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
}
.energy-graph-wrap {
  position: relative;
  margin: 22px 0 2px;
}
.region-map {
  position: absolute;
  z-index: 0;
  right: -34px;
  bottom: 100%;
  display: block;
  width: 260px;
  height: 230px;
  opacity: .065;
  background-position: right bottom;
  background-size: contain;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, .16));
  pointer-events: none;
}
.sentiment-card[data-region="jp"] .region-map {
  right: -18px;
  width: 210px;
  height: 280px;
  opacity: .115;
  background-image: url("map-japan-wire.png");
}
.sentiment-card[data-region="world"] .region-map {
  right: -76px;
  bottom: calc(100% + 10px);
  width: 525px;
  height: 233px;
  opacity: .035;
  background-image: url("map-world-wire.png");
}
.energy-graph {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 94px;
  margin: 0;
  border-top: 1px solid rgba(255,255,255,.045);
  border-bottom: 1px solid rgba(255,255,255,.045);
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 6%, transparent), transparent),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,.028) 40px);
}
.tone-row {
  margin-top: 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.tone-meta,
.article-meta {
  flex: 1;
  text-align: center;
}
.tone-meta { border-right: 1px solid var(--line); }
.tone-meta span,
.article-meta span {
  display: block;
  color: #74849a;
  font-size: 10px;
  letter-spacing: .12em;
}
.tone-value {
  margin-top: 3px;
  color: #fff;
  font-size: 34px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.article-meta { text-align: center; }
.article-meta strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.article-meta .metric-change {
  font-size: 18px;
  font-weight: 800;
}
.metric-change-up {
  color: #38f2bd;
  text-shadow: 0 0 12px rgba(56,242,189,.38);
}
.metric-change-down {
  color: #ff658e;
  text-shadow: 0 0 12px rgba(255,71,120,.38);
}
.metric-change-flat { color: #aab7c8; }
.ratio-block { margin-top: 24px; }
.ratio-labels {
  margin-bottom: 10px;
  color: #8291a5;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.ratio-labels b { color: #c9d2df; font-weight: 600; }
.ratio-bar {
  display: flex;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.05);
}
.ratio-bar i { display: block; height: 100%; }
.ratio-bar .positive { background: var(--positive); }
.ratio-bar .neutral { background: var(--neutral); }
.ratio-bar .negative { background: var(--negative); }
.ratio-bar i {
  box-shadow: 0 0 16px currentColor;
  animation: ratio-life 3s ease-in-out infinite alternate;
}
@keyframes ratio-life { to { filter: brightness(1.45); } }
.card-bottom {
  margin-top: 26px;
  color: #68778c;
  font-size: 10px;
}
.history {
  display: flex;
  align-items: center;
  gap: 8px;
}
.history-track {
  width: 64px;
  height: 3px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255,255,255,.1);
}
.history-track i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.stale { color: #ffbd6b; }

.emotion-history {
  position: relative;
  overflow: hidden;
  margin-top: 22px;
  padding: 25px 26px 20px;
  border: 1px solid rgba(137, 173, 220, .2);
  border-radius: 18px;
  background:
    radial-gradient(circle at 13% 15%, rgba(53, 147, 255, .12), transparent 32%),
    radial-gradient(circle at 88% 35%, rgba(255, 45, 119, .11), transparent 34%),
    linear-gradient(145deg, rgba(7, 17, 31, .91), rgba(4, 7, 14, .86));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 24px 70px rgba(0,0,0,.22);
}
.emotion-history::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0, transparent 79px, rgba(130,171,225,.025) 80px);
  content: "";
}
.emotion-history-head,
.emotion-history-legend {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.emotion-history-kicker {
  margin: 0 0 7px;
  color: #71839a;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .26em;
}
.emotion-history-kicker span {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: #39f2c0;
  box-shadow: 0 0 12px #39f2c0;
}
.emotion-history h2 {
  margin: 0;
  color: #e7eef8;
  font-size: 20px;
  letter-spacing: .06em;
}
.emotion-history-periods {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(151,179,215,.13);
  border-radius: 10px;
  background: rgba(0,0,0,.24);
}
.emotion-history-periods button {
  min-width: 66px;
  padding: 8px 11px;
  border: 0;
  border-radius: 7px;
  color: #73839a;
  background: transparent;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: color .25s ease, background .25s ease, box-shadow .25s ease;
}
.emotion-history-periods button:hover { color: #dce8f8; }
.emotion-history-periods button.is-active {
  color: #f3f8ff;
  background: linear-gradient(135deg, rgba(59,148,255,.23), rgba(255,54,125,.18));
  box-shadow: inset 0 0 0 1px rgba(151,200,255,.18), 0 0 22px rgba(64,144,255,.08);
}
.emotion-history-legend {
  justify-content: flex-start;
  gap: 22px;
  margin-top: 18px;
  color: #9cabbf;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}
.emotion-history-legend button {
  display: inline-flex;
  align-items: center;
  padding: 5px 3px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  transition: opacity .4s ease, filter .4s ease;
}
.emotion-history-legend button i {
  display: inline-block;
  width: 18px;
  height: 2px;
  margin: 0 7px 0 0;
  box-shadow: 0 0 9px currentColor;
}
.emotion-history-legend button.is-off {
  opacity: .28;
  filter: grayscale(1);
}
.emotion-history-legend button.is-off i {
  box-shadow: none;
}
.legend-jp { color: #62b5ff; }
.legend-jp i { background: #62b5ff; }
.legend-world { color: #ff477e; }
.legend-world i { background: #ff477e; }
.emotion-history-legend small {
  margin-left: auto;
  color: #64748a;
  font-size: 8px;
  letter-spacing: .14em;
}
.emotion-history-legend small i {
  display: inline-block;
  width: 12px;
  margin: 0 6px 2px 0;
  border-top: 1px dashed #78899f;
}
.emotion-history-stage {
  position: relative;
  z-index: 1;
  height: 310px;
  margin-top: 10px;
}
#emotion-history-chart {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}
.emotion-history-scale {
  position: absolute;
  top: 20px;
  right: 3px;
  bottom: 29px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: rgba(149,165,186,.5);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}
.emotion-history-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 132px;
  padding: 9px 11px;
  border: 1px solid rgba(169,197,232,.22);
  border-radius: 8px;
  color: #dce7f5;
  background: rgba(2,7,14,.94);
  box-shadow: 0 10px 30px rgba(0,0,0,.38);
  font-size: 9px;
  line-height: 1.7;
  pointer-events: none;
  backdrop-filter: blur(12px);
}
.emotion-history-tooltip b { font-size: 11px; }
.emotion-history-tooltip .jp { color: #62b5ff; }
.emotion-history-tooltip .world { color: #ff477e; }
.emotion-history-note {
  position: relative;
  z-index: 2;
  margin: 2px 0 0;
  color: #59697e;
  font-size: 9px;
  letter-spacing: .04em;
}

.about {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(5, 10, 17, .65);
}
.about summary {
  padding: 18px 22px;
  cursor: pointer;
  color: #9ba9bb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}
.about-body {
  padding: 0 22px 22px;
  color: #718096;
  font-size: 11px;
  line-height: 1.9;
}
.about-body h2 {
  margin: 2px 0 18px;
  color: #d8e2ef;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: .04em;
}
.about-body p { margin: 0 0 16px; }
.about-body p:last-child { margin-bottom: 0; }
.about-body code {
  display: block;
  overflow-x: auto;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0,0,0,.35);
  color: #9fb1c8;
  white-space: nowrap;
}
.about-body small { display: block; margin-top: 12px; }
.error-panel {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(255,71,120,.5);
  border-radius: 14px;
  color: #ffd1dd;
  background: rgba(65, 8, 25, .72);
  font-size: 12px;
}

@media (max-width: 760px) {
  html,
  body { touch-action: pan-x pan-y; }
  .sentiment-shell {
    width: calc(100% - 16px);
    padding: 5px 0 58px;
  }
  .hero { margin-bottom: 18px; }
  .hero h1 { font-size: clamp(35px, 11vw, 50px); }
  .hero-copy { max-width: 340px; }
  .sentiment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sentiment-card,
  .skeleton { min-height: 0; border-radius: 10px; }
  .sentiment-card {
    padding: 16px 10px 14px;
    border-radius: 10px;
    clip-path: inset(0 round 10px);
  }
  .card-top { min-height: 39px; }
  .region span { font-size: 8px; }
  .region strong { margin-top: 4px; font-size: 15px; }
  .mode {
    top: -7px;
    right: 2px;
    padding: 4px 5px;
    font-size: 7px;
    letter-spacing: .05em;
  }
  .mode i { width: 4px; height: 4px; margin-right: 3px; }
  .energy-core { width: 118px; height: 118px; margin: 2px auto -43px; }
  .energy-graph-wrap {
    margin: 10px 0 0;
  }
  .region-map {
    opacity: .055;
  }
  .sentiment-card[data-region="jp"] .region-map {
    right: -10px;
    width: 105px;
    height: 140px;
    opacity: .1;
  }
  .sentiment-card[data-region="world"] .region-map {
    right: -54px;
    bottom: calc(100% + 6px);
    width: 278px;
    height: 123px;
    opacity: .03;
  }
  .verdict { margin-top: 0; min-height: 48px; }
  .verdict-label { font-size: 29px; }
  .verdict-en { margin-top: 4px; font-size: 7px; }
  .energy-graph { height: 48px; }
  .tone-row { margin-top: 0; }
  .tone-row { padding: 10px 0; }
  .tone-meta span,
  .article-meta span { font-size: 7px; letter-spacing: .07em; }
  .tone-value { font-size: 22px; }
  .article-meta strong { font-size: 12px; }
  .article-meta .metric-change { font-size: 13px; }
  .ratio-block { margin-top: 12px; }
  .ratio-labels { gap: 3px; font-size: 7px; letter-spacing: -.02em; }
  .ratio-bar { height: 5px; }
  .card-bottom { display: none; }
  .about {
    margin-top: 12px;
    border-radius: 10px;
  }
  .emotion-history {
    margin-top: 12px;
    padding: 17px 12px 14px;
    border-radius: 10px;
  }
  .emotion-history-head { align-items: flex-end; }
  .emotion-history h2 { font-size: 16px; }
  .emotion-history-kicker { font-size: 7px; }
  .emotion-history-periods { padding: 3px; }
  .emotion-history-periods button {
    min-width: 52px;
    padding: 7px 7px;
    font-size: 9px;
  }
  .emotion-history-legend { gap: 14px; margin-top: 15px; font-size: 8px; }
  .emotion-history-legend small { font-size: 6px; }
  .emotion-history-stage { height: 226px; margin-top: 5px; }
  .emotion-history-note { padding-right: 5px; font-size: 7px; line-height: 1.65; }
  .error-panel { border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .eyebrow span,
  .skeleton::after,
  .scan-field,
  .mode i,
  .core-ring,
  .core-fire,
  .core-dot,
  .ratio-bar i { animation: none; }
  .stamp-colon { animation: none; }
}
