:root {
  color-scheme: dark;
  --bg: #0b0f17;
  --panel: #131a26;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --accent: #6366f1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", sans-serif;
}

.view[hidden] { display: none !important; }

#login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 280px;
}

#login-form h1 { font-size: 18px; margin: 0 0 8px; }

#login-form input,
#login-form button {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
}

#login-form button {
  background: var(--accent);
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.error { color: #ef4444; font-size: 13px; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

header h1 { font-size: 18px; margin: 0; }

#search-input {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  width: 220px;
}

#tabs { display: flex; gap: 8px; padding: 0 20px 12px; }

.tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
}

.tab.active { background: var(--accent); color: white; border-color: transparent; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 0 20px 40px;
}

.card {
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
}

.thumb { aspect-ratio: 16 / 9; background: #1e293b; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-placeholder { width: 100%; height: 100%; }

.card-title {
  padding: 10px 12px 2px;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-date { padding: 0 12px 10px; font-size: 12px; color: var(--text-dim); }

.empty { text-align: center; color: var(--text-dim); padding: 40px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal[hidden] { display: none; }

.modal-content {
  width: min(900px, 92vw);
  background: var(--panel);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

#player-video { width: 100%; max-height: 70vh; display: block; background: black; }

.player-info {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-info h2 { font-size: 15px; margin: 0; }

.download-button {
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
}

.close-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 18px;
  cursor: pointer;
}
