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

/* GUI styling */
.lil-gui {
  --background-color: rgba(0, 0, 0, 0.85);
  --font-size: 11px;
  max-height: 90vh;
  overflow-y: auto;
}

.lil-gui.root {
  right: 0;
  left: auto;
}

:root {
  --widget-width: 550px;
  --widget-height: 354px;
  --green: #30d158;
  --green-dim: rgba(48, 209, 88, 0.6);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  background: #d8d4cf;
  min-height: 100vh;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

body.ready {
  opacity: 1;
}

/* ========== GYRO HINT OVERLAY (mobile) ========== */
.gyro-hint {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  opacity: 1;
  transition: opacity 0.4s ease-out;
}

.gyro-hint.dismissing {
  opacity: 0;
  pointer-events: none;
}

.gyro-hint p {
  font-size: 18px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: -0.01em;
  text-align: center;
  padding: 0 40px;
}

/* ========== SCENE ========== */
#scene-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ========== WIDGET ========== */
.widget {
  width: var(--widget-width);
  height: var(--widget-height);
  position: relative;
  border-radius: 32px;
  overflow: hidden;
  box-shadow:
    0 25px 80px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.widget-glass {
  position: absolute;
  inset: 0;
  background: rgba(40, 40, 45, 0.22);
  backdrop-filter: blur(60px) saturate(140%);
  -webkit-backdrop-filter: blur(60px) saturate(140%);
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-radius: 32px;
}

.widget-highlight {
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  z-index: 5;
}

/* ========== LAYOUT ========== */
.widget-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  color: #fff;
}

.widget-left {
  width: 50%;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.widget-right {
  width: 50%;
  padding: 32px 0 0 0;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

/* ========== METRIC (NYC Subway style - 2 sizes only) ========== */
.metric-eyebrow {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #fff;
  margin-bottom: 16px;
}

.metric-value {
  font-size: 72px;
  font-weight: 600;
  letter-spacing: -3px;
  line-height: 0.9;
  color: #fff;
}

/* ========== SPARKLINE ========== */
.sparkline-section {
  margin-top: auto;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Hide the scrim - using mask instead */
.sparkline-scrim {
  display: none;
}

.sparkline {
  width: 100%;
  height: 60px;
  display: block;
  mask-image: linear-gradient(to right, transparent 0%, black 30%, black 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 30%, black 100%);
}

.sparkline-bar {
  fill: var(--green);
  rx: 3;
  ry: 3;
  transition: all 0.3s ease-out;
}

.sparkline-bar-dim {
  fill: var(--green-dim);
  rx: 3;
  ry: 3;
  transition: all 0.3s ease-out;
}

.sparkline-bar.entering {
  animation: barEnter 0.3s ease-out;
}

@keyframes barEnter {
  0% {
    opacity: 0;
    transform: translateX(20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========== ORDER FEED ========== */
.feed-container {
  height: 100%;
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 0%, black 65%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 65%, transparent 100%);
}

.feed-list {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
}

/* Text-based order rows */
.feed-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  opacity: 1;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feed-item:first-child {
  padding-top: 0;
}

.feed-item:last-child {
  border-bottom: none;
}

/* New item animation */
.feed-item.entering {
  animation: slideInFade 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInFade {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Existing items shift down */
.feed-item.shifting {
  animation: shiftDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes shiftDown {
  0% {
    transform: translateY(-56px);
  }
  100% {
    transform: translateY(0);
  }
}

.feed-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feed-name {
  font-size: 18px;
  font-weight: 500;
  color: #fff;
}

.feed-meta {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.35);
}

.feed-amount {
  font-size: 18px;
  font-weight: 500;
  color: #fff;
}

/* Hide the scrim - using mask instead */
.feed-scrim {
  display: none;
}

/* Mask handles fading now - remove nth-child opacity */
