/* ============================================
   IRONLUCA.NL - Shared Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Figtree:wght@300;400;500;600;700&display=swap');

/* ---------- CSS Variables / Theme ---------- */
:root {
  --bg: #08080f;
  --bg-surface: #0e0e1a;
  --bg-card: #141425;
  --bg-card-hover: #1c1c35;
  --text: #e8e8f4;
  --text-muted: #7a7a9e;
  --primary: #00d4ff;
  --primary-dark: #009dc2;
  --primary-glow: rgba(0, 212, 255, 0.25);
  --secondary: #ff3d8b;
  --secondary-glow: rgba(255, 61, 139, 0.2);
  --accent: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.2);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --nav-bg: rgba(8, 8, 15, 0.88);
  --nav-blur: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px var(--primary-glow);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --font-heading: 'Bricolage Grotesque', serif;
  --font-body: 'Figtree', sans-serif;
  --grain-opacity: 0.03;
}

[data-theme="light"] {
  --bg: #f2f2f8;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0ff;
  --text: #12122a;
  --text-muted: #5e5e80;
  --primary: #0055ff;
  --primary-dark: #0040cc;
  --primary-glow: rgba(0, 85, 255, 0.12);
  --secondary: #e8265e;
  --secondary-glow: rgba(232, 38, 94, 0.1);
  --accent: #7c3aed;
  --accent-glow: rgba(124, 58, 237, 0.1);
  --border: rgba(0, 0, 0, 0.07);
  --border-hover: rgba(0, 0, 0, 0.14);
  --nav-bg: rgba(255, 255, 255, 0.88);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 40px var(--primary-glow);
  --grain-opacity: 0.015;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* Noise/grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  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)' opacity='1'/%3E%3C/svg%3E");
  background-size: 128px;
  opacity: var(--grain-opacity);
  pointer-events: none;
  z-index: 9999;
}

a {
  color: inherit;
  text-decoration: none;
}

img { max-width: 100%; }

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  outline: none;
}

input, textarea, select {
  font-family: var(--font-body);
  outline: none;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: var(--nav-bg);
  backdrop-filter: blur(var(--nav-blur));
  -webkit-backdrop-filter: blur(var(--nav-blur));
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.nav-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity var(--transition);
}

.nav-logo:hover { opacity: 0.8; }

.nav-logo .logo-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition);
  color: var(--text-muted);
}

.nav-link:hover {
  color: var(--text);
  background: var(--border);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-glow);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--border);
  color: var(--text);
  border-color: var(--border-hover);
  transform: rotate(30deg);
}

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ---------- Main Content ---------- */
.main {
  padding-top: 64px;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---------- Hero Section ---------- */
.hero {
  text-align: center;
  padding: 5rem 2rem 3rem;
  position: relative;
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 50%, var(--secondary) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 6s ease-in-out infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
  font-weight: 400;
}

/* Floating orbs background */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  z-index: -1;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  right: -100px;
  animation: float-orb 20s ease-in-out infinite;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--secondary);
  bottom: -50px;
  left: -50px;
  animation: float-orb 25s ease-in-out infinite reverse;
}

.orb-3 {
  width: 250px;
  height: 250px;
  background: var(--accent);
  top: 50%;
  left: 50%;
  animation: float-orb 30s ease-in-out infinite 5s;
}

@keyframes float-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -30px) scale(1.1); }
  50% { transform: translate(-30px, 50px) scale(0.9); }
  75% { transform: translate(30px, 30px) scale(1.05); }
}

/* ---------- Game Grid ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0 4rem;
}

.game-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-decoration: none;
  transition: all var(--transition);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: card-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.game-card:nth-child(1)  { animation-delay: 0.05s; }
.game-card:nth-child(2)  { animation-delay: 0.1s; }
.game-card:nth-child(3)  { animation-delay: 0.15s; }
.game-card:nth-child(4)  { animation-delay: 0.2s; }
.game-card:nth-child(5)  { animation-delay: 0.25s; }
.game-card:nth-child(6)  { animation-delay: 0.3s; }
.game-card:nth-child(7)  { animation-delay: 0.35s; }
.game-card:nth-child(8)  { animation-delay: 0.4s; }
.game-card:nth-child(9)  { animation-delay: 0.45s; }
.game-card:nth-child(10) { animation-delay: 0.5s; }

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, transparent 30%, var(--primary-glow) 50%, transparent 70%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition);
}

.game-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--border);
}

.game-card:hover::before {
  opacity: 1;
}

.game-card-emoji {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.game-card-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
}

.game-card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.game-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  background: var(--primary-glow);
  color: var(--primary);
  font-weight: 600;
  margin-top: auto;
  width: fit-content;
}

/* ---------- Game Page Layout ---------- */
.game-page {
  padding-top: 64px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-header {
  text-align: center;
  padding: 3rem 2rem 1.5rem;
}

.game-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.game-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.game-container {
  width: 100%;
  max-width: 640px;
  padding: 0 2rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.game-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: all var(--transition);
  align-self: flex-start;
}

.game-back:hover {
  color: var(--text);
  background: var(--border);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--primary-glow);
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--border);
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

/* ---------- Score / Stats Display ---------- */
.stats-bar {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  text-align: center;
  min-width: 100px;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.1rem;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

.footer a {
  color: var(--primary);
  transition: opacity var(--transition);
}

.footer a:hover { opacity: 0.8; }

/* ---------- Animations ---------- */
.fade-in {
  animation: fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(20px); }
}

.scale-in {
  animation: scale-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.8); }
}

.shake {
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* ---------- Utility ---------- */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav { padding: 0 1rem; }
  
  .nav-right .nav-link { display: none; }
  
  .nav-hamburger { display: flex; }
  
  .nav-right.open {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 2rem;
    gap: 0.5rem;
    z-index: 999;
  }
  
  .nav-right.open .nav-link {
    display: flex;
    font-size: 1.2rem;
    padding: 1rem;
  }
  
  .hero { padding: 3rem 1.5rem 2rem; }
  
  .game-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.5rem 0 3rem;
  }
  
  .container { padding: 0 1rem; }
  
  .game-container { padding: 0 1rem 3rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .game-card { padding: 1.5rem; }
}
