:root {
  color-scheme: light;
  --gate-blue: #009fe3;
  --gate-blue-dark: #007eaa;
  --gate-soft: #e8f7fd;
  --ink: #061827;
  --text: #173248;
  --muted: #6b8394;
  --bg: #eef5f8;
  --panel: #ffffff;
  --panel-soft: #f7fbfd;
  --line: #d7e6ee;
  --line-strong: #b8d6e5;
  --danger: #d83b2d;
  --ok: #16a765;
  --warning: #f0a93b;
  --shadow-sm: 0 12px 34px rgba(6, 24, 39, 0.08);
  --shadow: 0 26px 80px rgba(6, 24, 39, 0.14);
  --radius: 8px;
  font-family: Inter, Avenir Next, Segoe UI, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(0, 159, 227, 0.11), rgba(0, 159, 227, 0) 340px),
    #eef5f8;
  color: var(--text);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
.preview,
.media-open {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gate-blue), #24b9f0);
  color: #fff;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(0, 159, 227, 0.22);
}

button:hover,
.preview:hover,
.media-open:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(0, 159, 227, 0.24);
}

button.secondary,
.secondary,
.media-open {
  border-color: #c3e4f2;
  background: #ffffff;
  color: #07516f;
  box-shadow: none;
}

button.danger,
.danger {
  background: var(--danger);
  color: #fff;
}

button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(34px, 3vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.15;
}

h3 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 20px;
}

p {
  color: var(--muted);
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  background:
    linear-gradient(180deg, rgba(0, 159, 227, 0.08), transparent 260px),
    #f4efe7;
  color: #111111;
  box-shadow: 18px 0 60px rgba(6, 24, 39, 0.08);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px 10px 26px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(6, 24, 39, 0.08);
}

.brand-mark img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: #111111;
  font-size: 18px;
}

.brand small {
  color: #111111;
  font-weight: 800;
}

.nav {
  display: grid;
  gap: 9px;
}

.nav-item {
  width: 100%;
  justify-content: flex-start;
  min-height: 48px;
  padding: 12px 14px;
  background: transparent;
  color: #111111;
  text-align: left;
  box-shadow: none;
}

.nav-item:hover,
.nav-item.is-active {
  border: 1px solid rgba(0, 159, 227, 0.28);
  background: #e8f5f9;
  color: #111111;
  box-shadow: inset 4px 0 0 var(--gate-blue);
}

.workspace {
  min-width: 0;
  padding: clamp(18px, 2.2vw, 34px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 92px;
  margin-bottom: 22px;
  padding: 18px 20px;
  border: 1px solid #cfe8f4;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.top-actions,
.button-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.preview-select {
  width: auto;
  min-width: 150px;
  height: 44px;
  background: #fff;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gate-blue-dark);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.content-grid {
  display: grid;
  gap: 18px;
  align-items: start;
  animation: page-in 240ms ease-out both;
}

.content-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-grid.form-and-list {
  grid-template-columns: minmax(360px, 450px) minmax(0, 1fr);
}

.panel,
.stat-card {
  border: 1px solid #d6ebf4;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
}

.panel {
  padding: 22px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e7f3f8;
}

.panel-head p {
  margin-bottom: 0;
  font-size: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--gate-blue);
}

.stat-card span,
label {
  color: #31546b;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1;
}

.stat-warning::before {
  background: var(--warning);
}

.dashboard-warnings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-warning {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid #f4d39a;
  border-left: 5px solid var(--warning);
  border-radius: var(--radius);
  background: #fffaf0;
  box-shadow: var(--shadow-sm);
}

.dashboard-warning strong,
.dashboard-warning span {
  display: block;
}

.dashboard-warning span {
  color: #6b5834;
  font-size: 13px;
  font-weight: 800;
}

.dashboard-warning button {
  grid-row: 1 / span 2;
  grid-column: 2;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 900;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #bfddeb;
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  font-weight: 700;
  line-height: 1.25;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
.preview:focus-visible {
  border-color: var(--gate-blue);
  box-shadow: 0 0 0 4px rgba(0, 159, 227, 0.16);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.upload-box {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #d6ebf4;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8fcfe, #ffffff);
}

.slides-sortable,
.cards-list,
.compact-list {
  display: grid;
  gap: 16px;
}

.slide-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(170px, 240px) minmax(0, 1fr);
  min-height: 152px;
  overflow: hidden;
  border: 1px solid #d6ebf4;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(6, 24, 39, 0.06);
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-card.is-dragging {
  opacity: 0.58;
}

.drag-handle {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #e8f7fd, #d7f0fb);
  color: #007eaa;
  font-size: 20px;
  font-weight: 1000;
  cursor: grab;
}

.thumb {
  display: grid;
  place-items: center;
  min-height: 150px;
  background: #061827 center / cover no-repeat;
  color: var(--gate-blue);
  font-size: 18px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thumb.placeholder {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #d7e9ef, #f6fafc);
}

.thumb.video {
  color: #ffffff;
}

.slide-body {
  min-width: 0;
  padding: 18px 18px 16px;
}

.slide-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.slide-title-row h3 {
  margin: 0 0 8px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #e9faef;
  color: #13824f;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 1000;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid #bfddeb;
  border-radius: var(--radius);
  background: #ffffff;
}

.check-row input {
  width: auto;
  min-height: auto;
  accent-color: var(--gate-blue);
}

.tobi-mini {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: linear-gradient(145deg, #f8d66d, #f7a83b);
  color: #063047;
  box-shadow: 0 12px 24px rgba(6, 24, 39, 0.16);
  font-size: 10px;
  font-weight: 1000;
  animation: tobi-wave 1.9s ease-in-out infinite;
}

.tobi-mini::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 10px;
  width: 17px;
  height: 8px;
  border-radius: 999px;
  background: #f7a83b;
  transform-origin: left center;
  animation: tobi-hand 1.2s ease-in-out infinite;
}

.tobi-bottom-right {
  right: 16px;
  bottom: 16px;
}

.tobi-bottom-left {
  left: 304px;
  bottom: 16px;
}

.tobi-top-right {
  right: 16px;
  top: 16px;
}

.tobi-top-left {
  left: 304px;
  top: 16px;
}

@keyframes tobi-wave {
  50% {
    transform: translateY(-3px);
  }
}

@keyframes tobi-hand {
  50% {
    transform: rotate(-22deg);
  }
}

.empty-state {
  padding: 28px;
  border: 1px dashed #b8d6e5;
  border-radius: var(--radius);
  background: #f9fdff;
  color: var(--muted);
  font-weight: 800;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #bde7cf;
  border-radius: var(--radius);
  background: #eefaf3;
  color: #126b42;
  font-weight: 800;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid #d6ebf4;
  border-radius: var(--radius);
  background: #ffffff;
}

.list-row strong,
.list-row span {
  display: block;
}

.list-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.narrow-panel {
  max-width: 860px;
}

hr {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid #e7f3f8;
}

.table {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-collapse: collapse;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.table th,
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e6f0f5;
  text-align: left;
  vertical-align: top;
}

.login-view,
.park-choice {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(0, 159, 227, 0.14), transparent 46%),
    #f6fbfe;
}

.login-card,
.choice-card {
  width: min(500px, 100%);
  padding: 34px;
  border: 1px solid #cfe8f4;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 34px 92px rgba(0, 159, 227, 0.18);
}

.login-logo {
  display: block;
  width: 178px;
  height: auto;
  margin-bottom: 24px;
}

.park-grid {
  display: grid;
  gap: 12px;
}

.park-tile {
  width: 100%;
  min-height: 70px;
  text-align: left;
}

.muted {
  color: var(--muted);
}

.error {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #ffc7c2;
  border-radius: var(--radius);
  background: #fff1f0;
  color: #8c1d18;
  font-weight: 800;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.media-tile {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 26px rgba(6, 24, 39, 0.06);
}

.media-preview {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  border: 1px solid #d7e6ee;
  background:
    linear-gradient(45deg, #eef6fa 25%, transparent 25%),
    linear-gradient(-45deg, #eef6fa 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef6fa 75%),
    linear-gradient(-45deg, transparent 75%, #eef6fa 75%),
    #ffffff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #061827;
  font-weight: 1000;
}

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

.missing-label {
  display: none;
  color: #8c1d18;
  font-size: 13px;
  font-weight: 1000;
}

.media-preview.is-missing {
  border-color: #ffc7c2;
  background: #fff1f0;
}

.media-preview.is-missing .missing-label {
  display: block;
}

.media-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.media-open {
  display: inline-grid;
  place-items: center;
  text-align: center;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) minmax(180px, 1fr) minmax(180px, 1.1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid #d6ebf4;
  border-radius: var(--radius);
  background: #ffffff;
}

.settings-row label {
  margin: 0;
}

@media (max-width: 1180px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid.two,
  .content-grid.form-and-list,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 14px;
  }

  .topbar,
  .panel-head {
    display: grid;
  }

  .slides-sortable .slide-card {
    grid-template-columns: 34px 104px minmax(0, 1fr);
  }

  .field-grid,
  .nav {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }
}

.player-body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #061827;
}

.player-shell,
.player-slide {
  width: 100vw;
  height: 100vh;
}

.player-loading,
.player-error,
.player-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 6vw;
  background: radial-gradient(circle at 20% 20%, rgba(0, 159, 227, 0.24), transparent 35%), #061827;
  color: #ffffff;
  text-align: center;
}

.player-empty,
.player-error {
  align-content: center;
  gap: 18px;
}

.player-empty p,
.player-overlay p {
  margin: 0;
  color: #27b7ef;
  font-size: clamp(18px, 2vw, 30px);
  font-weight: 1000;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.player-empty h1,
.player-overlay h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(54px, 8vw, 132px);
  line-height: 0.95;
  text-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.player-overlay h2 {
  max-width: 980px;
  margin: 0;
  color: #f2f8fb;
  font-size: clamp(28px, 3.8vw, 62px);
  line-height: 1.12;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

.player-slide {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(0, 159, 227, 0.28), rgba(6, 24, 39, 0.92)),
    #061827;
}

.player-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(6, 24, 39, 0.72), rgba(6, 24, 39, 0.1) 68%, rgba(6, 24, 39, 0.34));
}

.player-overlay {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: clamp(16px, 2vw, 30px);
  width: min(1180px, 72vw);
  min-height: 100%;
  padding: 8vh 7vw;
}

.player-overlay-plain {
  width: min(1320px, 86vw);
}

.player-progress {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  background: rgba(255, 255, 255, 0.18);
}

.player-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: #27b7ef;
  animation: player-progress linear both;
}

.player-tobi {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  width: clamp(112px, 10vw, 170px);
  height: clamp(112px, 10vw, 170px);
  border: 8px solid #ffffff;
  border-radius: 50%;
  background: linear-gradient(145deg, #f8d66d, #f7a83b);
  color: #063047;
  box-shadow: 0 28px 60px rgba(6, 24, 39, 0.32);
  font-size: clamp(18px, 1.6vw, 30px);
  font-weight: 1000;
  animation: tobi-wave 1.9s ease-in-out infinite;
}

.player-tobi::after {
  content: "";
  position: absolute;
  right: -22px;
  top: 30px;
  width: 46px;
  height: 20px;
  border-radius: 999px;
  background: #f7a83b;
  transform-origin: left center;
  animation: tobi-hand 1.2s ease-in-out infinite;
}

.player-tobi-bottom-right {
  right: 5vw;
  bottom: 7vh;
}

.player-tobi-bottom-left {
  left: 5vw;
  bottom: 7vh;
}

.player-tobi-top-right {
  right: 5vw;
  top: 7vh;
}

.player-tobi-top-left {
  left: 5vw;
  top: 7vh;
}

.player-transition-fade {
  animation: player-fade 560ms ease-out both;
}

.player-transition-slide {
  animation: player-slide-in 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.player-transition-zoom {
  animation: player-zoom 680ms ease-out both;
}

.player-transition-wipe {
  animation: player-wipe 620ms ease-out both;
}

@keyframes player-fade {
  from {
    opacity: 0;
  }
}

@keyframes player-slide-in {
  from {
    opacity: 0;
    transform: translateX(34px);
  }
}

@keyframes player-zoom {
  from {
    opacity: 0;
    transform: scale(1.035);
  }
}

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

@keyframes player-progress {
  from {
    transform: scaleX(0);
  }
}
