/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: #0f1115; color: #e7e9ee;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: #6aa8ff; text-decoration: none; }
kbd { background: #2a2e36; border: 1px solid #3a3f49; border-radius: 4px;
  padding: 1px 6px; font-size: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
h1, h2 { font-weight: 600; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px; border-radius: 8px; background: #1f242d; color: #e7e9ee;
  border: 1px solid #2c323d; cursor: pointer; font-size: 14px; user-select: none; }
.btn:hover { background: #262c37; }
.btn.primary { background: #3460ff; border-color: #3460ff; color: white; }
.btn.primary:hover { background: #2a52e0; }
.btn.warn { background: #b8431f; border-color: #b8431f; color: white; }
.btn.warn:hover { background: #9c3818; }
.btn.warn.active { background: #ff6633; border-color: #ff6633; }
.btn.big { padding: 12px 22px; font-size: 16px; }
.upload-btn { cursor: pointer; }

/* ---------- landing ---------- */
.landing { display: grid; place-items: center; min-height: 100vh; padding: 40px; }
.landing-card { max-width: 640px; background: #161a22; border: 1px solid #232934;
  padding: 36px; border-radius: 14px; }
.landing-card h1 { margin: 0 0 8px; font-size: 28px; }
.landing-actions { display: flex; gap: 12px; margin: 22px 0; flex-wrap: wrap; }
.howto { color: #b5bac4; padding-left: 22px; line-height: 1.6; }
.note { color: #8a90a0; font-size: 13px; margin-top: 16px; }
code { background: #11141a; padding: 1px 6px; border-radius: 4px; }

/* ---------- control panel layout ---------- */
.control { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.topbar { display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid #1d222b; background: #12161e; }
.brand { font-weight: 600; letter-spacing: 0.2px; }
.topbar-actions { display: flex; gap: 8px; }

.layout { display: grid; grid-template-columns: 240px 1fr 320px; flex: 1;
  min-height: 0; }
.layout > * { min-height: 0; overflow: auto; padding: 14px 16px;
  border-right: 1px solid #1d222b; }
.layout > *:last-child { border-right: none; }

.layout h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em;
  color: #8a90a0; margin: 0 0 12px; }

/* ---------- deck list ---------- */
.deck-list { list-style: none; padding: 0; margin: 0; display: flex;
  flex-direction: column; gap: 4px; }
.deck-list li { display: flex; justify-content: space-between; align-items: center;
  gap: 6px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; }
.deck-list li:hover { background: #181d26; }
.deck-list li.active { background: #1c2434; border-color: #2a3a5a; }
.deck-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-count { color: #8a90a0; font-size: 12px; }
.deck-del { background: transparent; border: 0; color: #8a90a0; cursor: pointer;
  font-size: 16px; padding: 0 4px; }
.deck-del:hover { color: #ff6e6e; }

.upload-status { margin-top: 14px; font-size: 12px; color: #b5bac4;
  background: #11141a; padding: 8px 10px; border-radius: 8px; white-space: pre-wrap; }

/* ---------- slide grid ---------- */
.slides-header { display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 12px; }
.slides-header h2 { margin: 0; color: #e7e9ee; text-transform: none;
  letter-spacing: 0; font-size: 16px; }
.hint { color: #8a90a0; font-size: 12px; }

.slide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; }
.slide-tile { position: relative; background: #161a22; border: 2px solid #232934;
  border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 16 / 9; }
.slide-tile img { width: 100%; height: 100%; object-fit: contain; background: black; }
.slide-tile:hover { border-color: #3a4a6a; }
.slide-tile.live { border-color: #ff6633; box-shadow: 0 0 0 2px rgba(255,102,51,.3); }
.slide-tile .idx { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.6);
  color: white; font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.slide-tile.live::after { content: "LIVE"; position: absolute; right: 6px; top: 6px;
  background: #ff6633; color: white; font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px; letter-spacing: 0.05em; }

.empty-state { color: #8a90a0; padding: 40px 0; text-align: center; }

/* ---------- live preview ---------- */
.live-preview { background: black; border-radius: 8px; aspect-ratio: 16 / 9;
  display: grid; place-items: center; overflow: hidden; }
.live-preview img { width: 100%; height: 100%; object-fit: contain; }
.live-empty { color: #5e6470; font-size: 13px; }
.live-meta { margin-top: 10px; font-size: 12px; color: #8a90a0; }

/* ---------- projector ---------- */
.projector { background: black; cursor: none; }
.stage { position: fixed; inset: 0; display: grid; place-items: center;
  background: black; }
#slide { max-width: 100%; max-height: 100%; display: none; }
#slide.visible { display: block; }
.placeholder { color: #555; text-align: center; }
.placeholder-title { font-size: 36px; font-weight: 600; }
.placeholder-sub { margin-top: 8px; color: #888; }
.placeholder-hint { margin-top: 24px; color: #666; font-size: 13px; }
.placeholder kbd { background: #222; border-color: #333; color: #ccc; }
.blackout { position: fixed; inset: 0; background: black; z-index: 10; }
