:root {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --border: #243244;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #0f172a, #020617);
  color: var(--text);
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  transition: max-width 0.25s ease;
}

body.cinema .container {
  max-width: 1600px;
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

/* ── 상단 바 + 영화관 모드 토글 ───────────────────────── */
.topbar {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: max-width 0.25s ease;
}

body.cinema .topbar {
  max-width: 1600px;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.cinemaToggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cinemaToggle:hover {
  border-color: var(--accent);
}

.cinemaToggle__icon {
  display: inline-block;
  font-size: 11px;
  transform: translateY(0.5px);
}

body.cinema .cinemaToggle {
  background: var(--accent);
  color: #00111a;
  border-color: var(--accent);
}

/* ── 레이아웃 (기본 = 세로 스택, 영화관 = 좌/우) ─────────── */
.layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body.cinema .layout {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 220px);
  align-items: start;
  gap: 20px;
}

.playerCard {
  margin-bottom: 0;
}

.sidePanel {
  display: contents;
}

body.cinema .sidePanel {
  display: block;
  position: sticky;
  top: 16px;
}

.sideCard {
  margin-bottom: 16px;
}

body.cinema .sideCard {
  margin-bottom: 0;
  padding: 14px;
}

/* ── 영화관 모드에서 우측 패널 폭 압축 ───────────────────── */
body.cinema .sideCard label {
  font-size: 12px;
  margin-bottom: 10px;
}

body.cinema .sideCard input[type="text"] {
  width: 100%;
  padding: 10px 8px;
  font-size: 13px;
}

body.cinema .sideCard .filter-item {
  font-size: 12px;
}

body.cinema .sideCard .actions {
  flex-direction: column;
  gap: 8px;
}

body.cinema .sideCard .directPlay {
  gap: 8px;
}

body.cinema .sideCard .btn-primary,
body.cinema .sideCard .btn-secondary {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
}

.status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
  min-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statusMessage {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statusAction {
  flex: 0 0 auto;
  padding: 0;
  background: transparent;
  color: var(--accent);
  border: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.statusAction:hover {
  color: var(--text);
}

.card {
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.layout .card {
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--muted);
}

input {
  width: 100%;
  margin-top: 8px;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--text);
  outline: none;
}

input:focus {
  border-color: var(--accent);
}

/* ── 입력 칸 + 클리어 버튼 ───────────────────────────── */
.inputWrap {
  position: relative;
  margin-top: 8px;
}

.inputWrap input {
  margin-top: 0;
  padding-right: 36px; /* X 버튼 자리 확보 */
}

.clearBtn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  border: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.clearBtn:hover {
  color: var(--text);
  background: rgba(56, 189, 248, 0.12);
}

.clearBtn[hidden] {
  display: none;
}

body.cinema .sideCard .inputWrap input {
  padding-right: 32px;
}

body.cinema .sideCard .clearBtn {
  right: 6px;
  width: 22px;
  height: 22px;
  font-size: 16px;
}

.directPlay {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.directPlay label {
  margin-bottom: 0;
}

.divider {
  height: 1px;
  margin: 14px 0;
  background: var(--border);
}

.filters {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.filter-item input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.filter-hint {
  color: var(--muted);
  font-size: 12px;
  margin-left: 4px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--accent);
  color: #00111a;
  font-weight: 700;
  cursor: pointer;
}

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

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
}

.playerWrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
