/* ── RESET ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f8fafc; color: #1e293b; line-height: 1.5; }
.hidden { display: none !important; }
a { text-decoration: none; color: inherit; }

/* ── BUTTONS ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: none; border-radius: 10px; font-weight: 700; cursor: pointer;
    transition: background 0.18s, transform 0.1s; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-blue  { background: #2563eb; color: #fff; }
.btn-blue:hover { background: #1d4ed8; }
.btn-dark  { background: #0f172a; color: #fff; }
.btn-dark:hover { background: #1e293b; }
.btn-lg    { padding: 14px 36px; font-size: 16px; border-radius: 12px; }
.btn-md    { padding: 9px 20px;  font-size: 14px; }
.btn-sm    { padding: 6px 14px;  font-size: 12px; border-radius: 7px; }
.btn:disabled { background: #94a3b8 !important; cursor: not-allowed; transform: none; }

/* ── AD SLOTS ─────────────────────────────────────────────────────────────── */
.ad-slot {
    background: #f1f5f9; border: 1.5px dashed #cbd5e1; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 4px; overflow: hidden; position: relative;
}
.ad-tag {
    font-size: 9px; font-weight: 800; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.12em;
}
.ad-leader  { width: 100%; min-height: 90px; border-radius: 0; border-left: none; border-right: none; }
.ad-rect    { width: 300px; min-height: 250px; flex-shrink: 0; }
.ad-vert    { width: 100%; flex: 1; min-height: 300px; }
.ad-modal   { width: 100%; min-height: 180px; border-radius: 8px; }

/* ── LANDING — NAV ────────────────────────────────────────────────────────── */
.nav { background: #fff; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 200; }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 22px; font-weight: 900; color: #2563eb; letter-spacing: -0.5px; }

/* ── LANDING — HERO ───────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 90px 24px 64px; max-width: 820px; margin: 0 auto; }
.badge { display: inline-block; background: #dbeafe; color: #1d4ed8; font-size: 12px; font-weight: 800; padding: 5px 16px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 28px; }
.hero h1 { font-size: clamp(36px, 6vw, 68px); font-weight: 900; color: #0f172a; line-height: 1.08; margin-bottom: 20px; }
.hero h1 span { color: #2563eb; }
.hero-sub { font-size: 18px; color: #475569; max-width: 560px; margin: 0 auto 40px; }
.hero-note { margin-top: 16px; font-size: 12px; color: #94a3b8; }

/* ── LANDING — HOW IT WORKS ───────────────────────────────────────────────── */
.how { padding: 72px 24px; background: #fff; border-top: 1px solid #e2e8f0; }
.how h2, .compare h2 { font-size: 30px; font-weight: 900; text-align: center; margin-bottom: 48px; color: #0f172a; }
.steps { display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; max-width: 900px; margin: 0 auto; }
.step { text-align: center; max-width: 180px; }
.step-icon { font-size: 36px; margin-bottom: 12px; }
.step-title { font-size: 15px; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.step-desc  { font-size: 13px; color: #64748b; }

/* ── LANDING — COMPARE ────────────────────────────────────────────────────── */
.compare { padding: 72px 24px; background: #f8fafc; border-top: 1px solid #e2e8f0; }
.compare-inner { max-width: 700px; margin: 0 auto; }
.compare-table { width: 100%; border-collapse: collapse; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.07); background: #fff; }
.compare-table th, .compare-table td { padding: 15px 20px; text-align: left; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.compare-table thead tr { background: #f8fafc; }
.compare-table th { font-weight: 700; color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.hl { background: #eff6ff; color: #1e40af; font-weight: 700; }
.green { color: #16a34a; font-weight: 700; }
.compare-table tr:last-child td { border-bottom: none; }

/* ── LANDING — FOOTER ─────────────────────────────────────────────────────── */
.land-footer { text-align: center; padding: 32px 24px; font-size: 13px; color: #94a3b8; border-top: 1px solid #e2e8f0; background: #fff; }

/* ── UNSUPPORTED SCREEN ───────────────────────────────────────────────────── */
.unsupported-screen { position: fixed; inset: 0; background: #0f172a; display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 24px; }
.unsupported-card { background: #fff; border-radius: 20px; padding: 48px 40px; max-width: 520px; width: 100%; text-align: center; }
.unsupported-card .icon { font-size: 52px; margin-bottom: 16px; }
.unsupported-card h2 { font-size: 26px; font-weight: 900; color: #0f172a; margin-bottom: 12px; }
.unsupported-card p { color: #475569; font-size: 15px; margin-bottom: 20px; line-height: 1.6; }
.req-list { background: #f8fafc; border-radius: 12px; padding: 20px 24px; text-align: left; margin: 0 0 28px; }
.req-list p { font-size: 13px; font-weight: 700; color: #334155; margin-bottom: 10px; }
.req-list li { font-size: 13px; color: #475569; margin-left: 18px; line-height: 2; }

/* ── EDITOR LAYOUT ────────────────────────────────────────────────────────── */
.editor-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: #f1f5f9; }
.editor-header { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 10px 20px; flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; }
.status-row { display: flex; gap: 8px; align-items: center; }
.pill { font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.pill-green { background: #dcfce7; color: #15803d; }
.pill-blue  { background: #dbeafe; color: #1d4ed8; }
.pill-amber { background: #fef3c7; color: #92400e; }

.editor-main { flex: 1; display: flex; overflow: hidden; }
.ad-sidebar { width: 140px; flex-shrink: 0; padding: 8px; display: flex; flex-direction: column; }
@media (max-width: 1100px) { .ad-sidebar { display: none; } }

.centre { flex: 1; display: flex; flex-direction: column; padding: 10px; gap: 10px; overflow-y: auto; min-width: 0; }

/* TOP ROW */
.top-row { display: grid; grid-template-columns: 1fr 190px 270px; gap: 10px; min-height: 360px; flex-shrink: 0; }
@media (max-width: 860px) { .top-row { grid-template-columns: 1fr; min-height: auto; } }

/* PANELS */
.panel { background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.05); display: flex; flex-direction: column; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 13px; border-bottom: 1px solid #f1f5f9; flex-shrink: 0; }
.panel-title { font-size: 10px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: 0.1em; }

/* VIDEO PANEL */
.video-panel { cursor: pointer; background: #0f172a; position: relative; min-height: 280px; }
.upload-zone { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 32px; }
.upload-zone .uicon { font-size: 44px; }
.upload-zone .utitle { color: #94a3b8; font-size: 14px; font-weight: 700; }
.upload-zone .usub   { color: #475569; font-size: 12px; }
.upload-zone .ulimit { color: #64748b; font-size: 11px; background: #1e293b; padding: 4px 10px; border-radius: 6px; }
#videoEl { flex: 1; width: 100%; object-fit: contain; background: #000; display: block; }
.caption-bar { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.82); padding: 10px 16px; min-height: 40px; display: flex; align-items: center; justify-content: center; }
#captionText { color: #fff; font-size: 14px; text-align: center; line-height: 1.4; }

/* TRANSCRIPT */
.transcript-body { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.t-empty { color: #94a3b8; font-size: 12px; padding: 10px 6px; }
.t-item { font-size: 11px; padding: 7px 9px; border-radius: 7px; background: #f8fafc; cursor: pointer; border-left: 3px solid transparent; transition: all 0.15s; }
.t-item:hover { background: #f1f5f9; border-left-color: #93c5fd; }
.t-item.active { background: #eff6ff; border-left-color: #2563eb; }
.t-time { color: #94a3b8; font-size: 10px; margin-bottom: 2px; font-weight: 600; }
.t-text { color: #334155; line-height: 1.4; }

/* GAME */
.game-inner { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; padding: 8px; }
.game-grid { display: grid; grid-template-columns: repeat(4, 54px); grid-template-rows: repeat(4, 54px); gap: 5px; background: #bbada0; padding: 5px; border-radius: 8px; }
.g-tile { width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; border-radius: 4px; font-weight: 900; transition: background 0.1s; }
.game-blur { position: absolute; inset: 0; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); background: rgba(255,255,255,0.86); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; text-align: center; z-index: 5; }
.game-blur h4 { font-size: 14px; font-weight: 800; color: #1e293b; }
.game-blur p  { font-size: 11px; color: #64748b; }
.game-score-bar { padding: 5px 12px; font-size: 11px; color: #94a3b8; text-align: right; flex-shrink: 0; }

/* PROGRESS */
.progress-panel { background: #fff; border-radius: 10px; border: 1px solid #e2e8f0; padding: 14px 16px; flex-shrink: 0; }
.progress-label { font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 8px; display: flex; justify-content: space-between; }
.progress-track { background: #f1f5f9; border-radius: 999px; height: 8px; overflow: hidden; }
.progress-fill  { height: 100%; background: linear-gradient(90deg, #2563eb, #60a5fa); border-radius: 999px; width: 0%; transition: width 0.5s ease; }
.progress-pct   { color: #2563eb; }

/* BOTTOM ADS */
.bottom-ad-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; flex-shrink: 0; }

/* EDITOR FOOTER */
.editor-footer { flex-shrink: 0; }

/* ── AD MODAL (30s unskippable) ───────────────────────────────────────────── */
.modal-bg { position: fixed; inset: 0; background: rgba(10,15,28,0.97); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { background: #fff; border-radius: 22px; padding: 36px 32px; max-width: 460px; width: 100%; text-align: center; position: relative; overflow: hidden; }
.modal-progress-bar { position: absolute; top: 0; left: 0; height: 4px; background: #2563eb; transition: width 1s linear; }
.modal-adtag { font-size: 10px; font-weight: 800; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 14px; }
.modal-title { font-size: 22px; font-weight: 900; color: #0f172a; margin-bottom: 6px; }
.modal-sub   { font-size: 13px; color: #64748b; margin-bottom: 4px; }
.modal-timer { font-size: 52px; font-weight: 900; color: #2563eb; line-height: 1; margin: 16px 0 4px; }
.modal-timer-label { font-size: 12px; color: #94a3b8; margin-bottom: 20px; }

/* ── ERROR TOAST ──────────────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #ef4444; color: #fff; padding: 12px 24px; border-radius: 10px; font-size: 13px; font-weight: 600; z-index: 2000; box-shadow: 0 4px 20px rgba(0,0,0,0.2); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.toast.show { opacity: 1; }
