/* style.css - Bomb the Man: dunkles Feuer-Theme */
:root {
  --acc: #ff7043;
  --acc2: #ffab00;
  --bg: #120b09;
  --panel: rgba(24, 14, 11, .88);
  --line: rgba(255, 112, 67, .25);
  --txt: #f5e9e4;
  --dim: #a08a80;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
}
#cv { position: fixed; inset: 0; width: 100%; height: 100%; transition: filter .45s ease; }
#cv.blurred { filter: blur(9px) brightness(.55) saturate(.8); }

.screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 20px;
  animation: fadeUp .35s ease both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hidden { display: none !important; }

h1 {
  font-size: clamp(38px, 7vw, 74px); letter-spacing: .06em; font-weight: 900;
  color: var(--acc); text-shadow: 0 0 32px rgba(255, 112, 67, .45), 0 3px 0 #4a1a08;
}
h1 span { display: block; font-size: .42em; color: var(--txt); letter-spacing: .5em; text-shadow: none; }
h2 { font-size: 30px; letter-spacing: .04em; }
h2 span { color: var(--acc2); font-family: ui-monospace, monospace; letter-spacing: .15em; }
.tag { color: var(--dim); margin-top: -6px; }

button {
  font: inherit; cursor: pointer; border: 1px solid var(--line); border-radius: 10px;
  background: #2a1710; color: var(--txt); padding: 10px 22px;
  transition: transform .12s, background .15s, box-shadow .15s;
}
button:hover:not(:disabled) { background: #3d2013; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.4); }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
button.navFocus { outline: 2px solid var(--acc); outline-offset: 2px; box-shadow: 0 0 14px rgba(255,112,67,.4); }
.bigBtn {
  font-size: 20px; font-weight: 700; padding: 16px 34px; min-width: 280px;
  background: linear-gradient(160deg, #43240f, #2a1710); border-color: var(--acc);
}
.bigBtn:hover:not(:disabled) { background: linear-gradient(160deg, #57300f, #3d2013); }
.ghostBtn { background: transparent; border-color: transparent; color: var(--dim); }
.ghostBtn:hover { color: var(--txt); background: transparent; box-shadow: none; }

input, select {
  font: inherit; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #1d110c; color: var(--txt);
}
input { width: 280px; text-align: center; }
#joinCode { width: 110px; text-transform: uppercase; letter-spacing: .2em; font-family: ui-monospace, monospace; }
select { width: auto; }

.col { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.row { display: flex; gap: 12px; align-items: center; justify-content: center; }
.joinRow { display: flex; gap: 8px; }
.soloRow { display: flex; gap: 8px; align-items: center; }
.soloRow button { min-width: 140px; }
.err { color: #ff6d5a; min-height: 1.2em; font-size: 14px; }
.rejoin { color: var(--acc2); border-color: var(--acc2); }

#plist { list-style: none; display: flex; flex-direction: column; gap: 8px; min-width: 300px; }
#plist li {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
#plist .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
#plist .nm { flex: 1; font-weight: 600; }
#plist .st { color: var(--dim); font-size: 13px; }
#plist .st.rdy { color: #7cfc00; }
#plist .host { color: var(--acc2); font-size: 12px; }
#plist .off { opacity: .45; font-style: italic; }

/* HUD im Spiel */
#hud {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; pointer-events: none;
  background: linear-gradient(transparent, rgba(10, 5, 3, .8));
}
#chips { display: flex; gap: 8px; }
.chip {
  display: flex; align-items: center; gap: 7px; padding: 5px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; font-size: 13px;
}
.chip .dot { width: 11px; height: 11px; border-radius: 50%; }
.chip.me { border-color: var(--acc2); }
.chip.dead { opacity: .4; text-decoration: line-through; }
#stats { display: flex; gap: 12px; font-size: 15px; }
#stats span { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; }
#pauseBtn { pointer-events: auto; cursor: pointer; width: 40px; height: 40px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); color: var(--txt); font-size: 16px; line-height: 1; }
#pauseBtn:hover { border-color: var(--acc2); }

#count {
  position: fixed; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center;
  font-size: clamp(80px, 18vw, 200px); font-weight: 900; color: var(--acc2);
  text-shadow: 0 0 60px rgba(255, 171, 0, .6); pointer-events: none;
}
#count.tick { animation: cpop .5s ease both; }
@keyframes cpop { from { transform: scale(1.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

#overlay {
  position: fixed; inset: 0; z-index: 9; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  background: rgba(10, 5, 3, .72); backdrop-filter: blur(4px);
  animation: fadeUp .3s ease both;
}
#overlay h2 { font-size: clamp(34px, 6vw, 60px); color: var(--acc2); text-shadow: 0 0 40px rgba(255,171,0,.4); }
#overlay .sub { color: var(--dim); }

#sfxBtn {
  position: fixed; top: 12px; right: 12px; z-index: 12;
  width: 42px; height: 42px; padding: 0; border-radius: 50%;
  background: var(--panel); font-size: 18px; line-height: 1;
}
#padToast, .padHint { font-size: 13px; }
.padHint { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); color: var(--dim); z-index: 5; pointer-events: none; }
body.ingame .padHint { display: none; }
#padToast {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 20;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 8px 18px; opacity: 0; transition: opacity .3s; pointer-events: none;
}
#padToast.show { opacity: 1; }

/* ---------- touch controls (floating stick + bomb button, touch.js haengt es ein) ---------- */
#touchUI { position: fixed; inset: 0; z-index: 8; pointer-events: none; display: none; }
#touchUI.on { display: block; }
#stickZone { position: absolute; left: 0; bottom: 0; width: 58%; height: 72%; pointer-events: auto; touch-action: none; }
#stickBase { position: fixed; width: 140px; height: 140px; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(255,112,67,.4); background: rgba(20,10,8,.35); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; }
#stickNub { width: 62px; height: 62px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffab6e, #e05a1e 70%);
  box-shadow: 0 4px 16px #000a, inset 0 -5px 10px #0006; }
#bombBtn { position: absolute; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  width: 96px; height: 96px; border-radius: 50%; pointer-events: auto; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  border: 2px solid var(--acc2); font-size: 44px; background: radial-gradient(circle at 35% 30%, #3a2015, #1c0e08 75%);
  color: var(--txt); box-shadow: 0 6px 20px #000a, 0 0 24px rgba(255,171,0,.25);
  display: flex; align-items: center; justify-content: center; transition: transform .06s; }
#bombBtn.held { transform: scale(.9); background: radial-gradient(circle at 35% 30%, #5a2e18, #241009 75%); }
@media (orientation: landscape) and (max-height: 500px) {
  #bombBtn { width: 80px; height: 80px; font-size: 36px; }
}

/* ---------- mobile: kompaktere Eingaben ---------- */
@media (max-width: 640px) {
  .screen { gap: 10px; padding: 14px; }
  .screen h1 { font-size: 30px; }
  .screen input, .screen select, .screen button { font-size: 16px; }
  .soloRow, .joinRow { flex-wrap: wrap; justify-content: center; }
}

/* ---------- touch: manueller Toggle ---------- */
#touchToggle { position: fixed; left: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 9;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); font-size: 22px; display: none; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent; }
#touchToggle.on { display: flex; }
