/* —— Base (full-screen kiosk shell) —— */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: system-ui, "Segoe UI", Roboto, Ubuntu, sans-serif;
  transition: background 0.25s ease, color 0.25s ease;
}

.chrome {
  flex-shrink: 0;
  padding: clamp(0.5rem, 1.5vw, 1rem) clamp(0.75rem, 2vw, 1.5rem);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.top-bar__title {
  margin: 0;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.92;
}

.theme-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: clamp(0.7rem, 1.4vw, 0.85rem);
  opacity: 0.85;
}

.theme-select {
  font: inherit;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  background: color-mix(in srgb, currentColor 8%, transparent);
  color: inherit;
  cursor: pointer;
  max-width: min(100vw - 2rem, 16rem);
}

/* Native <select> lists often ignore inherited colors; keep popups readable. */
[data-theme="nordic"] {
  color-scheme: light;
}

[data-theme="grid"],
[data-theme="column"],
[data-theme="darkroom"],
[data-theme="hero"],
[data-theme="terminal"],
[data-theme="bars"] {
  color-scheme: dark;
}

[data-theme="grid"] .theme-select,
[data-theme="column"] .theme-select,
[data-theme="darkroom"] .theme-select,
[data-theme="hero"] .theme-select,
[data-theme="bars"] .theme-select {
  background-color: rgba(12, 14, 18, 0.95);
  color: inherit;
  border-color: rgba(255, 255, 255, 0.22);
}

[data-theme="grid"] .theme-select option,
[data-theme="column"] .theme-select option,
[data-theme="darkroom"] .theme-select option,
[data-theme="hero"] .theme-select option,
[data-theme="bars"] .theme-select option {
  background-color: #1c1f26;
  color: #e8eaef;
}

.meta {
  margin: 0.35rem 0 0;
  font-size: clamp(0.65rem, 1.2vw, 0.75rem);
  opacity: 0.65;
}

.app-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(0.75rem, 2vw, 1.5rem) clamp(0.75rem, 2vw, 1.5rem);
  overflow: auto;
}

.kiosk-toggle {
  position: fixed;
  right: clamp(0.6rem, 1.4vw, 1rem);
  bottom: clamp(0.6rem, 1.4vw, 1rem);
  z-index: 20;
  font: inherit;
  font-size: clamp(0.68rem, 1.2vw, 0.8rem);
  padding: 0.42rem 0.65rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  background: color-mix(in srgb, currentColor 10%, transparent);
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
}

.kiosk-toggle:hover {
  opacity: 1;
}

body.kiosk-mode .chrome {
  display: none;
}

body.kiosk-mode .app-root {
  padding: 0;
}

body.kiosk-mode .kiosk-toggle {
  opacity: 0.1;
}

body.kiosk-mode .kiosk-toggle:hover {
  opacity: 0.65;
}

.muted {
  opacity: 0.72;
}

.error-msg {
  padding: 1.5rem;
  border-radius: 8px;
  background: color-mix(in srgb, #c00 15%, transparent);
  color: inherit;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.waiting-msg {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  line-height: 1.45;
  opacity: 0.88;
  max-width: 36rem;
  margin: 0 auto;
}

/* —— Theme: default grid (balanced cards) —— */
[data-theme="grid"] {
  background: #0f1419;
  color: #e8eef4;
}

[data-theme="grid"] .chrome {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel--grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: clamp(0.5rem, 1.5vw, 1rem);
  min-height: 0;
}

.zone-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  border-radius: 12px;
  background: linear-gradient(160deg, #1a2332 0%, #121820 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.zone-card__code {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #7eb8ff;
}

.zone-card__city {
  font-size: clamp(0.85rem, 2vw, 1rem);
  opacity: 0.8;
  margin-top: 0.25rem;
}

.zone-card__price--today {
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 700;
  margin-top: 0.75rem;
  line-height: 1.1;
}

.zone-card__tomorrow {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: clamp(0.75rem, 1.8vw, 0.9rem);
}

/* —— Theme: column —— */
[data-theme="column"] {
  background: #1c1c1e;
  color: #f5f5f7;
}

[data-theme="column"] .chrome {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel--column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  justify-content: center;
  max-width: 56rem;
  margin: 0 auto;
  width: 100%;
}

.zone-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  padding: clamp(0.85rem, 2vw, 1.25rem) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.zone-row:last-child {
  border-bottom: none;
}

.zone-row__left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.zone-row__code {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: #a78bfa;
}

.zone-row__city {
  font-size: clamp(0.8rem, 1.8vw, 0.95rem);
  opacity: 0.75;
}

.zone-row__today {
  font-size: clamp(1.35rem, 3.5vw, 2.25rem);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.zone-row__tomorrow {
  font-size: clamp(0.75rem, 1.6vw, 0.88rem);
  opacity: 0.65;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .zone-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .zone-row__today,
  .zone-row__tomorrow {
    text-align: left;
  }
}

/* —— Theme: darkroom —— */
[data-theme="darkroom"] {
  background: #050608;
  color: #eceff4;
}

[data-theme="darkroom"] .chrome {
  border-bottom: 1px solid rgba(94, 129, 172, 0.25);
}

.panel--darkroom.panel--grid {
  gap: clamp(0.4rem, 1vw, 0.75rem);
}

[data-theme="darkroom"] .zone-card {
  background: radial-gradient(ellipse at 30% 0%, #1e2a3a 0%, #0d1117 55%);
  border-color: rgba(94, 129, 172, 0.2);
  border-radius: 4px;
}

[data-theme="darkroom"] .zone-card__code {
  color: #88c0d0;
  font-family: "SF Mono", ui-monospace, monospace;
}

[data-theme="darkroom"] .zone-card__price--today {
  color: #fff;
  text-shadow: 0 0 40px rgba(136, 192, 208, 0.35);
}

/* —— Theme: nordic (light) —— */
[data-theme="nordic"] {
  background: #f4f1ea;
  color: #2c2c2c;
}

[data-theme="nordic"] .chrome {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="nordic"] .theme-select {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.12);
}

.panel--nordic.panel--column {
  gap: 0;
}

[data-theme="nordic"] .zone-row {
  border-bottom-color: rgba(0, 0, 0, 0.08);
  padding-top: clamp(1rem, 2.5vw, 1.5rem);
  padding-bottom: clamp(1rem, 2.5vw, 1.5rem);
}

[data-theme="nordic"] .zone-row__code {
  color: #1a1a1a;
  font-weight: 600;
  letter-spacing: 0.04em;
}

[data-theme="nordic"] .zone-row__today {
  font-weight: 500;
  color: #111;
}

[data-theme="nordic"] .zone-row__tomorrow {
  color: #555;
}

/* —— Theme: hero —— */
[data-theme="hero"] {
  background: linear-gradient(180deg, #0d1321 0%, #1a1525 100%);
  color: #eef0f6;
}

[data-theme="hero"] .chrome {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel--hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2rem);
  max-width: 48rem;
  margin: 0 auto;
  width: 100%;
}

.hero-main {
  text-align: center;
  padding: clamp(1rem, 3vw, 2rem);
}

.hero-main__label {
  font-size: clamp(0.75rem, 1.8vw, 0.9rem);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.65;
}

.hero-main__value {
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 800;
  line-height: 1.05;
  margin-top: 0.35rem;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-main__sub {
  margin-top: 0.5rem;
  font-size: clamp(0.8rem, 1.6vw, 0.95rem);
}

.hero-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
}

@media (max-width: 600px) {
  .hero-strip {
    grid-template-columns: 1fr;
  }
}

.hero-strip__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: clamp(0.65rem, 1.5vw, 0.85rem) clamp(0.85rem, 2vw, 1rem);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: clamp(0.75rem, 1.6vw, 0.9rem);
}

.hero-strip__z {
  opacity: 0.88;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-strip__p {
  font-weight: 600;
  white-space: nowrap;
}

/* —— Theme: terminal —— */
[data-theme="terminal"] {
  background: #0a0c0a;
  color: #33ff66;
}

[data-theme="terminal"] .chrome {
  border-bottom: 1px solid rgba(51, 255, 102, 0.2);
}

[data-theme="terminal"] .top-bar__title,
[data-theme="terminal"] .meta,
[data-theme="terminal"] .theme-label {
  color: #33ff66;
  opacity: 0.9;
}

[data-theme="terminal"] .theme-select {
  background: #0a0c0a;
  border-color: #33ff6644;
  color: #33ff66;
}

.panel--terminal {
  flex: 1;
  margin: 0;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: clamp(0.7rem, 1.8vw, 1rem);
  line-height: 1.55;
  white-space: pre;
  overflow: auto;
  background: #070807;
  border: 1px solid rgba(51, 255, 102, 0.15);
  border-radius: 4px;
  text-shadow: 0 0 12px rgba(51, 255, 102, 0.35);
}

/* —— Theme: bars —— */
[data-theme="bars"] {
  background: #111318;
  color: #e6e8ef;
}

[data-theme="bars"] .chrome {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.panel--bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  max-width: 52rem;
  margin: 0 auto;
  width: 100%;
}

.bar-row__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-bottom: 0.35rem;
}

.bar-row__code {
  font-weight: 800;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: #6ee7b7;
}

.bar-row__city {
  font-size: clamp(0.8rem, 1.8vw, 0.95rem);
  opacity: 0.75;
  flex: 1;
  min-width: 0;
}

.bar-row__price {
  font-size: clamp(1.1rem, 2.8vw, 1.65rem);
  font-weight: 700;
  margin-left: auto;
}

.bar-row__track {
  height: clamp(6px, 1.2vw, 10px);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.bar-row__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399, #6ee7b7);
  transition: width 0.4s ease;
}

.bar-row__tomorrow {
  font-size: clamp(0.7rem, 1.5vw, 0.82rem);
  margin-top: 0.35rem;
}
