/* ==========================================================================
   TeachmeAmine LMS — glass design system
   Colours come from the settings page (CSS variables injected inline).
   Logical properties everywhere, so RTL and LTR both work.
   ========================================================================== */

@font-face { font-family: "Readex Pro"; font-style: normal; font-weight: 160 700; font-display: swap;
	src: url(../fonts/readex-pro-arabic.woff2) format("woff2");
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Readex Pro"; font-style: normal; font-weight: 160 700; font-display: swap;
	src: url(../fonts/readex-pro-latin-ext.woff2) format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Readex Pro"; font-style: normal; font-weight: 160 700; font-display: swap;
	src: url(../fonts/readex-pro-latin.woff2) format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
	--tma-primary: #2450d8; --tma-primary-rgb: 36, 80, 216;
	--tma-ink: #0e1b3f; --tma-ink-rgb: 14, 27, 63;
	--tma-accent: #ffb22c; --tma-accent-rgb: 255, 178, 44;
	--tma-bg: #eef3ff;
	--tma-ok: #16a777;
	--tma-bad: #e2434b;
	--tma-font: "Readex Pro", "Cairo", "SF Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
	--tma-primary-dark: color-mix(in srgb, var(--tma-primary) 78%, #000);
	--tma-muted: rgba(var(--tma-ink-rgb), .62);
	--tma-line: rgba(var(--tma-primary-rgb), .12);
	--tma-fill: rgba(255, 255, 255, .62);
	--tma-fill-2: rgba(255, 255, 255, .82);
	--tma-hair: rgba(255, 255, 255, .9);
	--tma-r-sm: 14px; --tma-r-md: 20px; --tma-r-lg: 28px;
	--tma-sh-sm: 0 1px 2px rgba(var(--tma-primary-rgb), .06), 0 8px 18px -10px rgba(var(--tma-primary-rgb), .25);
	--tma-sh-md: 0 2px 4px rgba(var(--tma-primary-rgb), .05), 0 20px 42px -20px rgba(var(--tma-primary-rgb), .34);
	--tma-sh-lg: 0 4px 8px rgba(var(--tma-primary-rgb), .06), 0 34px 70px -28px rgba(var(--tma-primary-rgb), .48);
	--tma-ease: cubic-bezier(.22, .9, .3, 1);
	--tma-glass: blur(18px) saturate(160%);
	--tma-btn-bg:
		linear-gradient(180deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, 0) 52%),
		linear-gradient(160deg, color-mix(in srgb, var(--tma-primary) 84%, #fff) 0%, var(--tma-primary) 48%, var(--tma-primary-dark) 100%);
	--tma-bnav-h: 0px;
	--tma-night: #0e1b3f; --tma-night-rgb: 14, 27, 63;
	--tma-surf-rgb: 255, 255, 255; --tma-card: #fff; --tma-hl: #fff;
	--tma-primary-base: #2450d8;
	--mx: 0; --my: 0;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
html:has(body.tma) { overflow-x: clip; }
body.tma {
	margin: 0; min-height: 100vh;
	font-family: var(--tma-font); font-size: 16px; line-height: 1.8; font-weight: 300;
	color: var(--tma-ink); background: var(--tma-bg);
	-webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
	overflow-x: clip;
}
body.tma :is(button, input, select, textarea) { font: inherit; color: inherit; }
body.tma img { max-width: 100%; height: auto; }
body.tma :where(a) { color: var(--tma-primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
body.tma :is(b, strong) { font-weight: 600; }
body.tma h1, body.tma h2, body.tma h3, body.tma h4 { line-height: 1.35; font-weight: 600; margin: 0 0 .5em; text-wrap: balance; }
body.tma ::selection { background: rgba(var(--tma-accent-rgb), .45); color: var(--tma-night); }
body.tma :focus-visible { outline: 3px solid color-mix(in srgb, var(--tma-accent) 85%, #fff); outline-offset: 2px; border-radius: 10px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tma-skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 999; padding: 10px 16px; border-radius: 12px; background: var(--tma-night); color: #fff !important; }
.tma-skip:focus { top: 12px; }
.tma-hp { position: absolute !important; inset-inline-start: -9999px; }

/* Living background: soft orbs + grain (gives the glass something to refract) */
html:has(body.tma)::before {
	content: ""; position: fixed; inset: 0; z-index: -3; pointer-events: none;
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
		linear-gradient(180deg, color-mix(in srgb, var(--tma-bg) 90%, var(--tma-primary)) 0%, var(--tma-bg) 40%, color-mix(in srgb, var(--tma-bg) 94%, var(--tma-accent)) 100%);
}
body.tma::before, body.tma::after {
	content: ""; position: fixed; z-index: -2; pointer-events: none; border-radius: 50%;
	width: 70vmax; height: 70vmax; will-change: transform;
}
body.tma::before {
	top: -28vmax; inset-inline-end: -24vmax;
	background: radial-gradient(circle, rgba(var(--tma-primary-rgb), .22), transparent 66%);
	translate: calc(var(--mx) * -30px) calc(var(--my) * -24px);
	animation: tma-drift-a 40s ease-in-out infinite alternate;
}
body.tma::after {
	bottom: -32vmax; inset-inline-start: -26vmax;
	background: radial-gradient(circle, rgba(var(--tma-accent-rgb), .2), transparent 66%);
	translate: calc(var(--mx) * 26px) calc(var(--my) * 20px);
	animation: tma-drift-b 48s ease-in-out infinite alternate;
}
@keyframes tma-drift-a { to { transform: translate3d(-6vmax, 8vmax, 0) scale(1.08); } }
@keyframes tma-drift-b { to { transform: translate3d(7vmax, -6vmax, 0) scale(1.1); } }

.tma-wrap { width: min(1240px, 100% - 28px); margin-inline: auto; }
.tma-main { display: block; min-height: 60vh; padding-bottom: 48px; }

/* ---------- Buttons ---------- */
.tma-btn {
	position: relative; isolation: isolate; overflow: hidden;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 46px; padding: 0 22px; border: 0; border-radius: 16px; cursor: pointer;
	font-weight: 500; font-size: 15.5px; line-height: 1.2; letter-spacing: 0;
	color: #fff !important; text-decoration: none !important; text-shadow: 0 1px 0 rgba(0, 0, 0, .2);
	background: var(--tma-btn-bg);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .34), inset 0 -2px 0 rgba(0, 0, 0, .22), 0 0 0 1px rgba(var(--tma-primary-rgb), .95), 0 14px 24px -12px rgba(var(--tma-primary-rgb), .7);
	transition: transform .3s var(--tma-ease), box-shadow .3s var(--tma-ease);
}
.tma-btn::before {
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background: linear-gradient(110deg, transparent 32%, rgba(255, 255, 255, .38) 50%, transparent 68%);
	transform: translateX(-135%); transition: transform .9s var(--tma-ease);
}
@media (hover: hover) {
	.tma-btn:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -2px 0 rgba(0, 0, 0, .22), 0 0 0 1px rgba(var(--tma-primary-rgb), .95), 0 0 0 5px rgba(var(--tma-accent-rgb), .25), 0 20px 30px -14px rgba(var(--tma-primary-rgb), .75); }
	.tma-btn:hover::before { transform: translateX(135%); }
}
.tma-btn:active { transform: translateY(1px) scale(.985); }
.tma-btn--ghost {
	color: var(--tma-ink) !important; text-shadow: none;
	background: var(--tma-fill-2); -webkit-backdrop-filter: var(--tma-glass); backdrop-filter: var(--tma-glass);
	box-shadow: inset 0 1px 0 var(--tma-hl), 0 0 0 1px var(--tma-line), var(--tma-sh-sm);
}
@media (hover: hover) { .tma-btn--ghost:hover { background: #fff; box-shadow: inset 0 1px 0 var(--tma-hl), 0 0 0 1px var(--tma-line), var(--tma-sh-md); } }
.tma-btn--lg { min-height: 54px; padding: 0 26px; font-size: 16.5px; border-radius: 18px; }
.tma-btn--sm { min-height: 38px; padding: 0 16px; font-size: 14px; border-radius: 13px; }
.tma-btn--xs { min-height: 32px; padding: 0 13px; font-size: 13px; border-radius: 11px; }
.tma-btn .tma-i { flex: none; }

/* ---------- Header ---------- */
.tma-hdr { position: sticky; top: 0; z-index: 80; padding: 10px 12px 0; pointer-events: none; }
.admin-bar .tma-hdr { top: 32px; }
@media (max-width: 782px) { .admin-bar .tma-hdr { top: 0; } }
.tma-hdr__bar {
	pointer-events: auto; max-width: 1240px; margin: 0 auto;
	display: flex; align-items: center; gap: 14px; min-height: 64px; padding-block: 8px; padding-inline: 16px 10px;
	border-radius: 24px; color: #fff;
	background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 60%), color-mix(in srgb, var(--tma-night) 88%, transparent);
	-webkit-backdrop-filter: blur(22px) saturate(165%); backdrop-filter: blur(22px) saturate(165%);
	border: 1px solid rgba(255, 255, 255, .12);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 22px 44px -22px rgba(var(--tma-night-rgb), .7);
}
.tma-brand, .tma-hdr .custom-logo-link { display: inline-flex; align-items: center; gap: 10px; color: inherit !important; text-decoration: none !important; flex: none; }
.tma-hdr .custom-logo { max-height: 42px; width: auto; }
.tma-brand__mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: #fff; background: var(--tma-btn-bg); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 14px -6px rgba(var(--tma-primary-rgb), .9); }
.tma-brand__name { font-weight: 650; font-size: 18px; letter-spacing: -.01em; }
.tma-hdr__nav { flex: 1; min-width: 0; }
.tma-hdr__nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.tma-hdr__nav li { position: relative; }
.tma-hdr__nav a { display: block; padding: 8px 14px; border-radius: 12px; color: rgba(255, 255, 255, .82); text-decoration: none; font-weight: 500; font-size: 15px; transition: background-color .2s, color .2s; }
.tma-hdr__nav a:hover, .tma-hdr__nav [aria-current="page"], .tma-hdr__nav .current-menu-item > a { color: #fff; background: rgba(255, 255, 255, .1); }
.tma-hdr__nav .sub-menu { display: none; position: absolute; top: 100%; inset-inline-start: 0; min-width: 200px; padding: 8px; border-radius: 18px; background: color-mix(in srgb, var(--tma-night) 94%, transparent); box-shadow: var(--tma-sh-lg); flex-direction: column; }
.tma-hdr__nav li:hover > .sub-menu, .tma-hdr__nav li:focus-within > .sub-menu { display: flex; }
.tma-hdr__search {
	display: flex; align-items: center; gap: 8px; width: min(280px, 26vw); height: 42px; padding: 0 14px; border-radius: 14px;
	background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .7);
	transition: background-color .2s, border-color .2s;
}
.tma-hdr__search:focus-within { background: rgba(255, 255, 255, .16); border-color: rgba(var(--tma-accent-rgb), .7); }
.tma-hdr__search input { flex: 1; min-width: 0; border: 0; background: transparent; color: #fff; outline: 0; font-size: 14.5px; }
.tma-hdr__search input::placeholder { color: rgba(255, 255, 255, .6); }
.tma-hdr__act { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.tma-ib {
	position: relative; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 14px; cursor: pointer;
	color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); transition: transform .25s var(--tma-ease), background-color .2s;
}
.tma-ib:hover { background: rgba(255, 255, 255, .16); transform: translateY(-1px); }
.tma-ib__n { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; font-size: 11px; font-weight: 700; line-height: 19px; color: var(--tma-night); background: var(--tma-accent); box-shadow: 0 0 0 2px var(--tma-night); }
.tma-ib--search { display: none; }
.tma-install[hidden] { display: none; }
.tma-xppill { display: inline-flex; align-items: center; gap: 2px; height: 42px; padding: 0 6px; border-radius: 14px; text-decoration: none !important; color: #fff !important; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); font-weight: 600; font-size: 14px; }
.tma-xppill > span { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; }
.tma-xppill__fire .tma-i { color: #ff8a3d; }
.tma-xppill__xp .tma-i { color: var(--tma-accent); }
.tma-xppill.is-bump { animation: tma-bump .6s var(--tma-ease); }
@keyframes tma-bump { 40% { transform: scale(1.12); } }
.tma-avatar { width: 42px; height: 42px; padding: 0; border: 2px solid rgba(255, 255, 255, .5); border-radius: 50%; overflow: hidden; cursor: pointer; background: transparent; }
.tma-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tma-hdr .tma-btn--ghost { background: rgba(255, 255, 255, .1); color: #fff !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 0 0 1px rgba(255, 255, 255, .14); }
.tma-show-sm { display: none !important; }

/* Dropdowns */
.tma-dd { position: relative; }
.tma-dd__menu {
	position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 90; width: 250px; padding: 8px;
	border-radius: 22px; color: var(--tma-ink);
	background: rgba(var(--tma-surf-rgb), .9); -webkit-backdrop-filter: blur(26px) saturate(170%); backdrop-filter: blur(26px) saturate(170%);
	border: 1px solid var(--tma-hair); box-shadow: var(--tma-sh-lg);
	transform-origin: top; animation: tma-pop .25s var(--tma-ease);
}
.tma-dd__menu--wide { width: min(340px, 92vw); }
@keyframes tma-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.tma-dd__menu > a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; color: var(--tma-ink); text-decoration: none; font-size: 14.5px; }
.tma-dd__menu > a:hover { background: rgba(var(--tma-primary-rgb), .07); }
.tma-dd__menu > a .tma-i { color: var(--tma-primary); }
.tma-dd__title { margin: 4px 12px 8px; font-weight: 650; }
.tma-dd__title small { display: block; font-weight: 400; color: var(--tma-muted); font-size: 13px; }
.tma-dd__foot { justify-content: center; margin-top: 4px; font-weight: 600; color: var(--tma-primary) !important; }

/* ---------- Sections ---------- */
.tma-sec {
	position: relative; margin-block: 18px; padding: 22px;
	border-radius: var(--tma-r-lg);
	background: linear-gradient(160deg, rgba(var(--tma-surf-rgb), .78), rgba(var(--tma-surf-rgb), .5));
	-webkit-backdrop-filter: var(--tma-glass); backdrop-filter: var(--tma-glass);
	border: 1px solid var(--tma-hair);
	box-shadow: inset 0 1px 0 var(--tma-hl), 0 0 0 1px var(--tma-line), var(--tma-sh-md);
}
.tma-sec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tma-sec__title { font-size: clamp(19px, 2.2vw, 23px); margin: 0; }
.tma-sec__more { flex: none; font-size: 14px; font-weight: 600; text-decoration: none !important; }
.tma-sec__more:hover { text-decoration: underline !important; }
.tma-sec__sub { margin: -6px 0 14px; color: var(--tma-muted); font-size: 14.5px; }
.tma-empty { color: var(--tma-muted); font-size: 14.5px; margin: 6px 0; }
.tma-side .tma-sec__title { font-size: 17px; }

/* Home layout */
.tma-home { display: grid; gap: 0 24px; padding-top: 14px; }
.tma-home__main, .tma-home__side { min-width: 0; }
@media (min-width: 1100px) {
	.tma-home--side { grid-template-columns: minmax(0, 1fr) 340px; }
	.tma-home__side { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; scrollbar-width: thin; padding-inline: 2px; }
}

/* ---------- Hero ---------- */
.tma-hero {
	position: relative; display: grid; align-items: center; gap: 8px 32px; margin-block: 18px; padding: 30px 26px 0;
	border-radius: 34px; overflow: hidden; color: #fff; isolation: isolate;
	background:
		radial-gradient(120% 80% at 85% 0%, rgba(var(--tma-primary-rgb), .65), transparent 60%),
		radial-gradient(70% 60% at 0% 100%, rgba(var(--tma-accent-rgb), .25), transparent 70%),
		linear-gradient(160deg, color-mix(in srgb, var(--tma-night) 92%, var(--tma-primary)) 0%, var(--tma-night) 70%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 40px 70px -40px rgba(var(--tma-night-rgb), .9);
}
.tma-hero::after { /* fine grid, like a notebook page */
	content: ""; position: absolute; inset: 0; z-index: -1; opacity: .07;
	background-image: linear-gradient(rgba(255, 255, 255, 1) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 1) 1px, transparent 1px);
	background-size: 28px 28px; mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.tma-hero__hi { margin: 0 0 4px; font-size: 17px; color: rgba(255, 255, 255, .8); }
.tma-hero__title { font-size: clamp(28px, 4.4vw, 48px); line-height: 1.25; font-weight: 600; margin: 0 0 12px; max-width: 16ch; }
.tma-hero__lead { font-size: clamp(16px, 1.6vw, 18.5px); color: rgba(255, 255, 255, .82); max-width: 44ch; margin: 0 0 22px; }
.tma-hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.tma-hero .tma-btn { background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 60%), var(--tma-accent); color: var(--tma-night) !important; text-shadow: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(0, 0, 0, .12), 0 16px 26px -12px rgba(var(--tma-accent-rgb), .8); }
.tma-hero .tma-btn--ghost { background: rgba(255, 255, 255, .1); color: #fff !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 1px rgba(255, 255, 255, .22); }
.tma-hero__pills { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tma-hero__pills li { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 99px; font-size: 13.5px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.tma-hero__pills .tma-i { color: var(--tma-accent); }
.tma-hero__art { position: relative; margin-inline: -8px; align-self: end; }
.tma-hero__art img { display: block; width: 100%; max-width: 520px; margin-inline: auto; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .35)); transform: translate3d(calc(var(--mx) * -10px), calc(var(--my) * -8px), 0); transition: transform .6s var(--tma-ease); }
.tma-hero__xp { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 22px; max-width: 460px; }
.tma-hero__xp .tma-bar { flex: 1 1 180px; }
.tma-hero__xp small { color: rgba(255, 255, 255, .75); }
.tma-rankchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-weight: 600; font-size: 14px; color: var(--tma-night); background: var(--tma-accent); }
@media (min-width: 860px) {
	.tma-hero { grid-template-columns: 1.1fr .9fr; padding: 44px 46px 0; min-height: 440px; }
	.tma-hero__txt { padding-bottom: 40px; }
}

/* Progress bars */
.tma-bar { position: relative; display: block; height: 10px; border-radius: 99px; overflow: hidden; background: rgba(var(--tma-primary-rgb), .12); }
.tma-bar > span { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: inherit; background: linear-gradient(90deg, var(--tma-ok), color-mix(in srgb, var(--tma-ok) 70%, var(--tma-card))); transition: width 1s var(--tma-ease); }
.tma-bar--xp { background: rgba(255, 255, 255, .16); }
.tma-bar--xp > span { background: linear-gradient(90deg, var(--tma-accent), #ffd677); box-shadow: 0 0 14px rgba(var(--tma-accent-rgb), .7); }
.tma-sec .tma-bar--xp, .tma-prog .tma-bar--xp { background: rgba(var(--tma-accent-rgb), .18); }

/* ---------- Progress strip ---------- */
.tma-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
@media (min-width: 760px) { .tma-strip { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr); } }
.tma-stat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; background: rgba(var(--tma-surf-rgb), .7); box-shadow: 0 0 0 1px var(--tma-line); color: var(--tma-ink) !important; text-decoration: none !important; min-width: 0; }
.tma-stat > .tma-i { flex: none; color: var(--tma-primary); }
.tma-stat b { display: block; white-space: nowrap; font-size: 22px; line-height: 1.1; font-weight: 700; }
.tma-stat small { display: block; color: var(--tma-muted); font-size: 12.5px; }
.tma-stat--fire > .tma-i { color: #ff7a2f; }
.tma-stat--xp > .tma-i { color: var(--tma-accent); }
.tma-stat--badges { grid-column: 1 / -1; justify-content: space-between; }
@media (min-width: 760px) { .tma-stat--badges { grid-column: auto; } }
.tma-badgerow { display: flex; flex-wrap: wrap; gap: 2px; font-size: 20px; line-height: 1; }
.tma-badgerow span { filter: grayscale(1); opacity: .3; }
.tma-badgerow span.is-on { filter: none; opacity: 1; }

/* ---------- Nudge ---------- */
.tma-nudge { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 14px; border-radius: 20px; text-decoration: none !important; color: var(--tma-ink) !important; background: linear-gradient(135deg, rgba(var(--tma-accent-rgb), .22), rgba(var(--tma-primary-rgb), .08)); box-shadow: 0 0 0 1px rgba(var(--tma-accent-rgb), .4); }
.tma-nudge > .tma-i { color: var(--tma-primary); flex: none; }
.tma-nudge > span:not(.tma-btn) { flex: 1 1 220px; font-size: 15px; }
.tma-nudge .tma-btn { flex: none; }

/* ---------- 3D category carousel (coverflow; each card is placed by JS, so it renders the same on iPhone Safari) ---------- */
.tma-sec.tma-cats { overflow: hidden; -webkit-backdrop-filter: none; backdrop-filter: none; background: linear-gradient(160deg, rgba(var(--tma-surf-rgb), .9), rgba(var(--tma-surf-rgb), .7)); }
.tma-ring { --cw: clamp(150px, 44vw, 210px); --ch: calc(var(--cw) * 1.2); position: relative; user-select: none; -webkit-user-select: none; }
.tma-ring__stage { position: relative; height: calc(var(--ch) + 36px); perspective: 1000px; touch-action: pan-y; cursor: grab; }
.tma-ring__stage.is-drag { cursor: grabbing; }
.tma-ring__track { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.tma-ring__item {
	position: absolute; top: 18px; left: 50%; width: var(--cw); height: var(--ch); margin-left: calc(var(--cw) / -2);
	transform: translate3d(calc(var(--x, 0) * 1px), 0, calc(var(--z, 0) * 1px)) rotateY(calc(var(--ry, 0) * 1deg)) scale(var(--s, 1));
	opacity: var(--o, 1); z-index: var(--zi, 1);
	transition: transform .6s var(--tma-ease), opacity .45s var(--tma-ease);
}
.tma-ring__stage.is-drag .tma-ring__item { transition: none; }
.tma-ring__item[aria-hidden="true"] { pointer-events: none; }
.tma-ring__card {
	position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; padding: 14px; overflow: hidden;
	border-radius: 24px; color: #fff !important; text-decoration: none !important;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 42%),
		linear-gradient(160deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 68%, #000));
	border: 1px solid rgba(255, 255, 255, .45);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 24px 36px -22px color-mix(in srgb, var(--c) 80%, #000);
	transition: filter .5s;
}
.tma-ring__item:not(.is-front) .tma-ring__card { filter: saturate(.8) brightness(.9); }
.tma-ring__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .32; mix-blend-mode: luminosity; }
.tma-ring__icon { position: absolute; top: 12px; inset-inline-start: 12px; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; font-size: 25px; background: rgba(255, 255, 255, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.tma-ring__name { position: relative; font-size: clamp(15px, 4vw, 18px); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; text-shadow: 0 1px 8px rgba(0, 0, 0, .25); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tma-ring__count { position: relative; font-size: 12.5px; opacity: .85; }
.tma-ring__ctrl { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 6px; }
.tma-ring__hint { color: var(--tma-muted); font-size: 13.5px; }
.tma-ring__dots { display: flex; gap: 5px; justify-content: center; margin-top: 10px; }
.tma-ring__dots span { width: 6px; height: 6px; border-radius: 99px; background: rgba(var(--tma-primary-rgb), .2); transition: width .3s var(--tma-ease), background-color .3s; }
.tma-ring__dots span.is-on { width: 18px; background: var(--tma-primary); }
.tma-ring__btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; color: var(--tma-ink); background: var(--tma-fill-2); border: 1px solid var(--tma-hair); box-shadow: 0 0 0 1px var(--tma-line), var(--tma-sh-sm); transition: transform .25s var(--tma-ease); }
.tma-ring__btn:hover { transform: translateY(-2px); }
.tma-ring--flat .tma-ring__stage { height: auto; perspective: none; cursor: auto; }
.tma-ring--flat .tma-ring__track { position: static; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 10px; }
.tma-ring--flat .tma-ring__item { position: relative; top: 0; left: 0; margin: 0; flex: 0 0 var(--cw); transform: none; opacity: 1; scroll-snap-align: start; }
.tma-ring--flat .tma-ring__ctrl, .tma-ring--flat .tma-ring__dots { display: none; }

/* ---------- Cards (courses, games, posts) ---------- */
.tma-cgrid, .tma-ggrid, .tma-pgrid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .tma-cgrid, .tma-ggrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } .tma-pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1200px) { .tma-cgrid, .tma-ggrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tma-pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tma-home .tma-cgrid, .tma-home .tma-ggrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .tma-home .tma-cgrid, .tma-home .tma-ggrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tma-cgrid--scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.tma-cgrid--scroll > * { flex: 0 0 min(260px, 72vw); scroll-snap-align: start; }

.tma-ccard, .tma-gcard, .tma-pcard {
	--ty: 0px; position: relative; display: flex; flex-direction: column; padding: 8px; border-radius: 24px;
	color: var(--tma-ink) !important; text-decoration: none !important;
	background: linear-gradient(160deg, rgba(var(--tma-surf-rgb), .9), rgba(var(--tma-surf-rgb), .6));
	border: 1px solid var(--tma-hair); box-shadow: inset 0 1px 0 var(--tma-hl), 0 0 0 1px var(--tma-line), var(--tma-sh-sm);
	transform-style: preserve-3d; transform: translate3d(0, var(--ty), 0) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
	transition: transform .7s var(--tma-ease), box-shadow .5s var(--tma-ease);
}
.is-tilting { transition: transform .12s linear, box-shadow .5s var(--tma-ease) !important; }
@media (hover: hover) { :is(.tma-ccard, .tma-gcard, .tma-pcard):hover { --ty: -5px; box-shadow: inset 0 1px 0 var(--tma-hl), 0 0 0 1px var(--tma-line), var(--tma-sh-lg); } }
.tma-ccard__media, .tma-gcard__media, .tma-pcard__media { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; background: linear-gradient(140deg, rgba(var(--tma-primary-rgb), .14), rgba(var(--tma-accent-rgb), .16)); }
.tma-gcard__media { aspect-ratio: 4 / 3; }
:is(.tma-ccard__media, .tma-gcard__media, .tma-pcard__media) img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--tma-ease); }
@media (hover: hover) { :is(.tma-ccard, .tma-gcard, .tma-pcard):hover img { transform: scale(1.05); } }
.is-tilting :is(.tma-ccard__media, .tma-gcard__media, .tma-pcard__media) { transform: translateZ(22px); }
.tma-ccard__media::after, .tma-gcard__media::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .35), transparent 60%); transition: opacity .4s; }
.is-tilting .tma-ccard__media::after, .is-tilting .tma-gcard__media::after { opacity: 1; }
.tma-ccard__ph, .tma-gcard__ph { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(var(--tma-primary-rgb), .5); }
.tma-ccard__tag { position: absolute; top: 8px; inset-inline-start: 8px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; color: #fff; background: color-mix(in srgb, var(--tma-ok) 90%, transparent); box-shadow: 0 6px 12px -6px var(--tma-ok); }
.tma-gcard__play { position: absolute; bottom: 10px; inset-inline-end: 10px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--tma-night); background: var(--tma-accent); box-shadow: 0 10px 18px -8px rgba(var(--tma-accent-rgb), .9), inset 0 1px 0 rgba(255, 255, 255, .6); transition: transform .4s var(--tma-ease); }
[dir="rtl"] .tma-gcard__play .tma-i { transform: scaleX(-1); }
@media (hover: hover) { .tma-gcard:hover .tma-gcard__play { transform: scale(1.12); } }
.tma-ccard__body, .tma-gcard__body, .tma-pcard__body { display: flex; flex-direction: column; gap: 6px; padding: 12px 6px 6px; }
.tma-ccard__title, .tma-gcard__title, .tma-pcard__title { font-weight: 600; font-size: 15.5px; line-height: 1.5; }
.tma-ccard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--tma-muted); font-size: 13px; }
.tma-ccard__pct { font-size: 12.5px; color: var(--tma-ok); font-weight: 600; }
.tma-pcard__cat { font-size: 12.5px; font-weight: 600; color: var(--tma-primary); }
.tma-pcard__ex { color: var(--tma-muted); font-size: 14px; }
.tma-chips-sm { display: flex; flex-wrap: wrap; gap: 5px; }
.tma-chip-sm { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--tma-primary); background: rgba(var(--tma-primary-rgb), .09); }

/* ---------- Side widgets ---------- */
.tma-mlist, .tma-nlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tma-mrow { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; color: var(--tma-ink) !important; text-decoration: none !important; }
a.tma-mrow:hover { background: rgba(var(--tma-primary-rgb), .06); }
.tma-mrow img { flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--tma-card), 0 0 0 3px var(--tma-line); }
.tma-mrow__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tma-mrow__txt b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tma-mrow__txt small { color: var(--tma-muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tma-fcb { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.tma-fcb__i { --b: var(--tma-primary); display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; color: #fff; background: var(--b); }
.tma-nlist li > a, .tma-nlist li > span { display: block; padding: 9px 12px; border-radius: 14px; color: var(--tma-ink) !important; text-decoration: none !important; font-size: 14px; line-height: 1.55; }
.tma-nlist li > a:hover { background: rgba(var(--tma-primary-rgb), .06); }
.tma-nlist small { display: block; color: var(--tma-muted); font-size: 12px; margin-top: 2px; }
.tma-nlist .is-unread > a { background: rgba(var(--tma-primary-rgb), .07); box-shadow: inset 3px 0 0 var(--tma-primary); }
[dir="rtl"] .tma-nlist .is-unread > a { box-shadow: inset -3px 0 0 var(--tma-primary); }
.tma-nlist__xp > span { color: color-mix(in srgb, var(--tma-ok) 80%, var(--tma-ink)) !important; }
.tma-msgcard { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 18px; color: var(--tma-ink) !important; text-decoration: none !important; }
.tma-msgcard + .tma-msgcard { margin-top: 4px; }
.tma-msgcard:hover { background: rgba(var(--tma-primary-rgb), .06); }
.tma-msgcard b { display: block; font-size: 14.5px; font-weight: 600; }
.tma-msgcard small { display: block; color: var(--tma-muted); font-size: 12.5px; line-height: 1.5; }
.tma-msgcard__ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 15px; color: #fff; background: var(--tma-btn-bg); box-shadow: 0 8px 16px -8px rgba(var(--tma-primary-rgb), .8); overflow: hidden; }
.tma-msgcard__ico--bot { background: var(--tma-accent); border-radius: 50%; }
.tma-msgcard__ico img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Community CTA ---------- */
.tma-commcta { display: grid; gap: 18px; align-items: center; color: #fff; background: linear-gradient(140deg, var(--tma-primary), color-mix(in srgb, var(--tma-primary) 50%, var(--tma-night))); border-color: rgba(255, 255, 255, .2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 30px 50px -28px rgba(var(--tma-primary-rgb), .9); }
.tma-commcta p { color: rgba(255, 255, 255, .86); margin: 6px 0 16px; max-width: 46ch; }
.tma-commcta .tma-btn { background: #fff; color: var(--tma-primary) !important; text-shadow: none; box-shadow: 0 14px 24px -12px rgba(0, 0, 0, .4); }
.tma-commcta__faces { display: flex; align-items: center; }
.tma-commcta__faces img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 3px solid color-mix(in srgb, var(--tma-primary) 70%, #fff); margin-inline-end: -14px; }
.tma-commcta__n { display: grid; place-items: center; min-width: 58px; height: 52px; padding: 0 12px; border-radius: 99px; margin-inline-start: 20px; font-weight: 700; color: var(--tma-night); background: var(--tma-accent); }
@media (min-width: 760px) { .tma-commcta { grid-template-columns: 1fr auto; padding: 28px; } }

/* ---------- Leaderboard + tabs ---------- */
.tma-tabs__bar { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 14px; background: rgba(var(--tma-primary-rgb), .07); }
.tma-tabs__bar button { border: 0; padding: 7px 14px; border-radius: 11px; cursor: pointer; background: transparent; font-size: 14px; font-weight: 500; color: var(--tma-muted); }
.tma-tabs__bar [aria-selected="true"] { background: var(--tma-card); color: var(--tma-ink); box-shadow: var(--tma-sh-sm); }
.tma-lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tma-lb li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 16px; background: rgba(var(--tma-surf-rgb), .65); box-shadow: 0 0 0 1px var(--tma-line); }
.tma-lb li.is-me { background: rgba(var(--tma-accent-rgb), .2); box-shadow: 0 0 0 1px rgba(var(--tma-accent-rgb), .6); }
.tma-lb__pos { width: 28px; text-align: center; font-weight: 700; font-size: 17px; }
.tma-lb img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.tma-lb a { flex: 1; min-width: 0; color: var(--tma-ink); font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tma-lb b { font-weight: 700; color: var(--tma-primary); }

/* ---------- Teacher ---------- */
.tma-teacher { display: grid; gap: 10px 26px; align-items: end; padding-bottom: 0; overflow: hidden; }
.tma-teacher__photo { order: 2; max-width: 300px; margin-inline: auto; }
.tma-teacher__photo img { display: block; width: 100%; filter: drop-shadow(0 20px 30px rgba(var(--tma-ink-rgb), .25)); }
.tma-teacher__txt { padding-bottom: 8px; }
.tma-teacher__txt p { max-width: 48ch; }
@media (min-width: 760px) { .tma-teacher { grid-template-columns: 260px 1fr; align-items: center; } .tma-teacher__photo { order: 0; align-self: end; } }

/* ---------- FAQ / details ---------- */
.tma-acc { display: grid; gap: 8px; }
.tma-acc details, .entry-content .wp-block-details { border-radius: 18px; background: rgba(var(--tma-surf-rgb), .7); box-shadow: 0 0 0 1px var(--tma-line); padding: 0 16px; margin: 0 0 8px; }
.tma-acc summary, .entry-content .wp-block-details summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.tma-acc summary::-webkit-details-marker, .entry-content .wp-block-details summary::-webkit-details-marker { display: none; }
.tma-acc summary::after, .entry-content .wp-block-details summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 500; color: var(--tma-primary); background: rgba(var(--tma-primary-rgb), .09); transition: transform .3s var(--tma-ease); }
.tma-acc details[open] summary::after, .entry-content .wp-block-details[open] summary::after { transform: rotate(45deg); }
.tma-acc details p, .entry-content .wp-block-details p { margin: 0 0 14px; color: var(--tma-muted); }

/* ---------- Pages / content ---------- */
.tma-pagehead { padding: 26px 4px 10px; }
.tma-pagehead__title { font-size: clamp(26px, 3.6vw, 38px); margin: 6px 0; }
.tma-pagehead__meta, .tma-pagehead__desc { color: var(--tma-muted); margin: 0; }
.tma-crumb { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; text-decoration: none !important; }
[dir="ltr"] .tma-crumb .tma-i { transform: scaleX(-1); }
.tma-content { padding: 26px; margin-bottom: 24px; border-radius: var(--tma-r-lg); background: linear-gradient(160deg, rgba(var(--tma-surf-rgb), .85), rgba(var(--tma-surf-rgb), .62)); -webkit-backdrop-filter: var(--tma-glass); backdrop-filter: var(--tma-glass); border: 1px solid var(--tma-hair); box-shadow: inset 0 1px 0 var(--tma-hl), 0 0 0 1px var(--tma-line), var(--tma-sh-md); }
.tma-content:has(> .tma-pt, > .tma-prog, > .tma-sec, > .wp-block-shortcode) { padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.tma-content--full { padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.tma-article .tma-content, .tma-page .tma-content { max-width: 820px; }
.tma-article, .tma-page { max-width: 860px; }
.entry-content > * { max-width: 72ch; }
.entry-content > :is(.alignwide, .alignfull, .wp-block-image, .wp-block-embed, figure, table, .wp-block-shortcode, .tma-pt) { max-width: none; }
.entry-content p, .entry-content li { font-size: 17px; line-height: 1.9; }
.entry-content h2 { font-size: 24px; margin-top: 1.6em; }
.entry-content h3 { font-size: 20px; margin-top: 1.4em; }
.entry-content img { border-radius: 18px; }
.entry-content blockquote { margin: 1.4em 0; padding: 14px 18px; border-radius: 16px; background: rgba(var(--tma-primary-rgb), .06); border-inline-start: 4px solid var(--tma-primary); }
.entry-content :not(pre) > code { padding: 1px 6px; border-radius: 6px; background: rgba(var(--tma-primary-rgb), .08); }
.entry-content table { width: 100%; border-collapse: collapse; overflow-x: auto; display: block; }
.entry-content th, .entry-content td { padding: 10px; border-bottom: 1px solid var(--tma-line); text-align: start; }
.tma-article__cover { margin: 0 0 18px; }
.tma-article__cover img { width: 100%; border-radius: var(--tma-r-lg); box-shadow: var(--tma-sh-md); }
.tma-tags a { display: inline-block; margin: 0 0 6px 6px; padding: 3px 12px; border-radius: 99px; font-size: 13px; text-decoration: none; background: rgba(var(--tma-primary-rgb), .08); }
.tma-list { padding-bottom: 20px; }
.pagination, .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 26px 0; }
.page-numbers { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 14px; text-decoration: none !important; color: var(--tma-ink) !important; background: var(--tma-fill-2); box-shadow: 0 0 0 1px var(--tma-line); }
.page-numbers.current { color: #fff !important; background: var(--tma-btn-bg); }

/* Filter chips (games archive) */
.tma-filter { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 14px; margin-bottom: 6px; scrollbar-width: none; }
.tma-filter::-webkit-scrollbar { display: none; }
.tma-fchip { flex: none; display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 99px; font-size: 14px; font-weight: 500; text-decoration: none !important; color: var(--tma-ink) !important; background: var(--tma-fill-2); border: 1px solid var(--tma-hair); box-shadow: 0 0 0 1px var(--tma-line); transition: transform .25s var(--tma-ease); }
.tma-fchip:hover { transform: translateY(-2px); }
.tma-fchip.is-mine { box-shadow: 0 0 0 2px rgba(var(--tma-accent-rgb), .8); }
.tma-fchip.is-on { color: #fff !important; background: var(--tma-btn-bg); border-color: transparent; box-shadow: 0 10px 18px -10px rgba(var(--tma-primary-rgb), .8); }

/* ---------- Game page ---------- */
.tma-game { padding-top: 14px; }
.tma-game__head { padding: 10px 4px 14px; }
.tma-game__title { font-size: clamp(24px, 3.4vw, 34px); margin: 6px 0 8px; }
.tma-game__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tma-game__xp { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; font-size: 13.5px; font-weight: 500; text-decoration: none !important; color: var(--tma-ink) !important; background: rgba(var(--tma-accent-rgb), .25); }
.tma-game__xp .tma-i { color: color-mix(in srgb, var(--tma-accent) 70%, #a35a00); }
.tma-game__xp.is-done { background: rgba(22, 167, 119, .16); }
.tma-game__stage { position: relative; padding: 10px; border-radius: 30px; background: linear-gradient(160deg, rgba(var(--tma-surf-rgb), .85), rgba(var(--tma-surf-rgb), .55)); border: 1px solid var(--tma-hair); box-shadow: inset 0 1px 0 var(--tma-hl), 0 0 0 1px var(--tma-line), var(--tma-sh-lg); }
.tma-game__content { border-radius: 22px; overflow: hidden; background: #fff; direction: ltr; text-align: left; } /* games are English: LTR by default */
.tma-game__content > * { max-width: none; }
.tma-game__content iframe { display: block; width: 100%; min-height: min(78vh, 720px); border: 0; }
.tma-game__content > :first-child { margin-top: 0; }
.tma-game__fs { position: absolute; top: 18px; inset-inline-end: 18px; z-index: 5; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; border: 0; cursor: pointer; color: #fff; background: rgba(var(--tma-night-rgb), .7); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tma-game__stage:fullscreen { padding: 0; border-radius: 0; background: #000; overflow: auto; }
.tma-game__stage:fullscreen .tma-game__content { border-radius: 0; min-height: 100vh; }
.tma-game__stage:fullscreen iframe { min-height: 100vh; }

/* ---------- Placement test ---------- */
.tma-pt { max-width: 720px; margin: 10px auto; }
.tma-pt__card { position: relative; padding: 26px; border-radius: 30px; overflow: hidden; background: linear-gradient(160deg, rgba(var(--tma-surf-rgb), .9), rgba(var(--tma-surf-rgb), .62)); -webkit-backdrop-filter: var(--tma-glass); backdrop-filter: var(--tma-glass); border: 1px solid var(--tma-hair); box-shadow: inset 0 1px 0 var(--tma-hl), 0 0 0 1px var(--tma-line), var(--tma-sh-lg); }
.tma-pt__step { animation: tma-in .45s var(--tma-ease); }
@keyframes tma-in { from { opacity: 0; transform: translateY(10px); } }
.tma-pt__top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; color: var(--tma-muted); font-size: 14px; }
.tma-pt__top .tma-bar { flex: 1; }
.tma-pt h2 { font-size: clamp(22px, 3vw, 28px); margin-bottom: 8px; }
.tma-pt p { color: var(--tma-muted); margin: 0 0 16px; }
.tma-pt__hint { display: inline-block; padding: 3px 12px; border-radius: 99px; margin-bottom: 10px; font-size: 13.5px; font-weight: 600; color: var(--tma-primary); background: rgba(var(--tma-primary-rgb), .08); }
.tma-pt__q { text-align: center; font-size: clamp(20px, 2.8vw, 26px); font-weight: 600; line-height: 1.5; margin: 4px 0 18px; color: var(--tma-ink); }
.tma-pt__opts { display: grid; gap: 10px; }
@media (min-width: 560px) { .tma-pt__opts--2 { grid-template-columns: 1fr 1fr; } }
.tma-pt__opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 16px; border-radius: 18px; cursor: pointer; text-align: start; font-size: 16px; font-weight: 500; color: var(--tma-ink); background: rgba(var(--tma-surf-rgb), .85); border: 1px solid var(--tma-hair); box-shadow: 0 0 0 1px var(--tma-line), var(--tma-sh-sm); transition: transform .25s var(--tma-ease), box-shadow .25s, background-color .2s; }
.tma-pt__opt:hover { transform: translateY(-2px); background: var(--tma-card); box-shadow: 0 0 0 1px rgba(var(--tma-primary-rgb), .4), var(--tma-sh-md); }
.tma-pt__opt[aria-pressed="true"] { background: rgba(var(--tma-primary-rgb), .08); box-shadow: 0 0 0 2px var(--tma-primary); }
.tma-pt__opt .k { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--tma-primary); background: rgba(var(--tma-primary-rgb), .09); }
.tma-pt__opt--idk { justify-content: center; min-height: 46px; color: var(--tma-muted); background: transparent; box-shadow: 0 0 0 1px var(--tma-line); }
.tma-pt__group { margin: 14px 0 6px; font-weight: 600; font-size: 14px; color: var(--tma-muted); }
.tma-pt__nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.tma-pt__back { border: 0; background: none; color: var(--tma-muted); cursor: pointer; font-size: 14.5px; padding: 8px; }
.tma-pt__result { text-align: center; }
.tma-pt__lvl { display: inline-grid; place-items: center; width: 130px; height: 130px; margin: 6px auto 14px; border-radius: 40px; font-size: 48px; font-weight: 700; color: #fff; background: var(--tma-btn-bg); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), 0 30px 50px -22px rgba(var(--tma-primary-rgb), .9); transform: rotate(-4deg); animation: tma-lvl .8s var(--tma-ease); }
@keyframes tma-lvl { from { transform: rotate(-20deg) scale(.6); opacity: 0; } }
.tma-pt__result .tma-ggrid { text-align: start; margin: 18px 0; }
.tma-pt__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ---------- Progress page ---------- */
.tma-prog__head { display: grid; gap: 20px; }
@media (min-width: 760px) { .tma-prog__head { grid-template-columns: 1fr 1fr; align-items: center; } }
.tma-prog__rank { display: grid; gap: 8px; }
.tma-prog__big { font-size: 54px; font-weight: 700; line-height: 1; color: var(--tma-primary); }
.tma-prog__rank small { color: var(--tma-muted); }
.tma-prog__facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tma-prog__facts li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tma-prog__facts .tma-i { color: var(--tma-primary); }
.tma-badges { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tma-badges li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 10px; border-radius: 20px; background: rgba(var(--tma-surf-rgb), .6); box-shadow: 0 0 0 1px var(--tma-line); }
.tma-badges li:not(.is-on) { opacity: .55; }
.tma-badges li:not(.is-on) .tma-badges__i { filter: grayscale(1); }
.tma-badges li.is-on { background: linear-gradient(160deg, rgba(var(--tma-accent-rgb), .25), rgba(var(--tma-surf-rgb), .8)); box-shadow: 0 0 0 1px rgba(var(--tma-accent-rgb), .6); }
.tma-badges__i { font-size: 34px; line-height: 1.2; }
.tma-badges small { color: var(--tma-muted); font-size: 12.5px; line-height: 1.5; }
.tma-sub { font-size: 16px; margin: 18px 0 8px; }

/* ---------- Forms / alerts ---------- */
.tma-form { display: grid; gap: 4px; max-width: 560px; }
.tma-form label, .comment-form label { display: block; font-weight: 500; font-size: 14.5px; margin-bottom: 4px; }
body.tma :is(input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], textarea, select) {
	width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--tma-hair); background: rgba(var(--tma-surf-rgb), .85); box-shadow: 0 0 0 1px var(--tma-line); outline: 0; transition: box-shadow .2s;
}
body.tma :is(input, textarea, select):focus { box-shadow: 0 0 0 2px var(--tma-primary), 0 0 0 6px rgba(var(--tma-primary-rgb), .14); }
.tma-sform { display: flex; gap: 8px; max-width: 520px; margin: 10px 0 18px; }
.tma-sform input { flex: 1; }
body.tma .tma-hdr__search input[type="search"] { min-height: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; color: #fff; }
.tma-alert { padding: 12px 16px; border-radius: 16px; background: rgba(226, 67, 75, .1); box-shadow: 0 0 0 1px rgba(226, 67, 75, .3); }
.tma-alert--ok { background: rgba(22, 167, 119, .12); box-shadow: 0 0 0 1px rgba(22, 167, 119, .35); }
.tma-comments__list { list-style: none; padding: 0; }
.tma-comments__list .comment-body { padding: 12px 0; border-bottom: 1px solid var(--tma-line); }
.tma-comments__list .avatar { border-radius: 50%; vertical-align: middle; margin-inline-end: 8px; }

/* ---------- 404 ---------- */
.tma-404 { text-align: center; padding: 50px 0; }
.tma-404 .tma-sform { margin-inline: auto; }
.tma-404__code { font-size: clamp(80px, 16vw, 150px); font-weight: 700; line-height: 1; margin: 0; background: var(--tma-btn-bg); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Footer ---------- */
.tma-ftr { padding: 30px 0 40px; color: var(--tma-muted); font-size: 14.5px; }
.tma-ftr__in { display: grid; gap: 16px; padding: 24px; border-radius: var(--tma-r-lg); background: rgba(var(--tma-surf-rgb), .5); box-shadow: 0 0 0 1px var(--tma-line); }
@media (min-width: 760px) { .tma-ftr__in { grid-template-columns: 1fr auto; align-items: center; } }
.tma-ftr .tma-brand { color: var(--tma-ink) !important; }
.tma-ftr__brand p { margin: 6px 0 0; }
.tma-ftr__nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.tma-ftr__nav a { color: var(--tma-ink); text-decoration: none; }
.tma-ftr__nav a:hover { color: var(--tma-primary); }
.tma-ftr__copy { margin: 0; font-size: 13px; }

/* ---------- Bottom navigation (mobile) ---------- */
.tma-bnav { display: none; }
@media (max-width: 899px) {
	body.tma { --tma-bnav-h: 74px; padding-bottom: calc(var(--tma-bnav-h) + env(safe-area-inset-bottom)); }
	.tma-bnav { display: block; position: fixed; inset-inline: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 85; }
	.tma-bnav ul { list-style: none; margin: 0; padding: 6px; display: grid; grid-template-columns: repeat(5, 1fr); border-radius: 24px; background: color-mix(in srgb, var(--tma-night) 90%, transparent); -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%); border: 1px solid rgba(255, 255, 255, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 20px 40px -16px rgba(var(--tma-night-rgb), .7); }
	.tma-bnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; border-radius: 18px; font-size: 11.5px; font-weight: 500; color: rgba(255, 255, 255, .66) !important; text-decoration: none !important; transition: color .2s, background-color .2s; }
	.tma-bnav a.is-on, .tma-bnav a[aria-current="page"] { color: #fff !important; background: rgba(255, 255, 255, .1); }
	.tma-bnav a.is-on .tma-i { color: var(--tma-accent); }
	.tma-bnav a:active { transform: scale(.94); }
	.tma-ftr { padding-bottom: 10px; }
}

/* ---------- Toasts ---------- */
.tma-toasts { position: fixed; top: 86px; inset-inline: 0; z-index: 120; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.tma-toast { display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; border-radius: 99px; color: var(--tma-ink); font-weight: 600; font-size: 14.5px; background: rgba(var(--tma-surf-rgb), .95); box-shadow: 0 0 0 1px rgba(var(--tma-accent-rgb), .6), var(--tma-sh-lg); animation: tma-toast 3.6s var(--tma-ease) forwards; }
.tma-toast__i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; background: var(--tma-accent); color: var(--tma-night); }
@keyframes tma-toast { 0% { opacity: 0; transform: translateY(-14px) scale(.96); } 10%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }

/* ---------- Chatbot ---------- */
.tma-bot__fab { position: fixed; z-index: 95; bottom: calc(18px + var(--tma-bnav-h) + env(safe-area-inset-bottom)); inset-inline-end: 16px; width: 62px; height: 62px; padding: 3px; border: 0; border-radius: 50%; cursor: pointer; background: linear-gradient(140deg, var(--tma-accent), var(--tma-primary)); box-shadow: 0 16px 30px -10px rgba(var(--tma-primary-rgb), .8); transition: transform .3s var(--tma-ease); }
.tma-bot__fab:hover { transform: translateY(-3px) scale(1.04); }
.tma-bot__fab img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--tma-card); background: var(--tma-card); }
.tma-bot__dot { position: absolute; bottom: 3px; inset-inline-end: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--tma-ok); border: 2px solid var(--tma-card); }
.tma-bot__fab[aria-expanded="true"] { transform: scale(.9); }
.tma-bot { position: fixed; z-index: 96; bottom: calc(90px + var(--tma-bnav-h) + env(safe-area-inset-bottom)); inset-inline-end: 16px; width: min(400px, calc(100vw - 32px)); }
.tma-bot[hidden] { display: none; }
.tma-bot__panel { display: flex; flex-direction: column; height: min(600px, calc(100vh - 190px - var(--tma-bnav-h))); border-radius: 28px; overflow: hidden; background: rgba(var(--tma-surf-rgb), .92); -webkit-backdrop-filter: blur(26px) saturate(170%); backdrop-filter: blur(26px) saturate(170%); border: 1px solid var(--tma-hair); box-shadow: 0 0 0 1px var(--tma-line), 0 40px 80px -30px rgba(var(--tma-night-rgb), .55); animation: tma-pop .3s var(--tma-ease); }
.tma-bot__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #fff; background: linear-gradient(140deg, var(--tma-night), color-mix(in srgb, var(--tma-night) 60%, var(--tma-primary))); }
.tma-bot__head img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255, 255, 255, .6); }
.tma-bot__head div { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.tma-bot__head small { opacity: .75; font-size: 12.5px; }
.tma-bot__x { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 12px; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .1); }
.tma-bot__log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.tma-msg { max-width: 88%; padding: 10px 14px; border-radius: 20px; font-size: 15px; line-height: 1.7; white-space: normal; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.tma-msg p, .tma-msg li { unicode-bidi: plaintext; }
.tma-msg p { margin: 0 0 6px; } .tma-msg p:last-child { margin: 0; }
.tma-msg ul, .tma-msg ol { margin: 4px 0; padding-inline-start: 20px; }
.tma-msg--bot { align-self: flex-start; background: rgba(var(--tma-primary-rgb), .07); border-start-start-radius: 6px; }
.tma-msg--me { align-self: flex-end; color: #fff; background: var(--tma-btn-bg); border-start-end-radius: 6px; }
.tma-msg--err { align-self: center; font-size: 13.5px; color: var(--tma-bad); background: rgba(226, 67, 75, .08); }
.tma-msg code { padding: 0 5px; border-radius: 6px; background: rgba(var(--tma-night-rgb), .08); font-size: .92em; }
.tma-msg--typing { display: flex; gap: 4px; }
.tma-msg--typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--tma-primary); opacity: .4; animation: tma-dot 1s infinite; }
.tma-msg--typing i:nth-child(2) { animation-delay: .15s; } .tma-msg--typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tma-dot { 50% { opacity: 1; transform: translateY(-3px); } }
.tma-bot__chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 14px 8px; scrollbar-width: none; }
.tma-bot__chips button { flex: none; border: 0; cursor: pointer; padding: 7px 12px; border-radius: 99px; font-size: 13px; color: var(--tma-primary); background: rgba(var(--tma-primary-rgb), .08); }
.tma-bot__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--tma-line); }
body.tma .tma-bot__form textarea, .tma-bot__form textarea { flex: 1; min-height: 46px; max-height: 120px; resize: none; padding: 11px 14px; border-radius: 16px; border: 1px solid var(--tma-hair); background: var(--tma-card); box-shadow: 0 0 0 1px var(--tma-line); font: inherit; font-size: 15px; outline: 0; unicode-bidi: plaintext; }
.tma-bot__send { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 15px; cursor: pointer; color: #fff; background: var(--tma-btn-bg); box-shadow: 0 10px 18px -10px rgba(var(--tma-primary-rgb), .9); }
[dir="rtl"] .tma-bot__send .tma-i { transform: scaleX(-1); }
.tma-bot__send:disabled { opacity: .5; cursor: default; }
.tma-bot__note { padding: 10px 14px; font-size: 13.5px; color: var(--tma-muted); }

/* ---------- Responsive header ---------- */
@media (max-width: 1099px) { .tma-hdr__nav { display: none; } .tma-hdr__act { margin-inline-start: auto; } }
@media (max-width: 899px) {
	.tma-hdr__search { display: none; position: absolute; inset-inline: 12px; top: calc(100% + 8px); width: auto; height: 50px; background: color-mix(in srgb, var(--tma-night) 92%, transparent); -webkit-backdrop-filter: var(--tma-glass); backdrop-filter: var(--tma-glass); }
	.tma-hdr__search.is-open { display: flex; }
	.tma-hdr__bar { position: relative; min-height: 58px; border-radius: 20px; gap: 8px; }
	.tma-ib--search { display: grid; }
	.tma-ib--msg { display: none; }
	.tma-hide-sm { display: none !important; }
	.tma-show-sm { display: inline-flex !important; }
	.tma-brand__name { font-size: 16px; }
	.tma-ib, .tma-avatar, .tma-xppill { width: 40px; height: 40px; }
	.tma-xppill { width: auto; }
	.tma-xppill__fire { display: none !important; }
	.tma-sec { padding: 16px; border-radius: 24px; margin-block: 14px; }
	.tma-hero { padding: 24px 18px 0; border-radius: 28px; }
	.tma-content { padding: 18px; }
}
@media (max-width: 419px) { body.tma-in .tma-brand__name { display: none; } .tma-hdr__act { gap: 5px; } }
@media (max-width: 360px) { .tma-brand__name { display: none; } }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
	body.tma::before, body.tma::after { animation: none; }
}

/* ---------- v1.2 additions ---------- */
/* Bottom nav: profile picture for «حسابي» */
.tma-bnav__av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(255, 255, 255, .55); }
.tma-bnav a.is-on .tma-bnav__av { box-shadow: 0 0 0 2px var(--tma-accent); }

/* Members rows with follow buttons */
.tma-mrow__link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--tma-ink) !important; text-decoration: none !important; }
.tma-mrow .tma-btn { flex: none; }
.tma-btn.is-following { color: var(--tma-ok) !important; }
.tma-btn[data-follow].is-busy { opacity: .6; pointer-events: none; }

/* Ads: reserved space, labelled, gone when AdSense has nothing to show */
.tma-ad { position: relative; margin-block: 18px; padding: 22px 10px 10px; min-height: 290px; border-radius: 22px; text-align: center; background: rgba(var(--tma-surf-rgb), .5); box-shadow: 0 0 0 1px var(--tma-line); overflow: hidden; }
.tma-ad__lbl { position: absolute; top: 4px; inset-inline-start: 14px; font-size: 11px; color: var(--tma-muted); }
.tma-ad ins { min-height: 250px; }
@media (min-width: 900px) { .tma-ad:not(.tma-ad--side) { min-height: 140px; } .tma-ad:not(.tma-ad--side) ins { min-height: 100px; } }
.tma-ad:has(ins[data-ad-status="unfilled"]) { display: none; }
.tma-home__side .tma-ad { min-height: 280px; }

/* Unified login */
body.tma-auth-page .tma-pagehead { display: none; }
body.tma-auth-page .tma-page { max-width: none; }
.tma-auth { display: grid; place-items: center; min-height: calc(100vh - 200px); padding: 20px 0 40px; }
.tma-auth__card { width: min(440px, 100%); padding: 28px 24px; border-radius: 32px; background: linear-gradient(160deg, rgba(var(--tma-surf-rgb), .92), rgba(var(--tma-surf-rgb), .66)); -webkit-backdrop-filter: var(--tma-glass); backdrop-filter: var(--tma-glass); border: 1px solid var(--tma-hair); box-shadow: inset 0 1px 0 var(--tma-hl), 0 0 0 1px var(--tma-line), var(--tma-sh-lg); animation: tma-in .5s var(--tma-ease); }
.tma-auth__head { text-align: center; margin-bottom: 16px; }
.tma-auth__head .tma-brand { color: var(--tma-ink) !important; justify-content: center; }
.tma-auth__head p { margin: 6px 0 0; color: var(--tma-muted); font-size: 14.5px; }
.tma-auth__tabs { display: flex; width: 100%; margin-bottom: 16px; }
.tma-auth__tabs button { flex: 1; padding: 10px; }
.tma-auth__social { display: grid; gap: 8px; margin-bottom: 4px; }
.tma-auth__social .nsl-container { display: block !important; }
.tma-auth__social .nsl-container-buttons { display: grid !important; gap: 8px; }
.tma-auth__social .nsl-button { border-radius: 14px !important; box-shadow: 0 0 0 1px var(--tma-line) !important; }
.tma-auth__or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--tma-muted); font-size: 13px; }
.tma-auth__or::before, .tma-auth__or::after { content: ""; flex: 1; height: 1px; background: var(--tma-line); }
.tma-auth__form { max-width: none; }
.tma-auth__form[hidden] { display: none; }
.tma-auth__form p { margin: 0 0 12px; }
.tma-auth__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.tma-auth__row label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.tma-auth__submit { width: 100%; }
.tma-auth__small { font-size: 12.5px; color: var(--tma-muted); text-align: center; }

/* Header: unread messages */
.tma-ib--msg .tma-ib__n { background: #ff5a5f; color: #fff; }

/* WooCommerce (Tutor / memberships checkout) */
body.tma .woocommerce :is(a.button, button.button, input.button, #respond input#submit), body.tma .woocommerce-page :is(a.button, button.button) { border: 0; border-radius: 14px; padding: 12px 20px; font-weight: 500; color: #fff; background: var(--tma-btn-bg); box-shadow: 0 12px 20px -12px rgba(var(--tma-primary-rgb), .7); }
body.tma .woocommerce :is(form.checkout, .cart-collaterals, .woocommerce-MyAccount-content, table.shop_table) { border-radius: 22px; }

/* Lift other floating buttons (WhatsApp, cookie bars…) above the bottom menu — see app.js */
.tma-lifted { transition: bottom .3s var(--tma-ease); }

/* ==========================================================================
   Wall (Facebook-style, glass)
   ========================================================================== */
.tma-wall { max-width: 680px; margin-inline: auto; display: grid; gap: 14px; }
.tma-wall--compact { max-width: none; }
.tma-wallhome .tma-wall { gap: 12px; }
.tma-glass-card, .tma-comp, .tma-wpost, .tma-wall__tabs, .tma-strip-people {
	border-radius: 24px; border: 1px solid var(--tma-hair);
	background: linear-gradient(160deg, rgba(var(--tma-surf-rgb), .92), rgba(var(--tma-surf-rgb), .7));
	-webkit-backdrop-filter: var(--tma-glass); backdrop-filter: var(--tma-glass);
	box-shadow: inset 0 1px 0 var(--tma-hl), 0 0 0 1px var(--tma-line), var(--tma-sh-sm);
}
.tma-wallhome :is(.tma-comp, .tma-wpost) { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(var(--tma-surf-rgb), .75); }
.tma-wav { flex: none; display: block; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px var(--tma-card), 0 0 0 3px rgba(var(--tma-primary-rgb), .14); }
.tma-wav img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* People strip (stories-like) */
.tma-strip-people { display: flex; gap: 12px; overflow-x: auto; padding: 14px; scrollbar-width: none; }
.tma-strip-people::-webkit-scrollbar { display: none; }
.tma-strip-people__p { flex: none; display: grid; justify-items: center; gap: 4px; width: 66px; text-decoration: none !important; color: var(--tma-ink) !important; }
.tma-strip-people__av { display: block; width: 62px; height: 62px; padding: 3px; border-radius: 50%; background: conic-gradient(from 210deg, var(--tma-accent), var(--tma-primary), #ff6b9a, var(--tma-accent)); transition: transform .3s var(--tma-ease); }
.tma-strip-people__av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--tma-card); display: block; }
.tma-strip-people__p:hover .tma-strip-people__av { transform: scale(1.06) rotate(-3deg); }
.tma-strip-people__n { font-size: 12px; max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Composer */
.tma-comp { padding: 14px; display: grid; gap: 10px; transition: box-shadow .3s; }
.tma-comp.is-open { box-shadow: inset 0 1px 0 var(--tma-hl), 0 0 0 1px rgba(var(--tma-primary-rgb), .25), var(--tma-sh-md); }
.tma-comp.is-busy { opacity: .7; pointer-events: none; }
.tma-comp--guest { display: block; text-align: center; font-weight: 500; color: var(--tma-primary) !important; text-decoration: none !important; }
.tma-comp__row { display: flex; gap: 10px; align-items: flex-start; }
body.tma .tma-comp textarea { flex: 1; min-height: 46px; padding: 11px 16px; border-radius: 22px; border: 0; resize: none; background: rgba(var(--tma-primary-rgb), .06); box-shadow: none; font-size: 16px; line-height: 1.6; unicode-bidi: plaintext; }
body.tma .tma-comp textarea:focus { background: var(--tma-card); box-shadow: 0 0 0 2px rgba(var(--tma-primary-rgb), .3); }
.tma-comp__prev { display: flex; gap: 8px; flex-wrap: wrap; }
.tma-comp__prev:empty { display: none; }
.tma-comp__img { position: relative; width: 84px; height: 84px; border-radius: 16px; overflow: hidden; }
.tma-comp__img img { width: 100%; height: 100%; object-fit: cover; }
.tma-comp__img button { position: absolute; top: 4px; inset-inline-end: 4px; display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; cursor: pointer; color: #fff; background: rgba(0, 0, 0, .55); }
.tma-comp__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--tma-line); }
.tma-comp__tool { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 0; border-radius: 12px; cursor: pointer; background: transparent; color: #16a777; font-size: 14px; }
.tma-comp__tool:hover { background: rgba(22, 167, 119, .1); }
.tma-comp .tma-btn:disabled { opacity: .45; cursor: default; transform: none; }

.tma-wall__tabs { display: flex; margin: 0; padding: 5px; }
.tma-wall__tabs button { flex: 1; }

/* Post card */
.tma-wpost { padding: 14px 16px 6px; overflow: hidden; animation: tma-in .45s var(--tma-ease); }
.tma-wpost.is-new { animation: tma-new 1.2s var(--tma-ease); }
@keyframes tma-new { 0% { opacity: 0; transform: translateY(-10px) scale(.98); box-shadow: 0 0 0 3px rgba(var(--tma-accent-rgb), .6); } }
.tma-wpost.is-gone { opacity: 0; transform: scale(.97); transition: opacity .3s, transform .3s; }
.tma-wpost--skel { min-height: 170px; background: linear-gradient(100deg, rgba(var(--tma-surf-rgb), .6) 30%, rgba(var(--tma-surf-rgb), .95) 50%, rgba(var(--tma-surf-rgb), .6) 70%) 0 0 / 200% 100%; animation: tma-shimmer 1.3s linear infinite; }
@keyframes tma-shimmer { to { background-position: -200% 0; } }
.tma-wpost__head { display: flex; align-items: flex-start; gap: 10px; }
.tma-wpost__who { flex: 1; min-width: 0; line-height: 1.4; }
.tma-wpost__line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tma-wpost__name { font-weight: 600; color: var(--tma-ink) !important; text-decoration: none !important; }
.tma-wpost__rank { font-size: 11px; padding: 1px 8px; border-radius: 99px; background: rgba(var(--tma-accent-rgb), .25); color: color-mix(in srgb, var(--tma-accent) 40%, #6b3d00); }
.tma-wpost__action { font-size: 14px; color: var(--tma-muted); }
.tma-wpost__action a { color: var(--tma-ink); font-weight: 500; text-decoration: none; }
.tma-wpost__action img { display: none; }
.tma-wpost__time { display: inline-block; font-size: 12.5px; color: var(--tma-muted) !important; text-decoration: none !important; }
.tma-wpost__body { margin: 10px 2px 8px; font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.tma-wpost__body p { margin: 0 0 8px; unicode-bidi: plaintext; }
.tma-wpost__body p:last-child { margin: 0; }
.tma-wpost__body.is-big { font-size: 21px; font-weight: 500; line-height: 1.6; }
.tma-wpost__body a { word-break: break-all; }
.tma-wpost--sys { padding-bottom: 6px; }
.tma-wpost--sys .tma-wpost__body { font-size: 15px; }

.tma-wmenu { position: relative; }
.tma-wmenu__btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer; color: var(--tma-muted); background: transparent; }
.tma-wmenu__btn:hover { background: rgba(var(--tma-primary-rgb), .07); }
.tma-wmenu__pop { position: absolute; top: 100%; inset-inline-end: 0; z-index: 20; min-width: 150px; padding: 6px; border-radius: 16px; background: rgba(var(--tma-surf-rgb), .96); box-shadow: 0 0 0 1px var(--tma-line), var(--tma-sh-lg); animation: tma-pop .2s var(--tma-ease); }
.tma-wmenu__pop button { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 11px; text-align: start; cursor: pointer; background: transparent; font-size: 14px; }
.tma-wmenu__pop button:hover { background: rgba(var(--tma-primary-rgb), .07); }
.tma-wmenu__pop .is-danger { color: var(--tma-bad); }

/* Photos */
.tma-wimgs { position: relative; display: grid; gap: 3px; margin: 8px -16px; overflow: hidden; }
.tma-wimgs--1 { grid-template-columns: 1fr; }
.tma-wimgs--2 { grid-template-columns: 1fr 1fr; }
.tma-wimgs--3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.tma-wimgs--3 .tma-wimgs__i:first-child { grid-row: span 2; }
.tma-wimgs--4 { grid-template-columns: 1fr 1fr; }
.tma-wimgs__i { padding: 0; border: 0; cursor: zoom-in; background: rgba(var(--tma-primary-rgb), .06); display: block; }
.tma-wimgs__i img { width: 100%; height: 100%; display: block; object-fit: cover; max-height: 560px; }
.tma-wimgs:not(.tma-wimgs--1) .tma-wimgs__i { aspect-ratio: 1; }
.tma-burst { position: absolute; inset: 0; display: grid; place-items: center; color: #ff3b6b; pointer-events: none; animation: tma-burst .8s var(--tma-ease) forwards; }
.tma-burst svg { width: 96px; height: 96px; fill: currentColor; filter: drop-shadow(0 8px 20px rgba(255, 59, 107, .5)); }
@keyframes tma-burst { 0% { transform: scale(.3); opacity: 0; } 30% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

/* Stats + actions */
.tma-wstats { display: flex; justify-content: space-between; align-items: center; padding: 8px 2px; font-size: 13.5px; color: var(--tma-muted); }
.tma-wstats__likes { display: inline-flex; align-items: center; gap: 6px; }
.tma-wstats__heart { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; background: linear-gradient(140deg, #ff6b8b, #ff3b6b); box-shadow: 0 0 0 2px var(--tma-card); }
.tma-wstats__heart svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.tma-wstats__c { border: 0; background: none; cursor: pointer; color: var(--tma-muted); font-size: 13.5px; margin-inline-start: auto; }
.tma-wstats__c:hover { text-decoration: underline; }
.tma-wpost__acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px 0; border-top: 1px solid var(--tma-line); border-bottom: 1px solid var(--tma-line); }
.tma-wbtn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 6px; border: 0; border-radius: 12px; cursor: pointer; background: transparent; color: var(--tma-muted); font-size: 14.5px; font-weight: 500; transition: background-color .2s, color .2s; }
.tma-wbtn:hover { background: rgba(var(--tma-primary-rgb), .06); color: var(--tma-ink); }
.tma-wbtn--like.is-on { color: #ff3b6b; }
.tma-wbtn--like.is-on svg { fill: currentColor; }
.tma-wbtn--like.is-pop svg { animation: tma-heart .5s var(--tma-ease); }
@keyframes tma-heart { 30% { transform: scale(1.45); } 60% { transform: scale(.9); } }

/* Comments */
.tma-wpost__comments { display: grid; gap: 8px; padding: 10px 0 4px; }
.tma-wpost__comments:empty { display: none; }
.tma-wpost__all { justify-self: start; border: 0; background: none; cursor: pointer; padding: 2px 4px; color: var(--tma-muted); font-weight: 500; font-size: 14px; }
.tma-wc { display: flex; gap: 8px; align-items: flex-start; }
.tma-wc.is-new .tma-wc__bubble { animation: tma-new 1s var(--tma-ease); }
.tma-wc__main { min-width: 0; flex: 1; }
.tma-wc__bubble { display: inline-block; max-width: 100%; padding: 8px 14px; border-radius: 18px; background: rgba(var(--tma-primary-rgb), .07); }
.tma-wc__name { display: block; font-weight: 600; font-size: 13.5px; color: var(--tma-ink) !important; text-decoration: none !important; }
.tma-wc__txt { font-size: 14.5px; line-height: 1.7; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.tma-wc__txt p { margin: 0; unicode-bidi: plaintext; }
.tma-wc__acts { display: flex; gap: 12px; align-items: center; padding: 2px 12px 0; }
.tma-wc__a { border: 0; background: none; cursor: pointer; padding: 0; font-size: 12.5px; font-weight: 600; color: var(--tma-muted); }
.tma-wc__a:hover { text-decoration: underline; }
.tma-wc__a.is-on { color: #ff3b6b; }
.tma-wc__t { font-size: 12px; color: var(--tma-muted); }
.tma-wc__replies { display: grid; gap: 8px; margin-top: 8px; }
.tma-wc__replies:empty { display: none; margin: 0; }
.tma-wc__replies .tma-wav { width: 28px !important; height: 28px !important; }
.tma-wcform { display: flex; align-items: center; gap: 8px; padding: 8px 0 10px; }
.tma-wcform__in { flex: 1; min-width: 0; display: grid; gap: 4px; }
body.tma .tma-wcform input { min-height: 40px; padding: 8px 16px; border-radius: 99px; border: 0; background: rgba(var(--tma-primary-rgb), .07); box-shadow: none; font-size: 14.5px; }
body.tma .tma-wcform input:focus { background: var(--tma-card); box-shadow: 0 0 0 2px rgba(var(--tma-primary-rgb), .3); }
.tma-wreply { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 12px; font-size: 12.5px; color: var(--tma-primary); }
.tma-wreply[hidden] { display: none; }
.tma-wreply button { border: 0; background: none; cursor: pointer; color: var(--tma-muted); display: grid; }
.tma-wsend { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; cursor: pointer; color: #fff; background: var(--tma-btn-bg); }
[dir="rtl"] .tma-wsend svg { transform: scaleX(-1); }
.tma-wsend:disabled { opacity: .5; }

.tma-wall__empty { display: grid; justify-items: center; gap: 4px; padding: 34px 18px; text-align: center; border-radius: 24px; background: rgba(var(--tma-surf-rgb), .7); box-shadow: 0 0 0 1px var(--tma-line); }
.tma-wall__emoji { font-size: 36px; }
.tma-wall__empty span:last-child { color: var(--tma-muted); font-size: 14.5px; }
.tma-wall__more { display: block; text-align: center; padding: 12px; border-radius: 16px; font-weight: 500; text-decoration: none !important; background: rgba(var(--tma-primary-rgb), .07); }
.tma-wall__end { height: 1px; }

.tma-lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(10, 16, 40, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: tma-pop .25s var(--tma-ease); }
.tma-lightbox img { max-width: 100%; max-height: 90vh; border-radius: 16px; }
.tma-lightbox__x { position: absolute; top: 16px; inset-inline-end: 16px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .15); }

@media (max-width: 600px) {
	.tma-wpost { padding: 12px 12px 4px; border-radius: 20px; }
	.tma-wimgs { margin-inline: -12px; }
	.tma-wbtn span { font-size: 13.5px; }
}

/* ---------- v1.4: gaps, rounded photos, article cards, desktop community ---------- */
.tma-wall__feed { display: grid; gap: 16px; }
@media (min-width: 760px) { .tma-wall { gap: 18px; } .tma-wall__feed { gap: 20px; } }
.tma-wpost { border-radius: 26px; padding: 16px 18px 6px; }
.tma-wpost__head .tma-wav { box-shadow: 0 0 0 2px var(--tma-card), 0 0 0 4px rgba(var(--tma-primary-rgb), .16); }
.tma-wpost__name { font-size: 15.5px; }

/* Photos: inset with round corners */
.tma-wimgs { margin: 10px 0 6px; gap: 4px; border-radius: 20px; }
.tma-wimgs__i:first-child { border-start-start-radius: 20px; }
.tma-wimgs .tma-wimgs__i img { border-radius: 0; }
.tma-wimgs--1 .tma-wimgs__i img { max-height: 520px; }

/* Article card (lessons, games, blog posts on the wall): title above, rounded cover */
.tma-wart { display: grid; gap: 10px; margin: 12px 0 8px; }
.tma-wart__kind { justify-self: start; padding: 3px 12px; border-radius: 99px; font-size: 12px; font-weight: 500; color: var(--tma-primary); background: rgba(var(--tma-primary-rgb), .09); }
.tma-wart__title { font-size: clamp(18px, 2.4vw, 21px); font-weight: 600; line-height: 1.45; color: var(--tma-ink) !important; text-decoration: none !important; text-wrap: balance; unicode-bidi: plaintext; }
.tma-wart__title:hover { color: var(--tma-primary) !important; }
.tma-wart__img { display: block; border-radius: 20px; overflow: hidden; box-shadow: 0 16px 30px -22px rgba(var(--tma-night-rgb), .6); }
.tma-wart__img img { display: block; width: 100%; max-height: 420px; object-fit: cover; transition: transform .8s var(--tma-ease); }
@media (hover: hover) { .tma-wart__img:hover img { transform: scale(1.03); } }
.tma-wart__ex { margin: 0; color: var(--tma-muted); font-size: 15px; line-height: 1.8; unicode-bidi: plaintext; }
.tma-wart__cta { justify-self: start; }

/* Community page: wide on desktop, 3 columns */
body.tma-bp-wall .tma-page { max-width: 1280px; }
.tma-commu { display: grid; gap: 22px; padding-top: 8px; }
.tma-commu__l, .tma-commu__r { display: none; }
.tma-commu__feed { min-width: 0; }
@media (min-width: 900px) {
	.tma-commu { grid-template-columns: minmax(0, 1fr) 300px; }
	.tma-commu__r { display: block; position: sticky; top: 96px; align-self: start; }
	.tma-commu__feed .tma-wall { max-width: 680px; }
}
@media (min-width: 1200px) {
	.tma-commu { grid-template-columns: 260px minmax(0, 1fr) 300px; }
	.tma-commu__l { display: grid; gap: 12px; position: sticky; top: 96px; align-self: start; order: -1; }
}
.tma-commu__r .tma-sec { margin: 0 0 16px; padding: 16px; }
.tma-commu__me { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 22px; text-decoration: none !important; color: var(--tma-ink) !important; background: linear-gradient(160deg, rgba(var(--tma-surf-rgb), .94), rgba(var(--tma-surf-rgb), .7)); box-shadow: inset 0 1px 0 var(--tma-hl), 0 0 0 1px var(--tma-line), var(--tma-sh-sm); }
.tma-commu__me img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--tma-card), 0 0 0 5px rgba(var(--tma-accent-rgb), .6); }
.tma-commu__me b { display: block; font-weight: 600; }
.tma-commu__me small { color: var(--tma-muted); font-size: 12.5px; }
.tma-commu__l > .tma-bar { margin: 0 6px; }
.tma-commu__nav { display: grid; gap: 2px; padding: 8px; border-radius: 22px; background: rgba(var(--tma-surf-rgb), .65); box-shadow: 0 0 0 1px var(--tma-line); }
.tma-commu__nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 15px; font-size: 15px; color: var(--tma-ink) !important; text-decoration: none !important; transition: background-color .2s; }
.tma-commu__nav a .tma-i { color: var(--tma-primary); }
.tma-commu__nav a:hover, .tma-commu__nav a.is-on { background: var(--tma-card); box-shadow: var(--tma-sh-sm); }

/* Tutor LMS login / register (now the site-wide login) */
body.tma :is(.tutor-login-wrap, .tutor-login-form-wrapper, .tutor-template-segment.tutor-login-wrap, .tutor-registration-wrap, #tutor-registration-wrap) {
	max-width: 460px; margin: 24px auto; padding: 28px 24px !important; border-radius: 30px;
	background: linear-gradient(160deg, rgba(var(--tma-surf-rgb), .94), rgba(var(--tma-surf-rgb), .7)) !important;
	-webkit-backdrop-filter: var(--tma-glass); backdrop-filter: var(--tma-glass);
	border: 1px solid var(--tma-hair); box-shadow: inset 0 1px 0 var(--tma-hl), 0 0 0 1px var(--tma-line), var(--tma-sh-lg) !important;
}
body.tma :is(.tutor-login-wrap, .tutor-registration-wrap) :is(input[type="text"], input[type="password"], input[type="email"]) { border-radius: 14px !important; min-height: 48px; }
body.tma :is(.tutor-login-wrap, .tutor-registration-wrap) .tutor-btn-primary { width: 100%; min-height: 50px; }

/* ==========================================================================
   Dark mode — <html data-theme="dark">, toggled from the header (saved per device)
   ========================================================================== */
:root[data-theme="dark"] {
	color-scheme: dark;
	--tma-ink: #e9edff; --tma-ink-rgb: 233, 237, 255;
	--tma-muted: rgba(233, 237, 255, .64);
	--tma-bg: #0a1024;
	--tma-surf-rgb: 20, 28, 56; --tma-card: #17203f; --tma-hl: rgba(255, 255, 255, .07);
	--tma-line: rgba(150, 170, 255, .16); --tma-hair: rgba(255, 255, 255, .08);
	--tma-fill: rgba(22, 31, 62, .72); --tma-fill-2: rgba(28, 38, 76, .9);
	--tma-primary: color-mix(in srgb, var(--tma-primary-base) 70%, #fff);
	--tma-sh-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 18px -10px rgba(0, 0, 0, .55);
	--tma-sh-md: 0 2px 4px rgba(0, 0, 0, .3), 0 20px 42px -20px rgba(0, 0, 0, .7);
	--tma-sh-lg: 0 4px 8px rgba(0, 0, 0, .35), 0 34px 70px -28px rgba(0, 0, 0, .8);
}
:root[data-theme="dark"] body.tma::before { background: radial-gradient(circle, rgba(var(--tma-primary-rgb), .28), transparent 66%); }
:root[data-theme="dark"] body.tma::after { background: radial-gradient(circle, rgba(var(--tma-accent-rgb), .12), transparent 66%); }
:root[data-theme="dark"] .tma-hdr__bar, :root[data-theme="dark"] .tma-bnav ul { background: rgba(8, 13, 32, .82); }
:root[data-theme="dark"] .tma-wpost__rank { color: var(--tma-accent); background: rgba(var(--tma-accent-rgb), .14); }
:root[data-theme="dark"] .tma-chip-sm, :root[data-theme="dark"] .tma-wart__kind { background: rgba(var(--tma-primary-rgb), .25); }
:root[data-theme="dark"] .tma-ccard__media, :root[data-theme="dark"] .tma-gcard__media, :root[data-theme="dark"] .tma-pcard__media { background: linear-gradient(140deg, rgba(var(--tma-primary-rgb), .3), rgba(var(--tma-accent-rgb), .12)); }
:root[data-theme="dark"] .tma-alert { background: rgba(226, 67, 75, .18); }
:root[data-theme="dark"] img.tma-strip-people__av, :root[data-theme="dark"] .tma-strip-people__av img { border-color: var(--tma-card); }
:root[data-theme="dark"] .tma-ftr__in { background: rgba(var(--tma-surf-rgb), .6); }
.tma-theme-btn .tma-i--sun { display: none; }
:root[data-theme="dark"] .tma-theme-btn .tma-i--sun { display: block; }
:root[data-theme="dark"] .tma-theme-btn .tma-i--moon { display: none; }
html.tma-theming *, html.tma-theming *::before, html.tma-theming *::after { transition: background-color .35s ease, color .35s ease, border-color .35s ease, box-shadow .35s ease !important; }

/* ==========================================================================
   «الاستوديو» — teacher front-end dashboard
   ========================================================================== */
body.tma-studio-page .tma-pagehead { display: none; }
body.tma-studio-page .tma-page, body.tma-studio-page .tma-page .tma-content { max-width: 1240px; }
body.tma-studio-page .entry-content > * { max-width: none; }
.tma-studio { padding-top: 10px; }
.tma-st__head { display: grid; gap: 14px; padding: 26px; margin-bottom: 18px; border-radius: 30px; color: #fff; background: radial-gradient(110% 90% at 90% 0%, rgba(var(--tma-primary-rgb), .75), transparent 60%), linear-gradient(150deg, color-mix(in srgb, var(--tma-night) 90%, var(--tma-primary)), var(--tma-night)); box-shadow: 0 30px 60px -36px rgba(var(--tma-night-rgb), .9); }
.tma-st__head h1 { margin: 0; font-size: clamp(24px, 3.4vw, 34px); color: #fff; }
.tma-st__head p { margin: 4px 0 0; opacity: .82; }
.tma-st__links { display: flex; gap: 8px; flex-wrap: wrap; }
.tma-st__head .tma-btn--ghost { background: rgba(255, 255, 255, .12); color: #fff !important; box-shadow: 0 0 0 1px rgba(255, 255, 255, .2); }
.tma-st__stats { display: flex; flex-wrap: wrap; gap: 8px; }
.tma-st__stats span { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 99px; font-size: 13px; background: rgba(255, 255, 255, .1); }
.tma-st__stats b { font-size: 17px; color: var(--tma-accent); }
@media (min-width: 900px) { .tma-st__head { grid-template-columns: 1fr auto; align-items: center; } .tma-st__stats { grid-column: 1 / -1; } }
.tma-st__grid { display: grid; gap: 18px; }
@media (min-width: 1000px) { .tma-st__grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } .tma-st__side { position: sticky; top: 96px; } }
.tma-st__panel { padding: 22px; border-radius: 28px; background: linear-gradient(160deg, rgba(var(--tma-surf-rgb), .94), rgba(var(--tma-surf-rgb), .72)); -webkit-backdrop-filter: var(--tma-glass); backdrop-filter: var(--tma-glass); border: 1px solid var(--tma-hair); box-shadow: inset 0 1px 0 var(--tma-hl), 0 0 0 1px var(--tma-line), var(--tma-sh-md); }
.tma-st__h { font-size: 18px; margin: 0 0 14px; }
.tma-st__form { display: grid; gap: 16px; }
.tma-st__form.is-busy { opacity: .7; pointer-events: none; }
.tma-st__types { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.tma-st__type { display: grid; justify-items: center; gap: 6px; padding: 16px 8px; border-radius: 20px; cursor: pointer; font-weight: 500; font-size: 14px; color: var(--tma-ink); background: rgba(var(--tma-surf-rgb), .8); border: 1px solid var(--tma-hair); box-shadow: 0 0 0 1px var(--tma-line); transition: transform .25s var(--tma-ease), box-shadow .25s, background-color .25s; }
.tma-st__type .tma-i { color: var(--tma-primary); }
.tma-st__type:hover { transform: translateY(-2px); }
.tma-st__type[aria-checked="true"] { color: #fff; background: var(--tma-btn-bg); box-shadow: 0 16px 26px -14px rgba(var(--tma-primary-rgb), .85); }
.tma-st__type[aria-checked="true"] .tma-i { color: #fff; }
.tma-st__dyn { display: grid; gap: 14px; }
.tma-st__f { display: grid; gap: 6px; }
.tma-st__f > span { font-weight: 500; font-size: 14.5px; }
.tma-st__f > small { color: var(--tma-muted); font-size: 12.5px; }
.tma-st__url { display: flex; gap: 8px; }
.tma-st__url input { flex: 1; }
.tma-st__preview { padding: 10px; border-radius: 18px; background: rgba(var(--tma-primary-rgb), .06); font-size: 14px; color: var(--tma-muted); }
.tma-st__card { display: flex; gap: 12px; align-items: center; }
.tma-st__card img { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; flex: none; }
.tma-st__card b { display: block; color: var(--tma-ink); font-weight: 600; }
.tma-st__card small { color: var(--tma-muted); }
.tma-st__noimg { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px; flex: none; color: var(--tma-primary); background: rgba(var(--tma-primary-rgb), .1); }
.tma-st__spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(var(--tma-primary-rgb), .25); border-top-color: var(--tma-primary); animation: tma-spin .8s linear infinite; vertical-align: -2px; margin-inline-end: 6px; }
@keyframes tma-spin { to { transform: rotate(360deg); } }
.tma-st__drop { display: grid; gap: 2px; justify-items: center; padding: 18px; border-radius: 18px; cursor: pointer; color: var(--tma-ink); background: transparent; border: 2px dashed rgba(var(--tma-primary-rgb), .3); }
.tma-st__drop small { color: var(--tma-muted); }
.tma-st__levels { display: grid; gap: 8px; }
.tma-st__lvrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tma-st__lvg { width: 100%; font-size: 12.5px; color: var(--tma-muted); }
.tma-st__lvrow .tma-fchip { height: 36px; padding: 0 14px; cursor: pointer; font: inherit; font-size: 13.5px; }
.tma-st__row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.tma-st__chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.tma-st__chk input { width: 18px; height: 18px; accent-color: var(--tma-primary); }
.tma-st__done { margin-top: 16px; }
.tma-st__ok { display: grid; gap: 8px; padding: 18px; border-radius: 20px; background: rgba(22, 167, 119, .12); box-shadow: 0 0 0 1px rgba(22, 167, 119, .35); }
.tma-st__ok b { color: var(--tma-ok); font-size: 17px; }
.tma-st__items { display: grid; gap: 8px; }
.tma-st__item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; background: rgba(var(--tma-surf-rgb), .7); box-shadow: 0 0 0 1px var(--tma-line); }
.tma-st__item img { width: 64px; height: 44px; object-fit: cover; border-radius: 10px; flex: none; }
.tma-st__item .tma-st__noimg { width: 64px; height: 44px; border-radius: 10px; }
.tma-st__meta { flex: 1; min-width: 0; display: grid; }
.tma-st__meta a { font-weight: 500; font-size: 14px; color: var(--tma-ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tma-st__meta small { color: var(--tma-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tma-st__ic { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; cursor: pointer; text-decoration: none; background: transparent; color: var(--tma-muted); font-size: 15px; }
.tma-st__ic:hover { background: rgba(var(--tma-primary-rgb), .08); }

/* Content made by the studio */
.entry-content > .tma-pdf, .entry-content > iframe { max-width: none; }
.tma-pdf iframe { display: block; width: 100%; height: min(80vh, 900px); border: 0; border-radius: 18px; background: #fff; box-shadow: 0 0 0 1px var(--tma-line); }
.tma-pdf__bar { margin: 12px 0 0; }
.tma-embed-game { display: block; width: 100%; min-height: min(80vh, 720px); border: 0; }
.entry-content .wp-block-embed iframe { border-radius: 18px; max-width: 100%; }
body.tma-studio-page .tma-page .tma-content { padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
