/*
Theme Name: Otakuchar
Theme URI: https://otakuchar.com/
Author: Otakuchar
Description: Theme nhẹ cho Otakuchar.com: Pokedex tiếng Việt và thư viện thẻ bài One Piece TCG, Pokémon TCG. Không jQuery, không web font, hỗ trợ chế độ tối.
Version: 1.9.0
Requires at least: 6.3
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: otakuchar
*/

:root {
	--bg: #0b0e1c;
	--surface: #141933;
	--surface-2: #1c2244;
	--text: #e9ebf7;
	--muted: #a1a7c4;
	--border: #272e55;
	--brand: #8b74ff;
	--brand-2: #ff5c93;
	--brand-ink: #ffffff;
	--link: #b3a6ff;
	--header-bg: rgba(9, 11, 23, .88);
	--header-text: #f2f3fa;
	--footer-bg: #070914;
	--shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
	--radius: 14px;
	--wide: 1200px;
	--narrow: 780px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	color-scheme: dark;
}

/* Dark is the default; visitors can switch to light with the header button. */
:root[data-theme="light"] {
	--bg: #f6f7fb;
	--surface: #ffffff;
	--surface-2: #eef0f7;
	--text: #161a2b;
	--muted: #5b6178;
	--border: #dfe2ec;
	--brand: #5b3df5;
	--brand-2: #ef4b7c;
	--link: #4a2fe0;
	--header-bg: rgba(18, 21, 40, .92);
	--footer-bg: #0f1224;
	--shadow: 0 1px 2px rgba(20, 24, 50, .06), 0 4px 16px rgba(20, 24, 50, .06);
	color-scheme: light;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 var(--font); text-rendering: optimizeLegibility; overflow-wrap: break-word; }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.01em; margin: 1.6em 0 .6em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.4rem); margin-top: .2em; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); }
h3 { font-size: 1.2rem; }
p, ul, ol, table, figure, blockquote { margin: 0 0 1.1em; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
blockquote { margin-left: 0; padding: .2em 1.1em; border-left: 4px solid var(--brand); background: var(--surface-2); border-radius: 0 10px 10px 0; }
code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
pre { overflow-x: auto; padding: 1rem; background: var(--surface-2); border-radius: 10px; }
input, select, textarea, button { font: inherit; color: inherit; }
input[type="search"], input[type="text"], input[type="email"], input[type="url"], select, textarea {
	background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .55em .8em; max-width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
button, .button, input[type="submit"] {
	display: inline-block; cursor: pointer; border: 0; border-radius: 10px; padding: .6em 1.2em; font-weight: 600; text-decoration: none;
	background: var(--brand); color: var(--brand-ink);
}
button:hover, .button:hover { filter: brightness(1.08); }

.container { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .container { padding: 0 24px; } }
.is-narrow .entry, .is-narrow .archive-header { max-width: calc(var(--narrow) + 48px); }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); padding: .5em 1em; border-radius: 8px; }
.skip-link:focus { top: 8px; }

/* ---------- Header ---------- */

.site-header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); color: var(--header-text); -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }
.site-header__inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.site-brand { flex: 0 0 auto; }
.site-title { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; text-decoration: none; color: var(--header-text); }
.site-title__icon { flex: none; width: 36px; height: 36px; border-radius: 10px; }
.site-title__accent { background: linear-gradient(90deg, #a594ff, var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.site-title:hover { text-decoration: none; }
.custom-logo { display: block; max-height: 44px; width: auto; }

.site-nav { order: 2; display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.site-nav .menu { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.site-nav .menu li { position: relative; }
.site-nav .menu a { display: block; white-space: nowrap; padding: .45em .8em; border-radius: 8px; color: var(--header-text); text-decoration: none; font-weight: 600; font-size: .95rem; opacity: .85; }
.site-nav .menu a:hover, .site-nav .current-menu-item > a, .site-nav .current-menu-ancestor > a { opacity: 1; background: rgba(255, 255, 255, .1); }
.site-nav .sub-menu { list-style: none; margin: 0; padding: .4rem; position: absolute; left: 0; top: 100%; min-width: 200px; background: #0d1022; border-radius: 10px; box-shadow: var(--shadow); display: none; }
.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { display: block; }

.site-header .search-form { display: flex; align-items: center; background: rgba(255, 255, 255, .08); border-radius: 999px; padding: 0 .3rem 0 .9rem; }
.site-header .search-field { background: transparent; border: 0; color: var(--header-text); width: 11rem; padding: .45em 0; }
.site-header .search-field::placeholder { color: rgba(242, 243, 250, .6); }
.site-header .search-submit { background: transparent; padding: .4em; color: var(--header-text); display: flex; }
@media (min-width: 1001px) and (max-width: 1180px) { .site-header__inner { gap: .6rem; } .site-nav { gap: .6rem; } .site-nav .menu a { padding: .45em .55em; font-size: .9rem; } .site-header .search-field { width: 6.5rem; } }

.nav-toggle { order: 4; display: none; margin-left: auto; background: transparent; padding: .6rem; }
.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after { display: block; width: 22px; height: 2px; background: var(--header-text); border-radius: 2px; position: relative; transition: transform .2s; }
.nav-toggle__bar::before, .nav-toggle__bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bar::before { top: -7px; }
.nav-toggle__bar::after { top: 7px; }
.nav-open .nav-toggle__bar { background: transparent; }
.nav-open .nav-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1000px) {
	.nav-toggle { display: block; }
	.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: .5rem; padding: .75rem 16px 1rem; background: #0d1022; border-top: 1px solid rgba(255, 255, 255, .08); }
	.nav-open .site-nav { display: flex; }
	.site-nav .menu { flex-direction: column; }
	.site-nav .sub-menu { position: static; display: block; box-shadow: none; padding-left: 1rem; }
	.site-header .search-field { width: 100%; }
	.site-header .search-form { order: -1; }
}

/* Secondary bar under the main header row (Appearance → Menus → "Menu phụ"). Scrolls sideways on small screens instead of wrapping. */
.sub-nav { border-top: 1px solid rgba(255, 255, 255, .06); background: rgba(255, 255, 255, .03); }
.sub-nav__menu { list-style: none; display: flex; gap: .25rem; margin: 0; padding: .3rem 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sub-nav__menu::-webkit-scrollbar { display: none; }
.sub-nav__menu li { flex: 0 0 auto; }
.sub-nav__menu a { display: block; padding: .3em .75em; border-radius: 999px; color: var(--header-text); text-decoration: none; font-size: .88rem; font-weight: 600; white-space: nowrap; opacity: .75; }
.sub-nav__menu a:hover, .sub-nav__menu .current-menu-item > a { opacity: 1; background: rgba(255, 255, 255, .1); text-decoration: none; }
.sub-nav__menu .current-menu-item > a, .sub-nav__menu .current-menu-ancestor > a { box-shadow: inset 0 0 0 1px rgba(165, 148, 255, .45); }
/* Dropdowns: theme.js copies a parent's child list into .sub-nav__panel, a fixed panel on <body>, so the scrolling bar and the header cannot clip it. */
.sub-nav__menu .menu-item-has-children > a::after, .site-nav .menu-item-has-children > a::after { content: ""; display: inline-block; width: .38em; height: .38em; margin: 0 0 .2em .45em; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); opacity: .7; }
.sub-nav__menu a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.sub-nav__menu .is-open > a { opacity: 1; background: rgba(255, 255, 255, .1); }
.sub-nav__menu .sub-menu { display: none; }
.sub-nav__panel { position: fixed; z-index: 1000; top: 0; left: 16px; padding-top: .35rem; }
.sub-nav__panel[hidden] { display: none; }
.sub-nav__panel .sub-menu { list-style: none; margin: 0; padding: .4rem; min-width: 220px; max-width: calc(100vw - 32px); background: #0d1022; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.sub-nav__panel .sub-menu a { display: block; padding: .6em .85em; border-radius: 8px; color: #f2f3fa; text-decoration: none; font-size: .9rem; font-weight: 600; opacity: .9; }
.sub-nav__panel .sub-menu a:hover, .sub-nav__panel .sub-menu .current-menu-item > a { opacity: 1; background: rgba(255, 255, 255, .1); }
@media (max-width: 1000px) { .site-header__inner { position: relative; } .site-nav { z-index: 2; } .sub-nav .container { padding-right: 0; } }

.theme-toggle { order: 3; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); color: var(--header-text); flex: 0 0 auto; }
.theme-toggle:hover { background: rgba(255, 255, 255, .16); filter: none; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
@media (max-width: 1000px) { .theme-toggle { margin-left: auto; } .nav-toggle { margin-left: .25rem; } }

/* Language switch (Polylang + otakuchar-lang): "EN" on Vietnamese pages, "VI" on English ones. */
.lang-switch { order: 3; display: grid; place-items: center; min-width: 2.4rem; height: 2.4rem; padding: 0 .55rem; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--header-text); font-size: .78rem; font-weight: 800; letter-spacing: .05em; text-decoration: none; flex: 0 0 auto; }
.lang-switch:hover { background: rgba(255, 255, 255, .16); color: var(--header-text); text-decoration: none; }
@media (max-width: 1000px) { .lang-switch { margin-left: auto; } .lang-switch + .theme-toggle { margin-left: .25rem; } }

/* ---------- Content ---------- */

.site-main { flex: 1 0 auto; padding-bottom: 3rem; }
.entry { padding-top: 1.5rem; }
.entry-header { margin-bottom: 1.25rem; }
.entry-meta { color: var(--muted); font-size: .9rem; margin: 0; }
.entry-thumb img { border-radius: var(--radius); width: 100%; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content img { border-radius: 8px; }
.entry-content table { font-size: .95rem; }
.entry-content th, .entry-content td { padding: .5em .6em; border-bottom: 1px solid var(--border); text-align: left; }
.entry-tags a { display: inline-block; margin: 0 .3em .3em 0; padding: .1em .7em; background: var(--surface-2); border-radius: 999px; font-size: .85rem; text-decoration: none; }
.alignwide { max-width: var(--wide); }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { color: var(--muted); font-size: .85rem; text-align: center; }

.otk-breadcrumb { font-size: .85rem; color: var(--muted); margin: 0 0 .75rem; }
.otk-breadcrumb a { color: inherit; text-decoration: none; }
.otk-breadcrumb a:hover { color: var(--link); text-decoration: underline; }

/* Plugin pages sit on cards that follow the theme colors. */
.is-wide .entry-content .otk-pdx.otk-card,
.is-wide .entry-content .otk-tcg.otk-card { background: var(--surface); box-shadow: var(--shadow); border-color: var(--border); }
.otk-pdx .otk-filter input, .otk-pdx .otk-filter select, .otk-tcg .otk-filter input, .otk-tcg .otk-filter select { border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.otk-pdx .otk-grid li { background: var(--surface); border-color: var(--border); transition: transform .15s, box-shadow .15s; }
.otk-pdx .otk-grid li:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.otk-type { display: inline-block; padding: .1em .65em; margin: 0 .25em .25em 0; border-radius: 999px; background: var(--otk-type); color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.6; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }

/* ---------- Archives and post cards ---------- */

.archive { padding-top: 1.5rem; }
.archive-desc { color: var(--muted); }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s; }
.post-card:hover { transform: translateY(-3px); }
.post-card__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.post-card__media { display: block; aspect-ratio: 16 / 9; background: var(--surface-2); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card__media.is-contain img { object-fit: contain; padding: .6rem; }
.post-card__body { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem 1.2rem; }
.post-card__kind { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); }
.post-card__title { font-size: 1.08rem; margin: 0; }
.post-card__excerpt { color: var(--muted); font-size: .92rem; }

.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: 2rem; }
.pagination .page-numbers { padding: .4em .85em; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; }
.pagination .current { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* ---------- Front page ---------- */

.hero {
	color: #fff; padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem);
	background:
		radial-gradient(60rem 30rem at 85% -10%, rgba(239, 75, 124, .45), transparent 60%),
		radial-gradient(50rem 30rem at 0% 110%, rgba(91, 61, 245, .55), transparent 60%),
		#0b0d1d;
}
.hero__inner { max-width: 860px; text-align: center; }
.hero__title { color: #fff; font-size: clamp(1.8rem, 1.1rem + 3vw, 3rem); font-weight: 800; margin: 0 0 .5rem; }
.hero__text { color: rgba(255, 255, 255, .78); font-size: 1.05rem; max-width: 640px; margin: 0 auto 1.75rem; }

.hero-search { max-width: 640px; margin: 0 auto; }
.hero-search__tabs { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: .3rem; padding: .3rem; margin-bottom: .75rem; background: rgba(255, 255, 255, .08); border-radius: 999px; }
.hero-search__tabs input { position: absolute; opacity: 0; pointer-events: none; }
.hero-search__tabs span { display: block; padding: .35em .95em; border-radius: 999px; font-size: .9rem; font-weight: 600; cursor: pointer; color: rgba(255, 255, 255, .8); }
.hero-search__tabs input:checked + span { background: #fff; color: #1b1f3a; }
.hero-search__tabs input:focus-visible + span { outline: 3px solid rgba(255, 255, 255, .6); }
/* One row on phones: tighter pills, and a sideways scroll if the labels still do not fit. */
@media (max-width: 600px) {
	.hero-search__tabs { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
	.hero-search__tabs::-webkit-scrollbar { display: none; }
	.hero-search__tabs { padding: .25rem; }
	.hero-search__tabs label { position: relative; flex: 1 0 auto; }
	.hero-search__tabs span { padding: .5em .5em; font-size: clamp(.72rem, 3.3vw, .85rem); white-space: nowrap; text-align: center; }
}
.hero-search__row { display: flex; gap: .5rem; background: #fff; padding: .4rem; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.hero-search__row input { flex: 1; min-width: 0; border: 0; background: transparent; color: #161a2b; padding: .6em .8em; font-size: 1.05rem; }
.hero-search__row input:focus-visible { outline: none; }
.hero-search__row button { background: linear-gradient(90deg, var(--brand), var(--brand-2)); padding: .6em 1.5em; }

.hero-stats { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.75rem; margin: 1.75rem 0 0; padding: 0; color: rgba(255, 255, 255, .75); font-size: .95rem; }
.hero-stats strong { color: #fff; font-size: 1.25rem; }

.home-section { margin-top: 2.75rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }
.section-more { font-weight: 600; text-decoration: none; font-size: .95rem; }
.home-intro { max-width: var(--narrow); }

.mon-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .9rem; }
.mon-grid a { display: flex; flex-direction: column; align-items: center; gap: .1rem; height: 100%; padding: .8rem .6rem 1rem; text-align: center; color: inherit; text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: transform .15s, box-shadow .15s; }
.mon-grid a:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.mon-grid img { width: 110px; height: 110px; object-fit: contain; }
.mon-grid__number { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.mon-grid strong { font-size: 1rem; }
.mon-grid__types { margin-top: .2rem; }

.set-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .9rem; }
.set-grid a { display: flex; align-items: center; gap: 1rem; height: 100%; padding: .75rem; color: inherit; text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: transform .15s, box-shadow .15s; }
.set-grid a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.set-grid img { width: 72px; height: auto; border-radius: 5px; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); flex: 0 0 auto; }
.set-grid__text { display: flex; flex-direction: column; min-width: 0; }
.set-grid__code { font-size: .78rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; }
.set-grid strong { line-height: 1.3; }
.set-grid__count { color: var(--muted); font-size: .88rem; }

/* Mini games: each card is a short pitch with a button to its game page. */
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: .9rem; }
.game-card { display: flex; flex-direction: column; gap: .9rem; min-width: 0; padding: 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.game-card--doan { background: linear-gradient(160deg, color-mix(in srgb, #ffcb05 12%, var(--surface)), var(--surface) 55%); }
.game-card--quiz { background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 16%, var(--surface)), var(--surface) 55%); }
.game-card--diff { background: linear-gradient(160deg, color-mix(in srgb, #22c55e 14%, var(--surface)), var(--surface) 55%); }
.game-card__tag { font-size: .75rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; }
.game-card h3 { margin: .15rem 0 .35rem; font-size: 1.25rem; }
.game-card h3 a { color: inherit; text-decoration: none; }
.game-card__intro p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.game-card__go { align-self: flex-start; margin-top: auto; border-radius: 999px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }

/* Linh Thẻ promo box. */
.linhthe { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.5rem; padding: clamp(1.25rem, 4vw, 2.25rem); border-radius: calc(var(--radius) + 4px); color: #fff; border: 1px solid rgba(255, 255, 255, .08);
	background:
		radial-gradient(28rem 18rem at 100% 0%, rgba(255, 122, 69, .45), transparent 65%),
		radial-gradient(26rem 18rem at 0% 100%, rgba(76, 195, 255, .35), transparent 65%),
		linear-gradient(135deg, #1a1240, #0d1030);
}
.linhthe h2 { margin: .35rem 0 .5rem; color: #fff; }
.linhthe p { margin: 0 0 1rem; max-width: 36rem; color: rgba(255, 255, 255, .8); line-height: 1.55; }
.linhthe__badge { display: inline-block; padding: .15em .75em; border-radius: 999px; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: #ffb547; color: #2a1600; }
.linhthe__facts { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.25rem; padding: 0; }
.linhthe__facts li { padding: .2em .75em; border-radius: 999px; font-size: .85rem; white-space: nowrap; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .12); }
.linhthe__go { border-radius: 999px; padding: .75em 1.5em; background: linear-gradient(135deg, #ff7a45, #ff5c93); color: #fff; box-shadow: 0 8px 24px rgba(255, 92, 147, .35); }
.linhthe__cards { list-style: none; display: flex; margin: 0; padding: 0 .5rem 0 0; }
.linhthe__cards li { position: relative; overflow: hidden; display: flex; flex-direction: column; width: 84px; height: 118px; margin-left: -14px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .75); background: linear-gradient(160deg, var(--c1), var(--c2)); box-shadow: 0 10px 24px rgba(0, 0, 0, .4); transform: rotate(calc((var(--i, 0) - 2) * 7deg)) translateY(calc(var(--lift, 0) * 1px)); transition: transform .2s; }
.linhthe__cards li:nth-child(1) { --i: 0; --lift: 14; }
.linhthe__cards li:nth-child(2) { --i: 1; --lift: 4; }
.linhthe__cards li:nth-child(3) { --i: 2; --lift: 0; z-index: 1; }
.linhthe__cards li:nth-child(4) { --i: 3; --lift: 4; }
.linhthe__cards li:nth-child(5) { --i: 4; --lift: 14; }
.linhthe:hover .linhthe__cards li { transform: rotate(calc((var(--i, 0) - 2) * 10deg)) translateY(calc(var(--lift, 0) * 1.4px)); }
.linhthe__cards img { flex: 1 1 auto; min-height: 0; width: 100%; object-fit: cover; object-position: top; }
.linhthe__cards b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: .15rem 2px .2rem; font-size: .72rem; text-align: center; letter-spacing: .03em; background: rgba(0, 0, 0, .45); }
@media (max-width: 760px) {
	.linhthe { grid-template-columns: minmax(0, 1fr); }
	.linhthe__cards { order: -1; justify-content: center; padding: .5rem 0 .5rem 10px; }
	.linhthe__cards li { width: clamp(50px, 16vw, 64px); height: clamp(72px, 23vw, 90px); margin-left: -10px; }
	.linhthe__cards b { font-size: .62rem; }
	.linhthe__go { display: block; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .linhthe__cards li { transition: none; } }

/* Otakuchar Survival promo box: the Linh Thẻ box with a forest palette and a small lane scene. */
.linhthe--survival {
	background:
		radial-gradient(28rem 18rem at 100% 0%, rgba(123, 214, 90, .4), transparent 65%),
		radial-gradient(26rem 18rem at 0% 100%, rgba(255, 122, 69, .3), transparent 65%),
		linear-gradient(135deg, #0f2a22, #0b1a1f);
}
.linhthe--survival .linhthe__badge { background: #7bd65a; color: #0d2a10; }
.linhthe--survival .linhthe__go { background: linear-gradient(135deg, #3fbf6a, #1f9d8a); box-shadow: 0 8px 24px rgba(63, 191, 106, .35); }
.survival-scene { position: relative; width: 300px; height: 180px; margin-right: .25rem; border-radius: 14px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .12);
	background: linear-gradient(180deg, #1d5a48 0 58%, #2c6b3a 58% 100%);
	box-shadow: inset 0 -30px 40px rgba(0, 0, 0, .25), 0 12px 30px rgba(0, 0, 0, .35);
}
.survival-scene::before { content: ""; position: absolute; inset: 0 0 42% 0; background: repeating-linear-gradient(90deg, transparent 0 18px, rgba(70, 160, 120, .35) 18px 30px, transparent 30px 46px); }
.survival-scene__hero { position: absolute; bottom: 14px; width: auto; height: 120px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .45)); }
.survival-scene__hero:nth-child(1) { left: 4px; height: 104px; bottom: 34px; }
.survival-scene__hero:nth-child(2) { left: 30px; z-index: 1; }
.survival-scene__hero:nth-child(3) { left: 84px; height: 96px; bottom: 6px; }
.survival-scene__fence { position: absolute; left: 156px; bottom: 6px; width: 14px; height: 100px; border-radius: 4px; background: repeating-linear-gradient(160deg, #8a5a2b 0 10px, #b07a3f 10px 18px); box-shadow: 0 4px 8px rgba(0, 0, 0, .4); }
.survival-scene__block { position: absolute; right: 74px; bottom: 74px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; font-weight: 800; font-size: 1.25rem; color: #0d2a10; background: linear-gradient(180deg, #8ff07a, #3fbf4a); border: 2px solid #d6ffcc; box-shadow: 0 0 16px rgba(143, 240, 122, .6); }
.survival-scene__slime { position: absolute; bottom: 22px; right: 26px; width: 30px; height: 26px; border-radius: 50% 50% 40% 40%; background: radial-gradient(circle at 35% 30%, #b8ffb0, #48c25a 60%, #2a8a3a); box-shadow: 0 3px 0 rgba(0, 0, 0, .25); animation: survival-hop 1.2s ease-in-out infinite; }
.survival-scene__slime::before { content: ""; position: absolute; left: 8px; top: 9px; width: 4px; height: 5px; border-radius: 50%; background: #123; box-shadow: 9px 0 0 #123; }
.survival-scene__slime:nth-of-type(2) { right: 64px; bottom: 8px; animation-delay: -.4s; }
.survival-scene__slime--boss { right: 8px; bottom: 60px; width: 40px; height: 34px; background: radial-gradient(circle at 35% 30%, #ffb0c4, #e0436b 60%, #8a1f3d); animation-delay: -.8s; }
.survival-scene__slime--boss::before { left: 11px; top: 12px; box-shadow: 13px 0 0 #123; }
@keyframes survival-hop { 50% { transform: translateY(-6px) scaleY(1.05); } }
@media (max-width: 760px) {
	.survival-scene { order: -1; justify-self: center; width: min(100%, 300px); }
}
@media (prefers-reduced-motion: reduce) { .survival-scene__slime { animation: none; } }

/* Circle Of Death promo box: blood-red palette and a small arena where face balls spin their blades. */
.linhthe--cod {
	background:
		radial-gradient(28rem 18rem at 100% 0%, rgba(229, 48, 63, .45), transparent 65%),
		radial-gradient(26rem 18rem at 0% 100%, rgba(167, 123, 255, .28), transparent 65%),
		linear-gradient(135deg, #2a0b12, #12070b);
}
.linhthe--cod .linhthe__badge { background: #ff4d5e; color: #fff; }
.linhthe--cod .linhthe__go { background: linear-gradient(135deg, #ff4d5e, #9a1424); box-shadow: 0 8px 24px rgba(229, 48, 63, .4); }
.cod-scene { position: relative; width: 220px; height: 220px; margin-right: .5rem; border-radius: 50%;
	background: radial-gradient(circle, #0f2a1b, #04100a 72%); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
.cod-scene__ring { position: absolute; inset: 0; border-radius: 50%; border: 4px solid #ff5d6c; box-shadow: 0 0 22px rgba(255, 60, 80, .6), inset 0 0 18px rgba(255, 60, 80, .35); }
.cod-scene__ball { position: absolute; width: 56px; height: 56px; }
.cod-scene__ball img { width: 100%; height: 100%; border-radius: 50%; border: 3px solid #fff; background: #3a1520; object-fit: cover; position: relative; z-index: 1; }
.cod-scene__ball i { position: absolute; left: 50%; top: 50%; width: 52px; height: 6px; margin-top: -3px; border-radius: 3px; transform-origin: 0 50%;
	background: linear-gradient(90deg, #6b4a2a 0 30%, #ffe08a 30%); animation: cod-spin 1.6s linear infinite; }
.cod-scene__ball:nth-child(2) { left: 30px; top: 120px; animation: cod-drift 5s ease-in-out infinite alternate; }
.cod-scene__ball:nth-child(3) { left: 128px; top: 52px; animation: cod-drift 6s ease-in-out -2s infinite alternate-reverse; }
.cod-scene__ball:nth-child(3) i { background: linear-gradient(90deg, #3a2440 0 30%, #b28cff 30%); animation-direction: reverse; }
.cod-scene__ball:nth-child(4) { left: 70px; top: 26px; width: 46px; height: 46px; animation: cod-drift 4.5s ease-in-out -1s infinite alternate; }
.cod-scene__ball:nth-child(4) i { background: linear-gradient(90deg, #c98ab5 0 40%, #fff 40%); animation-duration: 2.2s; }
@keyframes cod-spin { to { transform: rotate(360deg); } }
@keyframes cod-drift { to { transform: translate(18px, 14px); } }
@media (max-width: 760px) {
	.cod-scene { order: -1; justify-self: center; }
}
@media (prefers-reduced-motion: reduce) { .cod-scene__ball, .cod-scene__ball i { animation: none; } }

/* ---------- 404 ---------- */

.not-found { text-align: center; padding-top: 3rem; max-width: 640px; }
.not-found__code { font-size: 5rem; font-weight: 800; line-height: 1; margin: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.not-found .search-form { display: flex; gap: .5rem; max-width: 420px; margin: 0 auto 1.5rem; }
.not-found .search-field { flex: 1; }

/* ---------- Footer ---------- */

.site-footer { position: relative; overflow: hidden; margin-top: 2rem; background: var(--footer-bg); color: rgba(233, 235, 247, .72); font-size: .92rem; }
.site-footer::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--brand), var(--brand-2), #ffb547); }
.site-footer::after { content: ""; position: absolute; width: 38rem; height: 38rem; right: -12rem; top: -20rem; background: radial-gradient(circle, rgba(139, 116, 255, .22), transparent 65%); pointer-events: none; }
.site-footer a { color: #e9ebf7; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.footer-main { position: relative; z-index: 1; display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2rem 2.5rem; padding: 3.25rem 0 2.5rem; }
.footer-brand .site-title { font-size: 1.7rem; color: #fff; }
.footer-brand .site-title__icon { width: 42px; height: 42px; }
.footer-brand p { margin: .75rem 0 1.25rem; max-width: 22rem; line-height: 1.6; }
.footer-col h2 { margin: 0 0 .9rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: #fff; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-col a { color: rgba(233, 235, 247, .78); }
.footer-col .otk-type { margin: 0; }
.footer-types { display: flex !important; flex-wrap: wrap; gap: .35rem !important; }
.footer-types a:hover { text-decoration: none; filter: brightness(1.15); }

.footer-social { display: flex; gap: .5rem; flex-wrap: wrap; }
.footer-social a { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08); transition: background .15s, transform .15s; }
.footer-social a:hover { background: linear-gradient(135deg, var(--brand), var(--brand-2)); transform: translateY(-2px); }

.footer-search { display: flex; margin-bottom: 1.25rem; max-width: 22rem; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: .25rem; }
.footer-search input { flex: 1; min-width: 0; background: transparent; border: 0; color: #fff; padding: .45em .7em; }
.footer-search input::placeholder { color: rgba(233, 235, 247, .5); }
.footer-search button { padding: .45em .9em; border-radius: 9px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

.footer-bottom { position: relative; z-index: 1; border-top: 1px solid rgba(255, 255, 255, .08); padding: 1.25rem 0 1.75rem; display: flex; gap: 1rem 2rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; font-size: .82rem; color: rgba(233, 235, 247, .55); }
.footer-bottom p { margin: 0; max-width: 46rem; }
.footer-bottom .to-top { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem; padding: .4em .9em; border-radius: 999px; background: rgba(255, 255, 255, .07); color: #e9ebf7; }
.footer-bottom .to-top:hover { background: rgba(255, 255, 255, .14); text-decoration: none; }

@media (max-width: 900px) {
	.footer-main { grid-template-columns: 1fr 1fr; }
	.footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
	.footer-main { grid-template-columns: 1fr; padding-top: 2.5rem; }
}

/* ---------- Comments ---------- */

.comments-area { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.comment-form textarea { width: 100%; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; }
}

/* ---------- FAQ (Otakuchar SEO) ---------- */

.otk-faq { margin: 3rem 0 1rem; }
.otk-faq__title { margin: 0 0 1.1rem; }
.otk-faq__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1.25rem; align-items: start; }
.otk-faq__col { display: grid; gap: .75rem; min-width: 0; }
.otk-faq__item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.otk-faq__item summary { position: relative; cursor: pointer; list-style: none; padding: .85rem 2.6rem .85rem 1rem; font-weight: 650; line-height: 1.4; }
.otk-faq__item summary::-webkit-details-marker { display: none; }
.otk-faq__item summary::after { content: "+"; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-size: 1.3rem; font-weight: 400; color: var(--brand); transition: transform .2s; }
.otk-faq__item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.otk-faq__item[open] summary { border-bottom: 1px solid var(--border); }
.otk-faq__item summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 12px; }
.otk-faq__answer { padding: .8rem 1rem .2rem; color: var(--muted); font-size: .97rem; }
.otk-faq__answer p { margin: 0 0 .8em; }
@media (max-width: 760px) { .otk-faq__cols { grid-template-columns: 1fr; } }

/* ---------- Edit buttons (logged-in editors only) ---------- */

.otk-edit {
	position: absolute; top: .4rem; right: .4rem; z-index: 40; display: inline-flex; align-items: center;
	padding: .2em .65em; border-radius: 999px; background: #2271b1; color: #fff !important; font: 600 12px/1.6 var(--font);
	text-decoration: none !important; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); opacity: .85; white-space: nowrap;
}
.otk-edit:hover { opacity: 1; background: #135e96; }
.site-brand > .otk-edit, .site-nav > .otk-edit { top: -.5rem; right: -.5rem; }
.otk-edit + .otk-edit { display: none; }

/* ---------- Floating buttons: quick menu + back to top ---------- */

.otk-fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; }
.otk-fab__btn {
	position: relative; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid var(--border); border-radius: 50%;
	background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: pointer; text-decoration: none;
	transition: transform .25s ease, opacity .25s ease, background .2s ease;
}
.otk-fab__btn:hover { background: var(--surface-2); filter: none; }
.otk-fab__menu { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border: 0; }
.otk-fab__menu:hover { background: linear-gradient(135deg, var(--brand), var(--brand-2)); transform: scale(1.06); }
.otk-fab__close, .otk-fab.is-open .otk-fab__open { display: none; }
.otk-fab.is-open .otk-fab__close { display: block; }
.otk-fab__top { opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none; }
.otk-fab.is-scrolled .otk-fab__top { opacity: 1; transform: none; pointer-events: auto; }
.otk-fab__ring { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); transform: rotate(-90deg); pointer-events: none; }
.otk-fab__ring circle { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .1s linear; }

.otk-quick {
	position: absolute; right: 0; bottom: calc(100% + .6rem); width: min(300px, calc(100vw - 32px)); padding: .9rem; border: 1px solid var(--border); border-radius: 16px;
	background: var(--surface); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); opacity: 0; transform: translateY(10px) scale(.97); transform-origin: bottom right;
	transition: opacity .2s ease, transform .2s ease;
}
.otk-quick.is-visible { opacity: 1; transform: none; }
.otk-quick__title { margin: 0 0 .5rem; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.otk-quick ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.otk-quick a { display: grid; gap: .05rem; padding: .55rem .7rem .55rem .9rem; border-radius: 10px; border-left: 3px solid var(--accent, var(--brand)); color: var(--text); text-decoration: none; background: var(--surface-2); }
.otk-quick a:hover, .otk-quick a:focus-visible { background: color-mix(in srgb, var(--accent, var(--brand)) 18%, var(--surface-2)); }
.otk-quick a strong { font-size: .95rem; line-height: 1.3; }
.otk-quick a span { font-size: .8rem; color: var(--muted); line-height: 1.3; }
.otk-quick__search { margin: .7rem 0 0; }
.otk-quick__search input { width: 100%; font-size: .9rem; }
@media (prefers-reduced-motion: reduce) { .otk-fab__btn, .otk-quick { transition: none; } }
@media print { .otk-fab { display: none; } }
.home-section > .otk-edit { top: -1.9rem; right: 0; }

/* ---------- Install as an app (inc/pwa.php) ---------- */

.otk-app-cta { padding: 2rem 0; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 22%, var(--bg)), color-mix(in srgb, var(--brand-2) 16%, var(--bg))); border-top: 1px solid var(--border); }
.otk-app-cta__inner { display: flex; align-items: center; gap: 1.1rem 1.5rem; flex-wrap: wrap; }
.otk-app-cta img { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--shadow); }
.otk-app-cta__text { flex: 1 1 22rem; }
.otk-app-cta h2 { margin: 0 0 .25rem; font-size: 1.3rem; }
.otk-app-cta p { margin: 0; color: var(--muted); font-size: .95rem; }
.otk-app-cta__actions { display: flex; align-items: center; gap: .6rem 1.1rem; flex-wrap: wrap; }
.otk-app-cta__actions button { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-radius: 999px; padding: .7em 1.4em; }
.otk-app-cta__actions a { font-weight: 600; }

.footer-bottom__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.footer-bottom button.to-top { font-size: inherit; font-weight: 400; line-height: inherit; }

.otk-quick__install { display: flex; align-items: center; gap: .5rem; width: 100%; margin-top: .5rem; padding: .55rem .9rem; border-radius: 10px; font-size: .9rem; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }

.otk-install-link { border-radius: 999px; }

.otk-install {
	position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 70; display: flex; align-items: center; gap: .7rem;
	max-width: 520px; margin: 0 auto; padding: .7rem .7rem .7rem .8rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
.otk-install[hidden] { display: none; }
.otk-install img { flex: 0 0 auto; border-radius: 10px; }
.otk-install p { flex: 1 1 auto; display: grid; margin: 0; font-size: .85rem; line-height: 1.35; }
.otk-install p span { color: var(--muted); font-size: .8rem; }
.otk-install__go { flex: 0 0 auto; padding: .5em 1em; border-radius: 999px; font-size: .9rem; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.otk-install__close { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; background: transparent; color: var(--muted); }
body.has-install-bar .otk-fab { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 84px); }

.otk-ios { width: min(420px, calc(100vw - 32px)); padding: 1.3rem 1.4rem; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 18px 50px rgba(0, 0, 0, .5); }
.otk-ios::backdrop { background: rgba(5, 7, 15, .65); }
.otk-ios h2 { margin: 0 0 .8rem; font-size: 1.15rem; }
.otk-ios ol { padding-left: 1.2rem; margin-bottom: .8rem; }
.otk-ios li { margin-bottom: .45rem; }
.otk-ios svg { vertical-align: -4px; color: var(--link); }
.otk-ios__note { font-size: .85rem; color: var(--muted); }
.otk-ios form { margin: 0; text-align: right; }

.otk-guide__cta { display: flex; gap: 1.1rem; align-items: flex-start; padding: 1.2rem; margin-bottom: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 16%, var(--surface)), var(--surface)); }
.otk-guide__cta img { flex: 0 0 auto; border-radius: 18px; }
.otk-guide__lead { margin: 0 0 .9rem; }
.otk-guide__go { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-radius: 999px; padding: .7em 1.5em; }
.otk-guide__done { margin: 0; font-weight: 600; color: var(--link); }
.otk-guide__os { margin: 0 0 .7rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.otk-guide__os summary { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; font-weight: 700; cursor: pointer; }
.otk-guide__os[open] summary { border-bottom: 1px solid var(--border); }
.otk-guide__os ol { margin: .9rem 0 .6rem; padding: 0 1rem 0 2.3rem; }
.otk-guide__os li { margin-bottom: .45rem; }
.otk-guide__tip { margin: 0; padding: 0 1rem 1rem; font-size: .9rem; color: var(--muted); }
.otk-guide__yours { margin-left: auto; padding: .1em .6em; border-radius: 999px; font-size: .75rem; background: var(--brand); color: #fff; }
.otk-guide__ico { vertical-align: -3px; color: var(--link); }
@media (max-width: 560px) { .otk-guide__cta { flex-direction: column; } }

/* Google Play badge (inc/pwa.php otakuchar_play_badge): Google's artwork as is, with clear space around it. */
.otk-play { display: inline-block; line-height: 0; border-radius: 8px; transition: transform .15s, box-shadow .15s; }
.otk-play img { display: block; width: auto; max-width: 100%; }
.otk-play:hover, .otk-play:focus-visible { transform: translateY(-1px); box-shadow: 0 0 0 2px var(--brand-2); outline: none; }
.otk-app-cta__actions .otk-play img { height: 48px; }
.otk-app-cta__actions .otk-app-cta__web { background: transparent; color: var(--text); border: 1px solid var(--border); padding: .6em 1.2em; }
.footer-app { margin-top: 1.1rem; }
.footer-app .otk-play img { height: 44px; }
.otk-quick__play { margin-top: .6rem; text-align: center; }
.otk-quick__play .otk-play img { height: 40px; }
.otk-guide__actions { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem 1rem; }
.otk-guide__actions .otk-play img { height: 52px; }
.otk-guide__go--web { background: transparent; color: var(--text); border: 1px solid var(--border); }
p.otk-play-legal { margin-top: 1.5rem; font-size: .8rem; color: var(--muted); }
.is-ios .otk-play, .is-ios .footer-app, .is-ios .otk-quick__play { display: none !important; }
/* iPhone has no Play Store: the web install stays the main button there. */
.is-ios .otk-app-cta__web, .is-ios .otk-guide__go--web { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border: 0; }

/* Android: the CH Play app is the one to install, so the web install buttons step aside (the guide still explains it). */
.is-android .otk-app-cta__web, .is-android .otk-guide__go--web { display: none; }

/* Inside the installed app (web install or the CH Play app) there is nothing to install. */
.is-app [data-otk-install], .is-app .otk-app-cta, .is-app .otk-install, .is-app .otk-play, .is-app .footer-app, .is-app .otk-quick__play, .is-app .otk-guide__actions { display: none !important; }
@media (display-mode: standalone) { [data-otk-install], .otk-app-cta, .otk-install, .otk-play, .footer-app, .otk-quick__play, .otk-guide__actions { display: none !important; } }
@media print { .otk-app-cta, .otk-install { display: none; } }

/* Page loading feedback (assets/theme.js): top bar right away, spinner when slow. */
.otk-loader { position: fixed; inset: 0 0 auto; z-index: 9999; pointer-events: none; }
.otk-loader__bar { position: absolute; top: 0; left: 0; height: 3px; width: 100%; transform: scaleX(0); transform-origin: left; opacity: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); box-shadow: 0 0 10px var(--brand-2); }
.otk-loader.is-active .otk-loader__bar { opacity: 1; animation: otk-load 8s cubic-bezier(.08, .8, .2, 1) forwards; }
@keyframes otk-load { 0% { transform: scaleX(0); } 10% { transform: scaleX(.35); } 40% { transform: scaleX(.7); } 100% { transform: scaleX(.94); } }
.otk-loader__spin { position: fixed; left: 50%; top: 50%; display: flex; align-items: center; gap: .6rem; padding: .7rem 1.1rem; border-radius: 999px; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: .9rem; font-weight: 600; opacity: 0; visibility: hidden; transform: translate(-50%, -50%) scale(.92); transition: opacity .2s, transform .2s, visibility 0s .2s; }
.otk-loader.is-slow .otk-loader__spin { opacity: 1; visibility: visible; transform: translate(-50%, -50%); transition: opacity .2s, transform .2s; }
.otk-loader__spin span { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--border); border-top-color: var(--brand); animation: otk-spin .7s linear infinite; }
@keyframes otk-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .otk-loader.is-active .otk-loader__bar { animation: none; transform: scaleX(.6); } .otk-loader__spin span { animation-duration: 1.6s; } }

/* ---------- Share bar (inc/share.php, assets/share.js) ---------- */

.otk-share { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .7rem; min-height: 38px; margin: 0 0 1.25rem; }
.otk-share__label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.otk-share__list { display: flex; flex-wrap: wrap; gap: .4rem; }
.otk-share__btn {
	display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid var(--border);
	background: var(--surface-2); color: var(--text); transition: transform .15s ease, background .15s ease, color .15s ease;
}
.otk-share__btn svg { width: 20px; height: 20px; }
.otk-share__btn:hover { transform: translateY(-2px); filter: none; color: #fff; border-color: transparent; background: var(--share, var(--brand)); }
.otk-share__btn--zalo { --share: #0068ff; }
.otk-share__btn--zalo svg { width: 28px; height: 28px; }
.otk-share__btn--facebook { --share: #1877f2; }
.otk-share__btn--messenger { --share: linear-gradient(135deg, #0a7cff, #a033ff 60%, #ff5280); }
.otk-share__btn--x { --share: #000; }
.otk-share__btn--telegram { --share: #229ed9; }
.otk-share__btn--instagram { --share: linear-gradient(45deg, #f9ce34, #ee2a7b 50%, #6228d7); }
.otk-share__btn--copy, .otk-share__btn--print, .otk-share__btn--more { --share: var(--brand); }
@media (prefers-reduced-motion: reduce) { .otk-share__btn { transition: none; } .otk-share__btn:hover { transform: none; } }

/* A result inside a game or a comparison: a framed box. */
.otk-share--result { justify-content: center; margin: 1rem 0 0; padding: .7rem .9rem; border: 1px dashed var(--border); border-radius: 12px; background: color-mix(in srgb, var(--brand) 8%, transparent); }

/* Someone opened a friend's result link. */
.otk-challenge { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; margin: 0 0 1.25rem; padding: .9rem 1.1rem; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--brand) 45%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 20%, var(--surface)), color-mix(in srgb, var(--brand-2) 12%, var(--surface))); }
.otk-challenge p { flex: 1 1 18rem; margin: 0; }
.otk-challenge strong { font-size: 1.15em; }
.otk-challenge a { flex: 0 0 auto; padding: .55em 1.2em; border-radius: 999px; font-weight: 700; text-decoration: none; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }

.otk-share-toast {
	position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 9998; max-width: calc(100vw - 32px); padding: .7rem 1.1rem; border-radius: 12px;
	background: var(--text); color: var(--bg); font-size: .9rem; font-weight: 600; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translate(-50%, 12px);
	transition: opacity .2s, transform .2s, visibility 0s .2s;
}
.otk-share-toast.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .2s, transform .2s; }


.otk-print-src { display: none; }

/* ---------- Print: just the page content on white paper ---------- */

@media print {
	:root, :root[data-theme="light"] { --bg: #fff; --surface: #fff; --surface-2: #f2f3f7; --text: #111; --muted: #444; --border: #ccc; --link: #111; color-scheme: light; }
	body { font-size: 12pt; background: #fff; color: #111; }
	.site-header, .sub-nav, .site-footer, .skip-link, .otk-share, .otk-share-toast, .otk-challenge a, .otk-loader, .otk-edit, .otk-breadcrumb, .otk-fab, .comments-area, .nav-toggle, .theme-toggle, .lang-switch { display: none !important; }
	.site-main { padding: 0; }
	a { color: inherit; text-decoration: none; }
	img { break-inside: avoid; }
	h1, h2, h3 { break-after: avoid; }
	.otk-print-src { display: block !important; margin-top: 1.5rem; font-size: 9pt; color: #555; }
}
