:root {
  --color-navy: #2d3c4b;
  --color-teal: #51b7c1;
  --color-white: #ffffff;
  --color-text: #414141;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--color-navy);
  color: var(--color-text);
  font-family: 'Open Sans', Arial, sans-serif;
}

body.scrollable {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--color-navy);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-white);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 13px;
  text-decoration: none;
}

.brand-mark {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: block;
}

.menu-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: var(--color-white);
}

.nav-panel {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-navy);
  border-top: 2px solid var(--color-teal);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

@media (min-width: 480px) {
  .nav-panel {
    left: auto;
    min-width: 220px;
  }
}

.nav-panel.open {
  max-height: 220px;
}

.nav-panel a {
  padding: 14px 20px;
  color: var(--color-white);
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-panel a:last-child {
  border-bottom: none;
}

.nav-panel a:hover {
  color: var(--color-teal);
}

main {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

.reel-viewport {
  height: 100%;
  overflow: hidden;
  background: var(--color-navy);
}

.reel {
  height: 100%;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.reel-item {
  height: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.reel-item img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  border-radius: 0;
}

.reel-item.is-final img {
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45), 0 0 0 4px var(--color-teal);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--color-navy);
  color: var(--color-white);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 24px;
  transition: opacity 0.4s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--color-teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.reload-cta {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
}

.reload-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--color-white);
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.reload-arrow {
  display: inline-block;
  animation: reload-bounce 1.4s ease-in-out infinite;
}

@keyframes reload-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

.reload-btn {
  background: var(--color-teal);
  color: var(--color-white);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.reload-btn:hover {
  background: var(--color-white);
  color: var(--color-navy);
}

.site-footer {
  position: relative;
  flex-shrink: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 12px 16px;
  background: var(--color-navy);
  border-top: 2px solid var(--color-teal);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
}

.site-footer-label {
  color: var(--color-teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-footer-links {
  display: flex;
  gap: 18px;
}

.site-footer-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 13px;
}

.site-footer-links a:hover {
  color: var(--color-teal);
}

.empty {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-size: 18px;
  text-align: center;
  padding: 24px;
}
