:root {
  --bg0: #0f0b08;
  --bg1: #1a1410;
  --glass: rgba(16, 12, 10, 0.72);
  --line: rgba(245, 186, 76, 0.32);
  --line-soft: rgba(245, 186, 76, 0.18);
  --gold: #f5ba4c;
  --text: #f7f2df;
  --muted: #cdbf97;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(245, 186, 76, 0.14), transparent 32%),
    radial-gradient(circle at 80% 82%, rgba(239, 127, 43, 0.12), transparent 34%),
    linear-gradient(180deg, #16110d 0%, #0b0907 100%);
  color: var(--text);
  font-family: "Rajdhani", "Segoe UI", sans-serif;
}

.stage {
  width: 100%;
  height: 100%;
  padding: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.phone-shell {
  width: min(540px, calc(100vw - 16px), calc((100vh - 16px) * 0.5625));
  height: calc(100vh - 16px);
}

.metrics-dock {
  width: min(360px, calc(100vw - 580px));
  max-height: calc(100vh - 16px);
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.metrics-card {
  position: relative;
  padding: 8px 10px;
  border-color: rgba(245, 186, 76, 0.34);
}

.metrics-card h3 {
  margin: 0 0 6px;
  font-family: "Bebas Neue", "Impact", sans-serif;
  letter-spacing: 0.7px;
  font-size: 28px;
  line-height: 0.9;
  color: var(--gold);
}

.metrics-stats .metrics-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.metrics-stats .hud-pill {
  font-size: 14px;
  padding: 3px 8px;
}

.wave-phase-pill {
  min-width: 68px;
  text-align: center;
}

.wave-objective {
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.05;
  color: #ffe3a1;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.chat-stats {
  margin-top: 7px;
  font-size: 14px;
  line-height: 1;
  color: #dcca9f;
  font-weight: 700;
}

.vote-power {
  margin-top: 8px;
  padding: 7px 8px 6px;
  border: 1px solid rgba(245, 186, 76, 0.24);
  border-radius: 10px;
  background: rgba(11, 8, 6, 0.55);
}

.vote-power-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.vote-title {
  font-size: 14px;
  font-weight: 700;
  color: #f7d28a;
  letter-spacing: 0.35px;
}

.vote-timer {
  font-size: 13px;
  font-weight: 700;
  color: #fff0c1;
}

.vote-bars {
  margin-top: 5px;
  display: grid;
  gap: 4px;
}

.vote-row {
  display: grid;
  grid-template-columns: 42px 1fr 24px;
  align-items: center;
  gap: 6px;
}

.vote-row span {
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  color: #ead9b1;
}

.vote-track {
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(245, 186, 76, 0.22);
  background: rgba(0, 0, 0, 0.48);
  overflow: hidden;
}

.vote-fill {
  width: 0%;
  height: 100%;
  transition: width 140ms linear;
}

.vote-heal .vote-fill {
  background: linear-gradient(90deg, #6dd889, #9ef2a2);
}

.vote-bomb .vote-fill {
  background: linear-gradient(90deg, #f58950, #ffd08d);
}

.vote-chest .vote-fill {
  background: linear-gradient(90deg, #f0c04f, #ffe39c);
}

.vote-boss .vote-fill {
  background: linear-gradient(90deg, #ff6f5b, #ffb996);
}

.vote-row b {
  font-size: 12px;
  line-height: 1;
  text-align: right;
  color: #fff2ca;
}

.vote-meta {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1;
  color: #d8c79c;
  font-weight: 700;
}

.metrics-dock .list li {
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
}

.metrics-dock .list.compact li {
  font-size: 14px;
}

.metrics-dock .feed-list li {
  font-size: 15px;
  line-height: 1;
  padding: 4px 6px;
}

.metrics-feed .feed-list {
  max-height: 210px;
  overflow: auto;
  padding-right: 2px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.38);
}

.glass {
  background: linear-gradient(180deg, rgba(33, 25, 20, 0.82), rgba(17, 12, 9, 0.8));
  backdrop-filter: blur(7px);
}

.arena-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 208, 112, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 12px 26px rgba(0, 0, 0, 0.45);
}

#arenaCanvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  background: #1e1712;
}

.hud-card,
.donations-card,
.queue-card,
.players-card,
.rules-card,
.loot-tag,
.feed-overlay,
.my-hero-card {
  position: absolute;
  z-index: 5;
  pointer-events: none;
}

.hud-card {
  left: 10px;
  top: 10px;
  width: calc(100% - 20px);
  padding: 8px 10px;
}

.hud-handle {
  font-family: "Bebas Neue", "Impact", sans-serif;
  letter-spacing: 0.8px;
  font-size: 34px;
  line-height: 0.88;
}

.hud-stats {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.hud-pill {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(8, 7, 5, 0.74);
  padding: 3px 10px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.hud-pill b {
  color: #fff4c9;
}

.donations-card {
  right: 10px;
  top: 84px;
  width: 41%;
  max-width: 220px;
  padding: 8px 10px;
}

.queue-card {
  right: 10px;
  top: 196px;
  width: 41%;
  max-width: 220px;
  padding: 8px 10px;
}

.players-card {
  right: 10px;
  top: 312px;
  width: 41%;
  max-width: 220px;
  padding: 8px 10px;
}

.rules-card {
  left: 10px;
  top: 106px;
  width: 49%;
  max-width: 260px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(38, 28, 21, 0.86), rgba(18, 12, 9, 0.84));
}

.rules-card p {
  margin: 4px 0;
  font-weight: 700;
  line-height: 1.08;
  font-size: 13px;
}

.rules-card .rule-head {
  font-family: "Bebas Neue", "Impact", sans-serif;
  font-size: 34px;
  letter-spacing: 0.8px;
  color: var(--gold);
  line-height: 0.84;
  margin-bottom: 6px;
}

.rules-card .rule-head span {
  display: inline-block;
  color: #fff2c7;
  font-size: 24px;
}

.loot-tag {
  left: 50%;
  bottom: 168px;
  transform: translateX(-50%);
  font-family: "Bebas Neue", "Impact", sans-serif;
  letter-spacing: 0.8px;
  color: #2d230f;
  background: linear-gradient(180deg, #f7cf53, #d59a2f);
  border-color: rgba(255, 227, 135, 0.46);
  padding: 4px 14px;
  font-size: 25px;
  border-radius: 10px;
}

.donations-card h3,
.queue-card h3,
.players-card h3 {
  margin: 0 0 6px;
  font-family: "Bebas Neue", "Impact", sans-serif;
  letter-spacing: 0.8px;
  font-size: 30px;
  line-height: 0.84;
  color: var(--gold);
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px;
}

.list li {
  font-size: 20px;
  font-weight: 700;
  line-height: 0.95;
  padding: 5px 7px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: rgba(9, 7, 5, 0.68);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.58);
}

.list.compact {
  gap: 4px;
}

.list.compact li {
  font-size: 15px;
  padding: 4px 6px;
  line-height: 1;
}

.feed-overlay {
  left: 10px;
  bottom: 10px;
  width: calc(100% - 20px);
  max-height: 146px;
  padding: 7px 8px;
  background: linear-gradient(180deg, rgba(21, 15, 10, 0.8), rgba(12, 9, 7, 0.78));
}

.my-hero-card {
  right: 10px;
  top: 10px;
  width: min(47%, 198px);
  padding: 8px 9px;
  background: linear-gradient(180deg, rgba(27, 20, 15, 0.84), rgba(12, 10, 8, 0.82));
  border-color: rgba(245, 186, 76, 0.34);
}

.my-hero-card h3 {
  margin: 0 0 5px;
  font-family: "Bebas Neue", "Impact", sans-serif;
  letter-spacing: 0.7px;
  font-size: 24px;
  line-height: 0.86;
  color: var(--gold);
}

.my-hero-name {
  font-size: 20px;
  line-height: 0.95;
  font-weight: 700;
  color: #fff1c5;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.my-hero-meta {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
}

.my-hero-hp-track {
  margin-top: 6px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(245, 186, 76, 0.22);
  overflow: hidden;
}

.my-hero-hp-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #4fdd75, #a8f76a);
  transition: width 150ms linear;
}

.my-hero-stats {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1;
  color: #e8ddbd;
}

.feed-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.feed-list li {
  font-size: 21px;
  font-weight: 700;
  line-height: 0.9;
  padding: 4px 7px;
  border-radius: 9px;
  border: 1px solid rgba(245, 186, 76, 0.24);
  background: rgba(9, 7, 5, 0.66);
}

.feed-list li.highlight {
  border-color: rgba(255, 208, 110, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 224, 145, 0.2);
}

@media (max-width: 760px) {
  .stage {
    padding: 4px;
  }

  .phone-shell {
    width: min(540px, calc(100vw - 8px));
    height: calc(100vh - 8px);
  }

  .hud-handle {
    font-size: 28px;
  }

  .hud-pill {
    font-size: 14px;
    padding: 3px 9px;
  }

  .donations-card,
  .queue-card,
  .players-card {
    width: 44%;
    right: 8px;
  }

  .donations-card {
    top: 82px;
  }

  .queue-card {
    top: 190px;
  }

  .players-card {
    top: 302px;
  }

  .rules-card {
    left: 8px;
    top: 102px;
    width: 50%;
    max-width: 220px;
  }

  .rules-card .rule-head {
    font-size: 30px;
  }

  .rules-card .rule-head span {
    font-size: 20px;
  }

  .rules-card p {
    font-size: 12px;
  }

  .donations-card h3,
  .queue-card h3,
  .players-card h3 {
    font-size: 26px;
  }

  .list li {
    font-size: 16px;
  }

  .feed-overlay {
    left: 8px;
    bottom: 8px;
    width: calc(100% - 16px);
    max-height: 132px;
  }

  .feed-list li {
    font-size: 18px;
  }

  .loot-tag {
    bottom: 148px;
    font-size: 22px;
  }

  .my-hero-card {
    right: 8px;
    top: 8px;
    width: min(49%, 180px);
    padding: 7px 8px;
  }

  .my-hero-card h3 {
    font-size: 22px;
  }

  .my-hero-name {
    font-size: 18px;
  }

  .my-hero-meta {
    font-size: 13px;
  }

  .my-hero-stats {
    font-size: 12px;
  }
}

@media (max-width: 1180px) {
  .metrics-dock {
    display: none;
  }
}

/* Temporary clean mode for YouTube mobile:
   keep only gameplay area without bulky overlay cards. */
.hud-card,
.donations-card,
.queue-card,
.players-card,
.rules-card,
.feed-overlay,
.loot-tag {
  display: none !important;
}
