/* Xeropen – shared styles (v3) */
:root {
  --ink: #1D2230;
  --night: #12162A;
  --night-2: #1A2040;
  --night-line: #2A3157;
  --blue: #2340C8;
  --blue-deep: #1A2F96;
  --blue-soft: #7F95FF;
  --yellow: #FFE45C;
  --green: #1FA862;
  --mint: #7BE495;
  --muted: #5A6072;
  --paper: #FFFFFF;
  --line: #E3E6EF;
  --soft: #F3F5FC;
  --display: "Archivo", system-ui, sans-serif;
  --body: "Instrument Sans", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--paper); font-size: 17px; line-height: 1.6; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-stretch: 112%; letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-stretch: 108%; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--blue); }
img, svg { max-width: 100%; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1120px, 100% - 40px); margin: 0 auto; }
.narrow { width: min(720px, 100% - 40px); margin: 0 auto; }
section { padding: 64px 0; }
.soft { background: var(--soft); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.hl { background: linear-gradient(transparent 55%, var(--yellow) 55%, var(--yellow) 92%, transparent 92%); padding: 0 .1em; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.wordmark { font-family: var(--display); font-weight: 800; font-stretch: 110%; font-size: 1.45rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.wordmark span { color: var(--blue); }
.wm { font-weight: 800; }
.mark { width: 34px; height: 34px; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 10px; }
.nav a:hover { background: var(--soft); }
.nav a.go { background: var(--ink); color: #fff; }
.nav a.go:hover { background: var(--blue); }

/* Dark "play" pages */
body.night { background: var(--night); color: #E9EBF5; }
.night .site-head { background: rgba(18,22,42,.92); border-bottom-color: var(--night-line); }
.night .wordmark { color: #fff; }
.night .wordmark span { color: var(--yellow); }
.night .nav a { color: #D5D9EC; }
.night .nav a:hover { background: var(--night-2); }
.night .nav a.go { background: var(--yellow); color: var(--ink); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 12px; font-family: var(--body); font-weight: 700; font-size: 1rem; text-decoration: none; border: 2px solid var(--blue); cursor: pointer; line-height: 1.2; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn-yellow { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.btn-yellow:hover { filter: brightness(.95); }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-ghost:hover { background: var(--soft); }
.btn:disabled { opacity: .55; cursor: default; }

/* Footer */
.site-foot { background: var(--night); color: #B9BED4; padding: 48px 0 28px; font-size: .95rem; }
.site-foot a { color: #E9EBF5; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.foot-grid h3 { color: #fff; font-size: .95rem; margin-bottom: 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin-bottom: 7px; }
.foot-brand { font-family: var(--display); font-weight: 800; font-stretch: 110%; font-size: 1.3rem; color: #fff; }
.foot-brand span { color: var(--yellow); }
.foot-free { color: var(--mint); font-weight: 700; margin-top: 10px; }
.foot-base { border-top: 1px solid var(--night-line); margin-top: 28px; padding-top: 16px; font-size: .85rem; color: #8B91AB; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > div:first-child { grid-column: 1 / -1; } }

/* Tables and figures in posts */
.table-scroll { overflow-x: auto; margin: 0 0 1.5em; }
table { border-collapse: collapse; width: 100%; font-size: .97rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); font-family: var(--display); font-weight: 700; }
.post-img { margin: 24px 0 28px; }
.post-img img { width: 100%; height: auto; display: block; border-radius: 14px; border: 1px solid var(--line); background: var(--soft); }
.post-img figcaption { font-size: .88rem; color: var(--muted); margin-top: 8px; text-align: center; }

/* "Free, no ads" badge */
.adfree { display: inline-flex; align-items: center; gap: 6px; background: #E7F6EE; color: #1E6B3E; border: 1px solid #BFE5CE; border-radius: 999px; padding: 4px 12px; font-size: .85rem; font-weight: 700; }
.adfree.dark, .night .adfree { background: rgba(123,228,149,.12); color: var(--mint); border-color: rgba(123,228,149,.35); }

/* Top players lists (games) */
.xb { list-style: none; margin: 0; padding: 0; }
.xb li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 6px; border-top: 1px solid rgba(255,255,255,.08); }
.xb li:first-child { border-top: 0; }
.xb .xb-r { text-align: center; font-family: var(--display); font-weight: 800; color: #8B91AB; }
.xb .xb-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xb .xb-s { font-family: var(--display); font-weight: 800; color: var(--yellow); font-variant-numeric: tabular-nums; }
.xb li.xb-me { background: rgba(255,228,92,.12); border-radius: 8px; }
.xb .xb-empty { display: block; color: #A9AEC6; font-size: .92rem; }

/* Launcher tiles: live previews of each tool (home + tools page) */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile { display: flex; flex-direction: column; text-decoration: none; color: #fff; background: var(--night-2); border: 1px solid var(--night-line); border-radius: 20px; overflow: hidden; transition: transform .18s ease, border-color .18s ease; }
.tile:hover { transform: translateY(-4px); border-color: var(--yellow); }
.tile-view { position: relative; height: 170px; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, #243066 0%, #151A33 70%); }
.tile-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tile-kind { font-size: .82rem; font-weight: 700; color: var(--blue-soft); }
.tile-body h3 { font-size: 1.25rem; font-stretch: 108%; margin: 0; color: #fff; }
.tile-body p { color: #B9BED4; font-size: .95rem; margin: 2px 0 12px; flex: 1; }
.tile-go { align-self: flex-start; background: var(--yellow); color: var(--ink); font-weight: 700; border-radius: 10px; padding: 9px 16px; font-size: .95rem; }
@media (max-width: 860px) { .tiles { grid-template-columns: 1fr; } .tile { flex-direction: row; } .tile-view { width: 38%; height: auto; min-height: 150px; flex: none; } }
@media (max-width: 480px) { .tile-view { width: 34%; } .tile-body { padding: 14px; } .tile-body h3 { font-size: 1.1rem; } }
@media (max-width: 860px) {
  .pv-gauge svg { width: 104px; }
  .pv-stack { transform: translateX(-50%) scale(.82); transform-origin: bottom center; bottom: 50%; margin-bottom: -58px; }
  .pv-arrows { transform: translate(-50%, -50%) scale(.74); }
}
@media (max-width: 480px) {
  .pv-gauge svg { width: 74px; }
  .pv-stack { transform: translateX(-50%) scale(.58); margin-bottom: -41px; }
  .pv-arrows { transform: translate(-50%, -50%) scale(.54); }
}

/* preview 1: speed gauge */
.pv-gauge { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pv-gauge svg { width: 150px; height: auto; overflow: visible; }
.pv-needle { transform-origin: 80px 80px; animation: pv-sweep 5s cubic-bezier(.5,0,.3,1) infinite; }
@keyframes pv-sweep { 0%, 100% { transform: rotate(-80deg); } 35% { transform: rotate(18deg); } 55% { transform: rotate(4deg); } 80% { transform: rotate(62deg); } }
/* preview 2: stacking blocks */
.pv-stack { position: absolute; left: 50%; bottom: 14px; width: 110px; height: 140px; transform: translateX(-50%); }
.pv-stack i { position: absolute; height: 20px; border-radius: 5px; left: 0; }
.pv-stack i:nth-child(1) { bottom: 0; width: 110px; background: #4C66F0; }
.pv-stack i:nth-child(2) { bottom: 22px; width: 96px; left: 8px; background: #6A5CF0; }
.pv-stack i:nth-child(3) { bottom: 44px; width: 84px; left: 12px; background: #8E54E9; }
.pv-stack i:nth-child(4) { bottom: 66px; width: 70px; left: 20px; background: #B14FDD; }
.pv-stack i:nth-child(5) { bottom: 88px; width: 62px; left: 22px; background: #D94FBF; animation: pv-slide 2.6s ease-in-out infinite; }
@keyframes pv-slide { 0% { transform: translate(-80px, -26px); } 45% { transform: translate(60px, -26px); } 70% { transform: translate(0, -26px); } 80%, 100% { transform: translate(0, 0); } }
/* preview 3: arrows escaping */
.pv-arrows { position: absolute; left: 50%; top: 50%; width: 132px; height: 132px; transform: translate(-50%, -50%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pv-arrows i { border-radius: 9px; background: #1F2648; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 800; color: #fff; font-size: 1.2rem; }
.pv-arrows .a { background: #1FA862; animation: pv-out-r 3.6s ease-in infinite; }
.pv-arrows .b { background: #3D5BEA; animation: pv-out-u 3.6s ease-in infinite .9s; }
.pv-arrows .c { background: #E07A1F; animation: pv-out-d 3.6s ease-in infinite 1.8s; }
.pv-arrows .d { background: #6B3FD6; }
@keyframes pv-out-r { 0%, 20% { transform: none; opacity: 1; } 45%, 90% { transform: translateX(160px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes pv-out-u { 0%, 20% { transform: none; opacity: 1; } 45%, 90% { transform: translateY(-160px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes pv-out-d { 0%, 20% { transform: none; opacity: 1; } 45%, 90% { transform: translateY(160px); opacity: 0; } 100% { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pv-needle, .pv-stack i, .pv-arrows i { animation: none !important; }
  .tile { transition: none; }
}
@media (max-width: 640px) {
  section { padding: 44px 0; }
  .site-head .wrap { flex-wrap: wrap; padding: 10px 0; gap: 6px; }
  .nav { width: 100%; gap: 2px; margin-left: -8px; }
  .nav a { font-size: .9rem; padding: 7px 9px; }
}
/* real photos inside posts */
.post-img.real img { max-height: 520px; object-fit: cover; }
.countdown { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 18px; }
.countdown div { background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 14px; min-width: 90px; text-align: center; }
.countdown b { display: block; font-family: var(--display); font-size: 1.7rem; font-stretch: 112%; color: var(--yellow); line-height: 1.1; }
.countdown small { color: #C9CDE0; font-size: .8rem; font-weight: 600; }
.steps-list { counter-reset: st; list-style: none; padding: 0; }
.steps-list li { position: relative; padding: 2px 0 14px 46px; margin: 0; }
.steps-list li::before { counter-increment: st; content: counter(st); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-family: var(--display); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.steps-list b { display: block; }
/* previews for the new games */
.tiles { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pv-word { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; grid-template-columns: repeat(4, 26px); gap: 4px; }
.pv-word i { height: 26px; border-radius: 5px; background: #F3F5FC; color: #12162A; font-style: normal; font-family: var(--display); font-weight: 800; font-size: .9rem; display: flex; align-items: center; justify-content: center; }
.pv-word i.e { background: transparent; }
.pv-word i.a { animation: pv-pop 3.2s infinite; background: #9BE8B4; } .pv-word i.a + i.a { animation-delay: .25s; }
.pv-word i.b { animation: pv-pop 3.2s infinite 1.2s; background: #FFE45C; }
@keyframes pv-pop { 0%, 30% { transform: scale(1); } 38% { transform: scale(1.18); } 46%, 100% { transform: scale(1); } }
.pv-sudoku { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; grid-template-columns: repeat(4, 28px); gap: 2px; background: #8E99CC; border: 2px solid #8E99CC; border-radius: 6px; }
.pv-sudoku i { height: 28px; background: #F6F8FF; color: #12162A; font-style: normal; font-family: var(--display); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.pv-sudoku i.p { color: #2340C8; animation: pv-in 3.6s infinite; } .pv-sudoku i.p:nth-child(6) { animation-delay: .6s; } .pv-sudoku i.p:nth-child(9) { animation-delay: 1.2s; } .pv-sudoku i.p:nth-child(15) { animation-delay: 1.8s; }
@keyframes pv-in { 0%, 15% { opacity: 0; transform: scale(.6); } 25%, 85% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
.pv-xmas { position: absolute; inset: 0; }
.pv-xmas i { position: absolute; top: -30px; font-style: normal; font-size: 1.6rem; animation: pv-fall 2.8s linear infinite; }
.pv-xmas .g1 { left: 28%; } .pv-xmas .g2 { left: 52%; animation-delay: .9s; } .pv-xmas .g3 { left: 70%; animation-delay: 1.8s; }
.pv-xmas b { position: absolute; bottom: 14px; left: 50%; width: 64px; height: 34px; margin-left: -32px; background: #C1121F; border-radius: 4px 4px 30px 30px; border-top: 8px solid #fff; animation: pv-sack 2.8s ease-in-out infinite; }
@keyframes pv-fall { 0% { transform: translateY(0); opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(150px); opacity: 0; } }
@keyframes pv-sack { 0%, 100% { transform: translateX(-30px); } 50% { transform: translateX(30px); } }
@media (max-width: 860px) { .pv-word, .pv-sudoku { transform: translate(-50%, -50%) scale(.8); } }
@media (max-width: 480px) { .pv-word, .pv-sudoku { transform: translate(-50%, -50%) scale(.62); } .pv-xmas i { font-size: 1.2rem; } .pv-xmas b { width: 46px; margin-left: -23px; height: 26px; } }
@media (prefers-reduced-motion: reduce) { .pv-word i, .pv-sudoku i, .pv-xmas i, .pv-xmas b { animation: none !important; } .pv-sudoku i.p { opacity: 1; } }
/* posts that appear on their date */
.rows li[data-date].first { grid-column: 1 / -1; border-top: 0; }
.rows li.first a { grid-template-columns: 1.25fr 1fr; gap: 28px; padding: 6px 0 22px; }
.rows li.first img { border-radius: 18px; }
.rows li.first h3 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); }
.rows li.first p { display: block; -webkit-line-clamp: unset; font-size: 1rem; }
.rows img { aspect-ratio: 1200 / 630; object-fit: cover; }
@media (max-width: 820px) { .rows li.first a { grid-template-columns: 1fr; gap: 12px; } }
.rkf { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; background: var(--night); color: #fff; border-radius: 20px; padding: 24px 26px; }
.rkf .yt { width: 64px; height: 46px; border-radius: 12px; background: #FF0033; display: flex; align-items: center; justify-content: center; }
.rkf .yt span { width: 0; height: 0; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 4px; }
.rkf h2 { color: #fff; margin: 0 0 4px; } .rkf p { color: #C3C8DE; margin: 0; }
.rkf .row { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 760px) { .rkf { grid-template-columns: 1fr; } }

/* ===== v4: scroll motion (motion.js) ===== */
html.mo .rv { opacity: 0; transform: translateY(34px); transition: opacity .75s ease, transform .75s cubic-bezier(.2,.7,.2,1); }
html.mo .rv.in { opacity: 1; transform: none; }
[data-parallax], [data-slide] { will-change: transform; }
@media (prefers-reduced-motion: reduce) { html.mo .rv { opacity: 1; transform: none; transition: none; } }

/* ===== v4: social icons ===== */
.socials { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.soc { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.soc:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.25); text-decoration: none !important; }
.soc svg { width: 22px; height: 22px; }
.soc.yt { background: #FF0033; } .soc.ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.soc.tg { background: #229ED9; } .soc.em { background: var(--yellow); color: var(--ink); }
.foot-contact { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--night-line); font-size: .92rem; }
.foot-contact b { color: #fff; }

/* social cards (Roz Ke Facts + Xeropen) */
.soc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.soc-card { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; background: var(--night); color: #fff; border-radius: 20px; padding: 22px 24px; }
.soc-card .big { width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.soc-card .big svg { width: 32px; height: 32px; color: #fff; }
.soc-card h3 { color: #fff; font-size: 1.3rem; margin: 0 0 2px; font-stretch: 108%; }
.soc-card p { color: #C3C8DE; margin: 0 0 12px; font-size: .95rem; }
.soc-card .row { display: flex; gap: 8px; flex-wrap: wrap; grid-column: 1 / -1; }
.soc-card .btn { padding: 10px 16px; font-size: .92rem; }
.soc-card .btn-line { background: transparent; color: #fff; border-color: #48507E; }
.soc-card .btn-line:hover { border-color: var(--yellow); }
@media (max-width: 760px) { .soc-cards { grid-template-columns: 1fr; } }

/* sideways moving chip rows */
.slide-rows { overflow: hidden; padding: 6px 0; }
.slide-row { display: flex; gap: 12px; width: max-content; margin: 0 auto 12px; }
.chip { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 18px; font-weight: 700; color: var(--ink); text-decoration: none; box-shadow: 0 2px 0 var(--line); }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip i { font-style: normal; font-size: 1.2rem; }
.night .chip, .chip.dark { background: var(--night-2); border-color: var(--night-line); color: #fff; box-shadow: none; }

/* post extras: author box + related posts */
.author-box { display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: center; background: var(--soft); border-radius: 16px; padding: 18px 20px; margin-top: 40px; }
.author-box img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.author-box p { margin: 0; font-size: .95rem; color: var(--muted); }
.author-box b { color: var(--ink); display: block; font-size: 1.05rem; }
.related { margin-top: 36px; }
.related ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.related li { margin: 0; }
.related a { display: block; height: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; }
.related a:hover { border-color: var(--blue); color: var(--blue); }
.related small { display: block; color: var(--muted); font-weight: 700; font-size: .78rem; margin-bottom: 2px; }
@media (max-width: 600px) { .related ul { grid-template-columns: 1fr; } }

/* ===== v4: site search (search.js) ===== */
.xs-btn { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 600; font-size: .95rem; color: var(--ink); background: var(--soft); border: 1.5px solid var(--line); border-radius: 10px; padding: 7px 12px; cursor: pointer; }
.xs-btn:hover { border-color: var(--blue); color: var(--blue); }
.xs-btn svg { width: 17px; height: 17px; }
.night .xs-btn { background: var(--night-2); border-color: var(--night-line); color: #D5D9EC; }
html.xs-open { overflow: hidden; }
.xs-pop { position: fixed; inset: 0; z-index: 100; background: rgba(10,13,28,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding: 9vh 16px 16px; }
.xs-pop[hidden] { display: none; }
.xs-box { width: min(640px, 100%); background: #fff; color: var(--ink); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: hidden; max-height: 80vh; display: flex; flex-direction: column; }
.xs-form { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.xs-form svg { width: 22px; height: 22px; color: var(--blue); flex: none; }
.xs-form input, .xs-big input { flex: 1; min-width: 0; font: inherit; font-size: 1.1rem; border: 0; outline: none; background: transparent; color: var(--ink); }
.xs-close { font: inherit; font-size: .78rem; font-weight: 700; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.xs-hint { padding: 10px 16px; font-size: .88rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 10px; border-bottom: 1px solid var(--line); }
.xs-hint a { color: var(--blue); font-weight: 600; text-decoration: none; }
.xs-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.xs-list:empty { display: none; }
.xs-list li { margin: 0; }
.xs-list a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.xs-list a:hover, .xs-list a:focus { background: var(--soft); outline: none; }
.xs-list b { display: block; font-family: var(--display); font-weight: 700; line-height: 1.25; }
.xs-k { display: block; font-size: .76rem; font-weight: 700; color: var(--blue); margin-bottom: 2px; text-transform: uppercase; letter-spacing: .03em; }
.xs-d { display: block; font-size: .9rem; color: var(--muted); margin-top: 2px; }
.xs-list mark { background: #FFF1A6; color: inherit; border-radius: 3px; padding: 0 1px; }
.xs-none { padding: 16px 12px; color: var(--muted); }
@media (max-width: 640px) { .xs-btn span { display: none; } .xs-btn { padding: 7px 9px; } .xs-pop { padding-top: 12px; } }

/* ---- v5: Stories dropdown in the top menu ---- */
.nav { align-items: center; }
.dd { position: relative; }
.dd > summary { list-style: none; cursor: pointer; color: var(--ink); font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 10px; display: flex; align-items: center; gap: 6px; user-select: none; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.dd[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.dd > summary:hover, .dd[open] > summary { background: var(--soft); }
.night .dd > summary { color: #D5D9EC; } .night .dd > summary:hover, .night .dd[open] > summary { background: var(--night-2); }
.dd-menu { position: absolute; right: 0; top: calc(100% + 8px); width: min(330px, 92vw); max-height: 72vh; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(11,20,64,.18); padding: 8px; z-index: 50; animation: dd-in .18s ease; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.nav .dd-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-weight: 600; font-size: .93rem; color: var(--ink); background: none; }
.nav .dd-menu a:hover { background: var(--soft); color: var(--blue); }
.dd-menu a i { font-style: normal; width: 24px; text-align: center; flex: none; }
.nav .dd-menu a.dd-main { background: linear-gradient(135deg, #0A1A52, #2340C8); color: #fff; padding: 12px; margin-bottom: 4px; }
.nav .dd-menu a.dd-main:hover { color: #fff; filter: brightness(1.08); }
.dd-main small { display: block; font-weight: 500; font-size: .78rem; color: #C9D2F5; }
.dd-h { margin: 8px 10px 2px; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.nav .dd-menu a.dd-wa { margin-top: 6px; background: #E8F9EF; color: #0B6B34; }
.nav .dd-menu a.dd-wa:hover { background: #D3F4E1; color: #0B6B34; }
@media (max-width: 640px) { .dd { position: static; } .dd-menu { left: 4vw; right: 4vw; width: auto; top: calc(100% + 2px); } .site-head .wrap { position: relative; } }

/* ---- v5: small dates ---- */
.meta { font-size: .76rem !important; color: #9AA0B6 !important; letter-spacing: .01em; }
.meta a { color: inherit; }
.rows .kind { font-size: .72rem; font-weight: 600; color: #8A93B8; }
.clist a small { font-size: .7rem; color: #A0A6BC; font-weight: 500; }

/* ---- v5: shopping buttons ---- */
.shop-cta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 18px 0; padding: 14px 16px; border-radius: 14px; background: var(--soft); }
.shop-cta small { color: var(--muted); font-size: .82rem; }
.note.aff { font-size: .82rem; }

/* ---- v5: search tabs (Xeropen = blue, Web = green) ---- */
.xs-tabs { display: flex; gap: 8px; padding: 12px 16px 0; }
.xs-tabs button { font: inherit; font-weight: 700; font-size: .92rem; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.xs-tabs button:hover { border-color: var(--ink); color: var(--ink); }
.xs-box.is-site .xs-tabs [data-tab="site"] { background: #2340C8; border-color: #2340C8; color: #fff; }
.xs-box.is-web .xs-tabs [data-tab="web"] { background: #13A35A; border-color: #13A35A; color: #fff; }
.xs-box .xs-form { margin: 12px 16px; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; transition: border-color .2s; }
.xs-box.is-site .xs-form { border-color: #2340C8; } .xs-box.is-site .xs-form svg { color: #2340C8; }
.xs-box.is-web .xs-form { border-color: #13A35A; } .xs-box.is-web .xs-form svg { color: #13A35A; }
.xs-box.is-web .xs-form input::placeholder { color: #3E9A6C; } .xs-box.is-site .xs-form input::placeholder { color: #5A6FD6; }
.xs-box .xs-hint { border-top: 0; padding-top: 0; }
.xs-eng { display: flex; align-items: center; gap: 12px; width: 100%; font: inherit; text-align: left; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; margin: 0 0 6px; }
.xs-eng:hover, .xs-eng:focus { border-color: #13A35A; background: #F0FBF5; outline: none; }
.xs-eng i { width: 30px; height: 30px; border-radius: 50%; color: #fff; font-style: normal; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.xs-eng span { flex: 1; } .xs-eng b { font-weight: 800; } .xs-eng em { font-style: normal; color: var(--muted); }

/* ---- v5: Anaya, the floating assistant ---- */
.anaya { position: fixed; right: 18px; bottom: 18px; z-index: 90; font-family: var(--body, inherit); }
.an-fab { position: relative; width: 62px; height: 62px; padding: 0; border: 3px solid #fff; border-radius: 50%; background: #DCE6FF; cursor: pointer; box-shadow: 0 10px 28px rgba(11,20,64,.30); transition: transform .2s; display: block; overflow: visible; }
.an-fab:hover { transform: scale(1.06); }
.an-fab > svg { width: 100%; height: 100%; border-radius: 50%; display: block; }
.an-dot { position: absolute; right: 1px; top: 1px; width: 13px; height: 13px; border-radius: 50%; background: #22C55E; border: 2px solid #fff; }
.an-ai { position: absolute; left: -4px; bottom: -2px; font-style: normal; font: 800 .62rem/1 var(--display, sans-serif); color: #fff; background: #2340C8; border: 2px solid #fff; border-radius: 999px; padding: 3px 5px; letter-spacing: .04em; }
.anaya.is-open .an-fab { box-shadow: 0 0 0 4px rgba(35,64,200,.25), 0 10px 28px rgba(11,20,64,.3); }
.an-tip { position: absolute; right: 74px; bottom: 8px; width: 230px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 16px 16px 4px 16px; box-shadow: 0 12px 34px rgba(11,20,64,.18); padding: 12px 14px; cursor: pointer; animation: an-pop .35s cubic-bezier(.3,1.4,.5,1); }
.an-tip[hidden] { display: none; }
.an-tip p { margin: 0; padding-right: 22px; font-size: .92rem; line-height: 1.4; }
.an-tip-x { position: absolute; top: 7px; right: 7px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--soft); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.an-tip-x svg { width: 12px; height: 12px; }
.an-tip-x:hover { background: #E3E7F5; color: var(--ink); }
@keyframes an-pop { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }
.an-box { position: absolute; right: 0; bottom: 76px; width: 360px; height: min(540px, calc(100vh - 120px)); background: #fff; color: var(--ink); border-radius: 20px; box-shadow: 0 24px 70px rgba(11,20,64,.30); border: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; animation: an-pop .25s ease; transform-origin: bottom right; }
.an-box[hidden] { display: none; }
.an-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: linear-gradient(135deg, #0A1A52, #2340C8); color: #fff; }
.an-av { width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); overflow: hidden; flex: none; }
.an-av svg { width: 100%; height: 100%; display: block; }
.an-who { flex: 1; min-width: 0; } .an-who b { display: block; font-family: var(--display); font-size: 1.05rem; } .an-who small { color: #C9D2F5; font-size: .76rem; }
.an-ic { width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: none; }
.an-ic svg { width: 18px; height: 18px; }
.an-ic:hover { background: rgba(255,255,255,.26); }
.an-spk.on { background: #FFE45C; color: #0B1440; }
.an-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #F4F6FC; }
.an-msg { max-width: 88%; }
.an-msg p { margin: 0; padding: 10px 13px; border-radius: 16px; font-size: .94rem; line-height: 1.5; }
.an-msg.bot { align-self: flex-start; } .an-msg.bot p { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.an-msg.me { align-self: flex-end; } .an-msg.me p { background: #2340C8; color: #fff; border-bottom-right-radius: 5px; }
.an-card { display: block; margin-top: 7px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1.5px solid #D5DCF5; text-decoration: none; color: var(--ink); transition: border-color .2s, transform .2s; }
.an-card:hover { border-color: #2340C8; transform: translateY(-1px); }
.an-card small { display: block; font-size: .7rem; font-weight: 800; color: #2340C8; text-transform: uppercase; letter-spacing: .04em; }
.an-card b { display: block; font-family: var(--display); font-size: .95rem; line-height: 1.25; margin: 2px 0; }
.an-card span { font-size: .8rem; font-weight: 700; color: #2340C8; }
.an-card.wa { border-color: #9BE3B8; } .an-card.wa small, .an-card.wa span { color: #0B7A42; }
.an-card.web small, .an-card.web span { color: #0B7A42; }
.an-typing { display: inline-flex !important; gap: 4px; }
.an-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9AA3C7; animation: an-dots 1s infinite; }
.an-typing i:nth-child(2) { animation-delay: .15s; } .an-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes an-dots { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.an-sugg { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 0; background: #fff; scrollbar-width: none; }
.an-sugg:empty { display: none; }
.an-sugg button { flex: none; font: inherit; font-size: .8rem; font-weight: 700; color: #2340C8; background: #EEF1FD; border: 1px solid #D5DCF5; border-radius: 999px; padding: 6px 11px; cursor: pointer; white-space: nowrap; }
.an-bar { display: flex; gap: 6px; align-items: center; padding: 10px 12px 6px; background: #fff; }
.an-bar input { flex: 1; min-width: 0; font: inherit; font-size: .95rem; border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 14px; outline: none; }
.an-bar input:focus { border-color: #2340C8; }
.an-bar .an-ic { background: #EEF1FD; color: #2340C8; }
.an-bar .an-send { background: #2340C8; color: #fff; }
.an-bar .an-mic.rec { background: #E53935; color: #fff; animation: an-rec 1s infinite; }
@keyframes an-rec { 50% { box-shadow: 0 0 0 6px rgba(229,57,53,.2); } }
.an-note { margin: 0; padding: 0 12px 10px; font-size: .7rem; color: var(--muted); text-align: center; background: #fff; }
@media (max-width: 520px) {
  .anaya { right: 12px; bottom: 12px; }
  .an-box { position: fixed; left: 8px; right: 8px; bottom: 84px; width: auto; height: min(70vh, 560px); }
  .an-tip { width: 200px; }
}
@media print { .anaya { display: none; } }
.anaya .an-box { padding: 0 !important; margin: 0; }
.anaya .an-head { margin: 0; position: static; }

.xs-tabs { align-items: center; justify-content: space-between; }
.xs-webtag { font-weight: 800; font-size: .92rem; color: #fff; background: #13A35A; border-radius: 999px; padding: 8px 16px; }
.xs-ask { font: inherit; font-weight: 700; font-size: .85rem; color: #2340C8; background: #EEF1FD; border: 1px solid #D5DCF5; border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.xs-ask:hover { border-color: #2340C8; }

/* ---- v5: slide in from the sides ---- */
html.mo .rv.rv-l { transform: translate3d(-80px, 0, 0); }
html.mo .rv.rv-r { transform: translate3d(80px, 0, 0); }
html.mo .rv.rv-l.in, html.mo .rv.rv-r.in { transform: none; }
html.mo .rv { transition: opacity .8s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
html, body { overflow-x: clip; }

/* ---- v6: effects ---- */
.fx-bar { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 200; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #2340C8, #4F8BFF, #FFE45C); pointer-events: none; }
html.fx .fx-hide { opacity: 0; transition: opacity .7s ease, transform .9s cubic-bezier(.16,.84,.3,1.12), filter .7s ease; filter: blur(6px); }
html.fx .fx-hide.fx-l { transform: translate3d(-120px, 0, 0) rotate(var(--fx-rot, 0deg)) scale(.92); }
html.fx .fx-hide.fx-r { transform: translate3d(120px, 0, 0) rotate(var(--fx-rot, 0deg)) scale(.92); }
html.fx .fx-hide.fx-b { transform: translate3d(0, 90px, 0) rotate(var(--fx-rot, 0deg)) scale(.92); }
html.fx .fx-hide.fx-in { opacity: 1; transform: none; filter: none; }
.fx-words .fx-w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; }
.fx-words .fx-w > span { display: inline-block; transform: translateY(105%); transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.fx-words.fx-words-in .fx-w > span { transform: none; }
.fx-tilt { transform: perspective(900px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) translateY(-4px) !important; transition: transform .12s ease-out !important; position: relative; }
.fx-tilt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.45), rgba(255,255,255,0) 55%); mix-blend-mode: soft-light; }
.btn, .pill { transition: transform .25s cubic-bezier(.2,.8,.2,1), background .2s, border-color .2s, filter .2s; }
.fx-ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.45); transform: scale(0); animation: fx-rip .65s ease-out forwards; pointer-events: none; }
@keyframes fx-rip { to { transform: scale(1); opacity: 0; } }
.fx-glow { position: fixed; left: 0; top: 0; width: 320px; height: 320px; border-radius: 50%; pointer-events: none; z-index: 1; opacity: 0; transition: opacity .4s; background: radial-gradient(circle, rgba(79,139,255,.16), rgba(79,139,255,0) 65%); mix-blend-mode: multiply; }
.fx-stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.fx-top { position: fixed; left: 18px; bottom: 18px; z-index: 80; width: 50px; height: 50px; border-radius: 50%; border: 0; background: #0B1440; color: #fff; font-size: 1.4rem; cursor: pointer; box-shadow: 0 10px 26px rgba(11,20,64,.3); opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none; transition: opacity .3s, transform .3s; }
.fx-top.show { opacity: 1; transform: none; pointer-events: auto; }
.fx-top:hover { background: #2340C8; }
.fx-top.fly span { display: inline-block; animation: fx-fly .9s ease-in forwards; }
@keyframes fx-fly { 30% { transform: translateY(6px); } 100% { transform: translateY(-140px) rotate(-12deg); opacity: 0; } }
.fx-confetti { position: fixed; inset: 0; z-index: 300; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .fx-glow, .fx-stars { display: none; } }

/* ---- v6: blog post side panel (wide screens) ---- */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 48px; width: min(1180px, 100% - 40px); margin: 0 auto; align-items: start; }
.post-layout > article.narrow { max-width: none; width: auto; margin: 0; }
.post-side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 110px); overflow-y: auto; padding: 4px 4px 20px; scrollbar-width: thin; }
.ps-box { background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: 0 8px 24px rgba(11,20,64,.05); }
.ps-h { margin: 0 0 8px; font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #2340C8; }
.ps-toc { margin: 0; padding: 0 0 0 18px; font-size: .9rem; }
.ps-toc li { margin: 0 0 6px; }
.ps-toc a { color: var(--muted); text-decoration: none; font-weight: 600; transition: color .2s; }
.ps-toc a:hover, .ps-toc a.on { color: #2340C8; }
.ps-toc a.on { font-weight: 800; }
.ps-prog { height: 4px; background: var(--soft); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.ps-prog i { display: block; height: 100%; background: linear-gradient(90deg, #2340C8, #FFE45C); transform-origin: 0 50%; transform: scaleX(0); }
.ps-ask { background: linear-gradient(135deg, #0A1A52, #2340C8); border: 0; color: #fff; }
.ps-ask .ps-h { color: #FFE45C; }
.ps-anaya { display: block; width: 100%; font: inherit; font-weight: 800; padding: 10px 12px; border-radius: 12px; border: 0; background: #FFE45C; color: #0B1440; cursor: pointer; margin-bottom: 8px; }
.ps-share { display: block; text-align: center; font-weight: 700; font-size: .88rem; color: #fff; text-decoration: none; padding: 8px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,.35); }
.ps-share:hover { border-color: #fff; }
.ps-rel { list-style: none; margin: 0; padding: 0; }
.ps-rel li { margin: 0; border-top: 1px solid var(--line); }
.ps-rel li:first-child { border-top: 0; }
.ps-rel a { display: block; padding: 8px 0; font-size: .88rem; font-weight: 700; color: var(--ink); text-decoration: none; line-height: 1.3; }
.ps-rel a:hover { color: #2340C8; }
.ps-rel small { display: block; font-size: .7rem; color: var(--muted); font-weight: 600; }

/* ---- v6: wider About page ---- */
article.about-wide { width: min(1120px, 100% - 40px); max-width: none; }
article.about-wide > p, article.about-wide > ul { max-width: 80ch; }

/* table headers always readable, also on dark sections */
th { color: var(--ink); }

/* ---- v7: social icons with an account menu (one YouTube, one Instagram) ---- */
.soc-dd { position: relative; display: inline-block; }
.soc-dd > summary { list-style: none; cursor: pointer; }
.soc-dd > summary::-webkit-details-marker { display: none; }
.soc-menu { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); min-width: 210px; background: #fff; color: #0B0D14; border-radius: 16px; padding: 8px; box-shadow: 0 18px 40px rgba(0,0,0,.35); z-index: 40; animation: dd-in .18s ease; }
.soc-menu::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -7px; border: 7px solid transparent; border-top-color: #fff; }
.soc-menu p { margin: 2px 8px 6px; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #6A7190; }
.soc-menu a { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: #0B0D14 !important; }
.soc-menu a:hover { background: #EEF1FD; }
.soc-menu b { font-weight: 800; font-size: .95rem; }
.soc-menu small { color: #6A7190; font-size: .8rem; }

.an-learned { margin: 6px 2px 0 !important; padding: 0 !important; background: none !important; border: 0 !important; font-size: .72rem !important; color: #6A7190; font-weight: 700; }

/* ---- v7: "Free tools" button opens a menu of games and tools ---- */
.nav .dd > summary.go { background: var(--ink); color: #fff; }
.nav .dd > summary.go:hover, .nav .dd[open] > summary.go { background: var(--blue); color: #fff; }
.night .nav .dd > summary.go, .night .nav .dd[open] > summary.go { background: var(--yellow); color: var(--ink); }
.dd-tools .dd-menu { width: min(300px, 92vw); }
