:root{
  --bg1:#0b1020;
  --bg2:#0a2a38;
  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.08);
  --stroke: rgba(255,255,255,0.12);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.70);
  --shadow: 0 20px 60px rgba(0,0,0,0.45);
  --shadow2: 0 12px 30px rgba(0,0,0,0.35);

  --primary:#3dd6ff;
  --accent:#7c5cff;
  --home:#20c997;

  --radius: 18px;
  --radius2: 14px;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(61,214,255,0.20), transparent 60%),
    radial-gradient(900px 600px at 80% 20%, rgba(124,92,255,0.20), transparent 60%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
  overflow-x:hidden;
}

/* Top bar */
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 20px 26px;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  letter-spacing:1px;
  opacity:0.95;
}
.brand .dot{
  width:10px;height:10px;border-radius:999px;
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(61,214,255,0.12);
}
.status{
  padding:10px 14px;
  border:1px solid var(--stroke);
  border-radius:999px;
  background: rgba(255,255,255,0.04);
  box-shadow: var(--shadow2);
  font-weight:700;
}

/* Layout */
.layout{
  display:flex;
  justify-content:center;
  align-items:flex-start;
  gap: 26px;
  padding: 10px 26px 40px;
}

/* Video card */
.video-card{
  width: 420px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), rgba(255,255,255,0.03));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  overflow:hidden;
}

.video-header{
  padding: 18px 18px 12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.badge{
  width:max-content;
  font-size:12px;
  font-weight:800;
  letter-spacing:1px;
  color: rgba(0,0,0,0.85);
  background: linear-gradient(90deg, var(--primary), rgba(61,214,255,0.65));
  padding: 8px 10px;
  border-radius: 999px;
}
.video-header .title{
  font-size:18px;
  line-height:1.4;
  color: var(--text);
  opacity:0.95;
}

.video-frame{
  position:relative;
  margin: 0 14px 14px;
  border-radius: var(--radius2);
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.10);
  box-shadow: var(--shadow2);
  background: rgba(0,0,0,0.25);
}

.video-frame video{
  width:100%;
  height: 640px;
  display:block;
  object-fit: cover;
}

.video-overlay{
  position:absolute;
  left:14px; bottom:14px;
  pointer-events:none;
}
.overlay-chip{
  font-size:12px;
  color: rgba(255,255,255,0.90);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.16);
  padding: 8px 10px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

/* Panel */
.panel{
  width: 260px;
  display:flex;
  flex-direction:column;
  gap: 14px;
}
.panel-card{
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), rgba(255,255,255,0.03));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 16px;
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.panel-foot .mini{
  font-size:12px;
  color: var(--muted);
  text-align:center;
  opacity:0.85;
}

/* Buttons */
.btn{
  position:relative;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  padding: 14px 14px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor:pointer;
  text-decoration:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.25);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease;
  user-select:none;
}
.btn:focus{ outline: none; box-shadow: 0 0 0 4px rgba(61,214,255,0.18), 0 10px 22px rgba(0,0,0,0.25); }
.btn:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
}
.btn:active{
  transform: translateY(0px) scale(0.98);
}

.btn .btn-ic{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  border-radius:10px;
  background: rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.14);
  margin-right:10px;
}
.btn .btn-sub{
  font-size: 11px;
  color: var(--muted);
  margin-left:auto;
  opacity:0.9;
}

.btn-primary{
  background: linear-gradient(180deg, rgba(61,214,255,0.22), rgba(255,255,255,0.04));
  border-color: rgba(61,214,255,0.35);
}
.btn-accent{
  background: linear-gradient(180deg, rgba(124,92,255,0.22), rgba(255,255,255,0.04));
  border-color: rgba(124,92,255,0.35);
}
.btn-home{
  justify-content:center;
  background: linear-gradient(180deg, rgba(32,201,151,0.20), rgba(255,255,255,0.04));
  border-color: rgba(32,201,151,0.35);
  font-weight:700;
}

.nav-row{
  display:flex;
  gap: 12px;
}
.btn-ghost{
  justify-content:center;
  flex:1;
  font-weight:700;
}

.btn.is-disabled{
  opacity:0.45;
  cursor:not-allowed;
  transform:none !important;
}

/* Modal */
.modal{
  position: fixed;
  inset: 0;
  display:none;
  align-items:center;
  justify-content:center;
  z-index: 1000;
}
.modal.is-open{ display:flex; }
.modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(6px);
  opacity:0;
  animation: fadeIn .18s ease forwards;
}
.modal-dialog{
  position:relative;
  width: min(420px, calc(100vw - 48px));
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(20, 24, 44, 0.88);
  box-shadow: var(--shadow);
  overflow:hidden;
  transform: translateY(10px) scale(0.98);
  opacity:0;
  animation: popIn .18s ease forwards;
}
.modal-head{
  padding: 16px 16px 10px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.modal-title{
  font-weight:900;
  letter-spacing:0.5px;
}
.icon-btn{
  border:0;
  background: transparent;
  color: rgba(255,255,255,0.85);
  cursor:pointer;
  font-size:18px;
  padding: 8px 10px;
  border-radius: 12px;
}
.icon-btn:hover{ background: rgba(255,255,255,0.06); }

.modal-body{
  padding: 16px;
  color: rgba(255,255,255,0.90);
  line-height:1.6;
  font-size: 40px;
  font-weight: bold;
  text-align: center;
}
.modal-actions{
  padding: 12px 16px 16px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.modal-body p {
  white-space: pre-line;
}

@keyframes fadeIn{ to{ opacity:1; } }
@keyframes popIn{ to{ opacity:1; transform: translateY(0) scale(1); } }

/* Responsive */
@media (max-width: 860px){
  .layout{ flex-direction:column; align-items:center; }
  .panel{ width: min(420px, 92vw); }
  .video-card{ width: min(420px, 92vw); }
  .video-frame video{ height: 520px; }
}
