html, body {
  height: 100%;
  margin: 0;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(242, 181, 68, 0.18), transparent 60%),
    radial-gradient(800px 520px at 100% 110%, rgba(92, 58, 130, 0.38), transparent 55%),
    #121018;
  color: #241c16;
  font-family: "Malgun Gothic", "Noto Sans KR", sans-serif;
}

button,
input {
  font-family: inherit;
}

#app {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100vh;
  padding: 18px 18px 16px;
}

#brand {
  align-items: baseline;
  color: #f6f1e8;
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
}

#brand strong {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

#brand span {
  color: #d9c7a4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

#panels {
  display: flex;
  flex: 1;
  gap: 18px;
  min-height: 0;
}

#app[data-layout="lobby"] {
  gap: 0;
  padding: 0;
}

#app[data-layout="lobby"] #brand,
#app[data-layout="lobby"] #watch,
#app[data-layout="lobby"] .panel-caption,
#app[data-layout="lobby"] #unity-fullscreen {
  display: none;
}

#app[data-layout="lobby"] #panels {
  gap: 0;
}

#app[data-layout="lobby"] #unity-container {
  border-radius: 0;
  box-shadow: none;
  height: 100%;
  width: 100%;
}

#watch,
#theater-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

#watch {
  flex: 1.5;
  gap: 10px;
}

#theater-panel {
  flex: 1;
  gap: 10px;
}

.panel-caption {
  color: #e7d4ad;
  flex: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin: 0 8px;
}

#youtube-stage,
#watch-controls,
#unity-container {
  box-sizing: border-box;
}

#youtube-stage,
#unity-container {
  background:
    radial-gradient(420px 180px at 50% 0%, rgba(242, 181, 68, 0.08), transparent 70%),
    #0d0b12;
  border-radius: 24px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.32);
}

#youtube-stage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

#youtube-placeholder {
  align-items: center;
  color: #b7adbf;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  justify-content: center;
  position: relative;
  text-align: center;
  z-index: 1;
}

#youtube-mark {
  background: linear-gradient(180deg, #ffe09a, #f2b544);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(242, 181, 68, 0.28);
  height: 18px;
  margin-bottom: 6px;
  transform: rotate(45deg);
  width: 18px;
}

#youtube-placeholder strong {
  color: #f6f1e8;
  font-size: 22px;
  font-weight: 700;
}

#youtube-placeholder span {
  font-size: 14px;
}

#youtube-stage iframe,
#youtube-stage > div:not(#youtube-placeholder) {
  border: 0;
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 2;
}

#watch-controls {
  background: rgba(246, 241, 232, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 14px;
}

#watch-head {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

#watch-kicker {
  color: #9a6a12;
  flex: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

#watch-timeline {
  align-items: center;
  display: flex;
  gap: 10px;
}

#watch-time,
#watch-duration {
  color: #7a7068;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 48px;
  text-align: center;
}

#watch-scrub {
  --progress: 0%;
  appearance: none;
  background: transparent;
  flex: 1;
  height: 22px;
  margin: 0;
}

#watch-scrub::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #e23b3b var(--progress), #eadfce var(--progress));
  border-radius: 999px;
  height: 6px;
}

#watch-scrub::-webkit-slider-thumb {
  appearance: none;
  background: #fff;
  border: 2px solid #e23b3b;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(226, 59, 59, 0.28);
  height: 16px;
  margin-top: -5px;
  width: 16px;
}

#watch-scrub::-moz-range-track {
  background: #eadfce;
  border: 0;
  border-radius: 999px;
  height: 6px;
}

#watch-scrub::-moz-range-progress {
  background: #e23b3b;
  border-radius: 999px;
  height: 6px;
}

#watch-scrub::-moz-range-thumb {
  background: #fff;
  border: 2px solid #e23b3b;
  border-radius: 50%;
  height: 16px;
  width: 16px;
}

#watch-scrub:disabled {
  opacity: 0.45;
}

#watch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#watch-link {
  background: #fff;
  border: 1px solid #eadfce;
  border-radius: 14px;
  color: #241c16;
  flex: 1;
  font-size: 15px;
  min-width: 140px;
  padding: 0 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#watch-link:focus {
  border-color: #f2b544;
  box-shadow: 0 0 0 4px rgba(242, 181, 68, 0.2);
  outline: none;
}

#watch-row button,
#watch-row select,
#unity-fullscreen,
#unity-fullscreen-exit,
#youtube-fullscreen-exit {
  background: #efe4d4;
  border: 0;
  border-radius: 14px;
  color: #241c16;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.15s ease, filter 0.15s ease;
}

#watch-row button {
  min-width: 76px;
  padding: 0 12px;
}

#watch-row button.primary {
  background: linear-gradient(180deg, #ffd36a, #f2b544);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

#watch-captions[data-on="1"] {
  background: #241c16;
  color: #f6f1e8;
}

#watch-row button:hover:not(:disabled),
#unity-fullscreen:hover,
#unity-fullscreen-exit:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

#watch-link,
#watch-row button,
#watch-row select,
#unity-fullscreen,
#unity-fullscreen-exit {
  height: 44px;
}

#watch-rate {
  padding: 0 10px;
}

#watch-volume {
  height: 22px;
  width: 110px;
}

#youtube-fullscreen-exit {
  display: none;
  height: 44px;
  pointer-events: auto;
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 6;
}

#youtube-stage:fullscreen {
  background: #05070d;
  border-radius: 0;
}

#youtube-stage:fullscreen #youtube-fullscreen-exit {
  display: block;
}

#watch-link:disabled,
#watch-row button:disabled,
#watch-row select:disabled,
#watch-volume:disabled {
  cursor: default;
  opacity: 0.42;
}

#watch-status {
  color: #7a7068;
  font-size: 13px;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#unity-container {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

#unity-container:fullscreen,
#unity-container:-webkit-full-screen {
  border-radius: 0;
  height: 100%;
  width: 100%;
}

#unity-canvas {
  display: block;
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

#unity-loading-bar {
  display: none;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
}

#unity-progress-bar-empty {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  width: 180px;
}

#unity-progress-bar-full {
  background: linear-gradient(90deg, #ffe09a, #f2b544);
  height: 100%;
  width: 0;
}

#unity-warning {
  left: 12px;
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 5;
}

#unity-footer {
  display: none;
}

#unity-fullscreen,
#unity-fullscreen-exit {
  backdrop-filter: blur(10px);
  background: rgba(246, 241, 232, 0.9);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  position: absolute;
  right: 14px;
  top: 14px;
  width: 72px;
  z-index: 6;
}

#unity-fullscreen-exit {
  display: none;
}

#unity-container:fullscreen #unity-fullscreen,
#unity-container:-webkit-full-screen #unity-fullscreen {
  display: none;
}

#unity-container:fullscreen #unity-fullscreen-exit,
#unity-container:-webkit-full-screen #unity-fullscreen-exit {
  display: block;
}

@media (max-width: 900px) {
  #app {
    height: auto;
    min-height: 100vh;
  }

  #panels {
    flex-direction: column;
  }

  #youtube-stage,
  #unity-container {
    min-height: 280px;
  }

  #watch-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  #watch-status {
    text-align: left;
    white-space: normal;
  }

  #watch-row {
    flex-wrap: wrap;
  }

  #watch-link {
    flex-basis: 100%;
  }
}
