@font-face {
  font-family: 'mydigital';
  src: url('fonts/mydigital.ttf') format('truetype');
}

:root{
  --accent:#00e5ff;
  --accent-2:#ff4ade;
  --ok:#10b981;
  --danger:#ef4444;
  --bg:#071023;
  --card:#081227;
  --muted:#9aa6b2;
  --glow: 0 0 18px rgba(0,229,255,0.25), 0 0 40px rgba(255,74,170,0.06);
  font-family: 'Inter', ui-sans-serif, system-ui;
  --score-red:#ff2d2d;
  --sidebar-width: 240px;
}

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

/* BODY */
html, body {
  height: 100%;
}

body {
  min-height: 100vh;
  display: block;              /* ❗ kein Flex hier */
  margin: 0;
  background: radial-gradient(1200px 600px at 10% 10%, #051023 0%, #021018 20%, #000814 80%), var(--bg);
  color: #e6f3ff;
}

.app {
  display: flex;
  flex-direction: column;
  height:100vh;
  max-width:1400px;
  margin: 12px auto 0;   /* 🔑 ZENTRIERT DIE GANZE APP */
}


.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.board {
  flex: 1;
  display: flex;
  justify-content: center;

  max-width: calc(100vh - 260px); 
}


/* Grid quadratisch */
.grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-auto-rows: 1fr;
  gap: 4px;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: 1 / 1;
}

.board-and-info {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  gap: 16px;
  align-items: stretch; /* 🔑 */
}

.game-width-full {
  max-width: calc(
    (100vh - 260px) + var(--sidebar-width) + 16px
  );
  margin-left: auto;
  margin-right: auto;
}




/* Startscreen */
#startScreen {
  max-width: 400px;
  width: 100%;
  text-align: center;
  background: var(--card);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.03);
  box-shadow: 0 6px 28px rgba(2,6,23,0.6), 0 1px 0 rgba(255,255,255,0.02) inset;
  transform: scale(0);
  animation: popIn 0.5s forwards ease-out;
  margin: auto;  /* zentriert und Abstand automatisch */
}

@keyframes popIn {
  0% { transform: scale(0); opacity:0; }
  80% { transform: scale(1.1); opacity:1; }
  100% { transform: scale(1); }
}

/* CARD */
.card{
  background: var(--card);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.03);
  box-shadow: 0 6px 28px rgba(2,6,23,0.6), 0 1px 0 rgba(255,255,255,0.02) inset;
  margin: 0px; /* Abstand oben und unten Container */
}

section.card{
  margin-bottom:0px;
}

/* nur die obere Spiel-Card */
.app > section.card {
  flex: 0 0 auto;
  margin-bottom:12px;
}

/* PROBLEM / SLOTS */
.problem-wrapper{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:34px;
  margin-bottom:12px;
  flex:0 0 auto;
}

.slot{
  width:60px;
  height:60px;
  border-radius:10px;
  background:linear-gradient(180deg,#fff,#fff);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: var(--glow);
  border:1px solid rgba(255,255,255,0.03);
  font-weight:700;
  font-size:22px;
  color:#000; /* Zahlen schwarz */
  overflow:hidden;
  position:relative;
}

.slot-viewport{
  overflow:hidden;
  height:100%;
  border-radius:10px;
  position:relative;
}

.slot-column{
  display:block;
  transition: transform 0.5s ease; /* Roller-Animation */
}

.slot-column .slot-item{
  height:60px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:20px;
  color:#000;
}

.mul-dot{font-size:32px;margin:0 6px;color:var(--muted)}

/* Countdown */
#countdown{ margin-top:12px; font-weight:700; color:var(--accent); font-size:18px; }

/* Controls row */
.top-controls-row{
	display:flex;
	gap:12px;
	align-items:center;
	margin-top:12px;
	min-width: 1000px;
	}

/* Buttons */
.shuffle-btn{
  position: relative;
  background: linear-gradient(180deg, rgba(0,0,0,0.2), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.06);
  padding: 8px 12px;
  border-radius: 999px;
  height: 48px;
  width: 48px;
  cursor:pointer;
  font-weight:700;
  color: #fff;
  box-shadow: 0 6px 24px rgba(0,0,0,0.6);
}
.shuffle-btn:hover{ transform:translateY(-2px); }

.shuffle-btn::after{
  content:"";
  position:absolute;
  inset:-8px;
  border-radius:inherit;
  background:none;

  box-shadow:
    0 0 12px rgba(255,0,0,0.6),
    0 0 28px rgba(255,0,0,0.45),
    0 0 50px rgba(255,0,0,0.25);

  opacity:0;
  z-index:-1;
  pointer-events:none;
}

.cell{
  display:flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(180deg,#051426,#072032);
  border-radius:8px;
  font-weight:700;
  color: #bfefff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.7);
  user-select:none;
  transition: transform .12s ease, box-shadow .12s;
}
.cell:hover{ transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.8); }
.cell.filled{ background: linear-gradient(180deg,#00344a,#002431); opacity:0.85; }
.cell.correct{ background: linear-gradient(90deg,#00ffa3,#00d1ff); color:#002; }
.cell.wrong{ background: linear-gradient(90deg,#ff6b6b,#ff2d9b); color:#fff; }

/* Score panel */
aside.card{
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  display: flex;          /* 🔑 */
  flex-direction: column; /* 🔑 */
}


/* Player toggle */
.player-toggle{
  display:flex;
  gap:10px;
  align-items:center;
  background: rgba(255,255,255,0.01);
  padding:8px;
  border-radius:10px;
}

.player-toggle .name{
  padding:6px 10px;
  border-radius:5px;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.01));
  font-weight:700;
  position:relative;
  cursor:pointer;
  transition: transform .12s, box-shadow .12s;
}

.player-toggle .name.active{
  color: #001;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 30px rgba(0,229,255,0.14), 0 0 20px rgba(255,74,170,0.08);
  transform: translateY(-2px);
}

/* Reihenauswahl */
.row-selection{display:flex;flex-wrap:wrap;gap:6px}
.row-selection label{font-size:14px;display:flex;align-items:center;gap:4px}

/* Responsive */
@media (max-width:800px){
  .app{padding:12px;}
  .problem-wrapper{font-size:28px;}
  .slot{width:46px;height:58px;}
  .slot-column .slot-item{height:58px;}
}

@media (min-width:900px){
  .board-and-info{
    gap:18px;
    align-items:stretch; /* ✅ erzwingen */
  }
}

@media (max-width:1140px){
  .app {
    padding:0 12px; /* kleiner Abstand zu den Rändern */
  }
}



.instructions{
  margin-top:auto;
  margin-bottom: 12px;
  color: var(--muted);
  font-size:13px;
  line-height:1.4;

}
#scoreList{
  flex:0 0 auto;
}


.score-row{
	font-size:15px;
	}

.score-title {
  font-size: 20px;          /* größer als Standardtext */
  font-weight: 700;         /* fett */
  color: var(--accent);     /* leuchtender Arcade-Farbton */
  text-shadow: 
    0 0 4px var(--accent),
    0 0 10px var(--accent-2); /* leichter Neon-Glow */
}

.score-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}

/* Spielername */
.score-row .player-name{
  font-size:15px;
  color:var(--muted);
  font-weight:600;
}

/* Punktzahl – Digitalfont (ROT) */
.score-row .score-value{
  font-family:'mydigital', monospace;
  font-size:28px;
  letter-spacing:2px;
  color:var(--score-red);

  text-shadow:
    0 0 6px var(--score-red),
    0 0 12px rgba(255,45,45,0.7),
    0 0 22px rgba(255,45,45,0.5);
}

/* Winner Display Arcade-Style */
#winnerDisplay {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 
    0 0 6px var(--accent),
    0 0 12px var(--accent-2),
    0 0 20px rgba(255,74,170,0.5);
  margin-left:20px;
  min-width:200px;

  /* Animation */
  animation: neonPulse 1.2s infinite alternate;
}

/* Animation für leichtes Pulsieren */
@keyframes neonPulse {
  0% {
    text-shadow:
      0 0 4px var(--accent),
      0 0 10px var(--accent-2),
      0 0 18px rgba(255,74,170,0.4);
  }
  50% {
    text-shadow:
      0 0 8px var(--accent),
      0 0 18px var(--accent-2),
      0 0 28px rgba(255,74,170,0.6);
  }
  100% {
    text-shadow:
      0 0 6px var(--accent),
      0 0 12px var(--accent-2),
      0 0 20px rgba(255,74,170,0.5);
  }
}

/* Arcade Pulse */
@keyframes arcadePulse {
  0% {
    transform: scale(1);
    box-shadow:
      0 0 6px rgba(255,74,170,0.4),
      0 0 14px rgba(255,74,170,0.3);
  }
  50% {
    transform: scale(1.08);
    box-shadow:
      0 0 14px rgba(255,74,170,0.9),
      0 0 30px rgba(255,74,170,0.6);
  }
  100% {
    transform: scale(1);
    box-shadow:
      0 0 6px rgba(255,74,170,0.4),
      0 0 14px rgba(255,74,170,0.3);
  }
}

/* Pulsierender Button */
.shuffle-btn.pulse {
  animation: arcadePulse 1.1s infinite ease-in-out;
}

@keyframes redGlowPulse{
  0%{
    opacity:0.25;
    transform:scale(0.9);
  }
  50%{
    opacity:0.85;
    transform:scale(1.05);
  }
  100%{
    opacity:0.25;
    transform:scale(0.9);
  }
}
.sidebar-top {
	flex: 0 0 auto;
}

/* sidebar-bottom nach unten schieben */
.sidebar-bottom {
  display: flex; 
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 0;          /* 🔑 drückt ans untere Ende */
  padding-top: 8px;   /* Buttons horizontal zentrieren */
}


.component-btn {
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
  text-align: center;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.small-btn {
  font-size: 12px; /* Kleinere Schrift für Zurück und Impressum */
}

@media (max-width: 1024px) {
  .board {
    max-width: 100%;
    max-height: calc(100svh - 260px);
    aspect-ratio: 1 / 1;
	  overflow: hidden;
  }

  .grid {
    max-height: 100%;
    aspect-ratio: 1 / 1;
	overflow: auto;
  }
}
