* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: Arial, sans-serif;
  cursor: none;
  color: #f0c05a;
}

:root {
  --ticker-height: 54px;
  --caption-height: 50px;
  --ticker-offset: 0px;
  --caption-offset: 0px;
  --clock-accent: #d39a28;
  --overlay-green: rgba(3, 54, 55, 0.96);
  --overlay-gold: #e2a839;
}

#kiosk {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

.layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 1;
  transition: opacity var(--transition-duration, 800ms) ease;
}

.layer.active {
  opacity: 1;
  z-index: 2;
}

.media-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#clock-overlay {
  position: absolute;
  top: 54px;
  left: 56px;
  z-index: 110;
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

#clock-time {
  font-size: clamp(38px, 3.6vw, 58px);
  font-weight: 800;
  line-height: 1;
  color: var(--clock-accent);
  font-variant-numeric: tabular-nums;
}

#clock-date {
  margin-top: 12px;
  font-size: clamp(18px, 1.6vw, 30px);
  font-weight: 700;
  color: var(--clock-accent);
  letter-spacing: 0.01em;
}

.layer.slide-in {
  animation: slideIn var(--transition-duration, 800ms) ease forwards;
}

.layer.zoom-in .media-el {
  animation: zoomIn var(--transition-duration, 800ms) ease forwards;
}

.layer.wipe-in {
  animation: wipeIn var(--transition-duration, 800ms) ease forwards;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes zoomIn {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

@keyframes wipeIn {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

#empty-state {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #ddd;
  background: #000;
}

#empty-state.visible {
  display: flex;
}

.empty-title {
  font-size: 44px;
  font-weight: 700;
  margin-bottom: 10px;
}

.empty-subtitle {
  font-size: 22px;
  opacity: 0.85;
}

.bottom-bar {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 90;
  overflow: hidden;
  display: flex;
  align-items: center;
  background: var(--overlay-green);
  color: var(--overlay-gold);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

.bottom-bar.hidden {
  display: none;
}

#photo-caption-bar {
  bottom: var(--ticker-offset);
  min-height: var(--caption-height);
  justify-content: center;
  padding: 8px 36px;
  border-top: 2px solid rgba(255, 255, 255, 0.92);
  border-bottom: 2px solid rgba(255, 255, 255, 0.92);
  font-size: clamp(20px, 1.75vw, 34px);
  font-style: italic;
  font-weight: 700;
  text-align: center;
}

#photo-caption-text {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#lunch-ticker-bar {
  bottom: 0;
  min-height: var(--ticker-height);
  padding: 0 40px;
  border-top: 2px solid rgba(255, 255, 255, 0.92);
}

#lunch-ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 160px;
  min-width: max-content;
  white-space: nowrap;
  will-change: transform;
  animation: tickerScroll var(--ticker-duration, 30s) linear infinite;
}

.ticker-segment {
  display: inline-block;
  min-width: max-content;
  font-size: clamp(22px, 1.9vw, 34px);
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

@keyframes tickerScroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(calc(-50% - 80px), 0, 0); }
}

#progress-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--ticker-offset) + var(--caption-offset));
  height: 3px;
  z-index: 95;
  background: rgba(255, 255, 255, 0.16);
}

#progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #b6862f, #f1bf56);
}

#logo-overlay {
  position: fixed;
  top: 28px;
  right: 36px;
  z-index: 100;
  pointer-events: none;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.6));
}

#logo-image {
  width: var(--logo-size, 180px);
  max-width: 22vw;
  min-width: 95px;
  height: auto;
  display: block;
}

body.orient-portrait #kiosk {
  width: 100vh;
  height: 100vw;
  position: absolute;
  top: calc((100vh - 100vw) / 2);
  left: calc((100vw - 100vh) / 2);
  transform: rotate(90deg);
  transform-origin: center center;
}

body.orient-portrait #clock-overlay {
  top: 44px;
  left: 42px;
}

body.orient-portrait #logo-overlay {
  top: 26px;
  right: 28px;
}
