.header {
  display: flex;
  padding: 20px;
  background: #222;
  border-bottom: 2px solid #444;
}

.header-cell {
  text-align: center;
  font-size: 1.2em;
  font-weight: bold;
  color: #888;
}

.header-cell.location {
  flex: 1 1 auto;
  min-width: 0;
}

.header-cell.time {
  flex: 0 0 21%;
}

.header-cell.temp {
  flex: 0 0 16%;
}

.header-cell.wind {
  flex: 0 0 16%;
}

.board-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 8px;
}

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
}

.loader-text {
  font-size: 1.5em;
  color: #888;
}

.start-button {
  padding: 15px 30px;
  font-size: 1.2em;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Share', 'Courier New', monospace;
}

.start-button:hover {
  background: #0052a3;
}

.start-button:disabled {
  background: #444;
  cursor: not-allowed;
}

.row {
  display: flex;
  height: calc((100vh - 200px) / 10);
}

.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  overflow: hidden;
}

.cell.location {
  flex: 1 1 auto;
  min-width: 0;
  color: #00ffff;
  justify-content: flex-start;
}

.cell.time {
  flex: 0 0 21%;
}

.cell.temp {
  flex: 0 0 16%;
}

.cell.wind {
  flex: 0 0 16%;
}

.flap-display {
  display: flex;
  font-size: 2.8em;
  font-weight: bold;
  perspective: 1000px;
}

.digit {
  color: white;
  background: linear-gradient(135deg, #333 0%, #2a2a2a 50%, #1a1a1a 100%);
  position: relative;
  display: inline-block;
  box-sizing: content-box;
  width: 1.4ch;
  height: 1.0em;
  font-family: 'Share', 'Courier New', monospace;
  line-height: 1em;
  text-align: center;
  border-radius: 2px;
  border: 1px solid #404040;
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.2),
    inset -1px -1px 2px rgba(0, 0, 0, 0.5),
    0 4px 10px rgba(0, 0, 0, 0.5);
  margin-right: 0.1em;
  /* will-change removed - applied dynamically only when animating */
  backface-visibility: hidden;
  /* Force GPU compositing with translateZ for layer creation */
  transform: translateZ(0);
  /* Ensure text rendering is optimized */
  -webkit-font-smoothing: antialiased;
}

.hinge {
  width: 100%;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  box-sizing: border-box;
  height: 2px;
  background: linear-gradient(to bottom,
      #444 0%,
      #111 50%,
      #444 100%);
  border-top: 1px solid #555;
  border-bottom: 1px solid #090909;
  box-shadow:
    0 1px 0 #666,
    0 -1px 0 #000,
    inset 0 0.5px 1px rgba(0, 0, 0, 0.8);
}

/* Match the example's flip structure exactly */
.digit {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.digit>div:nth-of-type(2) {
  z-index: 2;
  transform: rotateX(-180deg);
  backface-visibility: hidden;
}

.digit div:nth-of-type(3) {
  z-index: 3;
  backface-visibility: hidden;
}

.digit div {
  position: absolute;
  transform-style: preserve-3d;
  overflow: hidden;
  inset: 0;
  background: linear-gradient(135deg, #333 0%, #2a2a2a 50%, #1a1a1a 100%);
  border: 1px solid #000;
  border-radius: inherit;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.2),
    inset -1px -1px 2px rgba(0, 0, 0, 0.5);
  backface-visibility: hidden;
}

.digit div:nth-of-type(odd) {
  clip-path: polygon(0 0,
      100% 0,
      100% 40%,
      calc(90% + 0.025em) 40%,
      calc(90% + 0.025em) 48%,
      calc(10% - 0.025em) 48%,
      calc(10% - 0.025em) 40%,
      0 40%);
}

.digit div:nth-of-type(even) {
  clip-path: polygon(0 60%,
      calc(10% - 0.025em) 60%,
      calc(10% - 0.025em) 52%,
      calc(90% + 0.025em) 52%,
      calc(90% + 0.025em) 60%,
      100% 60%,
      100% 100%,
      0 100%);
}

/* Temperature colors */
.temp-cold {
  color: #0000ff;
}

/* -40°C and below */
.temp-very-cold {
  color: #0080ff;
}

/* -20°C to -40°C */
.temp-cool {
  color: #00bfff;
}

/* -10°C to -20°C */
.temp-freezing {
  color: #00ffff;
}

/* 0°C to -10°C */
.temp-mild {
  color: #80ff80;
}

/* 10°C to 0°C */
.temp-warm {
  color: #00ff00;
}

/* 20°C to 10°C */
.temp-hot {
  color: #ffff00;
}

/* 30°C to 20°C */
.temp-very-hot {
  color: #ff8000;
}

/* 40°C to 30°C */
.temp-extreme {
  color: #ff4000;
}

/* 50°C to 40°C */
.temp-danger {
  color: #ff0000;
}

/* 50°C and above */

/* Wind colors */
.wind-calm {
  color: #00ff00;
}

/* 0-2 km/h */
.wind-light {
  color: #40ff40;
}

/* 2-5 km/h */
.wind-breeze {
  color: #80ff80;
}

/* 5-10 km/h */
.wind-gentle {
  color: #ffff00;
}

/* 10-15 km/h */
.wind-moderate {
  color: #ffcc00;
}

/* 15-25 km/h */
.wind-fresh {
  color: #ff9900;
}

/* 25-35 km/h */
.wind-strong {
  color: #ff6600;
}

/* 35-50 km/h */
.wind-gale {
  color: #ff3300;
}

/* 50-70 km/h */
.wind-storm {
  color: #ff0066;
}

/* 70-100 km/h */
.wind-hurricane {
  color: #ff00ff;
}

/* 100+ km/h */