:root{
  --bg:#0B0E14;
  --surface:#151922;
  --surface-hover:#1c212c;
  --ink:#F2EFE9;
  --muted:#8A8F9C;
  --gold:#E0A634;
  --border:#262b38;
}

*{box-sizing:border-box}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:'Inter',system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;
}

/* film-reel perforation edge */
.reel-edge{
  height:14px;
  background-image:radial-gradient(circle, var(--bg) 4px, transparent 4.5px);
  background-size:22px 14px;
  background-color:var(--surface);
}

.site-header{background:var(--surface)}
.header-inner{
  max-width:1080px;
  margin:0 auto;
  padding:2.6rem 1.5rem 2rem;
}
.header-inner h1{
  font-family:'Fraunces',serif;
  font-weight:600;
  font-size:2.1rem;
  margin:0;
  letter-spacing:-.01em;
}
.header-inner .sub{
  color:var(--muted);
  margin:.4rem 0 0;
  font-size:.95rem;
}

.wrap{max-width:1080px;margin:0 auto;padding:2.4rem 1.5rem 4rem}

.notice{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  padding:1.2rem 1.4rem;
  color:var(--muted);
  line-height:1.6;
}
.notice a{color:var(--gold)}
.notice code{color:var(--ink)}

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

.card{
  display:block;
  text-decoration:none;
  color:var(--ink);
  background:var(--surface);
  border-radius:10px;
  overflow:hidden;
  border:1px solid var(--border);
  transition:transform .15s ease, border-color .15s ease;
}
.card:hover{
  transform:translateY(-3px);
  border-color:var(--gold);
}
.card:hover .play-badge{opacity:1}

.thumb{
  position:relative;
  aspect-ratio:16/9;
  background:#000;
  overflow:hidden;
}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.thumb-fallback{
  width:100%;height:100%;
  display:flex;align-items:center;justify-content:center;
  color:var(--muted);font-size:1.8rem;
  background:linear-gradient(135deg, var(--surface), #10131a);
}
.play-badge{
  position:absolute;
  inset:0;
  display:flex;align-items:center;justify-content:center;
  font-size:1.6rem;
  color:var(--gold);
  background:rgba(11,14,20,.35);
  opacity:0;
  transition:opacity .15s ease;
}

.meta{padding:.9rem 1rem 1.1rem}
.meta h2{
  font-family:'Fraunces',serif;
  font-weight:500;
  font-size:1.02rem;
  margin:0 0 .35rem;
  line-height:1.35;
  overflow:hidden;
  text-overflow:ellipsis;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}
.meta .size{color:var(--muted);font-size:.82rem}

.site-footer{margin-top:2rem}

/* ---- player page ---- */
.player-page .player-header{
  max-width:960px;margin:0 auto;padding:1.4rem 1.5rem 0;
}
.player-page .back{
  color:var(--muted);
  text-decoration:none;
  font-size:.9rem;
}
.player-page .back:hover{color:var(--gold)}

.player-wrap{
  max-width:960px;
  margin:0 auto;
  padding:1.2rem 1.5rem 3rem;
}
.player-wrap h1{
  font-family:'Fraunces',serif;
  font-weight:600;
  font-size:1.5rem;
  margin:0 0 1rem;
}
.player-wrap .embed-frame{
  position:relative;
  width:100%;
  padding-top:56.25%; /* 16:9 */
  border-radius:10px;
  background:#000;
  overflow:hidden;
}
.player-wrap .embed-frame iframe{
  position:absolute;
  top:0;left:0;
  width:100%;
  height:100%;
  border:0;
}
.player-wrap .embed-frame:fullscreen,
.player-wrap .embed-frame:-webkit-full-screen,
.player-wrap .embed-frame:-moz-full-screen{
  padding-top:0;
  width:100vw;
  height:100vh;
  border-radius:0;
}
.player-wrap .fs-btn{
  margin-top:.9rem;
  padding:.55rem 1.2rem;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  color:var(--ink);
  font-family:inherit;
  font-size:.88rem;
  cursor:pointer;
}
.player-wrap .fs-btn:hover{border-color:var(--gold);color:var(--gold)}

@media (max-width: 480px){
  .header-inner h1{font-size:1.6rem}
  .grid{grid-template-columns:repeat(auto-fill, minmax(150px, 1fr))}
}

/* ---- admin page ---- */
.admin-page{font-family:'Inter',system-ui,sans-serif}
.admin-header{
  display:flex;align-items:center;justify-content:space-between;
  max-width:900px;margin:0 auto;padding:1.6rem 1.5rem 0;
}
.admin-header h1{font-size:1.3rem;margin:0}
.admin-actions a{color:var(--muted);text-decoration:none;margin-left:1.2rem;font-size:.9rem}
.admin-actions a:hover{color:var(--gold)}

.admin-wrap{max-width:900px;margin:0 auto;padding:1.4rem 1.5rem 4rem;display:flex;flex-direction:column;gap:1.6rem}

.admin-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  padding:1.4rem 1.6rem;
}
.admin-card h2{font-size:1rem;margin:0 0 .8rem;font-weight:600}
.admin-card .hint{color:var(--muted);font-size:.85rem;line-height:1.6;margin:0 0 1rem}

.add-form{display:flex;flex-direction:column;gap:.7rem}
.add-form input{
  padding:.7rem .9rem;border-radius:8px;border:1px solid var(--border);
  background:var(--bg);color:var(--ink);font-family:inherit;font-size:.92rem;
}
.add-form button{
  align-self:flex-start;
  padding:.65rem 1.4rem;border:none;border-radius:8px;
  background:var(--gold);color:#0B0E14;font-weight:600;cursor:pointer;
}

.flash{margin-top:1rem;padding:.7rem .9rem;border-radius:8px;font-size:.88rem}
.flash.ok{background:#1e3324;color:#8fd4a0}
.flash.err{background:#3a1f22;color:#ff9a9a}

.video-table{width:100%;border-collapse:collapse;font-size:.9rem}
.video-table tr{border-top:1px solid var(--border)}
.video-table td{padding:.6rem .4rem;vertical-align:middle}
.video-table .col-thumb img{width:70px;height:40px;object-fit:cover;border-radius:4px;display:block}
.thumb-fallback-sm{width:70px;height:40px;background:#0f1115;border-radius:4px;display:flex;align-items:center;justify-content:center;color:var(--muted)}
.video-table .col-size{color:var(--muted);white-space:nowrap}
.video-table .col-actions{white-space:nowrap;text-align:right}
.video-table .col-actions a{color:var(--gold);text-decoration:none;margin-left:1rem;font-size:.85rem}
.video-table .col-actions a.danger{color:#ff8080}
