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

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --accent: #7c6af7;
  --accent2: #f7c56a;
  --text: #e8e8f0;
  --muted: #6b6b80;
  --green: #4ade80;
  --yellow: #facc15;
  --orange: #fb923c;
  --red: #f87171;
  --radius: 16px;
  --font: 'Inter', system-ui, sans-serif;
}

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  user-select: none;
}

#weather-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#kiosk {
  position: relative;
  z-index: 1;
}

/* ── Kiosk display ── */
#kiosk {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  position: relative;
  z-index: 1;
}

#module-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.module-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 12px 32px 20px;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.module-slide > * {
  width: 100%;
  max-width: 900px;
}

.module-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* ── Progress bar ── */
#progress-bar {
  height: 3px;
  background: var(--surface);
  flex-shrink: 0;
}

#progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width linear;
}

/* ── Module dots ── */
#dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  flex-shrink: 0;
}

.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.3s;
}

.dot.active { background: var(--accent); }

/* ── Module header (above content) ── */
.module-header {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.module-tag {
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.module-tag.btc    { color: var(--accent2); }
.module-tag.claude { color: #cc88ff; }

.module-age {
  font-size: 12px;
  color: var(--muted);
}

/* ── Weather module ── */
.weather-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 32px;
  width: 100%;
}

.weather-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 120px;
}

.weather-icon { font-size: clamp(72px, 12vw, 140px); line-height: 1; }

.weather-temp {
  font-size: clamp(64px, 11vw, 130px);
  font-weight: 700;
  letter-spacing: -3px;
  line-height: 1;
}

.weather-temp sup { font-size: .42em; font-weight: 400; vertical-align: super; }

.weather-right {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.5vw, 18px);
}

.weather-desc {
  font-size: clamp(22px, 3.5vw, 52px);
  font-weight: 600;
}

.weather-range {
  font-size: clamp(18px, 2.8vw, 42px);
  color: var(--muted);
}

.weather-meta {
  display: flex;
  gap: clamp(12px, 2.5vw, 36px);
  font-size: clamp(14px, 2vw, 30px);
  color: var(--muted);
}

/* ── Bitcoin module ── */
.btc-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 32px;
  width: 100%;
}

.btc-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.btc-price {
  font-size: clamp(48px, 8vw, 110px);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
}

.btc-change {
  font-size: clamp(18px, 2.8vw, 40px);
  font-weight: 600;
}

.btc-change.up   { color: var(--green); }
.btc-change.down { color: var(--red); }

.btc-chart {
  flex: 1;
  height: 110px;
}

/* ── Claude Usage module ── */
.claude-wrap {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 24px;
  width: 100%;
}

.claude-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.claude-col-title {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

.claude-pct {
  font-size: clamp(40px, 7vw, 90px);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
}

.claude-bar-track {
  width: 100%;
  height: 8px;
  background: #1e1e2e;
  border-radius: 4px;
  overflow: hidden;
}

.claude-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.claude-reset {
  font-size: 16px;
  color: var(--muted);
  margin-top: 2px;
}

.claude-reset span {
  color: var(--text);
  font-weight: 600;
}

.claude-updated {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.claude-extra {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  min-width: 140px;
  gap: 6px;
}

.claude-extra-title {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.claude-extra-val {
  font-size: 28px;
  font-weight: 700;
}

/* ── GTA6 module ── */
.gta6-tag { color: #ff6ec7; }

.gta6-label {
  text-align: center;
  font-size: clamp(11px, 1.6vw, 18px);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.gta6-released {
  text-align: center;
  font-size: clamp(28px, 5vw, 64px);
  font-weight: 700;
  color: #ff6ec7;
}

.gta6-countdown {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: clamp(6px, 1.5vw, 20px);
}

.gta6-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.gta6-num {
  font-size: clamp(32px, 6.5vw, 88px);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
  color: #ff6ec7;
  font-variant-numeric: tabular-nums;
}

.gta6-sub {
  font-size: clamp(9px, 1.2vw, 14px);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.gta6-sep {
  font-size: clamp(24px, 4.5vw, 60px);
  font-weight: 700;
  color: #ff6ec7;
  opacity: 0.5;
  line-height: 1;
  margin-bottom: 14px;
}

/* ── Persona shared ── */
.persona-label {
  text-align: center;
  font-size: clamp(11px, 1.6vw, 18px);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.persona-countdown {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: clamp(6px, 1.5vw, 20px);
}

.persona-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.persona-num {
  font-size: clamp(32px, 6.5vw, 88px);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.persona-sub {
  font-size: clamp(9px, 1.2vw, 14px);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.persona-sep {
  font-size: clamp(24px, 4.5vw, 60px);
  font-weight: 700;
  opacity: 0.5;
  line-height: 1;
  margin-bottom: 14px;
}

/* ── Persona 4 Revival ── */
.p4r-tag  { color: #f5c518; }
.p4r-num  { color: #f5c518; }
.p4r-sep  { color: #f5c518; }
.p4r-released { text-align: center; font-size: clamp(28px, 5vw, 64px); font-weight: 700; color: #f5c518; }

/* ── Persona 6 ── */
.p6-tag { color: #4ade80; }
.p6-platforms {
  text-align: center;
  font-size: clamp(12px, 1.8vw, 20px);
  color: var(--muted);
  letter-spacing: 2px;
  margin-top: 6px;
}

/* ── Admin panel ── */
body.admin-page {
  overflow: auto;
  background: var(--bg);
  padding: 24px 16px;
}

.admin-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--accent);
  letter-spacing: 1px;
}

.module-row {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.module-row label { flex: 1; font-size: 16px; }

.module-row .duration-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.module-row input[type=range] { width: 80px; accent-color: var(--accent); }

.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--muted);
  border-radius: 24px;
  transition: background 0.2s;
  cursor: pointer;
}
.slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle input:checked + .slider { background: var(--accent); }
.toggle input:checked + .slider::before { transform: translateX(20px); }

.section { margin-bottom: 24px; }
.section-title { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }

.global-row {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.global-row label { flex: 1; font-size: 16px; }

.save-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}

.save-btn:active { opacity: 0.8; }

.saved-toast {
  text-align: center;
  color: var(--green);
  font-size: 14px;
  margin-top: 12px;
  opacity: 0;
  transition: opacity 0.3s;
}

.saved-toast.show { opacity: 1; }
