:root {
  --primary: #ff5500;
  /* Manually converted values */
  --primary-h: 24deg;
  --primary-s: 100%;
  --primary-l: 50%;
}
body {
  display: block;
  padding: 0;
  height: 120vh;
  background-repeat: no-repeat;
  background-size: cover;
  overflow: hidden;
  background-color: var(--background-color) !important;
}

main .strip > .title {
  background: transparent !important;
}

header a #header_logo.logo,
.game {
  display: none;
}

header {
  background: none !important;
}

h1 {
  color: var(--primary-color) !important;
  display: block;
  text-align: center;
  margin: 0 auto;
  animation-name: pulse;
  animation-duration: 2s;
  animation-iteration-count: infinite;
  font-size: var(--font-size, 2.5rem);
  line-height: var(--font-size, 2.5rem);
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Hide the thermometer text display */
.intro span,
span.thermometer {
  display: none !important;
}

header a#resume .logo {
  margin-top: 50px;
  margin-right: 50px;
}

/* CSS Custom Property for Mercury Fill - EXACTLY LIKE ORIGINAL */
@property --mercuryFillHeight {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

/* Enhanced Thermometer Container - Full Screen Layout */
.thermometer-container {
  display: flex;
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 1;
  z-index: 10;
}

/* Left Side - Enhanced Large Thermometer */
.thermometer-section {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 20px;
  box-sizing: border-box;
}

/* Main Thermometer Wrapper - EXACTLY LIKE ORIGINAL */
.thermometerWrapper {
  --thermometerHeight: 70vh;
  height: var(--thermometerHeight);
  aspect-ratio: 1/4;
  position: relative;
  margin: 0 auto;
  animation: thermometerShakeQuiet 2s infinite ease-in-out;
  /* Ensure full viewport height */
  height: 90vh;
  margin-left: 100px;
}

/* Base Colors - EXACTLY LIKE ORIGINAL */
.blue {
  background: hsl(
    var(--primary-h) var(--primary-s) calc(var(--primary-l) + 10%)
  );
}

.gray {
  background: hsl(0, 0%, 92%);
}

/* Main Tube (partOne) - EXACTLY LIKE ORIGINAL */
.partOne {
  width: 70%;
  height: 100%;
  margin-inline: auto;
  border-radius: 9999px;
  position: relative;
}

.partOneChild,
.partOneChildChild {
  position: absolute;
  inset: 0.5rem;
  border-radius: inherit;
}

.partOneChild {
  z-index: 1;
}

/* Bulb (partTwo) - EXACTLY LIKE ORIGINAL */
.partTwo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  position: absolute;
  bottom: 0;
}

.partTwoChild,
.partTwoChildChild {
  position: absolute;
  inset: 0.5rem;
  border-radius: inherit;
}

.partTwoChildChild {
  z-index: 1;
}

/* Mercury Containers - EXACTLY LIKE ORIGINAL */
.partOneChildChild,
.partTwoChildChild {
  overflow: hidden;
}

/* Transparency Effect - EXACTLY LIKE ORIGINAL */
.partOneChildChild::before,
.partTwoChildChild::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform: translateX(-1.5rem) translateY(-0.6875rem);
  background: hsl(0 0% 92% / 0.25);
}

.partTwoChildChild::before {
  translate: 0.25rem 0;
}

/* Animated Mercury Fill - EXACTLY LIKE ORIGINAL */
.redFill {
  position: absolute;
  inset: 0;
  /* FIXED: Use viewport height for full screen fill */
  background: linear-gradient(
    to top,
    hsl(120, 80%, 50%) 0%,
    hsl(120, 80%, 50%) var(--mercuryFillHeight, 0px),
    transparent var(--mercuryFillHeight, 0px)
  );
  border-radius: inherit;
  z-index: 3;
  transition: all var(--animationDuration) cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Color variations using CSS classes - FIXED for full screen */
.redFill.quiet {
  background: linear-gradient(
    to top,
    hsl(120, 80%, 50%) 0%,
    hsl(120, 80%, 50%) var(--mercuryFillHeight, 0px),
    transparent var(--mercuryFillHeight, 0px)
  );
}

.redFill.normal {
  background: linear-gradient(
    to top,
    hsl(40, 90%, 55%) 0%,
    hsl(40, 90%, 55%) var(--mercuryFillHeight, 0px),
    transparent var(--mercuryFillHeight, 0px)
  );
}

.redFill.loud {
  background: linear-gradient(
    to top,
    hsl(3, 82%, 51%) 0%,
    hsl(3, 82%, 51%) var(--mercuryFillHeight, 0px),
    transparent var(--mercuryFillHeight, 0px)
  );
}

.shine {
  position: absolute;
  width: 10%;
  aspect-ratio: 1/2.75;
  left: 10%;
  top: 7%;
  border-radius: inherit;
  background: white;
  box-shadow: 0 35px white, 0 45px white, 0 55px white;
  opacity: 0.8;
  z-index: 4;
}

.measurements {
  position: absolute;
  width: 25%;
  aspect-ratio: 3.5/1;
  border-radius: inherit;
  top: 28%;
  left: 5%;
  background: white;
  opacity: 0.75;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 1rem white, 0 2rem white, 0 3rem white, 1rem 3rem white,
    0 4rem white, 0 5rem white, 0 6rem white, 0 7rem white, 1rem 7rem white,
    0 8rem white, 0 9rem white, 0 10rem white, 0 11rem white, 1rem 11rem white,
    0 12rem white, 0 13rem white, 0 14rem white, 0 15rem white, 1rem 15rem white;
}

/* Dynamic Shake Animations */
@keyframes thermometerShakeQuiet {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  25% {
    transform: translateX(0.1rem) rotate(-0.2deg);
  }
  50% {
    transform: translateX(-0.1rem) rotate(0.2deg);
  }
  75% {
    transform: translateX(0.05rem) rotate(-0.1deg);
  }
}

@keyframes thermometerShakeNormal {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  20%,
  80% {
    transform: translateX(0.3rem) rotate(-0.5deg);
  }
  40% {
    transform: translateX(-0.3rem) rotate(0.5deg);
  }
  60% {
    transform: translateX(0.2rem) rotate(-0.3deg);
  }
}

@keyframes thermometerShakeLoud {
  0%,
  10%,
  20%,
  90%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  15%,
  25%,
  35%,
  45%,
  55%,
  65%,
  75%,
  85% {
    transform: translateX(0.8rem) rotate(-1.5deg);
  }
  5%,
  30%,
  40%,
  50%,
  60%,
  70%,
  80%,
  95% {
    transform: translateX(-0.8rem) rotate(1.5deg);
  }
}

/* Apply shake classes */
.thermometerWrapper.quiet {
  animation: thermometerShakeQuiet 1.5s infinite ease-in-out;
}

.thermometerWrapper.normal {
  animation: thermometerShakeNormal 1s infinite ease-in-out;
}

.thermometerWrapper.loud {
  animation: thermometerShakeLoud 0.6s infinite ease-in-out;
}

/* Decibel Scale Labels */
.decibel-scale {
  position: absolute;
  left: -80px;
  top: 5%;
  height: 90%;
  width: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 10;
}

.scale-label {
  position: absolute;
  left: -40px;
  font-size: 1.1rem;
  color: #333;
  font-weight: bold;
  text-align: right;
  width: 50px;
  font-family: "Courier New", monospace;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

.scale-label.quiet {
  color: #44ff44;
  text-shadow: 0 0 8px rgba(68, 255, 68, 0.6);
}
.scale-label.normal {
  color: #ffaa00;
  text-shadow: 0 0 6px rgba(255, 170, 0, 0.6);
}
.scale-label.loud {
  color: #ff4444;
  text-shadow: 0 0 8px rgba(255, 68, 68, 0.6);
}

/* Right Side - Enhanced Decibel Display - Vertically Centered */
.decibel-display-section {
  flex: 1;
  display: grid;
  place-items: center;
  position: relative;
  padding: 20px;
  box-sizing: border-box;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.05));
}

/* Enhanced Display Elements - Vertically centered */
#decibel-display,
#max-decibel-display {
  font-size: var(--secondary-font-size, 8rem);
  line-height: var(--secondary-font-size, 8rem);
  font-weight: 900;
  text-align: center;
  color: var(--secondary-color);
  width: 100%;
  max-width: 80%;
  font-family: var(--secondary-font-family, "Titillium Web", sans-serif);
  text-shadow: 0 0 30px currentColor, 0 0 60px currentColor,
    2px 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 9999999999999;
  position: relative;
  letter-spacing: 0.05em;
  animation: displayPulse 2s infinite ease-in-out;
  text-align: left;
  margin-left: -300px;
  margin-top: 100px;
  padding: 0;
}

@keyframes displayPulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.02);
    filter: brightness(1.1);
  }
}

/* Decibel Color Classes with Enhanced Effects */
.decibel-quiet {
  color: #44ff44;
  text-shadow: 0 0 30px #44ff44, 0 0 60px #44ff44, 0 0 90px #44ff44;
}
.decibel-normal {
  color: #ffaa00;
  text-shadow: 0 0 30px #ffaa00, 0 0 60px #ffaa00, 0 0 90px #ffaa00;
}
.decibel-loud {
  color: #ff4444;
  text-shadow: 0 0 30px #ff4444, 0 0 60px #ff4444, 0 0 90px #ff4444;
}

/* Sessions Display - Hidden by default */
#sessions-display {
  max-width: 800px;
  width: 90%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  padding: 20px;
  background: linear-gradient(135deg, #f9f9f9, #e9e9e9);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  max-height: 80vh;
  overflow-y: auto;
  backdrop-filter: blur(10px);
  display: none; /* Hidden by default */
}

.sessions-container {
  text-align: center;
}

.sessions-title {
  margin-bottom: 20px;
  margin-top: 0;
  color: var(--secondary-color);
  font-size: 1.5rem;
  font-weight: 700;
}

.sessions-table {
  width: 100%;
  border-collapse: collapse;
}

.sessions-table.two-columns {
  display: flex;
  gap: 20px;
}

.column {
  flex: 1;
  min-width: 0;
}

.sessions-header {
  display: flex;
  background: linear-gradient(135deg, #2196f3, #21cbf3);
  color: white;
  font-weight: bold;
  padding: 12px;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.sessions-row {
  display: flex;
  background: linear-gradient(135deg, #ffffff, #f5f5f5);
  border-bottom: 1px solid #e0e0e0;
  padding: 12px;
  transition: all 0.3s ease;
  border-radius: 6px;
  margin-bottom: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sessions-row:hover {
  background: linear-gradient(135deg, #f0f8ff, #e6f3ff);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.sessions-row:nth-child(even) {
  background: linear-gradient(135deg, #f8f8f8, #f0f0f0);
}

.header-rank,
.row-rank {
  flex: 1;
  text-align: center;
  font-size: 1.1rem;
}

.header-decibels,
.row-decibels {
  flex: 2;
  text-align: center;
  font-size: 1.1rem;
}

.header-timestamp,
.row-timestamp {
  flex: 4;
  text-align: center;
  font-size: 0.9rem;
}

.row-decibels.decibel-quiet {
  color: #44ff44;
  font-weight: bold;
}
.row-decibels.decibel-normal {
  color: #ffaa00;
  font-weight: bold;
}
.row-decibels.decibel-loud {
  color: #ff4444;
  font-weight: bold;
}

.sessions-empty {
  text-align: center;
  color: #666;
  font-size: 18px;
  padding: 20px;
  font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
  .thermometer-container {
    flex-direction: column;
  }

  .thermometer-section {
    height: 50vh;
    padding: 10px;
  }

  .decibel-display-section {
    height: 50vh;
    padding: 10px;
  }

  .thermometerWrapper {
    --thermometerHeight: 50vh;
    width: 25%;
  }

  .scale-label {
    font-size: 0.9rem;
    left: -50px;
    width: 40px;
  }

  .decibel-scale {
    left: -60px;
  }
}

@media (orientation: portrait) {
  header img {
    display: none !important;
  }
}

body[d-broadcaster_code="dragons-rouen"] h1 {
  line-height: 4.5rem;
  font-size: 4.5rem;
}

body[d-broadcaster_code="dragons-rouen"] #decibel-display,
body[d-broadcaster_code="dragons-rouen"] #max-decibel-display {
  font-size: 10rem;
  line-height: 10rem;
}

body[d-broadcaster_code="bdl"] #decibel-display,
body[d-broadcaster_code="bdl"] #max-decibel-display {
  line-height: 10rem;
  font-size: 10rem;
}
