/* Pisarniški TV — 1920x1080, 10-foot UI, Hisense / VIDAA */

/* hidden must win over display:flex/grid set on the same elements */
[hidden],
#start-screen[hidden],
#app[hidden],
#settings[hidden],
#celebrate[hidden],
.toast-reg[hidden],
#toast-buy[hidden],
#yt-placeholder[hidden] {
  display: none !important;
}

body.is-started #start-screen {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #07080c;
  color: #f3efe6;
  font-family: "Trebuchet MS", "Segoe UI", "Arial", sans-serif;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

* {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

#stage-root {
  width: 1920px;
  height: 1080px;
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(212, 168, 72, 0.08), transparent 42%),
    radial-gradient(ellipse at 100% 100%, rgba(40, 90, 130, 0.18), transparent 40%),
    linear-gradient(180deg, #10131a 0%, #0a0c11 100%);
}

/* ——— Start ——— */
#start-screen {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  z-index: 20000;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(212, 168, 72, 0.14), transparent 55%),
    #0a0c11;
}

.start-inner { text-align: center; max-width: 1100px; padding: 40px; }

.start-kicker {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #d4a848;
  font-size: 22px;
  margin-bottom: 18px;
}

#start-screen h1 {
  font-size: 112px;
  line-height: 0.95;
  margin: 0 0 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.start-lead {
  font-size: 32px;
  line-height: 1.4;
  color: #c8c2b4;
  margin: 0 auto 48px;
  max-width: 900px;
}

.btn-start {
  display: inline-block;
  min-width: 420px;
  height: 110px;
  border: 3px solid #d4a848;
  background: #d4a848;
  color: #1a1408;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 12px;
  cursor: pointer;
  outline: none;
  -webkit-animation: pulse 1.8s ease-in-out infinite;
  animation: pulse 1.8s ease-in-out infinite;
}

.btn-start:focus, .btn-start.is-focused {
  box-shadow: 0 0 0 8px rgba(212, 168, 72, 0.45), 0 18px 50px rgba(0,0,0,0.4);
  -webkit-transform: scale(1.04);
  transform: scale(1.04);
}

@-webkit-keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 168, 72, 0.55); }
  50% { box-shadow: 0 0 0 18px rgba(212, 168, 72, 0); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 168, 72, 0.55); }
  50% { box-shadow: 0 0 0 18px rgba(212, 168, 72, 0); }
}

.start-hint {
  margin-top: 36px;
  font-size: 22px;
  color: #8e8878;
}

/* ——— App chrome ——— */
#app {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
}

#topbar {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 88px;
  padding: 0 40px 0 36px;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  z-index: 20;
  background: -webkit-linear-gradient(top, rgba(7,8,12,0.92), rgba(7,8,12,0.55) 70%, transparent);
  background: linear-gradient(180deg, rgba(7,8,12,0.92), rgba(7,8,12,0.55) 70%, transparent);
}

.brand {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
}

.badge {
  display: inline-block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 6px;
  margin-right: 18px;
}

.badge-mock { background: #d4a848; color: #1a1408; }
.badge-live { background: #1fa971; color: #04150e; }
.badge-error { background: #c44b3a; color: #fff; }

.brand-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-right: 18px;
}

.update-meta { font-size: 20px; color: #9a9486; }

.clock { text-align: right; }
#clock-time {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}
#clock-date { font-size: 18px; color: #9a9486; margin-top: 4px; }

#toolbar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1920px;
  height: 92px;
  padding: 0 36px;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  z-index: 20;
  background: -webkit-linear-gradient(bottom, rgba(7,8,12,0.96), rgba(7,8,12,0.72) 70%, transparent);
  background: linear-gradient(0deg, rgba(7,8,12,0.96), rgba(7,8,12,0.72) 70%, transparent);
}

.nav-btn {
  height: 64px;
  margin-right: 16px;
  padding: 0 22px;
  border: 2px solid rgba(243, 239, 230, 0.18);
  background: rgba(20, 23, 32, 0.85);
  color: #f3efe6;
  font-size: 24px;
  font-family: inherit;
  border-radius: 10px;
  cursor: pointer;
  outline: none;
}

.nav-btn .key {
  display: inline-block;
  min-width: 28px;
  margin-right: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(212, 168, 72, 0.2);
  color: #d4a848;
  font-weight: 700;
  font-size: 20px;
}

.nav-btn.is-active {
  border-color: #d4a848;
  background: rgba(212, 168, 72, 0.14);
}

.nav-btn:focus, .nav-btn.is-focused, .toggle-btn:focus, .toggle-btn.is-focused,
.stepper button:focus, .stepper button.is-focused,
.settings input:focus, .settings input.is-focused {
  box-shadow: 0 0 0 6px rgba(212, 168, 72, 0.45);
  border-color: #d4a848;
  -webkit-transform: scale(1.03);
  transform: scale(1.03);
}

.nav-btn-primary {
  background: #d4a848;
  color: #1a1408;
  border-color: #d4a848;
  font-weight: 700;
}

/* ——— Stage / modes ——— */
#stage {
  position: absolute;
  left: 0;
  top: 88px;
  width: 1920px;
  height: 900px;
}

#youtube-pane, #stats-pane {
  position: absolute;
  top: 0;
  height: 900px;
  overflow: hidden;
}

#youtube-pane { background: #000; }
#yt-player, #youtube-pane iframe {
  width: 100%;
  height: 100%;
}

.yt-placeholder {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  font-size: 36px;
  color: #c8c2b4;
  background: #111318;
  text-align: center;
  padding: 40px;
}
.yt-placeholder-sub { font-size: 22px; color: #8e8878; margin-top: 16px; }

#app.mode-split #youtube-pane { left: 0; width: 1100px; }
#app.mode-split #stats-pane { left: 1100px; width: 820px; }

#app.mode-stats #youtube-pane {
  left: 0;
  width: 640px;
  height: 360px;
  opacity: 0;
  filter: alpha(opacity=0);
  pointer-events: none;
}
#app.mode-stats #stats-pane { left: 0; width: 1920px; }

#app.mode-youtube #youtube-pane { left: 0; width: 1920px; }
#app.mode-youtube #stats-pane {
  left: 0;
  width: 1920px;
  opacity: 0;
  filter: alpha(opacity=0);
  pointer-events: none;
}

#app.mode-youtube #topbar,
#app.mode-youtube #toolbar {
  opacity: 1;
}

/* ——— Stats ——— */
#stats-pane {
  padding: 8px 28px 16px 28px;
  background: -webkit-linear-gradient(left, rgba(8,10,14,0.55), rgba(8,10,14,0.92));
  background: linear-gradient(90deg, rgba(8,10,14,0.55), rgba(8,10,14,0.92));
}

#app.mode-stats #stats-pane {
  padding: 8px 48px 16px 48px;
  background: -webkit-linear-gradient(top, rgba(8,10,14,0.4), rgba(8,10,14,0.88));
  background: linear-gradient(180deg, rgba(8,10,14,0.4), rgba(8,10,14,0.88));
}

.kpi-grid {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  height: 280px;
}

#app.mode-stats .kpi-grid { height: 320px; }

.kpi {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  margin-right: 16px;
  padding: 22px 24px 18px;
  background: rgba(20, 24, 34, 0.88);
  border: 1px solid rgba(243, 239, 230, 0.08);
  border-top: 4px solid #d4a848;
  border-radius: 12px;
  min-width: 0;
}
.kpi:last-child { margin-right: 0; }

.kpi-online { border-top-color: #5ec8e8; }
.kpi-ops { border-top-color: #7ee0a8; }
.kpi-reg { border-top-color: #e89ad0; }
.kpi-buy { border-top-color: #d4a848; }

.kpi-label {
  font-size: 18px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9a9486;
  margin-bottom: 10px;
}

.kpi-value {
  font-size: 84px;
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

#app.mode-split .kpi-value { font-size: 64px; }

.kpi-sub {
  margin-top: 8px;
  font-size: 22px;
  color: #c8c2b4;
}

.stats-lower {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  margin-top: 16px;
  height: 560px;
}

#app.mode-split .stats-lower {
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  height: 560px;
}

.panel {
  background: rgba(16, 19, 28, 0.9);
  border: 1px solid rgba(243, 239, 230, 0.07);
  border-radius: 12px;
  padding: 16px 18px 12px;
  overflow: hidden;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9a9486;
  font-weight: 700;
}

#sites-panel { width: 32%; margin-right: 16px; }
#chart-panel { width: 34%; margin-right: 16px; }
#feed-panel { width: 34%; }

#app.mode-split #sites-panel,
#app.mode-split #chart-panel,
#app.mode-split #feed-panel {
  width: auto;
  -webkit-box-flex: 1;
  -webkit-flex: 1 1 100%;
  flex: 1 1 100%;
  margin-right: 0;
  margin-bottom: 12px;
  height: 170px;
}

#app.mode-split #sites-panel { height: 200px; }
#app.mode-split #feed-panel { height: 170px; }

.site-row {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(243, 239, 230, 0.08);
  font-size: 24px;
}

#app.mode-split .site-row { font-size: 20px; padding: 8px 4px; }

.site-name { font-weight: 700; }
.site-metrics { color: #c8c2b4; font-size: 20px; }
.site-metrics span { margin-left: 14px; }

.hourly-chart {
  height: 460px;
  position: relative;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: end;
  -webkit-align-items: flex-end;
  align-items: flex-end;
  padding-top: 28px;
}

#app.mode-split .hourly-chart { height: 110px; padding-top: 8px; }

.bar-col {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  text-align: center;
  height: 100%;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: end;
  -webkit-justify-content: flex-end;
  justify-content: flex-end;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
}

.bar-stack {
  width: 62%;
  max-width: 28px;
  height: 100%;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: end;
  -webkit-justify-content: flex-end;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  background: #d4a848;
  border-radius: 3px 3px 0 0;
  min-height: 0;
}
.bar-reg {
  width: 100%;
  background: #5ec8e8;
  opacity: 0.7;
  margin-bottom: 1px;
}

.bar-col.is-now .bar { background: #f3d48a; }
.bar-label { font-size: 12px; color: #8e8878; margin-top: 6px; }
#app.mode-split .bar-label { font-size: 10px; }

#activity-feed { overflow: hidden; }
.event {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(243, 239, 230, 0.07);
  font-size: 22px;
}
#app.mode-split .event { font-size: 18px; padding: 6px 0; }

.event-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 12px;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}
.event-purchase .event-dot { background: #d4a848; }
.event-registration .event-dot { background: #e89ad0; }
.event-main { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; min-width: 0; }
.event-time { color: #8e8878; margin-left: 10px; white-space: nowrap; }
.event-amount { color: #d4a848; font-weight: 700; }

/* ——— Toasts & celebration ——— */
.toast-reg {
  position: absolute;
  right: 48px;
  top: 110px;
  z-index: 12000;
  min-width: 420px;
  max-width: 640px;
  padding: 22px 28px;
  background: rgba(24, 16, 28, 0.94);
  border-left: 8px solid #e89ad0;
  border-radius: 10px;
  font-size: 28px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
  -webkit-animation: toastIn 0.35s ease-out;
  animation: toastIn 0.35s ease-out;
}

.toast-buy {
  position: absolute;
  left: 50%;
  top: 120px;
  z-index: 12000;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  min-width: 640px;
  padding: 28px 40px;
  background: rgba(28, 22, 12, 0.95);
  border-left: 10px solid #d4a848;
  border-radius: 12px;
  font-size: 34px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,0.5);
}

@-webkit-keyframes toastIn {
  from { opacity: 0; -webkit-transform: translateY(-16px); }
  to { opacity: 1; -webkit-transform: translateY(0); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

#celebrate {
  position: absolute;
  left: 0; top: 0;
  width: 1920px; height: 1080px;
  z-index: 16000;
  background: rgba(4, 5, 8, 0.55);
}

#confetti {
  position: absolute;
  left: 0; top: 0;
  width: 1920px; height: 1080px;
  pointer-events: none;
}

.celebrate-content {
  position: absolute;
  left: 0; top: 0;
  width: 1920px; height: 1080px;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  text-align: center;
  text-shadow: 0 6px 24px rgba(0,0,0,0.65);
  -webkit-animation: popIn 0.45s ease-out;
  animation: popIn 0.45s ease-out;
}

@-webkit-keyframes popIn {
  from { opacity: 0; -webkit-transform: scale(0.86); }
  to { opacity: 1; -webkit-transform: scale(1); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.86); }
  to { opacity: 1; transform: scale(1); }
}

.celebrate-kicker {
  font-size: 36px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: #d4a848;
  margin-bottom: 8px;
}

.celebrate-amount {
  font-size: 220px;
  line-height: 0.9;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #fff8e8;
}

.celebrate-package {
  font-size: 48px;
  margin-top: 18px;
  color: #f3efe6;
}

.celebrate-meta {
  font-size: 34px;
  margin-top: 10px;
  color: #c8c2b4;
}

#celebrate.is-out .celebrate-content {
  -webkit-animation: popOut 0.35s ease-in forwards;
  animation: popOut 0.35s ease-in forwards;
}

@-webkit-keyframes popOut {
  to { opacity: 0; -webkit-transform: scale(1.06); }
}
@keyframes popOut {
  to { opacity: 0; transform: scale(1.06); }
}

/* ——— Settings ——— */
.settings {
  position: absolute;
  left: 0; top: 0;
  width: 1920px; height: 1080px;
  z-index: 15000;
  background: rgba(0,0,0,0.72);
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
}

.settings-card {
  width: 1280px;
  max-height: 1000px;
  overflow: hidden;
  background: #141824;
  border: 1px solid rgba(212, 168, 72, 0.35);
  border-radius: 16px;
  padding: 36px 44px 28px;
}

.settings-card h2 {
  margin: 0 0 8px;
  font-size: 40px;
}

.settings-note, .settings-hint {
  color: #9a9486;
  font-size: 20px;
  margin: 0 0 22px;
}

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a9486;
  margin-bottom: 6px;
}

.settings input {
  width: 100%;
  height: 56px;
  border: 2px solid rgba(243, 239, 230, 0.16);
  background: #0c0e14;
  color: #f3efe6;
  font-size: 24px;
  padding: 0 16px;
  border-radius: 8px;
  font-family: inherit;
  outline: none;
}

.field-row {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  margin: 8px 0 16px;
}

.field-row .field, .field-row .toggle-btn {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  margin-right: 16px;
}
.field-row .field:last-child, .field-row .toggle-btn:last-child { margin-right: 0; }

.stepper {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
}

.stepper button {
  width: 64px;
  height: 56px;
  border: 2px solid rgba(243, 239, 230, 0.16);
  background: #0c0e14;
  color: #f3efe6;
  font-size: 32px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
}

.stepper strong {
  min-width: 140px;
  text-align: center;
  font-size: 28px;
}

.toggle-btn {
  height: 64px;
  border: 2px solid rgba(243, 239, 230, 0.16);
  background: #0c0e14;
  color: #f3efe6;
  font-size: 24px;
  border-radius: 10px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

.toggle-btn[aria-pressed="true"] {
  border-color: #1fa971;
  background: rgba(31, 169, 113, 0.12);
}

.settings-actions {
  margin-top: 16px;
  text-align: right;
}

.settings-hint { margin: 18px 0 0; }
