*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --text: #1a1a1a;
  --muted: #666;
  --border: #e8e8e8;
  --bg: #fafafa;
  --sidebar-width: 260px;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding: 2.5rem 1.75rem;
  border-right: 1px solid var(--border);
  background: #fff;
}

.logo {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.control-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
}

.select:focus {
  outline: 2px solid #943ba4;
  outline-offset: 2px;
}

.slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  border: none;
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  border: none;
  cursor: pointer;
}

.slider:focus {
  outline: 2px solid #943ba4;
  outline-offset: 4px;
}

.btn {
  width: 100%;
  padding: 0.55rem 1.1rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s, opacity 0.15s;
}

.btn:hover:not(:disabled) {
  border-color: #bbb;
}

.btn:focus {
  outline: 2px solid #943ba4;
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.btn-primary:hover:not(:disabled) {
  border-color: #333;
  background: #333;
}

.poster {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 1.5rem;
  overflow: hidden;
}

.stage-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.stage {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  box-shadow: 0 2px 24px rgb(0 0 0 / 0.06);
}

.stage.is-hidden {
  visibility: hidden;
}

.loading {
  position: absolute;
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.loading.is-hidden {
  display: none;
}

@media (max-width: 720px) {
  body {
    overflow: auto;
    height: auto;
    min-height: 100vh;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .poster {
    min-height: 60vh;
    padding: 1rem;
  }
}
