/* ABYSS - Schwarz-Weiss, ruhig. Farbe nur in den Spielkarten. */

:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --panel: #121212;
  --panel-solid: #121212;
  --line: #1f1f1f;
  --line-strong: #2e2e2e;
  --text: #ededed;
  --muted: #9a9a9a;
  --dim: #5e5e5e;
  --teal: #ffffff;
  --teal-2: #ffffff;
  --green: #62d26f;
  --green-dim: rgba(98, 210, 111, 0.14);
  --red: #ff5f5f;
  --red-dim: rgba(255, 95, 95, 0.14);
  --blue: #5ab4ff;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--teal-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Topbar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 14px clamp(16px, 4vw, 40px);
  transition: background 0.25s, border-color 0.25s, backdrop-filter 0.25s;
  border-bottom: 1px solid transparent;
}
.topbar.solid { background: rgba(5, 7, 10, 0.86); backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: 0.1em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 18px; color: var(--teal); }
.menu-btn { display: none; background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.nav a:hover, .nav a.active { color: var(--text); background: rgba(255, 255, 255, 0.07); text-decoration: none; }
.nav-login { margin-left: 6px; color: #000 !important; background: #fff; }
.nav-login:hover { background: #d9d9d9 !important; }
.acc { position: relative; margin-left: 10px; }
.acc-btn {
  display: flex; align-items: center; gap: 9px; padding: 7px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,.05); font-weight: 700; font-size: 14px;
}
.acc-btn:hover, .acc.open .acc-btn { background: rgba(255,255,255,.1); }
.chev { color: var(--muted); font-size: 11px; transition: transform .15s; }
.acc.open .chev { transform: rotate(180deg); }
.acc-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; padding: 6px; display: none;
  background: rgba(13, 18, 24, .98); border: 1px solid var(--line-strong); border-radius: 4px; box-shadow: var(--shadow);
}
.acc.open .acc-menu { display: grid; }
.acc-menu a { padding: 10px 12px !important; border-radius: 8px !important; }
.acc-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; width: auto; }

.lang-switch { display: flex; align-items: center; gap: 6px; margin-left: 10px; font-size: 13px; font-weight: 700; }
.lang-switch .lang-opt { color: var(--muted); }
.lang-switch .lang-opt.active { color: var(--teal-2); }
.lang-switch .lang-opt:hover { text-decoration: none; color: var(--text); }

@media (max-width: 860px) {
  .menu-btn { display: block; margin-left: auto; }
  .nav {
    position: fixed; inset: 58px 0 auto 0; margin: 0; flex-direction: column; align-items: stretch;
    background: rgba(5, 7, 10, 0.97); padding: 10px; border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
}

/* ---------------------------------------------------------------- Buttons / layout */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text); font-weight: 700; cursor: pointer;
}
.btn:hover { background: rgba(255, 255, 255, 0.11); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.teal { background: #fff; color: #000; border-color: #fff; }
.btn.teal:hover { background: #d9d9d9; }
.btn.red { background: var(--red-dim); border-color: rgba(255, 95, 95, 0.45); color: #ffc9c9; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; }
.google-btn { background: #fff; color: #1f1f1f; border-color: #fff; font-weight: 600; }
.google-btn:hover { background: #e8e8e8; }

.or-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 4px; color: var(--dim); font-size: 13px; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 8px;
  background: rgba(255,255,255,.06); border: 1px solid var(--line-strong); font-weight: 700; font-size: 13px;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.pill.s-ONLINE .dot { background: var(--green); }
.pill.s-OFFLINE .dot { background: var(--red); }
.pill.s-UNCONFIGURED .dot { background: var(--dim); }
.pill.dim { opacity: .75; }

.page { max-width: 1100px; margin: 0 auto; padding: 96px clamp(16px, 4vw, 40px) 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 12px 0 22px; }
.page-head h1 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 900; }
.grid { display: grid; gap: 16px; }
.stack { display: grid; gap: 16px; }
.page-narrow { max-width: 640px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .g2, .g3 { grid-template-columns: 1fr; } }
.section { margin-top: 48px; }
.section h2 { font-size: 20px; font-weight: 850; margin-bottom: 14px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
}
.card h3 { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 10px; }

.lobby-card { padding: 0; overflow: hidden; }
.lobby-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 20px;
  background: none; border: 0; cursor: pointer; text-align: left; color: var(--text);
}
.lobby-toggle:hover { background: rgba(255, 255, 255, 0.04); }
.lobby-toggle h3 { margin: 0; }
.lobby-sub { border-top: 1px solid var(--line); padding: 4px 20px; }
.lobby-sub.hidden { display: none; }
.lobby-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; font-size: 14px; }
.lobby-row:not(:last-child) { border-bottom: 1px solid var(--line); }

/* ---------------------------------------------------------------- Forms */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 96px 16px 40px; }
.auth { width: min(420px, 100%); }
.eyebrow { font-size: 14px; font-weight: 900; letter-spacing: 0.12em; color: var(--teal); margin-bottom: 6px; }
.field { display: grid; gap: 6px; margin-top: 14px; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.input {
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 11px 13px; color: var(--text); width: 100%;
}
.input:focus { outline: none; border-color: var(--teal); }
.bot-check { margin-top: 16px; min-height: 0; }
.bot-check:empty { display: none; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0;
  color: var(--muted); padding: 7px; border-radius: 8px; cursor: pointer;
}
.eye:hover { color: var(--text); background: rgba(255,255,255,.07); }
.eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.form-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; font-size: 14px; }
.msg { margin-top: 14px; padding: 11px 14px; border-radius: 8px; font-size: 14px; }
.msg.err { background: var(--red-dim); border: 1px solid rgba(255, 95, 95, 0.35); color: #ffd0d0; }
.msg.ok { background: var(--green-dim); border: 1px solid rgba(98, 210, 111, 0.35); color: #cdf7d2; }
.msg.info { background: rgba(90, 180, 255, 0.1); border: 1px solid rgba(90, 180, 255, 0.3); color: #cfe7ff; }
.code-input { letter-spacing: 0.4em; text-align: center; font-size: 20px; font-family: var(--mono); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.kbd { font-family: var(--mono); background: rgba(255,255,255,.08); padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line-strong); white-space: nowrap; }

/* ---------------------------------------------------------------- Hero */
.hero { padding: 130px clamp(16px, 4vw, 40px) 40px; }
.hero-inner { max-width: 1100px; margin: 0 auto; }
.logo-word { font-size: clamp(48px, 10vw, 96px); font-weight: 800; letter-spacing: 0.18em; color: #fff;
  line-height: 1; }
.hero-sub { color: var(--muted); font-size: 17px; max-width: 560px; margin: 18px 0 0; }
.ip-box { display: flex; align-items: center; gap: 18px; margin-top: 26px; padding: 14px 16px; width: fit-content; max-width: 100%;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.ip-label { font-size: 12px; color: var(--dim); font-weight: 700; }
.ip { font-family: var(--mono); font-size: 20px; font-weight: 700; word-break: break-all; }
.hero-actions { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 20px; font-weight: 700; font-size: 14px; }

/* Spielekarten mit Farbstreifen wie die Items im Lobby-Menue */
.game { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px 20px 26px; overflow: hidden; }
.game::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--dim); }
.game.bw::before { background: #e5484d; }
.game.sw::before { background: #4cc3ff; }
.game-head { display: flex; align-items: baseline; gap: 10px; }
.game-head b { font-size: 20px; font-weight: 900; }
.game .mode { color: var(--dim); font-weight: 700; font-size: 14px; }
.game p { color: var(--muted); margin: 8px 0 0; }
.note { padding: 4px 0; }
.note b { font-size: 16px; }
.note p { color: var(--muted); margin: 6px 0 0; }

/* ---------------------------------------------------------------- Misc */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300; padding: 12px 18px; border-radius: 4px; background: #11171f; border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-weight: 700; max-width: calc(100vw - 32px); }
.toast.err { border-color: rgba(255,95,95,.5); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--teal); animation: spin .8s linear infinite; display: inline-block; }
.loading { display: grid; place-items: center; min-height: 60vh; }
@keyframes spin { to { transform: rotate(360deg); } }

.update { padding: 18px 0; border-bottom: 1px solid var(--line); }
.update:last-child { border-bottom: 0; }
.update h3 { font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--text); }
.update .date { font-size: 12px; color: var(--dim); }
.update p { white-space: pre-wrap; color: var(--muted); margin-top: 8px; }

footer { text-align: center; color: var(--dim); font-size: 13px; padding: 30px 16px 50px; }

/* ---------------------------------------------------------------- Dashboard */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 12px 0 24px; }
.dash-head h1 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); font-weight: 600; font-size: 14px; }
.chip.ok { color: var(--text); border-color: #3a3a3a; background: #171717; }
.steps { margin: 4px 0 16px; padding-left: 20px; color: var(--muted); display: grid; gap: 6px; }
.steps li::marker { color: var(--text); font-weight: 700; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text); transition: border-color .15s; min-height: 112px; }
.tile:hover { border-color: #3a3a3a; text-decoration: none; }
.tile-label { font-size: 13px; color: var(--dim); font-weight: 600; }
.tile-main { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-sub { font-size: 13px; color: var(--muted); margin-top: auto; }

/* ---------------------------------------------------------------- Shop */
.test-banner { margin: 0 0 18px; padding: 10px 14px; border: 1px dashed #3a3a3a; border-radius: var(--radius); color: var(--muted); font-size: 14px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.filter { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; }
.filter:hover { color: var(--text); }
.filter.active { background: #fff; color: #000; border-color: #fff; }
.pet { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s; }
.pet:hover { border-color: #3a3a3a; }
.pet-preview { aspect-ratio: 4 / 3; display: grid; place-items: center; background: #0f0f0f; border-bottom: 1px solid var(--line); position: relative; }
.pet.deepsea .pet-preview { background: linear-gradient(#0f0f0f, #0f0f0f) padding-box; box-shadow: inset 0 -2px 0 #4cc3ff33; }
.pet.mine .pet-preview { box-shadow: inset 0 -2px 0 #c8a26b33; }
.pet.ember .pet-preview { box-shadow: inset 0 -2px 0 #e5484d33; }
.pet-preview img { width: 70%; height: 70%; object-fit: contain; image-rendering: pixelated; }
.pet-preview.big { aspect-ratio: 16 / 9; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 16px; }
.pet-glyph { font-size: 34px; font-weight: 800; letter-spacing: .08em; color: #3a3a3a; }
.pet-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pet-body b { font-size: 17px; }
.pet-body p { margin: 0; font-size: 14px; }
.pet-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; }
.price { font-weight: 700; }
.pet.owned .price { color: var(--muted); }
.owned-mark { color: var(--green); font-weight: 800; }

.modal-bg { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.7); display: grid; place-items: center; padding: 16px; }
.modal { position: relative; width: min(440px, 100%); background: #121212; border: 1px solid var(--line-strong); border-radius: 14px; padding: 26px; max-height: calc(100vh - 32px); overflow: auto; }
.modal h2 { font-size: 22px; margin-bottom: 6px; }
.modal-x { position: absolute; top: 12px; right: 12px; background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 6px; }
.modal-x:hover { color: var(--text); }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.pack { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 8px; background: #0f0f0f; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--text); cursor: pointer; }
.pack:hover { border-color: #fff; }
.pack-tokens { font-size: 24px; font-weight: 800; }
.pack-price { margin-top: 8px; font-weight: 700; }
.sum { margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius); }
.sum-row { display: flex; justify-content: space-between; padding: 11px 14px; }
.sum-row + .sum-row { border-top: 1px solid var(--line); }
.test-note { font-size: 13px; color: var(--muted); border-left: 2px solid #3a3a3a; padding-left: 10px; margin: 0 0 16px; }
.done-mark { width: 54px; height: 54px; margin: 6px auto 14px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #000; font-size: 26px; font-weight: 900; }
@media (max-width: 520px) { .packs { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Pet-Detail + 3D */
.pet { cursor: pointer; }
.modal.wide { width: min(820px, 100%); }
.detail { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: stretch; }
@media (max-width: 720px) { .detail { grid-template-columns: 1fr; } }
.v3-wrap { position: relative; background: radial-gradient(circle at 50% 60%, #1a1a1a, #0b0b0b 70%); border: 1px solid var(--line); border-radius: var(--radius); min-height: 340px; }
.v3-stage { position: absolute; inset: 0; display: grid; place-items: center; touch-action: none; cursor: grab; }
.v3-stage:active { cursor: grabbing; }
.v3-hint { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--dim); pointer-events: none; }
.v3-host { perspective: 1100px; }
.v3-scene, .v3-pivot, .v3-model, .v3-el { transform-style: preserve-3d; position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.v3-face { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; }
.v3-face.v3-plain { background: #2a2a2a; outline: 1px solid #333; }
.v3-tex { position: absolute; left: 0; top: 0; transform-origin: center; image-rendering: pixelated; background-repeat: no-repeat; }
.v3-missing { display: grid; place-items: center; gap: 10px; color: var(--dim); font-size: 13px; }
.v3-missing img { width: 160px; height: 160px; object-fit: contain; image-rendering: pixelated; }
.detail-info { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.detail-info h2 { font-size: 26px; margin: 0; }
.detail-info p { margin: 0; }
.small { font-size: 13px; }
.detail-theme { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.detail-theme.deepsea { border-color: #4cc3ff55; color: #9bdcff; }
.detail-theme.mine { border-color: #c8a26b55; color: #e0c597; }
.detail-theme.ember { border-color: #e5484d55; color: #ff9a9d; }
.detail-price { font-size: 22px; font-weight: 800; margin: 10px 0 4px; }
.detail-actions { display: grid; gap: 8px; margin-top: auto; }
.owned-line { padding: 11px 14px; border: 1px solid #2f4a33; background: #102014; color: #b8f0c0; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; }

.friend-pick { display: grid; gap: 6px; margin-top: 14px; max-height: 360px; overflow: auto; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: #0f0f0f; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); cursor: pointer; text-align: left; }
.friend-row:hover { border-color: #fff; }
.head { width: 32px; height: 32px; image-rendering: pixelated; border-radius: 4px; background: #222; }
.head.big { width: 56px; height: 56px; }
.fname { font-weight: 700; flex: 1; }
.fstate { font-size: 13px; color: var(--dim); }
.fstate.on { color: var(--green); }
.gift-head { display: flex; align-items: center; gap: 14px; }
.loading.small { min-height: 80px; }

.pet-preview { overflow: hidden; }
.pet-preview.v3-host { perspective: 900px; }
.v3-modes { position: absolute; top: 10px; left: 10px; display: flex; gap: 4px; z-index: 2; }
.mode-btn { background: rgba(255,255,255,.06); border: 1px solid var(--line-strong); color: var(--muted); font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.mode-btn.active { background: #fff; color: #000; border-color: #fff; }
