:root {
  /* Playful Colour Direction */
  --forest: #2D1B4E; /* Dark purple for text */
  --emerald: #10B981; /* Green */
  --coral: #EC4899; /* Pink */
  --orange: #F97316; /* Orange */
  --yellow: #FBBF24; /* Yellow */
  --plum: #8B5CF6; /* Purple */
  --cream: #FEF8FF; /* Playful background */
  --white: #FFFFFF;

  --bg: var(--cream);
  --panel: var(--white);
  --text: var(--forest);
  --accent-primary: var(--plum);
  --accent-secondary: var(--coral);
  --border: #E9D5FF;
  
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-8: 64px;
}

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

html {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  font-size: 17px;
  line-height: 1.6;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: opacity 150ms ease, color 150ms ease;
}

a:hover, a:focus {
  text-decoration: underline;
  color: var(--accent-secondary);
}

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: var(--space-2);
  color: var(--forest);
}

h1 { font-size: 42px; position: relative; display: inline-block; }
h1::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 60px;
  height: 6px;
  background: linear-gradient(90deg, var(--coral), var(--yellow));
  border-radius: 4px;
}

h2 { font-size: 30px; margin-top: var(--space-4); margin-bottom: var(--space-3); }
h3 { font-size: 24px; margin-top: var(--space-4); }

p {
  margin-bottom: var(--space-2);
  max-width: 72ch;
}

ul, ol {
  margin-bottom: var(--space-2);
  padding-left: var(--space-3);
  max-width: 72ch;
}

/* Decorative Background Shapes */
.deco-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}
.deco-shape {
  position: absolute;
  opacity: 0.5;
  filter: blur(80px);
  animation: floatShape 10s ease-in-out infinite;
}
@keyframes floatShape {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33% { transform: translate(30px, -40px) scale(1.1) rotate(10deg); }
  66% { transform: translate(-20px, 20px) scale(0.9) rotate(-10deg); }
}
.circle-1 {
  width: 400px; height: 400px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--yellow));
  top: -150px; right: -100px;
}
.square-1 {
  width: 500px; height: 500px;
  background: linear-gradient(135deg, var(--plum), var(--emerald));
  bottom: -200px; left: -150px;
  border-radius: 30%;
  animation-duration: 15s;
  animation-direction: reverse;
}

/* Section Divider */
.section-divider {
  height: 6px;
  background: linear-gradient(90deg, var(--plum), var(--coral), var(--yellow), var(--emerald));
  margin: var(--space-5) 0;
  border-radius: 3px;
  width: 100%;
}

.masthead {
  height: 92px;
  background-color: var(--panel);
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(to right, var(--plum), var(--coral), var(--yellow), var(--emerald)) 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.08);
}

.masthead-brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: bold;
  background: linear-gradient(90deg, var(--plum), var(--coral), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-block;
  letter-spacing: -0.5px;
}

.masthead-brand:hover {
  transform: scale(1.05) rotate(-2deg);
}

.masthead-latest {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 15px;
  font-weight: bold;
}

.layout-container {
  display: grid;
  grid-template-columns: 224px 1fr;
  gap: var(--space-4);
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-5);
  flex-grow: 1;
  width: 100%;
  position: relative;
  z-index: 1;
}

.nav-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.nav-link {
  display: block;
  padding: var(--space-1) var(--space-2);
  color: var(--text);
  border-left: 3px solid transparent;
  font-weight: 500;
  border-radius: 0 8px 8px 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.nav-link:hover, .nav-link:focus, .nav-link.active {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.1), transparent);
  border-left-color: var(--accent-primary);
  text-decoration: none;
  color: var(--plum);
  padding-left: 36px;
}

.nav-link::before {
  content: "✨";
  position: absolute;
  left: -20px;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-link:hover::before, .nav-link.active::before {
  left: 12px;
  opacity: 1;
  transform: rotate(15deg);
}

.nav-group-title {
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--coral);
  letter-spacing: 1px;
  margin-top: var(--space-3);
  margin-bottom: var(--space-1);
  padding-left: var(--space-2);
}

.main-content {
  min-width: 0;
}

.section-block {
  margin-bottom: var(--space-8);
  position: relative;
}

/* Playful Interactive Cards */
.panel {
  background: linear-gradient(145deg, #ffffff, #fcfaff);
  border: 2px solid var(--border);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.05);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
  position: relative;
}

.panel:hover {
  transform: translateY(-5px) rotate(0.5deg);
  box-shadow: 0 20px 40px rgba(139, 92, 246, 0.12);
  border-color: var(--plum);
}

.date-spine {
  border-left: 4px dashed var(--coral);
  padding-left: var(--space-4);
  margin-left: var(--space-2);
}

/* Interactive Rows */
.ledger-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-bottom: none;
  border-left: 4px solid var(--border);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
  background: linear-gradient(90deg, #ffffff, #faf5ff);
  margin-bottom: 8px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.ledger-row:hover {
  transform: translateX(8px) translateY(-3px) scale(1.01) rotate(0.5deg);
  box-shadow: 0 15px 30px rgba(249, 115, 22, 0.1);
  border-left-color: var(--orange);
  z-index: 2;
  position: relative;
}

.ledger-row:nth-child(even) {
  background: linear-gradient(90deg, #ffffff, #f0fdf4);
}

.ledger-row:nth-child(even):hover {
  border-left-color: var(--emerald);
  box-shadow: 0 15px 30px rgba(16, 185, 129, 0.1);
}

.ledger-date {
  font-weight: bold;
  width: 120px;
  flex-shrink: 0;
  color: var(--plum);
}

.number-pool {
  display: flex;
  gap: var(--space-1);
  margin-right: var(--space-3);
  flex-wrap: wrap;
}

/* Small Number Transitions */
.ball {
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background-color: var(--panel);
  border: 2px solid var(--plum);
  color: var(--forest);
  border-radius: 50%;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s, color 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.ball:hover {
  transform: scale(1.25) translateY(-5px) rotate(-10deg);
  background: linear-gradient(135deg, var(--plum), var(--coral));
  color: var(--white);
  box-shadow: 0 8px 15px rgba(236, 72, 153, 0.4);
  border-color: transparent;
}

.ball.euro {
  border-color: var(--orange);
  color: var(--orange);
}

.ball.euro:hover {
  transform: scale(1.25) translateY(-5px) rotate(10deg);
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  box-shadow: 0 8px 15px rgba(249, 115, 22, 0.4);
  color: var(--white);
  border-color: transparent;
}

.source-link-sm {
  font-size: 14px;
  margin-left: auto;
  font-weight: bold;
}

/* Gradients on Tables */
.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  margin-bottom: var(--space-4);
  background-color: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.08);
}

.matrix-table tr {
  transition: transform 0.2s;
}

.matrix-table tbody tr:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.05), transparent);
}

.matrix-table caption {
  font-family: "Helvetica Neue", Helvetica, sans-serif;
  text-align: left;
  font-weight: bold;
  margin-bottom: var(--space-2);
  font-size: 18px;
  color: var(--emerald);
}

.matrix-table th, .matrix-table td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 12px 8px;
  text-align: center;
  width: 10%;
  transition: background-color 0.2s, transform 0.3s;
}

.matrix-table th {
  background-color: var(--bg);
  font-weight: normal;
}

.matrix-table td.highlight {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(249, 115, 22, 0.3));
  color: var(--forest);
  font-weight: bold;
}

.matrix-table td.highlight:hover {
  transform: scale(1.15) rotate(4deg);
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.2);
  border-radius: 8px;
  z-index: 10;
  position: relative;
}

.matrix-table td.euro-highlight {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.2), rgba(139, 92, 246, 0.2));
  color: var(--plum);
  font-weight: bold;
}

.matrix-table td.euro-highlight:hover {
  transform: scale(1.15) rotate(-4deg);
  box-shadow: 0 4px 10px rgba(139, 92, 246, 0.2);
  border-radius: 8px;
  z-index: 10;
  position: relative;
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: linear-gradient(145deg, #ffffff, #fcfaff);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.05);
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: bold;
  margin-bottom: 4px;
  color: var(--plum);
}

.filter-group select {
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  background-color: var(--bg);
  color: var(--text);
  min-width: 160px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Playful Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--plum), var(--coral));
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background 0.3s ease;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.btn:hover, .btn:focus {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.5);
  background: linear-gradient(135deg, var(--coral), var(--orange));
  color: var(--white);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  background: var(--white);
  color: var(--plum);
  border: 2px solid var(--border);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--cream);
  color: var(--coral);
  border-color: var(--coral);
  box-shadow: 0 6px 16px rgba(236, 72, 153, 0.15);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 14px;
}

.filter-actions {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}

.status-bar {
  font-size: 16px;
  margin-bottom: var(--space-3);
  font-weight: bold;
  color: var(--orange);
}

.hidden {
  display: none !important;
}

details {
  background-color: var(--panel);
  border: 2px solid var(--border);
  margin-bottom: var(--space-2);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

details:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
  border-color: var(--plum);
}

summary {
  padding: var(--space-3);
  font-weight: bold;
  cursor: pointer;
  font-size: 18px;
  color: var(--forest);
  transition: background-color 0.2s, color 0.2s;
}

summary:hover {
  background-color: var(--bg);
  color: var(--coral);
}

details[open] summary {
  border-bottom: 2px solid var(--border);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.05), transparent);
}

details p {
  padding: var(--space-3);
  margin: 0;
}

.form-group {
  margin-bottom: var(--space-3);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-1);
  font-weight: bold;
}

.form-group textarea, .form-group input {
  width: 100%;
  padding: var(--space-2);
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px;
  background-color: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group textarea:focus, .form-group input:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
}

.draft-output {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background-color: var(--bg);
  border: 2px dashed var(--orange);
  border-radius: 12px;
  font-family: 'Courier New', Courier, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.site-footer {
  background: linear-gradient(135deg, var(--forest), #1a1033);
  color: var(--cream);
  padding: var(--space-5) var(--space-5) var(--space-4);
  margin-top: auto;
  position: relative;
  z-index: 10;
}

.site-footer a {
  color: var(--yellow);
}
.site-footer a:hover {
  color: var(--coral);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  max-width: 1280px;
  margin: 0 auto;
  font-size: 15px;
}

.footer-col h4 {
  font-family: "Helvetica Neue", Helvetica, sans-serif;
  font-size: 16px;
  margin-bottom: var(--space-2);
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: var(--space-1);
}

.footer-bottom {
  max-width: 1280px;
  margin: var(--space-4) auto 0;
  padding-top: var(--space-3);
  border-top: 1px solid rgba(254, 248, 255, 0.1);
  font-size: 13px;
  color: rgba(254, 248, 255, 0.7);
  text-align: center;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--forest);
  color: var(--cream);
  padding: var(--space-3) var(--space-4);
  z-index: 1000;
  display: flex;
  justify-content: center;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.15);
  border-top: 4px solid transparent;
  border-image: linear-gradient(to right, var(--plum), var(--coral), var(--yellow), var(--emerald)) 1;
}
.cookie-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 1280px;
  width: 100%;
  align-items: center;
}
.cookie-content p {
  margin: 0;
  font-size: 15px;
}
.cookie-content a {
  color: var(--yellow);
  text-decoration: underline;
}
.cookie-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .cookie-content {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Mini Game Elements */
.mini-game-section {
  text-align: center;
  background: linear-gradient(135deg, #fdf4ff, #fffbeb);
  padding: var(--space-5);
  border-radius: 16px;
  border: 3px dashed var(--plum);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.1);
  position: relative;
  overflow: hidden;
}

.mini-game-section h2 {
  margin-top: 0;
}

.game-score-board {
  font-size: 20px;
  font-weight: bold;
  color: var(--plum);
  background: var(--white);
  display: inline-block;
  padding: 8px 20px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
  margin-bottom: var(--space-3);
  border: 2px solid var(--border);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-balls {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  margin: var(--space-4) 0;
  flex-wrap: wrap;
}

.game-ball {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--yellow), var(--orange));
  border: 4px solid var(--white);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.game-ball:nth-child(2) { background: radial-gradient(circle at 30% 30%, var(--coral), var(--plum)); }
.game-ball:nth-child(3) { background: radial-gradient(circle at 30% 30%, var(--emerald), #059669); }
.game-ball:nth-child(4) { background: radial-gradient(circle at 30% 30%, #38bdf8, #0284c7); }
.game-ball:nth-child(5) { background: radial-gradient(circle at 30% 30%, #f472b6, #db2777); }

.game-ball:hover {
  transform: translateY(-8px) scale(1.1);
  box-shadow: 0 10px 20px rgba(0,0,0,0.25);
}

.game-ball.pop {
  transform: scale(0);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);
}

.game-result {
  text-align: center;
  padding: var(--space-4);
  background-color: var(--white);
  border-radius: 16px;
  border: 3px dashed var(--emerald);
  margin-top: var(--space-3);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.1);
}

.game-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  font-size: 42px;
  font-family: Georgia, serif;
  font-weight: bold;
  background: linear-gradient(135deg, var(--emerald), var(--yellow));
  border: 4px solid var(--white);
  border-radius: 50%;
  color: var(--forest);
  margin-bottom: var(--space-2);
  animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

@keyframes popIn {
  0% { transform: scale(0.3) rotate(-15deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.particle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999;
}

@media (max-width: 1279px) {
  .layout-container { padding: var(--space-3); }
}

@media (max-width: 999px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  .layout-container {
    grid-template-columns: 1fr;
    padding: var(--space-2);
    margin: var(--space-2) auto;
  }
  .masthead {
    padding: var(--space-2);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: auto;
    text-align: center;
  }
  .masthead-latest {
    flex-direction: column;
    gap: var(--space-1);
  }
  .nav-sidebar {
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
    height: 60px;
    align-items: center;
    border-bottom: 2px solid var(--border);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-1);
  }
  .nav-group-title { display: none; }
  .nav-link {
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 8px 8px 0 0;
  }
  .nav-link:hover, .nav-link:focus, .nav-link.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent-primary);
    padding-left: var(--space-2);
    transform: translateY(-3px);
  }
  .nav-link::before {
    display: none;
  }
  
  .panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(139, 92, 246, 0.1);
  }

  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .section-block { margin-bottom: var(--space-5); }
  .filter-actions { flex-direction: column; align-items: stretch; }
  .cookie-actions { flex-direction: column; width: 100%; }
  .cookie-actions .btn { width: 100%; }
}