/* ========== Shared Theme Variables ========== */
:root {
  --primary: #6c63ff;
  --shadow-main: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Theme: Dark Arcade */
[data-theme="dark"] {
  --bg-start: #0F172A;
  --bg-end: #1E293B;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --glass-bg: rgba(30, 41, 59, 0.6);
  --card-bg: rgba(30, 41, 59, 0.8);
  --border-light: rgba(255, 255, 255, 0.08);
  --link-color: #6366F1;
  --shape-color-1: rgba(99, 102, 241, 0.15);
  --shape-color-2: rgba(16, 185, 129, 0.12);
  --shape-color-3: rgba(239, 68, 68, 0.1);
}

/* Theme: Light Modern */
[data-theme="light"] {
  --bg-start: #F8FAFC;
  --bg-end: #E2E8F0;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --glass-bg: rgba(255, 255, 255, 0.6);
  --card-bg: rgba(255, 255, 255, 0.8);
  --border-light: rgba(0, 0, 0, 0.08);
  --link-color: #4F46E5;
  --shape-color-1: rgba(37, 99, 235, 0.1);
  --shape-color-2: rgba(245, 158, 11, 0.1);
  --shape-color-3: rgba(244, 63, 94, 0.08);
}

/* ========== Base ========== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== Background Shapes ========== */
#bg-shapes {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.5;
}

.shape-1 {
  width: 350px; height: 350px;
  top: -5%; left: 10%;
  background: radial-gradient(circle, var(--shape-color-1), transparent 70%);
  animation: float1 28s infinite ease-in-out;
}
.shape-2 {
  width: 280px; height: 280px;
  bottom: 10%; right: 5%;
  border-radius: 30%;
  background: radial-gradient(circle, var(--shape-color-2), transparent 70%);
  animation: float2 24s infinite ease-in-out;
}
.shape-3 {
  width: 200px; height: 200px;
  top: 30%; right: 15%;
  background: radial-gradient(circle, var(--shape-color-3), transparent 70%);
  animation: float3 20s infinite ease-in-out;
}
.shape-4 {
  width: 320px; height: 320px;
  bottom: -5%; left: 25%;
  border-radius: 40%;
  background: radial-gradient(circle, var(--shape-color-1), transparent 70%);
  animation: float4 32s infinite ease-in-out;
}

@keyframes float1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(40px, 30px); } }
@keyframes float2 { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(-30px, -20px) rotate(45deg); } }
@keyframes float3 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(25px, -35px); } }
@keyframes float4 { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(-45px, 25px) rotate(-30deg); } }

/* ========== Floating Particles ========== */
.floating-particle {
  position: absolute;
  bottom: -30px;
  opacity: var(--p-opacity, 0.2);
  will-change: transform, opacity;
}

@keyframes particleRise {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  5% { opacity: var(--p-opacity, 0.2); }
  90% { opacity: var(--p-opacity, 0.2); }
  100% { transform: translateY(-110vh) translateX(var(--p-sway, 20px)) rotate(var(--p-rotation, 180deg)); opacity: 0; }
}

@keyframes particleSway {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(var(--p-sway, 20px)); }
}

/* ========== Floating Text ========== */
.floating-text {
  position: absolute;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  animation: textFloat linear forwards;
}

@keyframes textFloat {
  0% { opacity: 0; transform: translateY(0) rotate(var(--rot)); }
  10% { opacity: var(--max-opacity); }
  80% { opacity: var(--max-opacity); }
  100% { opacity: 0; transform: translateY(-120px) rotate(var(--rot)); }
}

/* ========== Header & Footer ========== */
.page-header, .page-footer {
  position: relative;
  z-index: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-light);
}
.page-footer {
  border-bottom: none;
  border-top: 1px solid var(--border-light);
}
.page-header nav a,
.page-footer nav a {
  margin: 0 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}
.page-header nav a:hover,
.page-footer nav a:hover {
  color: var(--link-color);
}

/* ========== Content ========== */
main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 3rem;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 800px;
  width: 100%;
  line-height: 1.7;
}

h1, h2, h3 { color: var(--text-primary); }
h1 { font-size: 2.5rem; margin-top: 0; text-align: center; margin-bottom: 2rem; }
h2 { font-size: 1.5rem; margin-top: 2rem; border-bottom: 1px solid var(--border-light); padding-bottom: 0.5rem; margin-bottom: 1rem; }

p, li { color: var(--text-secondary); }
strong { color: var(--text-primary); }

a { color: var(--link-color); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: background 0.3s;
}
.back-link:hover { background: rgba(99, 102, 241, 0.3); text-decoration: none; }
.back-link::before { content: "← "; }

.heart { color: #e53935; }
.page-footer p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 1rem; }

@media (max-width: 600px) {
  .card { padding: 1.5rem; }
  .page-header nav a, .page-footer nav a { display: block; margin: 0.5rem 0; }
}
