/* ktech.games public theme: dark, teal accents, Steam/itch-style layout. */
:root {
  --bg: #0b1013;
  --bg-1: #11181c;
  --bg-2: #172126;
  --bg-3: #1e2b32;
  --border: #243239;
  --text: #dde7ea;
  --muted: #8d9fa6;
  --accent: #2ec4b6;
  --accent-2: #5ee0d3;
  --accent-dark: #0f6f67;
  --accent-soft: rgba(46, 196, 182, 0.13);
  --warn: #e3b341;
  --radius: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); color-scheme: dark; }
body {
  margin: 0;
  font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(46, 196, 182, 0.10), transparent 70%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; padding-bottom: 64px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
img, video, iframe { max-width: 100%; display: block; border: 0; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h2 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.lead { font-size: 1.12rem; color: var(--muted); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.icon { width: 1.05em; height: 1.05em; vertical-align: -0.15em; flex: none; }
[hidden], [data-hidden] { display: none !important; }
section { margin-top: 40px; }

/* ---- top bar ---- */
.topbar { background: rgba(8, 12, 14, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: .02em; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: var(--accent); color: #05201d; font-weight: 900; }
.mainnav { display: flex; gap: 20px; }
.mainnav a { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .85rem; letter-spacing: .08em; }
.mainnav a:hover { color: var(--text); }
.topsearch { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; padding: 0 10px; color: var(--muted); }
.topsearch input { background: none; border: 0; color: var(--text); padding: 8px 0; width: 180px; font: inherit; outline: none; }
.topsearch:focus-within { border-color: var(--accent); }
@media (max-width: 720px) { .topsearch { display: none; } .topbar-inner { gap: 16px; } .mainnav { gap: 14px; } }

.footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: .9rem; background: rgba(0,0,0,.25); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 18px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }

.page-title { margin-top: 32px; font-size: 2rem; }
.section-title { font-size: .9rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.section-head h1, .section-head h2 { margin-bottom: .6em; }
.crumbs { margin: 24px 0 6px; color: var(--muted); font-size: .9rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

/* ---- pills, chips, buttons ---- */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; padding: 2px 9px; border-radius: 4px; background: var(--bg-3); color: var(--text); border: 1px solid transparent; }
a.pill:hover { border-color: var(--accent); color: var(--text); }
.pill-status { background: rgba(227, 179, 65, .14); color: var(--warn); }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 6px; background: var(--bg-3); border: 1px solid var(--border); color: var(--text); font-weight: 600; font: inherit; font-weight: 600; cursor: pointer; text-align: center; }
.btn + .btn { margin-top: 8px; }
.btn:hover { border-color: var(--accent); color: var(--text); }
.btn-inline { display: inline-flex; }
.btn-primary { background: linear-gradient(180deg, var(--accent), #20a397); border-color: transparent; color: #04211e; }
.btn-primary:hover { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #04211e; }
.btn-accent { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn-accent:hover { color: var(--accent-2); }

/* ---- featured carousel ---- */
.featured { margin-top: 32px; position: relative; }
.feature { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); background: var(--bg-1); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); min-height: 340px; }
.feature.is-hidden { display: none; }
.feature-art { display: block; background: var(--bg-2); }
.feature-art img, .feature-art .ph { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.feature-info { padding: 22px; display: flex; flex-direction: column; gap: 12px; background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); }
.feature-info h3 { font-size: 1.6rem; margin: 0; }
.feature-info h3 a { color: var(--text); }
.feature-info p { color: var(--muted); margin: 0; }
.feature-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.feature-shots img { aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; width: 100%; }
.feature-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.carousel-nav { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 12px; }
.dots { display: flex; gap: 6px; }
.dot { width: 22px; height: 8px; border-radius: 3px; border: 0; background: var(--bg-3); cursor: pointer; }
.dot.is-active { background: var(--accent); }
.arrow { background: var(--bg-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; width: 36px; height: 32px; font-size: 1.3rem; cursor: pointer; }
.arrow:hover { border-color: var(--accent); }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } .feature-shots { display: none; } }

/* ---- library ---- */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 18px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; padding: 0 10px; color: var(--muted); flex: 1 1 220px; max-width: 320px; }
.search:focus-within { border-color: var(--accent); }
.search input { background: none; border: 0; color: var(--text); padding: 8px 0; font: inherit; width: 100%; outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.chip:hover { color: var(--text); }
.chip.is-on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; background: var(--bg-1); border-radius: var(--radius); overflow: hidden; color: var(--text); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--accent), var(--shadow); color: var(--text); }
.card-art { aspect-ratio: 16 / 9; background: var(--bg-2); overflow: hidden; }
.card-art img, .card-art .ph { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin: 0 0 4px; font-size: 1.05rem; }
.card-body p { margin: 0 0 10px; color: var(--muted); font-size: .9rem; }
.card-meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.platforms { display: inline-flex; gap: 8px; color: var(--muted); }

/* Placeholder art for games without a cover yet */
.ph { display: grid; place-items: center; padding: 16px; text-align: center; font-weight: 800; font-size: 1.3rem; color: rgba(255,255,255,.85); text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.ph-0 { background: linear-gradient(135deg, #0f6f67, #123a4a); }
.ph-1 { background: linear-gradient(135deg, #1b4d5c, #2a1f4a); }
.ph-2 { background: linear-gradient(135deg, #165a50, #3a4a14); }
.ph-3 { background: linear-gradient(135deg, #24344a, #0f6f67); }
.ph-4 { background: linear-gradient(135deg, #4a2340, #14465a); }
.ph-5 { background: linear-gradient(135deg, #2b3c1d, #145c66); }

/* ---- news ---- */
.newsgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.newscard { display: flex; flex-direction: column; background: var(--bg-1); border-radius: var(--radius); overflow: hidden; color: var(--text); border: 1px solid transparent; }
.newscard:hover { border-color: var(--accent); color: var(--text); }
.newscard-art img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.newscard-body { padding: 14px 16px; }
.newscard-body h3 { margin: 4px 0 6px; font-size: 1.1rem; }
.newscard-body p { color: var(--muted); margin: 0; font-size: .93rem; }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; margin-top: 12px; }
.post h1 { font-size: 2.1rem; margin-top: 6px; }
@media (max-width: 860px) { .post-layout { grid-template-columns: 1fr; } }

/* ---- prose (editor HTML) ---- */
.prose { max-width: 75ch; }
.prose img { border-radius: 6px; margin: 1em 0; height: auto; }
.prose h2, .prose h3 { margin-top: 1.4em; }
.prose blockquote { margin: 1em 0; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--muted); }
.prose code { background: var(--bg-3); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.prose pre { background: var(--bg-2); padding: 12px; border-radius: 6px; overflow: auto; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .25em 0; }

/* ---- game page ---- */
.game-title { font-size: 2.3rem; margin: 0 0 18px; }
.game-top { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
.viewer { min-width: 0; }
.stage { aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; }
.stage img, .stage video, .stage iframe, .stage .ph { width: 100%; height: 100%; object-fit: contain; }
.stage img[data-zoom] { cursor: zoom-in; }
.stage-empty .ph { object-fit: cover; font-size: 2rem; }
.thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.thumb { position: relative; flex: none; width: 120px; aspect-ratio: 16 / 9; padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; background: var(--bg-3); cursor: pointer; color: #fff; opacity: .7; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .icon { position: absolute; inset: 0; margin: auto; width: 28px; height: 28px; filter: drop-shadow(0 1px 3px #000); }
.thumb:hover { opacity: 1; }
.thumb.is-active { border-color: var(--accent); opacity: 1; }

.summary { background: var(--bg-1); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.summary-art { aspect-ratio: 16 / 9; background: var(--bg-2); }
.summary-art img, .summary-art .ph { width: 100%; height: 100%; object-fit: cover; }
.summary-tagline { padding: 14px 16px 0; margin: 0; color: var(--text); }
.summary-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 14px 16px; margin: 0; font-size: .9rem; }
.summary-facts dt { color: var(--muted); text-transform: uppercase; font-size: .75rem; letter-spacing: .06em; padding-top: 2px; }
.summary-facts dd { margin: 0; }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 16px; }
@media (max-width: 960px) { .game-top { grid-template-columns: 1fr; } }

.game-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
.game-main > section:first-child { margin-top: 28px; }
@media (max-width: 960px) { .game-body { grid-template-columns: 1fr; } }

.getbox { background: linear-gradient(135deg, rgba(46,196,182,.16), rgba(46,196,182,.04)); border: 1px solid rgba(46,196,182,.35); border-radius: var(--radius); padding: 18px 20px; }
.btn-play { font-size: 1.1rem; padding: 14px; margin-bottom: 12px; }
.downloads { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.dl { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg-1); border: 1px solid var(--border); border-radius: 6px; color: var(--text); }
.dl:hover { border-color: var(--accent); color: var(--text); }
.dl-icon .icon { width: 26px; height: 26px; color: var(--accent); }
.dl-text { display: flex; flex-direction: column; min-width: 0; }
.dl-text small { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-go { margin-left: auto; color: var(--accent); }

.artgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.artgrid img { width: 100%; border-radius: 6px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.tab { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 8px 14px; font: inherit; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
table.specs { width: 100%; border-collapse: collapse; font-size: .92rem; }
.specs th, .specs td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.specs thead th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .75rem; letter-spacing: .06em; }
.specs tbody th { color: var(--muted); font-weight: 500; width: 140px; }

.latest-change { background: var(--bg-1); border-radius: var(--radius); padding: 16px 18px; }
.timeline-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.version { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--accent-soft); color: var(--accent); padding: 1px 8px; border-radius: 4px; font-size: .9rem; }
.timeline { list-style: none; padding: 0; margin: 24px 0 0; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 28px 22px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg); }

.game-side .panel:first-child { margin-top: 28px; }
.panel { background: var(--bg-1); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.panel h3 { margin: 0 0 10px; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.panel-accent { border: 1px solid rgba(46,196,182,.35); }
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plist .icon { color: var(--accent); margin-right: 6px; }
.linklist { display: flex; flex-direction: column; gap: 6px; }

/* ---- player ---- */
.player-wrap { margin: 12px auto 0; display: flex; flex-direction: column; align-items: center; }
.player { width: 100%; background: #000; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; box-shadow: var(--shadow); }
.player iframe { width: 100%; height: 100%; }
.player-bar { width: 100%; max-width: inherit; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--bg-2); padding: 8px 12px; border-radius: 0 0 var(--radius) var(--radius); }
.player-bar .btn { padding: 6px 12px; }
.player-wrap .player, .player-wrap .player-bar { max-width: var(--player-w, 100%); }

/* ---- press kit ---- */
.press-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
@media (max-width: 860px) { .press-layout { grid-template-columns: 1fr; } }
table.facts { border-collapse: collapse; width: 100%; font-size: .93rem; }
.facts th, .facts td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.facts th { color: var(--muted); font-weight: 500; width: 150px; }
.facts td { word-break: break-word; }
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.asset { background: var(--bg-1); border-radius: var(--radius); overflow: hidden; color: var(--text); border: 1px solid transparent; }
.asset:hover { border-color: var(--accent); color: var(--text); }
.asset img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: repeating-conic-gradient(#1a2328 0 25%, #141c20 0 50%) 0 0 / 16px 16px; }
.asset span { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; font-size: .9rem; }

/* ---- lightbox ---- */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.9); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox img { max-height: 92vh; max-width: 96vw; object-fit: contain; border-radius: 4px; }
.lightbox button { position: absolute; top: 12px; right: 18px; background: none; border: 0; color: #fff; font-size: 2.4rem; cursor: pointer; }

.notfound { text-align: center; padding: 80px 0; }
.notfound h1 { font-size: 5rem; color: var(--accent); margin-bottom: 0; }
@media (max-width: 480px) { .brand-name { display: none; } .mainnav a { font-size: .8rem; } }
.player-wrap + .lead { margin-top: 20px; }

/* ---- accounts, reviews and comments (community.js) ---- */
.account { position: relative; }
.account-btn { padding: 7px 12px; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.account-menu summary { list-style: none; cursor: pointer; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); display: grid; gap: 8px; justify-items: start; }
.account-pop p { margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-align: left; }
.linkbtn:hover { color: var(--accent-2); }
@media (max-width: 720px) { .account { margin-left: auto; } }

.dialog { background: var(--bg-1); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 0; width: min(400px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(0, 0, 0, .7); }
.dialog-form { position: relative; display: grid; gap: 12px; padding: 22px; }
.dialog-form h2, .dialog-form p { margin: 0; }
.dialog-form label { display: grid; gap: 5px; font-size: .9rem; font-weight: 600; }
.dialog-close { position: absolute; top: 8px; right: 12px; background: none; border: 0; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.dialog-close:hover { color: var(--text); }
.dialog-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .9rem; }
.dialog-form input, .post-form textarea { font: inherit; font-weight: 400; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 9px 10px; width: 100%; }
.dialog-form input:focus, .post-form textarea:focus { outline: none; border-color: var(--accent); }
.post-form textarea { resize: vertical; min-height: 80px; }
.form-error, .field-error { color: #ef8a8a; margin: 0; }
.field-error { font-weight: 400; font-size: .85rem; }
.btn:disabled { opacity: .6; cursor: progress; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px); background: var(--bg-3); border: 1px solid var(--accent); border-radius: 6px; padding: 10px 16px; box-shadow: var(--shadow); }

.stars { color: var(--bg-3); letter-spacing: 1px; white-space: nowrap; }
.stars-on { color: var(--warn); }
.starpick { display: flex; gap: 2px; }
.starpick button { background: none; border: 0; padding: 0 2px; font-size: 1.9rem; line-height: 1; color: var(--bg-3); cursor: pointer; }
.starpick button.is-on { color: var(--warn); }
.starpick button:hover, .starpick button:focus-visible { color: var(--accent-2); outline: none; }

.rating-summary { display: flex; flex-wrap: wrap; gap: 14px 36px; align-items: center; margin-bottom: 18px; }
.rating-score { display: grid; justify-items: start; gap: 2px; }
.rating-score strong { font-size: 2.6rem; line-height: 1; }
.rating-bars { display: grid; gap: 4px; flex: 1 1 240px; max-width: 360px; }
.rating-bar { display: grid; grid-template-columns: 34px 1fr 34px; gap: 8px; align-items: center; }
.rating-bar .bar { height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.rating-bar .bar span { display: block; height: 100%; background: var(--warn); }
.summary-facts .stars { font-size: .95rem; }

.post-box { margin-bottom: 18px; }
.post-form { display: grid; gap: 10px; background: var(--bg-1); border-radius: var(--radius); padding: 16px 18px; }
.post-form h3, .post-form p { margin: 0; }
.post-actions { display: flex; align-items: center; gap: 16px; }
.posts { display: grid; gap: 10px; margin-bottom: 14px; }
.post { background: var(--bg-1); border-radius: var(--radius); padding: 14px 18px; }
.post header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.post header .linkbtn { margin-left: auto; font-size: .85rem; }
.post-text { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
