/*
* This file was created with significant AI assistance (e.g., Claude)
* to handle the portrait layout of the phone controller.
*
* It has been reviewed, tested, and approved by a human developer
* to ensure quality and correctness.
*/

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  --side: var(--magenta);
  --side-text: #fff;
}
body.right {
  --side: var(--white);
  --side-text: #000;
}

/* --- Auswahl --------------------------------------------------------------- */

#chooser {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  text-align: center;
}
#chooser h1 {
  margin: 0;
  font-size: 40px;
}
#chooser p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 18px;
}
.choose {
  display: block;
  padding: 36px 0;
  border-radius: 20px;
  font-size: 34px;
  font-weight: 800;
  text-decoration: none;
}
.choose.left {
  background: var(--magenta);
  color: #fff;
}
.choose.right {
  background: var(--white);
  color: #000;
}

/* --- Controller ------------------------------------------------------------ */

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(10px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  border-top: 6px solid var(--side);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 15px;
}
.side-label {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--side);
  color: var(--side-text);
  font-weight: 700;
}
.score {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.players {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.phase {
  margin: 8px 0 10px;
  text-align: center;
  font-size: 17px;
  color: var(--muted);
  min-height: 1.3em;
}

/* Slider */
.slider-ui {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
}
.track {
  position: relative;
  flex: 1;
  border-radius: 24px;
  background: var(--panel);
  border: 2px solid var(--line);
  touch-action: none;
}
.thumb {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 64px;
  margin-top: -32px;
  border-radius: 18px;
  background: var(--side);
  box-shadow: 0 0 24px color-mix(in srgb, var(--side) 50%, transparent);
  pointer-events: none;
}
.track-hint {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 18px;
  pointer-events: none;
}
.paddle-track {
  position: relative;
  width: 14px;
  border-radius: 7px;
  background: var(--panel);
}
.paddle-marker {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 18%;
  transform: translateY(-50%);
  border-radius: 7px;
  background: var(--side);
  opacity: 0.8;
  transition: top 0.2s linear;
}

/* Mikrofon-Leiste für die Boni */
.mic-bar {
  margin-bottom: 10px;
}
.mic-button {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--side);
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
}
.mic-button:disabled {
  opacity: 0.4;
}
.mic-active {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.mic-label {
  color: var(--muted);
}
.meter-h {
  position: relative;
  flex: 1;
  height: 12px;
  border-radius: 6px;
  background: var(--panel);
  overflow: hidden;
}
.meter-h .meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--side);
}
.mic-status {
  margin: 6px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.link-button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  font-size: 13px;
}

/* Aktive Boni */
.effects {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #ffd400;
  color: #000;
  font-weight: 700;
  text-align: center;
  font-size: 15px;
}

/* Schrei-Duell */
.shout {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: var(--side);
  color: var(--side-text);
  text-align: center;
}
.shout-title {
  margin: 0;
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.shout-count {
  margin: 0;
  font-size: 110px;
  font-weight: 900;
  line-height: 1;
}
.meter-big {
  position: relative;
  width: 100%;
  height: 34px;
  border-radius: 17px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.meter-big .meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: #ffd400;
}
.shout-hint {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

/* Countdown / Ergebnis */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  font-size: 44px;
  font-weight: 800;
  text-align: center;
  padding: 24px;
  z-index: 10;
}
.overlay.big {
  font-size: 160px;
  color: var(--side);
}
.overlay.win {
  background: var(--side);
  color: var(--side-text);
}
.overlay.msg {
  font-size: 30px;
  line-height: 1.25;
}
