/* PlayMaker — demo pub template for PubMonex Site Engine.
   Layout: article column (max 760px) + sticky 300px sidebar on desktop; single column on mobile. */
:root {
  --ink: #12171d;
  --ink-2: #4b5662;
  --paper: #f5f6f2;
  --surface: #ffffff;
  --line: #dfe3dc;
  --pitch: #17834a;
  --pitch-deep: #0d4d2c;
  --flood: #d8ff3e;
  --gold: #e8a317;
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --pmx-anchor-h: 0px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 18px; line-height: 1.7; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--pitch); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* PubMonex demo strip (not part of the pub template) */
.demo-bar { background: #0c2d48; color: #cfe3ee; font: 500 13px/1.4 var(--body); }
.demo-bar .in { max-width: 1240px; margin: 0 auto; padding: 7px var(--gutter); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.demo-bar b { color: #fff; letter-spacing: .06em; }
.demo-bar .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f97316; margin-right: 6px; vertical-align: 1px; }
.demo-bar button { font: 600 12px var(--body); color: #0c2d48; background: #fff; border: 0; border-radius: 999px; padding: 5px 12px; cursor: pointer; }
@media (max-width: 640px) { .demo-bar .detail { display: none; } }
.demo-bar button span { display: inline-block; min-width: 1.6em; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: #f97316; color: #fff; }

/* Site header */
.site-head { background: var(--ink); color: #fff; }
.site-head .in { max-width: 1240px; margin: 0 auto; padding: 14px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 700 26px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.logo i { width: 30px; height: 30px; border-radius: 50%; background: var(--flood); display: grid; place-items: center; font-style: normal; color: var(--ink); font-size: 17px; }
.site-nav { display: flex; gap: 22px; font: 600 15px var(--body); }
.site-nav a { color: #c9d1d9; text-decoration: none; }
.site-nav a[aria-current] { color: var(--flood); }
@media (max-width: 760px) { .site-nav { display: none; } }

/* Ad slots */
.pmx-ad { margin: 30px auto; text-align: center; min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.pmx-ad::before { content: 'Advertisement'; font: 600 10.5px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: #8a948f; margin-bottom: 6px; }
.pmx-ad > div { max-width: 100%; }
.pmx-ad[data-size]::after { content: attr(data-pos) ' · ' attr(data-size); font: 11px/1 var(--mono); color: #8a948f; margin-top: 6px; }
.pmx-ad.is-empty::after { content: attr(data-pos) ' · no fill'; font: 11px/1 var(--mono); color: #b0786a; margin-top: 6px; }
.pmx-ad--top { margin: 18px auto; min-height: 120px; }
@media (min-width: 768px) { .pmx-ad--top { min-height: 110px; } }
@media (min-width: 1024px) { .pmx-ad--top { min-height: 130px; } }
.top-ad-wrap { background: #eceee8; border-bottom: 1px solid var(--line); padding: 0 var(--gutter); }
.top-ad-wrap .pmx-ad { margin: 0 auto; padding: 12px 0; }

/* Page layout */
.layout { max-width: 1240px; margin: 0 auto; padding: 28px var(--gutter) 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; }
@media (min-width: 1024px) { .layout { grid-template-columns: minmax(0, 760px) 300px; justify-content: center; } }
.sidebar { display: none; }
@media (min-width: 1024px) {
  .sidebar { display: block; }
  .sidebar .sticky { position: sticky; top: 20px; display: grid; gap: 24px; }
  .sidebar .pmx-ad { margin: 0; min-height: 620px; }
}

/* Article */
.crumbs { font: 600 13px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--pitch); margin: 0 0 10px; }
.crumbs a { text-decoration: none; }
h1 { font: 700 clamp(36px, 5.6vw, 58px)/1.02 var(--display); letter-spacing: -.005em; margin: 0 0 14px; text-wrap: balance; text-transform: uppercase; }
.dek { font-size: 21px; line-height: 1.5; color: var(--ink-2); margin: 0 0 18px; max-width: 62ch; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14.5px; color: var(--ink-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; margin-bottom: 22px; }
.byline .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--pitch-deep); color: var(--flood); display: grid; place-items: center; font: 700 15px var(--display); }
.byline b { color: var(--ink); }
.article h2 { font: 700 32px/1.1 var(--display); text-transform: uppercase; margin: 44px 0 12px; text-wrap: balance; }
.article h3 { font: 700 23px/1.2 var(--display); margin: 28px 0 8px; }
.article p { margin: 0 0 18px; }
.article ul { padding-left: 22px; }
.article figure { margin: 30px 0; }
.article figure svg, .article figure img { display: block; width: 100%; border-radius: 10px; }
.article figcaption { font-size: 14.5px; color: var(--ink-2); margin-top: 8px; }
.pull { font: 600 27px/1.25 var(--display); border-left: 4px solid var(--pitch); padding: 4px 0 4px 18px; margin: 30px 0; color: var(--pitch-deep); }

/* Verdict box */
.verdict { background: var(--ink); color: #e9edf1; border-radius: 14px; padding: 26px 24px; margin: 40px 0; display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .verdict { grid-template-columns: 150px minmax(0, 1fr); } }
.score { width: 132px; height: 132px; border-radius: 50%; border: 6px solid var(--flood); display: grid; place-items: center; text-align: center; }
.score b { font: 700 54px/1 var(--display); color: #fff; display: block; }
.score small { font: 600 11px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--flood); }
.verdict h2 { margin: 0 0 6px; color: #fff; font-size: 28px; }
.verdict p { margin: 0 0 14px; color: #c3ccd4; }
.bars { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.bars li { display: grid; grid-template-columns: 110px minmax(0, 1fr) 34px; gap: 10px; align-items: center; font-size: 14.5px; }
.bars .track { display: block; height: 8px; background: #2a333c; border-radius: 99px; overflow: hidden; }
.bars .fill { display: block; height: 100%; background: var(--flood); border-radius: 99px; }
.bars b { font-variant-numeric: tabular-nums; text-align: right; color: #fff; }
.pros-cons { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 6px 0 0; }
.pros-cons div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.pros-cons h3 { margin: 0 0 6px; font-size: 20px; }
.pros-cons ul { margin: 0; padding-left: 20px; font-size: 16.5px; }
.pros h3 { color: var(--pitch); } .cons h3 { color: #b4472b; }

.faq dt { font-weight: 700; margin-top: 16px; }
.faq dd { margin: 4px 0 0; color: var(--ink-2); }

/* Related + sidebar cards */
.related { margin-top: 44px; border-top: 3px solid var(--ink); padding-top: 14px; }
.related h2 { margin-top: 0; }
.card-link { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: center; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-top: 12px; }
.card-link .thumb { aspect-ratio: 16/10; border-radius: 8px; background: linear-gradient(135deg, var(--pitch-deep), var(--pitch)); display: grid; place-items: center; color: var(--flood); font: 700 22px var(--display); }
.card-link b { font: 700 21px/1.15 var(--display); display: block; }
.card-link span { font-size: 14px; color: var(--ink-2); }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; font-size: 15.5px; }
.side-card h3 { font: 700 19px var(--display); text-transform: uppercase; margin: 0 0 8px; }
.side-card ol { margin: 0; padding-left: 20px; }
.side-card a { color: var(--ink); text-decoration: none; }

.site-foot { background: var(--ink); color: #9aa5b0; font-size: 14px; padding: 28px var(--gutter) calc(28px + var(--pmx-anchor-h)); }
.site-foot .in { max-width: 1240px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ---------- PubMonex Player ---------- */
.pmxp { margin: 0 0 26px; }
.pmxp-slot { position: relative; aspect-ratio: 16 / 9; width: 100%; background: #05080b; border-radius: 12px; }
.pmxp-slot::before { content: 'Playing in mini player'; position: absolute; inset: 0; display: grid; place-items: center; color: #6b7681; font: 600 14px var(--body); }
.pmxp-frame { position: absolute; inset: 0; background: #000; border-radius: 12px; overflow: hidden; }
.pmxp-video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.pmxp-ad { position: absolute; inset: 0; }
.pmxp:not(.is-ad) .pmxp-ad { visibility: hidden; pointer-events: none; }
.pmxp-big { position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%; border: 0; background: rgba(216, 255, 62, .95); color: var(--ink); cursor: pointer; display: grid; place-items: center; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.pmxp-big svg { width: 38px; height: 38px; margin-left: 4px; }
.pmxp-unmute { position: absolute; left: 12px; top: 12px; display: flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 6px 12px 6px 8px; background: rgba(0,0,0,.72); color: #fff; font: 600 13px var(--body); cursor: pointer; z-index: 3; }
.pmxp-unmute svg { width: 20px; height: 20px; }
.pmxp-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 26px 12px 10px; background: linear-gradient(transparent, rgba(0,0,0,.8)); color: #fff; opacity: 0; transition: opacity .2s; z-index: 2; }
.pmxp:hover .pmxp-bar, .pmxp-bar:focus-within, .pmxp:not(.is-playing) .pmxp-bar { opacity: 1; }
@media (hover: none) { .pmxp-bar { opacity: 1; } }
.pmxp.is-ad .pmxp-bar, .pmxp.is-ad .pmxp-big { display: none; }
.pmxp.is-ad .pmxp-unmute { top: auto; bottom: 48px; }
.pmxp-btn { width: 34px; height: 34px; border: 0; background: transparent; color: #fff; cursor: pointer; padding: 5px; flex: none; }
.pmxp-btn svg { width: 24px; height: 24px; }
.pmxp-progress { position: relative; flex: 1; height: 6px; border-radius: 99px; background: rgba(255,255,255,.25); cursor: pointer; min-width: 40px; }
.pmxp-buffer, .pmxp-played { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; width: 0; }
.pmxp-buffer { background: rgba(255,255,255,.35); }
.pmxp-played { background: var(--flood); }
.pmxp-time { font: 500 13px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pmxp-close { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.75); color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 5; padding: 4px; }
.pmxp-close svg { width: 18px; height: 18px; }
.pmxp-caption { font-size: 14.5px; color: var(--ink-2); margin: 8px 0 0; }

/* Floating mini-player (PiP) */
.pmxp.is-floating .pmxp-frame {
  position: fixed; inset: auto;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(16px + var(--pmx-anchor-h) + env(safe-area-inset-bottom, 0px));
  width: 380px; height: auto; aspect-ratio: 16 / 9;
  border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.45); z-index: 1000;
  animation: pmxp-pop .22s ease-out;
}
@media (max-width: 767px) {
  .pmxp.is-floating .pmxp-frame { width: min(64vw, 300px); min-width: 256px; bottom: calc(12px + var(--pmx-anchor-h) + env(safe-area-inset-bottom, 0px)); }
  .pmxp.is-floating .pmxp-time { display: none; }
}
@keyframes pmxp-pop { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pmxp.is-floating .pmxp-frame { animation: none; } .pmxp-bar { transition: none; } }

/* Ad event log (demo only) */
.pmxlog { position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(12px + var(--pmx-anchor-h)); width: min(440px, calc(100vw - 24px)); max-height: 46vh; display: flex; flex-direction: column; background: #0b1117; color: #d7dee5; border-radius: 12px; box-shadow: 0 16px 50px rgba(0,0,0,.5); z-index: 1001; font: 12px/1.45 var(--mono); }
.pmxlog header { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #1f2a35; font-family: var(--body); }
.pmxlog header strong { font-size: 14px; color: #fff; }
.pmxlog-mode { color: #8fa1b3; font-size: 12px; margin-right: auto; }
.pmxlog header button { border: 0; background: #1f2a35; color: #fff; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 16px; }
.pmxlog ul { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; }
.pmxlog li { display: grid; grid-template-columns: 44px 72px minmax(0, 1fr); gap: 6px; padding: 3px 12px; }
.pmxlog time { color: #6e7f90; }
.pmxlog b { font-weight: 600; color: #7fd0e4; }
.pmxlog li span { overflow-wrap: anywhere; }
.pmxlog-impression span { color: #d8ff3e; }
.pmxlog-warn span { color: #f5b041; }
.pmxlog-error span { color: #ff7a6b; }
.pmxlog-request span { color: #b9c6d2; }
