body {
  margin: 0;
  background: linear-gradient(135deg, #181818 0%, #23272a 100%);
}

canvas {
  height: 100%;
  display: block;
  margin: 32px auto;
  background: #222;
  border-radius: 18px;
  border: 3px solid #444;
  box-shadow: 0 8px 32px 0 rgba(0,0,0,0.7), 0 0 0 6px #181818;
}

.legend {
  position: fixed;
  top: 40px;
  right: 32px;
  width: 180px;
  background: #23272aee;
  border-radius: 14px;
  border: 2px solid #444;
  box-shadow: 0 4px 16px 0 rgba(0,0,0,0.5);
  padding: 18px 16px 16px 16px;
  color: #fff;
  z-index: 10000;
}
.legend h3 {
  margin: 0 0 10px 0;
  font-size: 1.1em;
  letter-spacing: 1px;
  text-align: center;
  color: #ffe066;
}
.legend ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.legend li {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
  flex-direction: row;
}
.legend li:last-child {
  margin-bottom: 0;
}
.legend img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #181818;
  margin-right: 12px;
  border: 1.5px solid #444;
}
.legend-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 120px;
}
.legend span {
  font-size: 1em;
  color: #fff;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  flex-shrink: 0;
}

.legend-streamer-name {
  font-size: 1.15em;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px #0008, 0 0 2px #ffe06688;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 2px;
  margin-right: 2px;
  display: inline-block;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.legend-streamer-name[data-streamer="asmongold"] { color: #ffe066; }
.legend-streamer-name[data-streamer="tyler1"] { color: #ff6666; }
.legend-streamer-name[data-streamer="carnyjared"] { color: #66ff66; }
.legend-streamer-name[data-streamer="myth"] { color: #6699ff; }
.legend-streamer-name[data-streamer="moist"] { color: #cccccc; }
.legend-streamer-name[data-streamer="pirate"] { color: #ffcc99; }
.legend-streamer-name[data-streamer="ninja"] { color: #1faaff; }
.legend-streamer-name[data-streamer="drdisrespect"] { color: #d32f2f; }
.legend-streamer-name[data-streamer="caseoh"] { color: #39ff14; }
.legend-streamer-name[data-streamer="kaicenat"] { color: #4a90e2; }

.critical-combo-logo {
  animation: floatLogo 3.2s ease-in-out infinite;
}

@keyframes floatLogo {
  0% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-60%) scale(1.04); }
  100% { transform: translateY(-50%) scale(1); }
}

@keyframes ult-glow-pulse {
  0% { box-shadow: 0 0 16px 6px #ffe066, 0 0 32px 12px #ffd70088; }
  50% { box-shadow: 0 0 32px 16px #ffd700, 0 0 48px 24px #ffe066cc; }
  100% { box-shadow: 0 0 16px 6px #ffe066, 0 0 32px 12px #ffd70088; }
}

.ult-glow-anim {
  animation: ult-glow-pulse 1.2s infinite;
}

.ult-bar {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
  height: 12px;
  background: #18181b !important;
  border-radius: 8px;
  border: 2.5px solid #ffe066;
  margin: 4px 0 0 0 !important;
  position: relative;
  box-shadow: 0 2px 8px 0 #0006;
  overflow: hidden;
  display: block;
}
.ult-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffe066 60%, #ffd700 100%);
  border-radius: 8px;
  box-shadow: 0 0 8px 2px #ffe06688;
  transition: width 0.3s;
}

@media (max-width: 700px) {
  body {
    background: #181818;
    overflow: hidden;
  }
  canvas {
    width: 98vw !important;
    height: 98vh !important;
    margin: 0 auto !important;
    display: block;
    border-radius: 10px;
    border-width: 2px;
    box-shadow: 0 2px 12px 0 rgba(0,0,0,0.5);
    max-width: 100vw;
    min-width: 0;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
  }
  .critical-combo-logo {
    display: none !important;
  }
  .game-instructions {
    position: fixed !important;
    left: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 60vw !important;
    min-width: 90px;
    max-width: 70vw !important;
    margin: 0 !important;
    border-radius: 12px 0 0 0;
    box-shadow: 2px 2px 8px 0 rgba(0,0,0,0.3);
    padding: 1vw 1vw 1vw 1vw;
    font-size: 2.5vw;
    z-index: 12;
    background: rgba(30,32,36,0.92) !important;
  }
  .legend {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    min-width: 90px;
    max-width: 100vw !important;
    height: auto !important;
    min-height: 48px;
    max-height: 18vw;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0 !important;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.3);
    padding: 1vw 1vw 1vw 1vw;
    font-size: 2.5vw;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    z-index: 10;
    background: #23272aee;
  }
  .legend ul {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 0;
    margin: 0;
  }
  .legend li {
    margin: 0 2vw 0 0;
    flex: 0 0 auto;
    min-width: 60px;
    font-size: 2.5vw;
    align-items: center;
    display: flex;
  }
  .legend img {
    width: 7vw;
    height: 7vw;
    margin-right: 1vw;
  }
  .twitch-chat {
    position: fixed !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 40vw !important;
    min-width: 90px;
    max-width: 45vw !important;
    height: 28vh !important;
    font-size: 2vw;
    margin: 0 !important;
    border-radius: 0 0 0 12px;
    box-shadow: -2px 2px 8px 0 rgba(0,0,0,0.3);
    padding: 1vw 1vw 1vw 1vw;
    z-index: 10;
    max-height: 28vh;
    overflow-y: auto;
    background: rgba(30,32,36,0.92) !important;
  }
  .end-stream-btn {
    position: fixed !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 60vw !important;
    border-radius: 0 12px 0 0 !important;
    font-size: 4vw !important;
    padding: 2vw 0 !important;
    z-index: 13 !important;
    box-shadow: 0 -2px 8px 0 rgba(0,0,0,0.18);
  }
}

