@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;900&display=swap');

:root {
  --bg1: #0f0c29;
  --bg2: #302b63;
  --bg3: #24243e;
  --accent: #00d2ff;
  --accent2: #7b2ff7;
  --accent3: #ff6ac1;
  --text: #f0f0f0;
  --card-bg: rgba(255, 255, 255, 0.06);
}

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

body {
  font-family: 'Nunito', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3));
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Floating particles */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.4;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* Main card */
.card {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 48px 40px 32px;
  max-width: 600px;
  width: 92%;
  text-align: center;
  color: var(--text);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: cardIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Avatar */
.avatar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 20px rgba(0, 210, 255, 0.3);
  animation: avatarPulse 3s ease-in-out infinite;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

@keyframes avatarPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 210, 255, 0.3); }
  50%      { box-shadow: 0 4px 35px rgba(123, 47, 247, 0.5); }
}

.ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent3);
  animation: ringSpin 3s linear infinite;
}

@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

/* Name */
.name {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 6px;
  animation: fadeInUp 0.6s 0.2s both;
}

.highlight {
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
  animation: fadeInUp 0.6s 0.35s both;
}

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

/* Divider */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  margin: 20px 0;
}

/* Info grid */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  animation: fadeInUp 0.6s 0.5s both;
}

.info-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px 12px;
  transition: transform 0.25s, background 0.25s;
}

.info-item:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.08);
}

.info-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.info-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 4px;
}

.info-value {
  font-size: 1rem;
  font-weight: 700;
}

/* Sonic section */
.sonic-section {
  animation: fadeInUp 0.6s 0.8s both;
}

.sonic-story {
  text-align: left;
  background: rgba(0, 100, 255, 0.08);
  border: 1px solid rgba(0, 150, 255, 0.15);
  border-radius: 16px;
  padding: 20px 22px;
  font-size: 0.95rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.8);
}

.sonic-story p {
  margin-bottom: 10px;
}

.sonic-story p:last-child {
  margin-bottom: 0;
}

.sonic-story strong {
  color: #fff;
}

/* About text */
.about-text {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
  animation: fadeInUp 0.6s 0.7s both;
}

.about-text strong {
  color: #fff;
}

/* Games section */
.games-section {
  animation: fadeInUp 0.6s 0.65s both;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 900;
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.games-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.game-chip {
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  transition: transform 0.25s, background 0.25s, border-color 0.25s;
  cursor: default;
}

.game-chip:hover {
  transform: translateY(-2px) scale(1.05);
  background: rgba(123, 47, 247, 0.25);
  border-color: var(--accent2);
}

/* Footer wave */
.footer-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
}

.footer-wave svg {
  width: 100%;
  height: 100%;
}

/* Tetris section */
.tetris-section {
  position: relative;
  z-index: 1;
  max-width: 600px;
  width: 92%;
  margin: 30px auto;
  text-align: center;
  color: var(--text);
  animation: fadeInUp 0.6s 1s both;
}

.tetris-hint {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
  margin-bottom: 14px;
}

.tetris-container {
  display: flex;
  justify-content: center;
  gap: 16px;
  align-items: flex-start;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

#tetris {
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(0,0,0,0.4);
  display: block;
}

.tetris-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 100px;
}

.tetris-score {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--accent);
}

.tetris-next-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#tetris-next {
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(0,0,0,0.3);
}

.tetris-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tetris-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(0,210,255,0.4);
}

@media (max-width: 400px) {
  .tetris-container { flex-direction: column; align-items: center; padding: 14px; }
  #tetris { width: 160px; height: 320px; }
}

/* Responsive */
@media (max-width: 400px) {
  .card { padding: 36px 20px 24px; }
  .name { font-size: 1.5rem; }
  .avatar-wrapper { width: 96px; height: 96px; }
  .avatar { width: 96px; height: 96px; font-size: 44px; }
  .info-grid { gap: 10px; }
}
