:root {
  color-scheme: dark;
  font-family: Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: #121212;
  color: #f4f4f4;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

button,
input,
select,
textarea {
  font: inherit;
}

.sidebar {
  border-right: 1px solid #2b2b2b;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #181818;
}

.brand {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
}

.sidebar button,
#more {
  border: 1px solid #3a3a3a;
  background: #242424;
  color: #fff;
  min-height: 38px;
  border-radius: 6px;
  cursor: pointer;
}

.sidebar button:hover,
#more:hover,
.card:hover {
  border-color: #ff3157;
}

form {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

input,
select,
textarea {
  background: #101010;
  color: #fff;
  border: 1px solid #333;
  border-radius: 6px;
  min-height: 36px;
  padding: 0 10px;
}

textarea {
  width: 100%;
  min-height: 120px;
  box-sizing: border-box;
  padding: 10px;
}

main {
  min-width: 0;
  padding: 20px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h1 {
  font-size: 24px;
  margin: 0 0 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.card {
  display: grid;
  grid-template-rows: 230px auto auto;
  text-align: left;
  color: #fff;
  background: #1d1d1d;
  border: 1px solid #2d2d2d;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
}

.card img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  background: #2a2a2a;
}

.card-title {
  font-weight: 700;
  padding: 10px 10px 4px;
}

.card-subtitle {
  color: #aaa;
  padding: 0 10px 12px;
  font-size: 13px;
}

#more {
  width: 100%;
  margin-top: 18px;
}

.player-layer {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 30;
  width: min(860px, calc(100vw - 40px));
  transform: translate(-50%, -50%);
  background: #0b0b0b;
  border: 1px solid #303030;
  border-radius: 8px;
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.58);
  overflow: hidden;
}

.player-layer[hidden] {
  display: none !important;
}

.player-layer.expanded {
  inset: 28px;
  width: auto;
  transform: none;
  display: grid;
  grid-template-rows: auto 1fr;
}

.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  background: #171717;
  border-bottom: 1px solid #2a2a2a;
}

#playerInfo {
  color: #d8d8d8;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.player-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.player-actions button {
  border: 1px solid #3a3a3a;
  background: #242424;
  color: #fff;
  min-height: 30px;
  border-radius: 6px;
  cursor: pointer;
  padding: 0 9px;
  font-size: 13px;
}

video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 94px);
  background: #000;
}

.player-layer.expanded video {
  height: 100%;
  aspect-ratio: auto;
}

@media (max-width: 760px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    border-right: 0;
    border-bottom: 1px solid #2b2b2b;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .card {
    grid-template-rows: 190px auto auto;
  }

  .card img {
    height: 190px;
  }

  .player-layer {
    left: 10px;
    right: 10px;
    top: 50%;
    width: auto;
    transform: translateY(-50%);
  }

  .player-layer.expanded {
    inset: 10px;
    transform: none;
  }
}
