/* ============================================
   JAPONÊS DA FEDERAL — Silver + Red accent
   Dark, clean, hacker vibes
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================================
   SPLASH / WARNING SCREEN
   ============================================ */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(5, 5, 8, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  overflow: hidden;
}

.splash.dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  position: relative;
}

/* Warning triangle */
.warning-icon {
  width: 80px;
  height: 70px;
  color: #c23030;
  animation: warningBlink 1.2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(194, 48, 48, 0.5));
}

.warning-icon svg {
  width: 100%;
  height: 100%;
}

@keyframes warningBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.splash-text {
  font-family: 'Fira Code', monospace;
  font-size: 1.4rem;
  font-weight: 500;
  color: #c23030;
  letter-spacing: 8px;
  text-transform: uppercase;
  text-shadow: 0 0 30px rgba(194, 48, 48, 0.4);
  animation: textFlicker 3s ease-in-out infinite;
}

.splash-sub {
  font-family: 'Fira Code', monospace;
  font-size: 0.7rem;
  color: rgba(194, 48, 48, 0.4);
  letter-spacing: 4px;
  text-transform: uppercase;
  animation: subtlePulse 2s ease-in-out infinite;
}

@keyframes textFlicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.3; }
  94% { opacity: 1; }
  96% { opacity: 0.5; }
  97% { opacity: 1; }
}

@keyframes subtlePulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* CRT scanline overlay */
.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  z-index: 1;
}

/* Horizontal scan sweep */
.splash::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(194, 48, 48, 0.15), transparent);
  animation: scanSweep 4s linear infinite;
  pointer-events: none;
}

@keyframes scanSweep {
  0% { top: -3px; }
  100% { top: 100%; }
}

:root {
  --accent: #b0b0b8;
  --accent-light: #d0d0d8;
  --accent-dark: #6a6a72;
  --accent-glow: rgba(176, 176, 184, 0.25);
  --red: #8b2020;
  --red-light: #c23030;
  --red-glow: rgba(139, 32, 32, 0.3);
  --bg-deep: #08080c;
  --bg-card: #0e0e14;
  --bg-card-inner: #131319;
  --text-primary: #d4d2cc;
  --text-secondary: #7c7a74;
  --text-muted: #44423e;
  --border-subtle: rgba(176, 176, 184, 0.08);
  --border-medium: rgba(176, 176, 184, 0.16);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-card: 20px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Raleway', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
}

/* CRT grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ---------- Particles Canvas ---------- */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Music Button ---------- */
.music-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border-medium);
  background: rgba(14, 14, 20, 0.8);
  backdrop-filter: blur(10px);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.music-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
  transform: scale(1.05);
}

.music-btn:focus-visible {
  outline: 2px solid var(--red-light);
  outline-offset: 3px;
}

.music-btn.loading {
  opacity: 0.5;
  animation: pulse-load 1s ease infinite;
}

@keyframes pulse-load {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.9; }
}

.music-btn svg {
  width: 20px;
  height: 20px;
}

.music-btn .hidden {
  display: none;
}

.music-btn.playing .icon-music-off {
  display: none;
}

.music-btn.playing .icon-music-on {
  display: block;
}

/* ---------- Card Container ---------- */
.card-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
}

/* ---------- Magic Card ---------- */
.magic-card {
  position: relative;
  width: 100%;
  border-radius: var(--radius-card);
  background: var(--bg-card);
  border: 1.5px solid var(--border-medium);
  overflow: visible;
}

@keyframes cardEntrance {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Card glow — subtle static */
.card-glow {
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: calc(var(--radius-card) + 1px);
  background: linear-gradient(135deg, var(--accent-glow), transparent 40%, transparent 60%, var(--red-glow));
  z-index: -1;
  filter: blur(6px);
  opacity: 0.5;
}

.card-glow-inner {
  display: none;
}

/* Card ornamental corners */
.card-border {
  position: absolute;
  inset: 8px;
  border-radius: calc(var(--radius-card) - 4px);
  border: 1px solid var(--border-subtle);
  pointer-events: none;
  z-index: 1;
}

.corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--accent-dark);
  opacity: 0.5;
}

.corner-tl {
  top: -1px;
  left: -1px;
  border-top: 2px solid;
  border-left: 2px solid;
  border-top-left-radius: 8px;
}

.corner-tr {
  top: -1px;
  right: -1px;
  border-top: 2px solid;
  border-right: 2px solid;
  border-top-right-radius: 8px;
}

.corner-bl {
  bottom: -1px;
  left: -1px;
  border-bottom: 2px solid;
  border-left: 2px solid;
  border-bottom-left-radius: 8px;
}

.corner-br {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid;
  border-right: 2px solid;
  border-bottom-right-radius: 8px;
}

/* ---------- Card Content ---------- */
.card-content {
  position: relative;
  z-index: 2;
  padding: 36px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* ---------- Ornaments ---------- */
.ornament-top,
.ornament-bottom {
  width: 100px;
  color: var(--accent-dark);
  opacity: 0.35;
}

.ornament-svg {
  width: 100%;
  height: auto;
}

/* ---------- Avatar ---------- */
.avatar-section {
  position: relative;
}

.avatar-ring {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--accent-dark), var(--red), var(--accent-dark));
}

.avatar-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--red-glow) 0%, transparent 70%);
  opacity: 0.4;
  z-index: -1;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid var(--bg-card);
}

/* ---------- Name & Username ---------- */
.card-name {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-light);
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 0 0 20px rgba(176, 176, 184, 0.15);
  line-height: 1.3;
}

.card-username {
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  margin-top: -10px;
}

/* ---------- Divider ---------- */
.divider {
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-medium), transparent);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.divider-diamond {
  position: absolute;
  color: var(--red);
  font-size: 8px;
  background: var(--bg-card);
  padding: 0 8px;
  opacity: 0.5;
}

/* ---------- Info Grid ---------- */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.info-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(176, 176, 184, 0.03);
  border: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
}

.info-tag:hover {
  background: rgba(176, 176, 184, 0.06);
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.tag-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent-dark);
  opacity: 0.6;
}

.tag-icon svg {
  width: 100%;
  height: 100%;
}

.tag-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tag-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-dark);
  font-weight: 600;
}

.tag-value {
  font-size: 0.78rem;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Social Links ---------- */
.social-links {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 50px;
  background: rgba(176, 176, 184, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.social-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: color 0.3s ease;
}

.social-link:hover {
  background: rgba(176, 176, 184, 0.08);
  border-color: var(--accent-dark);
  color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.social-link:focus-visible {
  outline: 2px solid var(--red-light);
  outline-offset: 3px;
  background: rgba(176, 176, 184, 0.08);
  color: var(--accent-light);
}

.social-link:hover svg {
  color: var(--accent-light);
}

/* ---------- Card Reflection ---------- */
.card-reflection {
  width: 80%;
  max-width: 340px;
  height: 40px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  opacity: 0.08;
  margin-top: -10px;
  border-radius: 50%;
  filter: blur(10px);
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 1.1rem;
  letter-spacing: 3px;
  font-family: 'Fira Code', monospace;
  opacity: 0.6;
  will-change: transform;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Small phones */
@media (max-width: 380px) {
  .card-content {
    padding: 28px 18px 22px;
    gap: 14px;
  }

  .card-name {
    font-size: 1.1rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .avatar-ring {
    width: 90px;
    height: 90px;
  }

  .social-links {
    flex-direction: column;
    align-items: center;
  }

  .social-link {
    width: 100%;
    justify-content: center;
  }
}

/* Regular phones */
@media (min-width: 381px) and (max-width: 480px) {
  .card-flip {
    max-width: 360px;
  }

  .card-content {
    padding: 30px 22px 24px;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* Tablets */
@media (min-width: 481px) and (max-width: 768px) {
  .card-flip {
    max-width: 400px;
  }
}

/* Desktop */
@media (min-width: 769px) {
  .card-flip:hover .magic-card {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .card-container {
    padding: 20px;
  }

  .card-content {
    padding: 20px 22px;
    gap: 12px;
  }

  .avatar-ring {
    width: 85px;
    height: 85px;
  }

  .card-name {
    font-size: 1.1rem;
  }

  .info-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   BASS-REACTIVE SHAKE
   ============================================ */
.magic-card {
  --shake-intensity: 0;
  will-change: transform;
}

/* Glow pulse on bass */
.magic-card.bass-hit .card-glow {
  opacity: 0.7;
  filter: blur(10px);
  transition: none;
}

/* Avatar ring pulse on bass */
.magic-card.bass-hit .avatar-ring {
  filter: brightness(1.15);
  transition: none;
}

/* Border flash on strong bass */
.magic-card.bass-hit .card-border {
  border-color: rgba(139, 32, 32, 0.25);
  transition: none;
}

/* ============================================
   CARD FLIP
   ============================================ */
.card-flip {
  position: relative;
  width: 100%;
  max-width: 420px;
  perspective: 1000px;
  cursor: pointer;
  animation: cardEntrance 1.2s ease-out forwards;
  opacity: 0;
  transform: translateY(30px);
}

.card-face {
  backface-visibility: hidden;
  transition: transform 0.7s ease;
}

.card-front {
  position: relative;
}

.card-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
}

.card-flip.flipped .card-front {
  transform: rotateY(180deg);
}

.card-flip.flipped .card-back {
  transform: rotateY(0deg);
}

/* Back card content */
.card-back-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 24px;
  text-align: center;
}

.back-quote {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 1rem;
  color: var(--accent-light);
  line-height: 1.6;
  opacity: 0.8;
  max-width: 280px;
}

.back-stats {
  display: flex;
  gap: 28px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-val {
  font-family: 'Fira Code', monospace;
  font-size: 1.5rem;
  color: var(--red-light);
  font-weight: 500;
}

.stat-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.back-hint {
  font-family: 'Fira Code', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  opacity: 0.4;
  animation: subtlePulse 2s ease-in-out infinite;
}

/* ============================================
   CUSTOM TOOLTIPS
   ============================================ */
.social-link {
  position: relative;
}

.social-link::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 4px 10px;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  font-family: 'Fira Code', monospace;
  font-size: 0.65rem;
  letter-spacing: 1px;
  color: var(--accent);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10;
}

.social-link:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   MUSIC PROGRESS BAR
   ============================================ */
.music-progress {
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2px;
  background: rgba(176, 176, 184, 0.1);
  border-radius: 1px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.music-btn.playing .music-progress {
  opacity: 1;
}

.music-progress::after {
  content: '';
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  background: var(--red-light);
  border-radius: 1px;
  transition: width 0.3s linear;
}

/* ============================================
   TYPING FOOTER
   ============================================ */
.typing-text {
  display: inline;
}

.typing-text::after {
  content: '|';
  color: var(--red-light);
  animation: blink-caret 0.8s step-end infinite;
  margin-left: 2px;
}

.typing-text.done::after {
  animation: blink-caret 0.8s step-end infinite 3s;
  opacity: 0;
}

@keyframes blink-caret {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}
