/* ============================================================
   AI'D — Death Note Aesthetic Stylesheet
   ============================================================ */

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --black: #080808;
  --deep: #0e0e0e;
  --surface: #141414;
  --surface2: #1a1a1a;
  --red: #cc0000;
  --red-bright: #ff1a1a;
  --red-glow: rgba(204, 0, 0, 0.35);
  --red-dim: #7a0000;
  --cream: #f0dcb0;
  --cream-dim: #c9b38a;
  --white: #f8f8f8;
  --grey: #555;
  --font-title: 'Cinzel Decorative', serif;
  --font-body: 'Cinzel', serif;
  --font-mono: 'Special Elite', serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--black);
  color: var(--cream);
  font-family: var(--font-mono);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ---- BG Canvas ---- */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}

main,
footer {
  position: relative;
  z-index: 1;
}

/* ---- Utilities ---- */
.hidden {
  display: none !important;
}

/* ============================================================
   MODAL OVERLAY
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(6px);
  animation: fadeIn 0.3s ease;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--red-dim);
  border-radius: 4px;
  padding: 2.5rem 2rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 0 60px var(--red-glow), 0 0 120px rgba(204, 0, 0, 0.1);
  animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-eye {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 10px var(--red));
  animation: pulseEye 2s ease-in-out infinite;
}

@keyframes pulseEye {

  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 10px var(--red));
  }

  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 20px var(--red-bright));
  }
}

.modal-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--red-bright);
  text-align: center;
  margin-bottom: 0.4rem;
  letter-spacing: 0.1em;
}

.modal-sub {
  font-size: 0.8rem;
  color: var(--cream-dim);
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 1.4rem;
}

.form-group label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--red-bright);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--grey);
  border-radius: 3px;
  padding: 0.75rem 1rem;
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  border-color: var(--red);
  box-shadow: 0 0 12px var(--red-glow);
}

.hint {
  display: block;
  font-size: 0.7rem;
  color: var(--grey);
  margin-top: 0.35rem;
}

.hint a {
  color: var(--red-dim);
  text-decoration: none;
}

.hint a:hover {
  color: var(--red-bright);
}

.modal-footer-note {
  font-size: 0.65rem;
  color: var(--grey);
  text-align: center;
  margin-top: 1rem;
  line-height: 1.6;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  width: 100%;
  background: var(--red);
  border: none;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  padding: 1rem 2rem;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

.btn-primary:hover {
  background: var(--red-bright);
  box-shadow: 0 0 20px var(--red-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-judge {
  position: relative;
  background: transparent;
  border: 2px solid var(--red);
  color: var(--red-bright);
  font-family: var(--font-title);
  font-size: 1.1rem;
  letter-spacing: 0.25em;
  padding: 1.1rem 3rem;
  cursor: pointer;
  transition: all 0.25s;
  clip-path: polygon(12px 0%, 100% 0%, calc(100% - 12px) 100%, 0% 100%);
  margin-top: 1.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.btn-judge::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--red);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 0;
}

.btn-judge:hover::before {
  transform: translateX(0);
}

.btn-judge:hover {
  color: var(--white);
  box-shadow: 0 0 30px var(--red-glow);
}

.btn-judge:hover .btn-judge-sub {
  color: rgba(255, 255, 255, 0.7);
}

.btn-judge:active {
  transform: scale(0.98);
}

.btn-judge-text,
.btn-judge-sub {
  position: relative;
  z-index: 1;
}

.btn-judge-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--grey);
  letter-spacing: 0.1em;
  transition: color 0.3s;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--grey);
  color: var(--cream-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  margin-top: 1rem;
}

.btn-secondary:hover {
  border-color: var(--cream-dim);
  color: var(--cream);
}

.btn-settings {
  background: transparent;
  border: none;
  color: var(--grey);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  margin-top: 1.2rem;
  letter-spacing: 0.1em;
  transition: color 0.2s;
}

.btn-settings:hover {
  color: var(--cream-dim);
}

.btn-share {
  background: #1a1a2e;
  border: 1px solid #333;
  color: var(--cream-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 1.5rem;
  letter-spacing: 0.1em;
}

.btn-share:hover {
  background: #0f3460;
  border-color: #1e90ff;
  color: #90caf9;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  text-align: center;
  padding: 7rem 1.5rem 3rem;
  max-width: 860px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  border: 1px solid var(--red-dim);
  color: var(--red-bright);
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  padding: 0.4rem 1.2rem;
  margin-bottom: 2rem;
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
  animation: fadeIn 1s ease 0.3s both;
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 1.5rem;
  animation: fadeIn 1s ease 0.5s both;
}

.title-line1 {
  font-family: var(--font-title);
  font-size: clamp(4.5rem, 14vw, 10rem);
  font-weight: 900;
  color: var(--red-bright);
  text-shadow:
    0 0 20px var(--red),
    0 0 60px rgba(204, 0, 0, 0.5),
    0 0 120px rgba(204, 0, 0, 0.2);
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.title-line2 {
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 2.5vw, 1.3rem);
  color: var(--cream-dim);
  letter-spacing: 0.3em;
  font-weight: 400;
  text-transform: uppercase;
  margin-top: 1.2rem;
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--cream-dim);
  line-height: 1.85;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  animation: fadeIn 1s ease 0.7s both;
}

.hero-warning {
  display: inline-block;
  background: rgba(204, 0, 0, 0.08);
  border: 1px solid var(--red-dim);
  color: var(--cream-dim);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  padding: 0.5rem 1.5rem;
  animation: fadeIn 1s ease 0.9s both;
}

/* ============================================================
   INPUT SECTION
   ============================================================ */
.input-section {
  display: flex;
  justify-content: center;
  padding: 1rem 1.5rem 5rem;
}

.input-card {
  background: var(--surface);
  border: 1px solid rgba(204, 0, 0, 0.3);
  box-shadow: 0 0 40px rgba(204, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 560px;
  animation: fadeIn 1s ease 1.1s both;
}

.input-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--red-bright);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.input-row {
  display: flex;
  align-items: center;
  width: 100%;
  border-bottom: 2px solid var(--red-dim);
  transition: border-color 0.3s;
}

.input-row:focus-within {
  border-color: var(--red-bright);
  box-shadow: 0 4px 20px rgba(204, 0, 0, 0.2);
}

.input-at {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--red);
  padding-right: 0.3rem;
  line-height: 1;
}

.twitter-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 2rem;
  padding: 0.5rem 0;
  caret-color: var(--red-bright);
}

.twitter-input::placeholder {
  color: rgba(240, 220, 176, 0.2);
}

.input-error {
  color: var(--red-bright);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  margin-top: 0.75rem;
  text-align: center;
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.shinigami-eye-anim {
  --size: 100px;
  width: var(--size);
  height: var(--size);
}

.eye-outer {
  width: 100%;
  height: 100%;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: linear-gradient(135deg, #300, #600);
  border: 2px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px var(--red), 0 0 60px rgba(204, 0, 0, 0.5);
  animation: eyePulse 1.5s ease-in-out infinite;
}

@keyframes eyePulse {

  0%,
  100% {
    box-shadow: 0 0 20px var(--red), 0 0 40px rgba(204, 0, 0, 0.4);
    transform: scaleY(1);
  }

  50% {
    box-shadow: 0 0 40px var(--red-bright), 0 0 80px rgba(255, 26, 26, 0.6);
    transform: scaleY(0.85);
  }
}

.eye-inner {
  width: 60%;
  height: 60%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff4444, #800);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pupil {
  width: 35%;
  height: 35%;
  border-radius: 50%;
  background: #000;
  animation: lookAround 3s ease-in-out infinite;
}

@keyframes lookAround {

  0%,
  100% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(4px, -2px);
  }

  50% {
    transform: translate(-3px, 3px);
  }

  75% {
    transform: translate(2px, 2px);
  }
}

.loading-text {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--cream-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: flicker 1.8s ease-in-out infinite;
}

@keyframes flicker {

  0%,
  100% {
    opacity: 1;
  }

  45% {
    opacity: 0.7;
  }

  50% {
    opacity: 0.4;
  }

  55% {
    opacity: 0.7;
  }
}

.loading-bar-wrap {
  width: 220px;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: var(--red);
  width: 0%;
  transition: width 0.4s ease;
  box-shadow: 0 0 10px var(--red);
}

/* ============================================================
   RESULTS
   ============================================================ */
.results-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

/* Report Header */
.report-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2.5rem;
  padding: 2rem;
  border-bottom: 1px solid rgba(204, 0, 0, 0.2);
  position: relative;
}

.report-victim-label {
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  color: var(--grey);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.report-victim-name {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--cream);
  text-shadow: 0 0 20px rgba(240, 220, 176, 0.3);
}

.report-stamp {
  font-family: var(--font-title);
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  color: var(--red-bright);
  border: 2px solid var(--red-bright);
  padding: 0.35rem 1rem;
  margin-top: 0.75rem;
  transform: rotate(-1.5deg);
  box-shadow: 0 0 10px var(--red-glow);
  animation: stampIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes stampIn {
  0% {
    transform: scale(3) rotate(-1.5deg);
    opacity: 0;
  }

  100% {
    transform: scale(1) rotate(-1.5deg);
    opacity: 1;
  }
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-bottom: 1px;
  background: rgba(204, 0, 0, 0.15);
}

.report-card {
  background: var(--surface);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  transition: background 0.2s;
}

.report-card:hover {
  background: var(--surface2);
}

.card-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 6px var(--red));
}

.card-label {
  font-family: var(--font-body);
  font-size: 0.58rem;
  letter-spacing: 0.25em;
  color: var(--red-bright);
  text-transform: uppercase;
}

.card-value {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--cream);
}

.card-ai-name {
  font-size: 1.1rem;
  color: var(--red-bright);
  text-shadow: 0 0 10px var(--red-glow);
}

.card-sub {
  font-size: 0.65rem;
  color: var(--grey);
  letter-spacing: 0.1em;
}

/* Glitch Effect */
.glitch {
  position: relative;
  animation: glitchAnim 4s infinite;
}

@keyframes glitchAnim {

  0%,
  86%,
  100% {
    text-shadow: none;
    transform: none;
  }

  87% {
    text-shadow: 2px 0 var(--red-bright), -2px 0 #00ffff;
    transform: translate(2px, 0);
  }

  88% {
    text-shadow: -2px 0 var(--red-bright), 2px 0 #00ffff;
    transform: translate(-2px, 0);
  }

  89% {
    text-shadow: none;
    transform: none;
  }

  90% {
    text-shadow: 2px 0 var(--red-bright);
    transform: translate(1px, 0);
  }

  91% {
    text-shadow: none;
    transform: none;
  }
}

/* Progress Ring */
.percentage-wrap {
  position: relative;
  width: 100px;
  height: 100px;
}

.progress-ring {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 8;
}

.ring-fill {
  fill: none;
  stroke: var(--red-bright);
  stroke-width: 8;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--red));
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.percentage-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--cream);
}

/* Threat Badge */
.threat-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  padding: 0.5rem 1.5rem;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

.threat-high {
  background: rgba(204, 0, 0, 0.2);
  color: var(--red-bright);
  border: 1px solid var(--red-bright);
  box-shadow: 0 0 15px var(--red-glow);
  animation: heartbeat 1s ease-in-out infinite;
}

.threat-medium {
  background: rgba(200, 120, 0, 0.15);
  color: #ff9900;
  border: 1px solid #ff9900;
}

.threat-low {
  background: rgba(0, 150, 60, 0.12);
  color: #00c851;
  border: 1px solid #00c851;
}

@keyframes heartbeat {

  0%,
  100% {
    transform: scale(1);
  }

  14% {
    transform: scale(1.05);
  }

  28% {
    transform: scale(1);
  }

  42% {
    transform: scale(1.05);
  }

  70% {
    transform: scale(1);
  }
}

/* Wide Cards */
.report-wide-card {
  background: var(--surface);
  border-top: 1px solid rgba(204, 0, 0, 0.15);
  padding: 2rem;
  margin-top: 1px;
}

.report-wide-card.survival {
  border-top-color: rgba(240, 220, 176, 0.1);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(100, 0, 0, 0.08) 100%);
}

.wide-card-label {
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: var(--red-bright);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.wide-card-text {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--cream-dim);
  line-height: 1.9;
  max-width: 720px;
}

/* Verdict Block */
.verdict-block {
  background: linear-gradient(135deg, #1a0000, #0e0e0e);
  border: 1px solid var(--red-dim);
  box-shadow: 0 0 60px rgba(204, 0, 0, 0.12), inset 0 1px 0 rgba(204, 0, 0, 0.1);
  padding: 3rem 2rem;
  text-align: center;
  margin-top: 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.verdict-eye {
  font-size: 2rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 12px var(--red));
  animation: pulseEye 2.5s ease-in-out infinite;
}

.verdict-label {
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  color: var(--grey);
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.verdict-text {
  font-family: var(--font-title);
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--red-bright);
  text-shadow: 0 0 20px rgba(204, 0, 0, 0.5);
  line-height: 1.5;
  max-width: 640px;
  font-weight: 700;
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   ERROR SECTION
   ============================================================ */
.error-section {
  display: flex;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.error-card {
  background: var(--surface);
  border: 1px solid rgba(204, 0, 0, 0.25);
  padding: 3rem 2rem;
  max-width: 500px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.error-eye {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 10px var(--red));
  opacity: 0.5;
}

.error-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--cream-dim);
  letter-spacing: 0.1em;
}

.error-msg {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--grey);
  line-height: 1.7;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: 0.7rem;
  color: var(--grey);
  letter-spacing: 0.15em;
  line-height: 2;
}

.footer-sub {
  color: rgba(85, 85, 85, 0.6);
}

/* ============================================================
   KEYFRAMES (shared)
   ============================================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 5rem 1rem 2rem;
  }

  .input-card {
    padding: 1.75rem 1rem;
  }

  .twitter-input,
  .input-at {
    font-size: 1.5rem;
  }

  .modal-box {
    padding: 2rem 1.25rem;
  }

  .report-card {
    padding: 1.4rem;
  }

  .report-wide-card,
  .verdict-block {
    padding: 1.5rem 1rem;
  }
}