/* Emoji Arcade – gemeinsames Layout (Dark Theme, responsive) */

:root {
  --bg: #12131a;
  --panel: #1c1e29;
  --panel-2: #262939;
  --border: #33374a;
  --text: #e8e9f0;
  --muted: #9a9db0;
  --accent: #ffcc4d;
  --accent-2: #5ad1ff;
  --radius: 14px;
  --emoji-font: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: var(--accent-2); }

button {
  font: inherit;
  color: inherit;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4em 0.8em;
  cursor: pointer;
}
button:hover { border-color: var(--accent-2); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.emoji { font-family: var(--emoji-font); }

/* ---------- Übersicht / Textseiten ---------- */

.site-header {
  text-align: center;
  padding: 2rem 1rem 1rem;
}
.site-header h1 { margin: 0; font-size: clamp(1.8rem, 6vw, 2.8rem); }
.site-header p { margin: 0.3rem 0 0; color: var(--muted); }

.site-main {
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  height: 100%;
  padding: 1.2rem 0.8rem 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  text-align: center;
  transition: transform 0.12s, border-color 0.12s;
}
a.tile:hover { transform: translateY(-3px); border-color: var(--accent); }
.tile-emoji { font-family: var(--emoji-font); font-size: 3.2rem; line-height: 1.2; }
.tile-title { font-weight: 600; }
.tile-score { color: var(--muted); font-size: 0.9rem; min-height: 1.4em; }
.tile.soon { opacity: 0.45; }
.tile .badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.7rem;
  padding: 0.1em 0.5em;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
}

.prose { max-width: 680px; margin: 0 auto; }
.prose h2 { margin-top: 2rem; }

.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Spielseiten ---------- */

body.game-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.game-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.game-bar .back { text-decoration: none; font-size: 1.3rem; padding: 0 0.3rem; }
.game-bar h1 { margin: 0; font-size: 1.1rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-bar .stats { display: flex; gap: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.game-bar .stats span { color: var(--muted); }
.game-bar .stats b { color: var(--text); }
.game-bar button { padding: 0.25em 0.55em; font-family: var(--emoji-font); }

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0.5rem;
  touch-action: none;
}
.stage canvas {
  display: block;
  background: #000;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--border), 0 10px 40px rgba(0, 0, 0, 0.5);
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(10, 11, 16, 0.72);
  text-align: center;
  z-index: 5;
}
.overlay[hidden] { display: none; }
.overlay { overflow-y: auto; }
.overlay-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.overlay-menu button { font-size: 0.95rem; }
.overlay-menu button .emoji { font-size: 1.3rem; vertical-align: middle; }
.overlay-menu button.active { border-color: var(--accent); background: #3a3320; }
.overlay-box { max-width: 420px; }
.overlay .big-emoji { font-family: var(--emoji-font); font-size: 4rem; line-height: 1.2; }
.overlay h2 { margin: 0.2rem 0 0.5rem; font-size: 2rem; }
.overlay p { margin: 0.4rem 0; color: var(--muted); white-space: pre-line; }
.overlay .record { color: var(--accent); font-weight: 700; }
.overlay button.primary {
  margin-top: 1rem;
  font-size: 1.2rem;
  padding: 0.5em 1.6em;
  background: var(--accent);
  color: #1a1a1a;
  border: none;
  font-weight: 700;
}

.touch-controls {
  display: none;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
  touch-action: none;
}
.touch-controls .group { display: flex; gap: 0.6rem; }
.touch-controls button {
  width: min(4.2rem, 16vw);
  height: min(4.2rem, 16vw);
  font-size: 1.8rem;
  font-family: var(--emoji-font);
  border-radius: 50%;
  touch-action: none;
}
.touch-controls button.held { background: var(--border); border-color: var(--accent); }

@media (pointer: coarse) {
  .touch-controls { display: flex; }
}

@media (max-width: 480px) {
  .game-bar .stats { gap: 0.5rem; font-size: 0.9rem; }
  .game-bar .stats .label { display: none; }
}
