:root {
  --bg: #f3efe4;
  --panel: #fff7e6;
  --ink: #13293d;
  --ink-soft: #32526b;
  --accent: #cc5803;
  --accent-2: #4f6d7a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, #fff2cc 0%, transparent 35%),
    radial-gradient(circle at 85% 80%, #ffd9c2 0%, transparent 42%),
    linear-gradient(135deg, #f3efe4 0%, #e7f0f5 100%);
}

.layout {
  width: min(1100px, 94vw);
  margin: 24px auto;
  display: grid;
  gap: 14px;
}

.topbar {
  background: var(--panel);
  border: 1px solid #ead9b6;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

h1 {
  margin: 0;
  font-size: clamp(1.1rem, 1.6vw, 1.6rem);
  letter-spacing: 0.02em;
}

.controls {
  display: flex;
  gap: 8px;
}

input,
button {
  border-radius: 10px;
  border: 1px solid #d6bf92;
  padding: 10px 12px;
  font-size: 0.95rem;
}

button {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.player-wrap {
  background: #0c1a26;
  border-radius: 16px;
  border: 1px solid #274157;
  overflow: hidden;
  min-height: min(60vh, 680px);
  position: relative;
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #0c1a26;
}

#fallbackFrame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0c1a26;
}

.stats {
  background: var(--panel);
  border-radius: 12px;
  border: 1px solid #ead9b6;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-soft);
  min-height: 52px;
}

@media (max-width: 720px) {
  .controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .controls input,
  .controls button {
    flex: 1 1 100%;
  }
}
