* { box-sizing: border-box; }
:root {
  --bg1: #1c1c2b; --bg2: #0d0d12; --field: #101014; --line: #2c2c38; --panel: rgba(255,255,255,.035);
  --text: #f2f2f5; --muted: #8b8b99; --yellow: #e3e352; --red: #e05252; --green: #3fbf6f;
}
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--text);
  background: radial-gradient(ellipse at 50% 20%, var(--bg1), var(--bg2) 75%) fixed; min-height: 100vh;
}
button { font: inherit; cursor: pointer; border: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 13px; }
.center { text-align: center; }
.r { color: var(--red); }

.wrap { max-width: 860px; margin: 0 auto; padding: 32px 16px 48px; display: flex; flex-direction: column; gap: 22px; }
.head { text-align: center; }
.suits { font-size: 26px; letter-spacing: 10px; opacity: .8; }
.logo {
  margin: 4px 0 0; font-size: clamp(42px, 9vw, 68px); font-weight: 900; letter-spacing: -1px; line-height: 1;
  background: linear-gradient(#fff, #c9c9d6); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo-sub { color: var(--muted); letter-spacing: 4px; font-weight: 700; font-size: 12px; margin-top: 8px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.tabs button { background: transparent; color: var(--muted); font-weight: 700; padding: 8px 16px; }
.tabs button.active { background: #2a2a3a; color: var(--text); }
.tabs.small { margin: 0; }
.tabs.small button { padding: 6px 12px; font-size: 13px; }

.auth { display: flex; gap: 10px; flex-wrap: wrap; }
.field {
  flex: 1 1 180px; min-width: 0; background: var(--field); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 12px 14px; font-size: 16px; outline: none;
}
.field:focus { border-color: #55556a; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 18px; border-radius: 10px;
  background: #2a2a3a; color: var(--text); font-weight: 700; text-decoration: none; font-size: 15px;
}
.btn:hover { background: #34344a; }
.btn.primary { background: var(--yellow); color: #111; }
.btn.primary:hover { background: #f0f06a; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
#authHint { margin: 10px 0 0; }

.me { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.me-name { font-size: 24px; font-weight: 800; }
.coins { display: flex; align-items: center; gap: 8px; font-size: 26px; font-weight: 800; color: #f5c84b; }
.coin {
  display: inline-block; width: 1em; height: 1em; border-radius: 50%; vertical-align: -0.12em;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #f5c84b 45%, #b8860b); box-shadow: inset 0 0 0 2px rgba(0,0,0,.15);
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.game {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--text);
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--panel);
  transition: transform .15s, border-color .15s;
}
.game:hover { transform: translateY(-3px); border-color: #55556a; }
.game-art { height: 120px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.game.mm .game-art { background: radial-gradient(ellipse at 50% 30%, #2b5a3e, #11261a); }
.game.pk .game-art { background: radial-gradient(ellipse at 50% 30%, #23406e, #0e1a30); }
.game-art span {
  width: 54px; height: 78px; border-radius: 7px; background: #fafafa; color: #111; display: flex; align-items: center;
  justify-content: center; font-size: 28px; font-weight: 900; box-shadow: 0 6px 16px rgba(0,0,0,.4);
}
.game-art span:nth-child(1) { transform: rotate(-10deg) translateY(6px); }
.game-art span:nth-child(3) { transform: rotate(10deg) translateY(6px); }
.game-art span.r { color: var(--red); }
.game-art .chip {
  width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle, #d33a3a 45%, #fff 46%, #fff 54%, #d33a3a 55%);
  border: 4px dashed #fff;
}
.game-body { padding: 14px 16px 4px; flex: 1; }
.game-body h2 { margin: 0 0 6px; font-size: 22px; }
.game-body p { margin: 0 0 6px; }
.mystats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 8px; }
.mystats b { color: var(--text); }
.play { margin: 8px 16px 16px; align-self: flex-start; font-weight: 800; color: var(--yellow); }

.board-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.board-head h3 { margin: 0; }
.board { margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.board li {
  counter-increment: rank; display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line);
}
.board li:last-child { border-bottom: 0; }
.board li::before { content: counter(rank); width: 26px; text-align: right; color: var(--muted); font-weight: 700; }
.board li:nth-child(1)::before { content: "🥇"; } .board li:nth-child(2)::before { content: "🥈"; } .board li:nth-child(3)::before { content: "🥉"; }
.board .nm { flex: 1; font-weight: 700; }
.board .val { font-weight: 800; }
.board .empty { color: var(--muted); }
.board .empty::before { content: ""; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #2a2a3a; color: var(--text);
  padding: 12px 18px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.5); z-index: 10; max-width: 90vw;
}

/* Namensfarben aus dem Shop (vereinfacht) */
.nc-rot { color: #ff6b6b; } .nc-blau { color: #6bc7ff; } .nc-gruen { color: #6fe08a; } .nc-lila { color: #c58bff; }
.nc-gold { color: #f5c84b; text-shadow: 0 0 8px rgba(245,200,75,.45); }
.nc-orange { color: #ff9f43; } .nc-pink { color: #ff6fb5; } .nc-tuerkis { color: #2ee6d6; }
.nc-silber { color: #dfe6ee; text-shadow: 0 0 6px rgba(223,230,238,.5); }
.nc-neon { color: #39ff14; text-shadow: 0 0 6px #39ff14; }
.nc-regenbogen, .nc-feuer, .nc-eis, .nc-ozean, .nc-galaxie, .nc-lava, .nc-glitch {
  -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: rainbow 3s linear infinite;
}
.nc-regenbogen, .nc-glitch { background-image: linear-gradient(90deg, #ff6b6b, #f6ad55, #f5e050, #6fe08a, #6bc7ff, #c58bff, #ff6b6b); }
.nc-feuer { background-image: linear-gradient(90deg, #ffbe0b, #ff5400, #d00000, #ff5400, #ffbe0b); }
.nc-eis { background-image: linear-gradient(90deg, #e0fbfc, #90e0ef, #48cae4, #90e0ef, #e0fbfc); }
.nc-ozean { background-image: linear-gradient(90deg, #00b4d8, #0077b6, #48cae4, #0077b6, #00b4d8); }
.nc-galaxie { background-image: linear-gradient(90deg, #9b5de5, #f15bb5, #00bbf9, #9b5de5); }
.nc-lava { background-image: linear-gradient(90deg, #370617, #d00000, #ffbe0b, #d00000, #370617); }
.nc-puls { animation: puls 1.4s ease-in-out infinite; }
@keyframes rainbow { to { background-position: 200% 0; } }
@keyframes puls { 50% { opacity: .55; } }

@media (max-width: 520px) {
  .me { flex-direction: column; align-items: flex-start; }
  .actions .btn { flex: 1 1 auto; }
}
