@font-face { font-family: 'BlackOps'; src: url('../fonts/blackops.woff2') format('woff2'); font-display: swap; }
:root {
  --bg: #141a10; --panel: rgba(30, 37, 21, 0.94); --line: #5f7040; --txt: #f5f1e1; --mut: #bcc2a7;
  --acc: #ffb020; --acc2: #ff6a2b; --red: #e5484d;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--txt);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none;
}
#cv { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font-family: inherit; }

/* ---------- Menüs ---------- */
#screens {
  position: fixed; inset: 0; overflow-y: auto; touch-action: pan-y;
  background: radial-gradient(ellipse at center, rgba(12, 16, 8, 0.3), rgba(12, 16, 8, 0.82));
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 14px max(14px, env(safe-area-inset-left));
}
.scr { display: none; min-height: 100%; align-items: center; justify-content: center; flex-direction: column; gap: 18px; }
.scr.on { display: flex; }
#screens { padding-bottom: calc(14px + var(--adh, 0px)); }
.box {
  background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 18px 20px;
  width: min(560px, 100%); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.box.wide { width: min(1000px, 100%); }
.box.small { width: min(340px, 100%); display: flex; flex-direction: column; gap: 10px; }
h1 {
  font: 400 clamp(46px, 9vw, 96px)/0.95 BlackOps, Impact, sans-serif; letter-spacing: 1px; margin: 0;
  color: #ffe7a8; text-shadow: 0 4px 0 #6b3d10, 0 8px 22px rgba(0, 0, 0, 0.7);
}
h1 em { font-style: normal; color: var(--acc2); }
h2 { margin: 0 0 10px; font: 400 26px BlackOps, Impact, sans-serif; letter-spacing: 1px; color: #ffe7a8; }
h3 { margin: 16px 0 8px; font: 800 15px system-ui, sans-serif; color: var(--acc); text-transform: uppercase; letter-spacing: 1px; }
p { line-height: 1.45; }
.logo { text-align: center; }
.logo canvas { width: 300px; height: 240px; max-width: 70vw; display: block; margin: 0 auto -18px; }
.sub { margin: 10px 0 0; color: var(--mut); font-weight: 600; }
.menu { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.menu-row { display: flex; gap: 12px; }
.hint { color: var(--mut); font-size: 13px; margin: 6px 0; }
.status { min-height: 1.2em; font-weight: 700; color: #9fe07a; }
.status.err { color: #ff8a80; }
.stack { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  font: 800 15px system-ui, sans-serif; color: var(--txt); cursor: pointer;
  background: linear-gradient(#4b5b2d, #36421f); border: 2px solid #7f9254; border-bottom-width: 4px;
  border-radius: 12px; padding: 10px 18px;
}
.btn:active { transform: translateY(2px); border-bottom-width: 2px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.big { font: 400 20px BlackOps, system-ui, sans-serif; letter-spacing: 0.5px; padding: 13px 26px; min-width: 250px; }
.btn.full { width: 100%; }
.btn.primary { background: linear-gradient(#ffb62e, #e8871a); border-color: #ffd27a; color: #2a1604; }
.btn.danger { background: linear-gradient(#c8453a, #9d2c23); border-color: #ef7f75; }
.btn.ghost { background: transparent; border-style: dashed; margin-top: 10px; }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

input, select { user-select: text; -webkit-user-select: text; font-family: inherit; }
input.text, #join-code {
  width: 100%; background: rgba(0, 0, 0, 0.35); color: var(--txt); border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px; padding: 10px 12px; font: 600 15px system-ui, sans-serif;
}
.join { display: flex; gap: 10px; margin-top: 14px; }
#join-code { font: 900 22px ui-monospace, Consolas, monospace; letter-spacing: 6px; text-transform: uppercase; text-align: center; }
.code-box { font: 700 18px system-ui; margin-bottom: 12px; }
.code-box b { font: 900 30px ui-monospace, Consolas, monospace; letter-spacing: 6px; color: var(--acc); user-select: text; -webkit-user-select: text; }

/* Teams */
.teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.team { border: 2px solid var(--tc); border-radius: 14px; background: rgba(0, 0, 0, 0.22); padding: 10px; }
.team.waiting { display: flex; align-items: center; justify-content: center; min-height: 140px; color: var(--mut); font-weight: 700; border-style: dashed; }
.team-head { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.team-name {
  flex: 1; min-width: 0; font: 800 16px system-ui, sans-serif; color: var(--tc);
  background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 8px; padding: 6px 8px;
}
.team-name:disabled { opacity: 1; }
.team-ctrl, .settings select {
  background: #1d2414; color: var(--txt); border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px; padding: 6px; font: 600 13px system-ui, sans-serif;
}
.icon {
  width: 34px; height: 34px; flex: none; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.3); color: #fff; cursor: pointer; font-size: 16px;
}
.dogs { display: flex; flex-wrap: wrap; gap: 6px; }
.dogs.center { justify-content: center; margin: 10px 0; }
.dog { width: 84px; display: flex; flex-direction: column; align-items: center; background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 4px; }
.dog canvas { width: 76px; height: 70px; cursor: pointer; }
.dog-name {
  width: 100%; font: 600 10.5px system-ui, sans-serif; text-align: center; color: var(--txt);
  background: transparent; border: none; border-bottom: 1px dashed rgba(255, 255, 255, 0.2); padding: 2px 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 16px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font: 600 13px system-ui, sans-serif; color: var(--mut); }

/* Anleitung */
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 24px; }
.help-grid ul { margin: 0; padding-left: 18px; line-height: 1.6; font-size: 14px; }
.wlist { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.witem { display: flex; gap: 10px; align-items: center; background: rgba(0, 0, 0, 0.2); border-radius: 10px; padding: 6px 10px; font-size: 13px; color: var(--mut); }
.witem b { color: var(--txt); font-size: 14px; }

/* ---------- Im Spiel ---------- */
#hudbar {
  position: fixed; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right));
  display: flex; gap: 8px;
}
.hb {
  height: 40px; min-width: 44px; padding: 0 14px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 18, 12, 0.78); color: #fff; font: 700 15px system-ui, sans-serif; cursor: pointer;
}

.fs-corner { position: fixed; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); z-index: 6; font-size: 20px; padding: 0 10px; }

#weapons {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5;
  background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto; touch-action: pan-y;
}
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; width: min(580px, 88vw); }
.wbtn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.12); background: rgba(0, 0, 0, 0.25); color: var(--txt);
  font: 700 12px system-ui, sans-serif; cursor: pointer;
}
.wbtn.sel { border-color: var(--acc); background: rgba(255, 176, 32, 0.15); }
.wbtn:disabled { opacity: 0.35; cursor: default; }
.wbtn small { color: var(--mut); font-weight: 600; }
.whint { margin: 8px 0 0; text-align: center; color: var(--mut); font-size: 13px; }
.whint:empty { display: none; }

#touch { position: fixed; inset: 0; pointer-events: none; }
#touch .tb {
  pointer-events: auto; position: absolute; width: 58px; height: 58px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); background: rgba(0, 0, 0, 0.42); color: #fff;
  font: 800 18px system-ui, sans-serif; display: flex; align-items: center; justify-content: center; touch-action: none; padding: 0;
}
#touch .tb.on { background: rgba(255, 176, 32, 0.7); }
.pad { position: absolute; left: max(12px, env(safe-area-inset-left)); bottom: 12px; width: 176px; height: 176px; }
.pad .up { left: 59px; top: 0; }
.pad .down { left: 59px; bottom: 0; }
.pad .left { left: 0; top: 59px; }
.pad .right { right: 0; top: 59px; }
.acts { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: 12px; width: 240px; height: 176px; }
#touch .fire { width: 94px; height: 94px; right: 0; bottom: 0; background: rgba(200, 50, 28, 0.75); font-size: 16px; }
#touch .mid { width: 68px; height: 68px; right: 104px; bottom: 6px; font-size: 13px; }
#touch .small { width: auto; min-width: 66px; height: 40px; border-radius: 20px; padding: 0 12px; font-size: 13px; }
#touch .t-flip { right: 0; bottom: 110px; }
#touch .t-weap { right: 82px; bottom: 110px; }
#touch .t-fuse { right: 164px; bottom: 110px; }
/* Super-Saiyajin: goldener Fliegen-Knopf über der Knopfreihe */
#touch .t-fly { right: 0; bottom: 160px; min-width: 110px; background: linear-gradient(180deg, #ffe45c, #f0a800); color: #3a2400; border-color: #fff3a0; box-shadow: 0 0 14px rgba(255, 210, 60, 0.8); }
#touch .t-fly.on, #b-fly.on { background: linear-gradient(180deg, #fff6b0, #ffcf33); }
#b-fly { background: linear-gradient(180deg, #ffe45c, #f0a800); color: #3a2400; border-color: #fff3a0; }

#rotate {
  position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center;
  background: var(--bg); font: 800 20px system-ui, sans-serif; text-align: center; padding: 20px;
}
@media (orientation: portrait) and (pointer: coarse) { #rotate { display: flex; } }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: rgba(0, 0, 0, 0.85); color: #fff; padding: 10px 16px; border-radius: 10px;
  font: 600 14px system-ui, sans-serif; max-width: 90vw; text-align: center;
}

@media (max-height: 430px) {
  .pad { transform: scale(0.82); transform-origin: bottom left; }
  .acts { transform: scale(0.82); transform-origin: bottom right; }
}
@media (max-height: 560px) {
  #scr-main.on { flex-direction: row; gap: 30px; }
  .logo canvas { width: 200px; height: 160px; margin-bottom: -10px; }
  h1 { font-size: 52px; }
  .btn.big { min-width: 200px; padding: 11px 20px; font-size: 17px; }
  .box { padding: 14px 16px; }
}

/* ---------- Freunde, Sprache ---------- */
.online-only { display: none; }
body.online .online-only { display: inline-flex; align-items: center; justify-content: center; }
.friends { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.friend { display: flex; align-items: center; gap: 8px; background: rgba(0, 0, 0, 0.25); border-radius: 10px; padding: 6px 8px; }
.friend .dot { width: 10px; height: 10px; border-radius: 50%; background: #666; flex: none; }
.friend.on .dot { background: #3fcf5e; box-shadow: 0 0 6px #3fcf5e; }
.friend .fname { font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend small { color: var(--mut); font-size: 11px; }
#main-acct { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
#lobby-friends { max-height: 150px; overflow-y: auto; margin-bottom: 12px; }
#lobby-invite h3 { margin-top: 4px; }
.acct-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--mut); margin: 4px 0 8px; }
#scr-account input.text { display: block; width: 100%; margin-top: 8px; }
.acct-google { display: flex; justify-content: center; min-height: 44px; margin: 12px 0 4px; }
.acct-btns { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.acct-btns .btn { flex: 1; }
.btn.google { background: #fff; color: #222; border-color: #ddd; }
.friend.req { background: rgba(255, 200, 60, 0.18); outline: 1px solid rgba(255, 200, 60, 0.5); }
.friend.req .dot { background: #ffc83c; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.talk-row { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.code-box .btn { margin-left: 10px; vertical-align: middle; }
/* Sprechen im Spiel: ein Knopf + kleines Menü darunter */
#b-talk { position: relative; font-size: 18px; }
#b-talk.on { background: rgba(63, 207, 94, 0.85); border-color: #9ff0b0; }
#b-talk.muted { background: rgba(120, 120, 120, 0.85); }
#b-talk.call-waiting { animation: vc-pulse 1.4s ease-in-out infinite; }
@keyframes vc-pulse { 50% { border-color: #3fcf5e; box-shadow: 0 0 10px #3fcf5e; } }
#b-talk .vc-n { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: #3fcf5e; color: #10200f; font: 800 11px/18px system-ui, sans-serif; padding: 0 4px; }
#b-talk .vc-n:empty { display: none; }
body.recording #b-talk, body.recording .b-memo { background: rgba(229, 72, 77, 0.9) !important; border-color: #ffb4b4; }
.b-voice.on { background: rgba(63, 207, 94, 0.8) !important; }
#talkmenu {
  position: fixed; top: calc(max(10px, env(safe-area-inset-top)) + 48px); right: max(10px, env(safe-area-inset-right)); z-index: 20;
  width: min(260px, calc(100vw - 20px)); background: rgba(15, 18, 12, 0.94); border: 2px solid rgba(255, 255, 255, 0.2); border-radius: 12px;
  padding: 8px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
#talkmenu.hidden { display: none; }
#talkmenu button { border: none; border-radius: 9px; padding: 10px 12px; font: 700 14px system-ui, sans-serif; text-align: left; cursor: pointer; background: rgba(255, 255, 255, 0.1); color: #fff; }
#talkmenu button.on { background: #e5484d; }
#talkmenu p { margin: 0; font-size: 12px; color: var(--mut); }
.ready-tag { margin-top: 8px; text-align: center; font: 700 13px system-ui, sans-serif; color: var(--mut); }
.ready-tag.ok { color: #9fe07a; }
#modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.55); padding: 16px; }
#modal.hidden { display: none; }
#modal .modal-text { font: 800 19px system-ui, sans-serif; text-align: center; margin: 4px 0 8px; white-space: pre-line; }
#modal .modal-text.long { font: 600 15px/1.45 system-ui, sans-serif; text-align: left; }

/* ---------- Arcade & Kartenwahl ---------- */
.btn.arcade { background: linear-gradient(#c8453a, #8f271f); border-color: #ff9a8f; }
.btn.gold { background: linear-gradient(#6b5314, #3f300a); border-color: #ffc61a; color: #ffe08a; }
.arcade-rank { display: flex; flex-direction: column; align-items: center; margin: 12px 0; padding: 12px; border: 2px dashed #ffb020; border-radius: 14px; }
.arcade-rank small { color: var(--mut); font-weight: 700; }
.arcade-rank b { font: 400 30px BlackOps, Impact, sans-serif; color: #ffe7a8; }
#scr-arcade .btn.full { margin-top: 8px; }
.mapbox { grid-column: 1 / -1; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.mapprev { width: 240px; height: 130px; border-radius: 10px; border: 2px solid var(--line); background: #1d2414; }
.mapside { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.mapside small { color: var(--mut); }

/* ---------- Lautstärke ---------- */
.sliders { display: flex; flex-direction: column; gap: 12px; }
.sliders label { display: grid; grid-template-columns: 90px 1fr 52px; align-items: center; gap: 10px; font: 700 14px system-ui, sans-serif; }
.sliders input[type=range] { width: 100%; accent-color: var(--acc); height: 28px; touch-action: pan-x; }
.sliders span { text-align: right; color: var(--mut); font-size: 13px; }
/* Bullys freischalten */
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.bcard { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border-radius: 12px; text-align: center;
  background: rgba(255, 255, 255, 0.05); border: 2px solid rgba(255, 255, 255, 0.12); font: 700 13px system-ui, sans-serif; }
.bcard canvas { width: 104px; height: 96px; }
.bcard[data-r="2"] { border-color: #4aa3ff; }
.bcard[data-r="3"] { border-color: #ffc61a; box-shadow: 0 0 14px rgba(255, 198, 26, 0.35); }
.bcard:not(.have) canvas { filter: grayscale(0.3) brightness(0.85); }
.bcard .rar { font-weight: 600; color: var(--mut); }
.bcard[data-r="2"] .rar { color: #7cc0ff; }
.bcard[data-r="3"] .rar { color: #ffd65c; }
.bcard .got { color: #9fe07a; font-weight: 600; }
.bcard .btn.small { padding: 6px 8px; font-size: 12px; }
/* Werbung: Eigenwerbung als Vollbild, Browser-Banner unten */
#adhouse { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 20px; text-align: center; background: radial-gradient(ellipse at center, #2b3a1c, #0d120a); color: var(--txt); }
#adhouse .ah-tag { position: absolute; top: 12px; left: 14px; font: 600 11px system-ui, sans-serif; color: var(--mut); border: 1px solid var(--mut); border-radius: 4px; padding: 1px 6px; }
#adhouse .ah-ico { font-size: 64px; }
#adhouse p { max-width: 420px; color: var(--mut); margin: 0; }
#adbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; justify-content: center; background: rgba(0, 0, 0, 0.6); }
#adbar.hidden { display: none; }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 14px; font: 700 14px system-ui, sans-serif; cursor: pointer; }
.switch input { width: 22px; height: 22px; accent-color: var(--acc); }
.switch .hint { margin: 0; font-weight: 400; }
