/* ===== 90'S SKUFFET STYLE ===== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-size: var(--bg-size);
  background-attachment: fixed;
  font-family: var(--font-body);
  color: var(--text);
  cursor: crosshair;
}

.wrapper {
  max-width: 960px;
  margin: 20px auto;
  padding: 10px;
}

/* ===== MAIN LAYOUT TABLE ===== */
.layout-main {
  width: 100%;
  table-layout: fixed;
  background: var(--table-bg);
  border: var(--table-border);
  border-collapse: separate;
}

.layout-main td {
  border: var(--cell-border);
  background: var(--cell-bg);
  padding: 10px 8px;
  vertical-align: top;
}

/* ===== HERO ===== */
.hero-cell {
  text-align: center;
  background: var(--hero-bg) !important;
}

.neon-text {
  font-family: var(--font-heading);
  font-size: 42px;
  color: var(--neon-color);
  text-shadow: var(--neon-shadow);
  margin-bottom: 4px;
  letter-spacing: 4px;
}

.subtitle {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--subtitle-color);
  text-shadow: 1px 1px 2px #000;
  margin-bottom: 8px;
}

marquee {
  color: var(--marquee-color);
  font-size: 13px;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000;
  background: var(--marquee-bg);
  padding: 4px 0;
  border: var(--marquee-border);
}

/* ===== BEER-O-METER ===== */
.beer-cell {
  text-align: center;
  background: var(--beer-bg) !important;
  border: var(--beer-border) !important;
}

.section-title {
  color: var(--section-title);
  font-size: 22px;
  text-shadow: 1px 1px 3px #000;
  margin-bottom: 4px;
}

.question {
  color: var(--question-color);
  font-size: 18px;
  font-weight: bold;
  text-shadow: 1px 1px 2px #000;
  margin-bottom: 8px;
}

.beer-answer {
  font-family: var(--font-heading);
  font-size: 72px;
  font-weight: bold;
  text-shadow: 3px 3px 0 #000;
  margin: 8px 0;
  line-height: 1;
  animation: pulse 1s ease-in-out infinite;
}

.beer-answer.yes {
  color: var(--beer-yes);
  text-shadow: var(--beer-yes-shadow);
}

.beer-answer.no {
  color: var(--beer-no);
  text-shadow: var(--beer-no-shadow);
}

.beer-countdown {
  color: var(--countdown);
  font-size: 16px;
  margin-bottom: 6px;
}

.beer-rules {
  color: #888888;
  font-size: 10px;
  font-style: italic;
}

/* ===== THERMOMETERS ===== */
.therm-row td {
  width: 33.33%;
}

.therm-cell {
  text-align: center;
  vertical-align: top;
  max-width: 33.33%;
  overflow: hidden;
}

.therm-title {
  color: var(--therm-title);
  font-size: 14px;
  text-shadow: 1px 1px 2px #000;
  margin-bottom: 4px;
}

.therm-display {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: bold;
  color: var(--therm-display);
  text-shadow: var(--therm-display-shadow);
  margin: 4px 0;
}

.therm-humidity {
  font-size: 11px;
  color: #88ccff;
  margin-bottom: 4px;
}

.therm-bar-bg {
  width: 100%;
  height: 18px;
  background: var(--therm-bar-bg);
  border: var(--therm-bar-border);
  margin: 6px auto;
  position: relative;
}

.therm-bar-fill {
  height: 100%;
  transition: width 0.5s ease;
  background: linear-gradient(180deg, #ff0000 0%, #ff6600 30%, #ffff00 60%, #00ff00 100%);
}

.therm-bar-fill.fridge {
  background: linear-gradient(180deg, #0044ff 0%, #0088ff 40%, #00ccff 70%, #ffffff 100%);
  box-shadow: 0 0 8px #0088ff;
}

.therm-bar-fill.tent {
  box-shadow: 0 0 8px #ff6600;
}

.therm-bar-fill.common {
  background: linear-gradient(180deg, #ff0000 0%, #ff6600 40%, #ffff00 70%, #00ff00 100%);
  box-shadow: 0 0 8px #00ff44;
}

/* ===== CHART ===== */
.chart-container {
  margin-top: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  height: 60px;
  width: 100%;
  overflow: hidden;
  padding: 3px;
  background: var(--chart-bg);
  border: var(--chart-border);
}

.chart-bar {
  flex: 1;
  max-width: 12px;
  min-width: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.chart-bar.fridge {
  background: linear-gradient(0deg, #0044ff 0%, #00aaff 50%, #ffffff 100%);
}

.chart-bar.tent {
  background: linear-gradient(0deg, #ff4400 0%, #ff8800 50%, #ffcc00 100%);
}

.chart-bar.common {
  background: linear-gradient(0deg, #006600 0%, #00cc00 50%, #ffff00 100%);
}

.chart-bar:hover {
  opacity: 0.8;
  border: 1px solid #fff;
  cursor: help;
}

/* ===== POWER ===== */
.power-cell {
  text-align: center;
  background: linear-gradient(180deg, #002200 0%, #001100 100%) !important;
  border: 3px ridge #00ff44 !important;
}

.power-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.power-stat {
  text-align: center;
  flex: 1;
}

.power-label {
  font-size: 11px;
  color: #66ff66;
  text-shadow: 1px 1px 2px #000;
  margin-bottom: 2px;
}

.power-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: bold;
  color: var(--therm-display);
  text-shadow: var(--therm-display-shadow);
}

.power-bar-bg {
  width: 100%;
  height: 14px;
  background: var(--therm-bar-bg);
  border: var(--therm-bar-border);
  margin: 4px auto 0;
  position: relative;
  max-width: 150px;
}

.power-bar-fill {
  height: 100%;
  transition: width 0.5s ease;
  background: linear-gradient(180deg, #ff0000 0%, #ff6600 30%, #ffff00 60%, #00ff00 100%);
  box-shadow: 0 0 6px #00ff44;
}

#powechart .chart-bar {
  background: linear-gradient(0deg, #006600 0%, #00cc00 50%, #ffff00 100%);
}

/* ===== INFO ===== */
.info-cell {
  font-size: 11px;
}

.info-cell td {
  text-align: center;
  background: var(--info-bg) !important;
}

.status-ok {
  color: var(--status);
  animation: pulse 2s ease-in-out infinite;
}

#last-update {
  color: var(--countdown);
}

/* ===== FOOTER ===== */
.footer-cell {
  text-align: center;
  font-size: 11px;
  background: var(--footer-bg) !important;
  border: var(--footer-border) !important;
}

.footer-cell p {
  margin: 4px 0;
}

.footer-cell a {
  color: var(--link);
  text-decoration: underline;
}

.footer-cell a:hover {
  color: var(--link-hover);
  background: var(--link-hover-bg);
}

.counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #aaaaaa;
}

#visitor-count {
  color: var(--visitor-color);
  font-weight: bold;
  font-size: 14px;
  background: var(--visitor-bg);
  padding: 2px 6px;
  border: 1px inset #555;
}

/* ===== ANIMATIONS ===== */
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes blinkSlow {
  0%, 69% { opacity: 1; }
  70%, 100% { opacity: 0; }
}

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

.blink-slow {
  animation: blinkSlow 3s step-end infinite;
}

.blink-fast {
  animation: blink 1s step-end infinite;
}

/* ===== HR ===== */
hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-color), var(--therm-display), var(--neon-color), transparent);
  margin: 8px 0;
}

/* ===== RESPONSIVE-ish ===== */
@media (max-width: 700px) {
  .neon-text {
    font-size: 22px;
  }
  .beer-answer {
    font-size: 48px;
  }
  .therm-display {
    font-size: 24px;
  }
  .chart-container {
    height: 45px;
  }
  .therm-row td {
    display: block;
    width: 100% !important;
  }
}

/* ===== SPINNING WIZARDS ===== */
.wizard-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
}

.wizard {
  width: 64px;
  height: 64px;
  opacity: 0.35;
  pointer-events: none;
  image-rendering: pixelated;
  animation: wizardSpin 12s linear infinite;
}

@keyframes wizardSpin {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(360deg) scale(1); }
}

/* ===== SPARKLE CURSOR ===== */
.sparkle {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  font-size: 14px;
  line-height: 1;
  animation-fill-mode: forwards;
  visibility: hidden;
  opacity: 0;
}

@keyframes sparkleFade {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.3);
  }
}
