:root {
  --ink: #17191c;
  --muted: #777c85;
  --line: #e8e9ec;
  --paper: #fff;
  --background: #f5f6f7;
  --coral: #ff705a;
  --coral-2: #ff9a5c;
  --purple: #8777e9;
  --purple-2: #a855f7;
  --blue: #59a9de;
  --green: #53b78a;
  --shadow: 0 20px 50px rgba(26, 31, 38, .08);
  --surface-soft: #f4f5f6;
  --surface-hover: #f1f2f4;
  --hero-start: #1e2025;
  --hero-end: #2c3038;
  --gradient-brand: linear-gradient(135deg, var(--coral) 0%, var(--purple-2) 55%, var(--blue) 100%);
  --gradient-coral: linear-gradient(135deg, var(--coral), var(--coral-2));
  --bg-wash: radial-gradient(1100px circle at 12% -8%, rgba(255, 112, 90, .07), transparent 58%), radial-gradient(950px circle at 102% 4%, rgba(89, 169, 222, .07), transparent 55%);
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f3f1ee;
  --muted: #a5a7ac;
  --line: #303238;
  --paper: #202228;
  --background: #17191d;
  --shadow: 0 20px 55px rgba(0, 0, 0, .24);
  --surface-soft: #292b31;
  --surface-hover: #2b2d33;
  --hero-start: #272a31;
  --hero-end: #313641;
  --bg-wash: radial-gradient(1100px circle at 12% -8%, rgba(255, 112, 90, .1), transparent 58%), radial-gradient(950px circle at 102% 4%, rgba(89, 169, 222, .1), transparent 55%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Plus Jakarta Sans", sans-serif; color: var(--ink); background: var(--bg-wash), var(--background); background-attachment: fixed; transition: color .25s, background-color .25s; overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }
button, input { font: inherit; }
button { color: inherit; touch-action: manipulation; }
.app-shell { min-height: 100vh; min-height: 100dvh; display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 244px; padding: 31px 22px 24px; display: flex; flex-direction: column; background: var(--paper); border-right: 1px solid var(--line); transition: background-color .25s, border-color .25s; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 19; background: rgba(12,13,16,.5); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 11px; color: var(--ink); text-decoration: none; font: 700 22px/1 "Space Grotesk", sans-serif; letter-spacing: -.8px; }
.brand > span:last-child span { background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-mark { width: 29px; height: 29px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; transform: rotate(-7deg); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.brand:hover .brand-mark { transform: rotate(8deg) scale(1.08); }
.brand-mark i { display: block; background: var(--ink); border-radius: 4px; }
.brand-mark i:nth-child(1) { grid-row: span 2; background: var(--gradient-coral); }
.brand-mark i:nth-child(2) { height: 11px; }
.main-nav { margin-top: 50px; display: grid; gap: 7px; }
.nav-item { border: 0; background: transparent; width: 100%; height: 46px; padding: 0 13px; border-radius: 12px; display: flex; align-items: center; gap: 13px; color: #6c7178; cursor: pointer; font: 600 15px "Space Grotesk", sans-serif; letter-spacing: -.2px; text-align: left; transition: background-color .2s, color .2s, box-shadow .2s; }
.nav-item:hover { color: var(--ink); background: var(--surface-hover); }
.nav-item.active { color: #fff; background: var(--gradient-coral); box-shadow: 0 10px 22px -8px rgba(255,112,90,.6); }
.nav-icon { width: 20px; font-size: 23px; text-align: center; font-weight: 400; display: inline-block; transition: transform .25s ease; }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { transform: scale(1.15) rotate(-4deg); }
.nav-count { margin-left: auto; min-width: 23px; height: 23px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.25); font-size: 15px; }
.nav-item:not(.active) .nav-count { background: var(--coral); }
.sidebar-label { margin: 34px 13px 13px; color: #a4a7ac; font: 700 12px "Space Grotesk", sans-serif; letter-spacing: 1.3px; text-transform: uppercase; }
.category-nav { display: grid; gap: 4px; }
.category-nav button { border: 0; background: transparent; padding: 9px 14px; display: flex; gap: 12px; align-items: center; border-radius: 9px; color: #6c7178; font: 600 15px "Space Grotesk", sans-serif; letter-spacing: -.1px; cursor: pointer; transition: background-color .2s, color .2s, transform .2s; }
.category-nav button:hover { background: var(--surface-soft); color: var(--ink); transform: translateX(3px); }
.category-dot { width: 8px; height: 8px; border-radius: 50%; transition: transform .2s, box-shadow .2s; }
.category-nav button:hover .category-dot { transform: scale(1.3); box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 18%, transparent); }
.peach { background: #f59a74; color: #f59a74; } .purple { background: var(--purple); color: var(--purple); } .blue { background: var(--blue); color: var(--blue); } .green { background: var(--green); color: var(--green); }
.sidebar-bottom { width: 100%; margin-top: auto; padding: 16px 13px 10px; display: block; text-align: left; border: 0; border-radius: 12px; background: transparent; color: inherit; cursor: pointer; transition: background-color .2s; }
.sidebar-bottom:hover { background: var(--surface-soft); }
.level-hint { display: block; margin-top: 6px; color: #a0a4aa; font-size: 12px; font-style: normal; line-height: 1.35; }
.level-copy { display: flex; align-items: baseline; justify-content: space-between; }
.level-copy span { font-size: 13px; color: #9b9fa6; letter-spacing: 1px; font-weight: 700; }
.level-copy strong { font: 700 15px "Space Grotesk", sans-serif; }
.level-track { height: 5px; margin: 10px 0 8px; overflow: hidden; background: var(--line); border-radius: 10px; }
.level-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--gradient-coral); background-size: 200% 100%; animation: shimmerMove 3.5s linear infinite; }
.sidebar-bottom small { color: #a0a4aa; font-size: 13px; }

.main-content { width: calc(100% - 244px); margin-left: 244px; min-width: 0; }
.topbar { height: 90px; padding: 0 4.2vw; display: flex; align-items: center; justify-content: space-between; background: color-mix(in srgb, var(--paper) 90%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); transition: background-color .25s, border-color .25s; }
.search { width: min(360px, 38vw); height: 43px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--surface-soft); border: 1px solid transparent; border-radius: 12px; transition: .2s; }
.search:focus-within { background: var(--paper); border-color: var(--line); box-shadow: 0 0 0 4px rgba(135,119,233,.08); }
.search > span { font-size: 25px; color: #81858b; transform: rotate(-15deg); }
.search input { flex: 1; min-width: 0; outline: 0; border: 0; color: var(--ink); background: transparent; font-size: 16px; }
.search kbd { color: #a4a7ac; background: var(--paper); padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; font: 13px "Plus Jakarta Sans"; box-shadow: 0 1px 1px rgba(0,0,0,.12); }
.top-actions { display: flex; align-items: center; gap: 24px; }
.theme-toggle { position: relative; width: 55px; height: 30px; padding: 3px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 20px; color: #8a8e94; background: var(--surface-soft); cursor: pointer; transition: background-color .2s; }
.theme-toggle::before { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); box-shadow: 0 2px 7px rgba(0,0,0,.15); transition: transform .35s cubic-bezier(.34,1.56,.64,1), background-color .25s; }
.theme-icon { position: relative; z-index: 1; width: 22px; text-align: center; font-size: 15px; line-height: 22px; transition: transform .4s cubic-bezier(.34,1.56,.64,1), opacity .3s; }
.sun { color: #e09b48; }.moon { color: #9699b8; transform: rotate(60deg) scale(.5); opacity: .35; }
[data-theme="dark"] .theme-toggle::before { transform: translateX(25px); }
[data-theme="dark"] .sun { transform: rotate(-60deg) scale(.5); opacity: .35; }
[data-theme="dark"] .moon { transform: rotate(0) scale(1); opacity: 1; }
.icon-button { position: relative; width: 38px; height: 38px; border: 0; background: transparent; font-size: 24px; cursor: pointer; transition: transform .2s; }
.icon-button:hover { transform: scale(1.12) rotate(-6deg); }
.notification-dot { position: absolute; right: 8px; top: 6px; width: 6px; height: 6px; border: 2px solid var(--paper); border-radius: 50%; background: var(--coral); }
.profile { display: flex; align-items: center; gap: 10px; }
.profile-editor { position: relative; }
.profile { padding: 0; border: 0; text-align: left; background: transparent; cursor: pointer; }
.profile-popover { position: absolute; z-index: 40; right: 0; top: calc(100% + 14px); width: 245px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); }
.profile-popover[hidden] { display: none; }
.profile-popover label { display: block; margin-bottom: 7px; color: #969aa1; font-size: 12px; font-weight: 700; letter-spacing: 1.1px; }
.profile-popover input { width: 100%; height: 39px; padding: 0 11px; outline: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface-soft); font-size: 16px; }
.profile-popover input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(255,112,90,.1); }
.profile-popover > div { margin-top: 10px; display: flex; justify-content: flex-end; gap: 7px; }
.profile-popover button { padding: 8px 10px; border: 0; border-radius: 8px; color: #8c9097; background: transparent; font-size: 13px; cursor: pointer; }
.profile-popover button[type="submit"] { color: #fff; background: var(--gradient-coral); font-weight: 700; }
.avatar { width: 37px; height: 37px; display: grid; place-items: center; color: #72514c; background: linear-gradient(135deg, #ffdccb, #f3c8b8); border-radius: 11px; font-size: 14px; font-weight: 700; transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.profile:hover .avatar { transform: scale(1.06) rotate(-3deg); }
.profile > span:nth-child(2) { display: grid; gap: 2px; min-width: 88px; }
.profile strong { font-size: 15px; }
.profile small { color: #9a9ea4; font-size: 13px; }
.chevron { color: #999da3; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 24px; }

.page { max-width: 1400px; margin: 0 auto; padding: 47px 4.2vw 60px; }
.welcome-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; animation: riseIn .6s cubic-bezier(.2,.8,.2,1) backwards; }
.eyebrow { margin: 0 0 9px!important; color: #aaaeb4!important; font-size: 13px!important; font-weight: 700; letter-spacing: 1.5px; }
.welcome-row h1 { margin: 0; font: 700 clamp(34px, 3.2vw, 44px)/1.15 "Space Grotesk"; letter-spacing: -1.8px; }
.welcome-row p { margin: 9px 0 0; color: #858990; font-size: 16px; }
.streak-pill[hidden] { display: none; }
.streak-pill { position: relative; min-width: 138px; height: 52px; padding: 0 18px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.streak-pill > span { position: relative; color: var(--coral); font-size: 20px; }
.streak-pill > span::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; background: var(--coral); opacity: .3; animation: pulseRing 2.4s ease-out infinite; }
.streak-pill strong { position: relative; font: 700 22px "Space Grotesk"; }
.streak-pill small { color: #969aa1; font-size: 14px; }

.hero-card { position: relative; min-height: 280px; overflow: hidden; padding: 42px 49px; border-radius: 25px; color: #fff; background: linear-gradient(115deg, var(--hero-start), var(--hero-end)); box-shadow: var(--shadow); animation: riseIn .6s .08s cubic-bezier(.2,.8,.2,1) backwards; }
.hero-card::after { content: ""; position: absolute; width: 500px; height: 500px; right: -220px; top: -260px; border-radius: 50%; background: rgba(255,255,255,.025); }
.hero-card::before { content: ""; position: absolute; z-index: 1; width: 380px; height: 380px; left: -140px; bottom: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(255,112,90,.16), transparent 70%); animation: driftBlob 16s ease-in-out infinite alternate; }
.hero-content { position: relative; z-index: 2; max-width: 475px; }
.hero-label { display: inline-block; margin-bottom: 14px; color: #ff9d8b; font-size: 13px; font-weight: 700; letter-spacing: 1.5px; }
.hero-card h2 { margin: 0; font: 700 clamp(32px, 3.2vw, 42px)/1.12 "Space Grotesk"; letter-spacing: -1.6px; }
.hero-card p { max-width: 410px; margin: 14px 0 22px; color: #aeb0b5; font-size: 16px; line-height: 1.6; }
.hero-actions { display: flex; align-items: center; gap: 20px; }
.primary-button { position: relative; overflow: hidden; border: 0; border-radius: 11px; padding: 13px 19px; color: #fff; background: var(--gradient-coral); font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 22px rgba(255,112,90,.28); transition: transform .2s, filter .2s, box-shadow .2s; }
.primary-button:hover { transform: translateY(-2px); filter: brightness(1.04); box-shadow: 0 12px 28px rgba(255,112,90,.38); }
.primary-button:active { transform: translateY(0) scale(.98); }
.primary-button::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.4) 50%, transparent 70%); transform: translateX(-130%); transition: transform .6s ease; }
.primary-button:hover::after { transform: translateX(130%); }
.primary-button span { margin-left: 10px; display: inline-block; transition: transform .2s; }
.primary-button:hover span { transform: translateX(3px); }
.reward { color: #8c9097; font-size: 14px; }
.reward b { color: #fff; }
.sudoku-art { position: absolute; width: 410px; height: 320px; right: 3%; top: -14px; }
.sudoku-board { position: absolute; z-index: 2; left: 125px; top: 62px; width: 200px; height: 200px; padding: 13px; display: grid; grid-template-columns: repeat(3, 1fr); transform: rotate(7deg); border: 1px solid rgba(255,255,255,.22); border-radius: 21px; background: rgba(255,255,255,.08); box-shadow: 0 26px 50px rgba(0,0,0,.24); backdrop-filter: blur(6px); }
.sudoku-board span { display: grid; place-items: center; border: 1px solid rgba(255,255,255,.09); color: #e8e8ea; font: 600 24px "Space Grotesk"; }
.sudoku-board span:nth-child(5) { color: #ff8b77; background: rgba(255,112,90,.12); }
.orbit { position: absolute; border: 1px solid rgba(255,255,255,.06); border-radius: 50%; }
.orbit-one { inset: 14px 12px 0 46px; animation: spinSlow 40s linear infinite; } .orbit-two { inset: 65px -30px -60px 93px; animation: spinSlow 55s linear infinite reverse; }
.float-number { position: absolute; z-index: 3; display: grid; place-items: center; width: 41px; height: 41px; border-radius: 11px; color: #ddd; background: #393d45; box-shadow: 0 10px 25px rgba(0,0,0,.22); font: 600 19px "Space Grotesk"; animation: floatY 5s ease-in-out infinite; }
.n1 { top: 24px; left: 65px; --r: -10deg; animation-delay: 0s; }.n2 { bottom: 24px; right: 26px; --r: 12deg; animation-delay: .6s; }.n3 { bottom: 42px; left: 77px; color: #ff9a88; --r: -5deg; animation-delay: 1.2s; }

.content-grid { margin-top: 40px; display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 45px; align-items: start; }
.section-heading, .scoreboard-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 19px; }
.section-heading h3, .scoreboard-heading h3 { margin: 0 0 5px; font: 700 19px "Space Grotesk"; letter-spacing: -.4px; }
.section-heading p, .scoreboard-heading p { margin: 0; color: #a1a5ab; font-size: 14px; }
.section-heading button, .scoreboard-heading button { border: 0; background: transparent; color: #777b82; font-size: 14px; cursor: pointer; transition: transform .2s; }
.section-heading button:hover, .scoreboard-heading button:hover { transform: translateX(3px); }
.section-heading button span { color: var(--coral); margin-left: 6px; }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.game-card { --accent: var(--coral); position: relative; min-width: 0; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 17px; cursor: pointer; transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s ease; animation: cardRise .5s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.game-card[data-category="Card"] { --accent: #ff8a65; }
.game-card[data-category="Puzzle"] { --accent: var(--purple); }
.game-card[data-category="Arcade"] { --accent: var(--blue); }
.game-card[data-category="Strategy"] { --accent: var(--green); }
.game-card::before { content: ""; position: absolute; z-index: 4; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), transparent); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.game-card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px -10px color-mix(in srgb, var(--accent) 40%, transparent), 0 15px 32px rgba(25,31,38,.09); }
.game-card:hover::before { transform: scaleX(1); }
.game-visual { position: relative; height: 128px; overflow: hidden; display: grid; place-items: center; background: var(--surface-soft); }
/* Art paints its own background, so it sits flush and identical in both themes. */
.game-art { position: absolute; inset: 0; }
.game-art svg { display: block; width: 100%; height: 100%; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.game-card:hover .game-art svg { transform: scale(1.06); }
.game-visual::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 55%, rgba(8,10,16,.28)); }
.game-symbol { position: relative; z-index: 2; font-size: 55px; line-height: 1; }
.favorite { position: absolute; z-index: 3; right: 10px; top: 10px; width: 29px; height: 29px; border: 0; border-radius: 9px; color: #7b7f85; background: rgba(255,255,255,.8); cursor: pointer; backdrop-filter: blur(5px); transition: transform .2s, color .2s; }
.favorite:hover { transform: scale(1.15); }
.favorite.active { color: var(--coral); animation: popIn .35s cubic-bezier(.34,1.56,.64,1); }
.game-copy { padding: 15px 15px 16px; }
.game-copy h4 { margin: 0 0 5px; font: 700 17px "Space Grotesk"; }
.game-copy p { margin: 0 0 14px; color: #a0a4a9; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-meta { display: flex; justify-content: space-between; color: #969aa0; font-size: 12px; }
.game-meta span:first-child { color: var(--accent); font-weight: 700; letter-spacing: .6px; }
.empty-state { padding: 70px 10px; text-align: center; color: #a0a4aa; }
.empty-state > span { font-size: 40px; }.empty-state h3 { margin: 6px 0; color: var(--ink); }.empty-state p { font-size: 15px; }

.scoreboard { min-width: 0; animation: riseIn .6s .12s cubic-bezier(.2,.8,.2,1) backwards; }
.score-tabs { display: flex; border-bottom: 1px solid var(--line); }
.score-tabs button { flex: 1; padding: 10px; border: 0; border-bottom: 2px solid transparent; color: #a0a4aa; background: transparent; font-size: 14px; cursor: pointer; transition: color .2s, border-color .2s; }
.score-tabs button.active { color: var(--ink); border-bottom-color: var(--coral); font-weight: 700; }
.score-filter { margin: 10px 0 2px; padding: 8px 10px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.score-filter > span { color: #a0a4aa; font-size: 11px; font-weight: 700; letter-spacing: 1px; }
.score-filter select { flex: 1; min-width: 0; outline: 0; border: 0; color: var(--ink); background: transparent; font: 600 13px "Plus Jakarta Sans",sans-serif; cursor: pointer; }
.score-filter option { color: #22262c; background: #fff; }
.leader-list { display: grid; }
.leader { display: grid; grid-template-columns: 24px 35px minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 14px 8px; margin: 0 -8px; border-bottom: 1px solid #ededee; border-radius: 10px; transition: background-color .2s, transform .2s; }
.leader:hover { background: var(--surface-soft); transform: translateX(2px); }
.leader > strong:first-child { color: #8e9298; font-size: 15px; text-align: center; }
.leader.is-real .leader-copy > strong::after { content: "●"; margin-left: 6px; color: var(--green); font-size: 11px; vertical-align: middle; }
.leader:nth-child(1) > strong:first-child { color: #eba94d; }.leader:nth-child(2) > strong:first-child { color: #a5a9ae; }.leader:nth-child(3) > strong:first-child { color: #c28061; }
.leader .avatar { width: 31px; height: 31px; border-radius: 9px; color: #fff; }
.leader-copy { min-width: 0; display: grid; gap: 3px; }
.leader-copy strong { overflow: hidden; text-overflow: ellipsis; font-size: 14px; white-space: nowrap; }
.leader-copy small { color: #aaaeb3; font-size: 12px; }
.leader-score { font-size: 14px; }.leader-score small { color: #a9adb2; font-size: 11px; font-weight: 400; }
.score-empty { padding: 30px 12px; display: grid; justify-items: center; gap: 4px; color: #a0a4aa; text-align: center; }
.score-empty span { color: var(--coral); font-size: 24px; }.score-empty strong { color: var(--ink); font-size: 14px; }.score-empty small { font-size: 12px; }
.full-board { width: 100%; padding: 15px 0; border: 0; color: #777b81; background: transparent; font-size: 13px; cursor: pointer; transition: transform .2s; }
.full-board:hover { transform: translateY(-1px); }
.full-board span { color: var(--coral); margin-left: 5px; }
.your-rank { display: grid; grid-template-columns: 25px 34px minmax(0,1fr) auto; gap: 8px; align-items: center; margin-top: 6px; padding: 13px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: 0 8px 22px rgba(20,25,30,.04); }
.rank-number { color: #8c9096; font-size: 13px; text-align: center; }.your-rank .avatar { width: 31px; height: 31px; border-radius: 9px; color: #72514c; }.your-rank > span:nth-child(3) { display: grid; }.your-rank span small { color: #aaaeb3; font-size: 11px; }.your-rank span strong { font-size: 13px; }.your-rank > b { font-size: 13px; }.your-rank > b small { font-size: 11px; color: #a7abb0; }
.coral { background: #f3c8b8!important; }

.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; padding: 12px 18px; color: #fff; background: #202329; border-radius: 11px; box-shadow: var(--shadow); font-size: 15px; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: .25s; }.toast.show { opacity: 1; transform: translate(-50%,0); }
.game-modal { width: min(410px, calc(100vw - 32px)); padding: 42px 36px 36px; border: 1px solid var(--line); border-radius: 24px; text-align: center; color: var(--ink); background: var(--paper); box-shadow: 0 30px 80px rgba(0,0,0,.22); animation: popIn .3s cubic-bezier(.34,1.56,.64,1); }.game-modal::backdrop { background: rgba(18,20,24,.55); backdrop-filter: blur(5px); }.modal-close { position: absolute; right: 17px; top: 14px; border: 0; background: transparent; color: #898d93; font-size: 24px; cursor: pointer; transition: transform .2s; }.modal-close:hover { transform: rotate(90deg); }.modal-icon { width: 160px; height: 90px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 20px; overflow: hidden; background: var(--surface-soft); font-size: 47px; }.modal-icon svg { width: 100%; height: 100%; display: block; }.game-modal p { margin: 0 0 8px; color: var(--coral); font-size: 13px; font-weight: 700; letter-spacing: 1.4px; }.game-modal h2 { margin: 0 0 10px; font: 700 28px "Space Grotesk"; }.game-modal > span { display: block; color: #858990; font-size: 15px; line-height: 1.6; }.modal-action { margin-top: 24px; }

[data-theme="dark"] .favorite { color: #b8bbc1; background: rgba(32,34,40,.78); }
[data-theme="dark"] .favorite.active { color: var(--coral); }
[data-theme="dark"] .leader, [data-theme="dark"] .score-tabs { border-color: var(--line); }

@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cardRise { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.85); } 100% { opacity: 1; transform: scale(1); } }
@keyframes pulseRing { 0% { transform: scale(.6); opacity: .35; } 70% { transform: scale(1.6); opacity: 0; } 100% { opacity: 0; } }
@keyframes shimmerMove { to { background-position: -200% 0; } }
@keyframes driftBlob { from { transform: translate(0, 0) scale(1); } to { transform: translate(30px, -20px) scale(1.15); } }
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes floatY { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-9px) rotate(var(--r, 0deg)); } }

@media (max-width: 1100px) { .game-grid { grid-template-columns: repeat(2, 1fr); }.sudoku-art { right: -6%; transform: scale(.88); }.content-grid { gap: 28px; } }
@media (max-width: 850px) { .sidebar { transform: translateX(-100%); transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: 20px 0 50px rgba(0,0,0,.1); }.sidebar.open { transform: translateX(0); }.sidebar-backdrop { display: block; }.sidebar.open ~ .sidebar-backdrop { opacity: 1; pointer-events: auto; }.main-content { width: 100%; margin-left: 0; }.mobile-menu { display: block; }.topbar { padding: 0 24px; }.search { margin-right: auto; margin-left: 15px; }.content-grid { grid-template-columns: 1fr; }.scoreboard { max-width: none; }.leader-list { grid-template-columns: repeat(2, 1fr); column-gap: 24px; }.hero-card { padding-left: 35px; }.sudoku-art { right: -14%; opacity: .45; }.hero-content { max-width: 450px; }.game-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 650px) { .page { padding: 32px 18px 45px; }.topbar { height: 72px; padding: 0 14px; }.top-actions .icon-button, .profile > span, .chevron, .search kbd { display: none; }.search { width: auto; flex: 1; }.welcome-row { align-items: flex-end; }.welcome-row > div:first-child p:last-child { max-width: 240px; }.streak-pill { min-width: 55px; padding: 0 12px; justify-content: center; }.streak-pill small { display: none; }.hero-card { min-height: 315px; padding: 34px 25px; }.hero-card p { max-width: 290px; }.sudoku-art { right: -160px; top: 25px; opacity: .32; }.game-grid { grid-template-columns: 1fr 1fr; }.game-visual { height: 112px; }.content-grid { margin-top: 32px; }.leader-list { grid-template-columns: 1fr; } }
@media (max-width: 650px) { .profile-popover { position: fixed; top: 64px; right: 12px; width: min(245px, calc(100vw - 24px)); }.top-actions { gap: 9px; }.profile .avatar { width: 35px; height: 35px; } }
@media (max-width: 650px) { .top-actions .profile > span:nth-child(2), .top-actions .profile > .chevron { display: none; }.profile { gap: 0; }.profile-editor { width: 35px; }.main-content { overflow-x: clip; } }
@media (max-width: 850px) { html, body { width: 100%; max-width: 100%; } html { overflow-y: visible; } body { min-height: 100%; overflow-y: auto; overscroll-behavior-y: auto; -webkit-overflow-scrolling: touch; }.app-shell { overflow-x: clip; }.app-shell,.main-content,.topbar,.page,.content-grid,.games-section,.scoreboard { min-width: 0; max-width: 100%; }.main-content,.topbar,.page { width: 100%; }.topbar { gap: 0; }.mobile-menu,.top-actions { flex: 0 0 auto; }.search { min-width: 0; }.page { overflow-x: clip; }.welcome-row>div:first-child { min-width: 0; }.streak-pill { flex: 0 0 auto; }.hero-card,.game-grid,.leader-list { max-width: 100%; }.sidebar { max-width: min(244px,86vw); } }
@media (max-width: 650px) { .search { margin-left: 8px; }.topbar { gap: 7px; }.scoreboard-heading p { max-width: 220px; }.your-rank { grid-template-columns: 21px 32px minmax(0,1fr) auto; padding-left: 8px; padding-right: 8px; }.your-rank > b { white-space: nowrap; } }
@media (max-width: 410px) { .game-grid { grid-template-columns: 1fr; }.hero-actions { align-items: flex-start; flex-direction: column; gap: 10px; }.hero-card { min-height: 345px; } }

/* ---------- card demos ----------
   Every cover carries a few `d-*` marks: the one thing you actually DO in that
   game, played as a short loop. The loop runs only while the card is marked
   .demo -- on a mouse that is hover/focus, on touch it is "scrolled into view"
   (app.js decides which). An idle grid animates nothing at all, and a visitor
   who asked for no motion gets none. */
.game-art [class*="d-"] { transform-box: fill-box; transform-origin: 50% 50%; }
.game-card:not(.demo) .game-art [class*="d-"] { animation: none !important; }
.game-card.demo .game-art [class*="d-"] { animation-duration: 2.6s; animation-iteration-count: infinite; animation-timing-function: cubic-bezier(.35,.1,.3,1); }
.d-late { animation-delay: .45s !important; }
.d-later { animation-delay: .9s !important; }

.game-card.demo .d-grow { transform-box: view-box; transform-origin: 150px 97px; animation-name: dGrow; }
.game-card.demo .d-draw { animation-name: dDraw; animation-timing-function: ease-in-out; }
.game-card.demo .d-pop { animation-name: dPop; }
.game-card.demo .d-pop-in { animation-name: dPopIn; }
.game-card.demo .d-shoot { animation-name: dShoot; }
.game-card.demo .d-trail { animation-name: dTrail; }
.game-card.demo .d-place { animation-name: dPlace; }
.game-card.demo .d-flip { animation-name: dFlip; }
.game-card.demo .d-fall { animation-name: dFall; }
.game-card.demo .d-drop { animation-name: dDrop; }
.game-card.demo .d-deal { animation-name: dDeal; }
.game-card.demo .d-slide-r { animation-name: dSlideR; }
.game-card.demo .d-slide-l { animation-name: dSlideL; }
.game-card.demo .d-advance { animation-name: dAdvance; }
.game-card.demo .d-swell { animation-name: dSwell; }
.game-card.demo .d-eaten { animation-name: dEaten; }
.game-card.demo .d-rally { animation-name: dRally; animation-timing-function: cubic-bezier(.5,0,.5,1); }
.game-card.demo .d-paddle-a { animation-name: dPaddleA; }
.game-card.demo .d-paddle-b { animation-name: dPaddleB; }
.game-card.demo .d-descend { animation-name: dDescend; }
.game-card.demo .d-shot { animation-name: dShot; }
.game-card.demo .d-chase { animation-name: dChase; }
.game-card.demo .d-drag { animation-name: dDrag; }
.game-card.demo .d-untie { animation-name: dUntie; }

@keyframes dGrow { 0%, 6% { transform: scaleY(.12); opacity: .35; } 48%, 100% { transform: none; opacity: 1; } }
@keyframes dDraw { 0%, 4% { stroke-dasharray: 190; stroke-dashoffset: 190; } 52%, 100% { stroke-dasharray: 190; stroke-dashoffset: 0; } }
@keyframes dPop { 0%, 34% { transform: none; opacity: 1; } 52% { transform: scale(1.3); opacity: .7; } 66%, 92% { transform: scale(0); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes dPopIn { 0%, 40% { transform: scale(.2); opacity: 0; } 60%, 92% { transform: scale(1); opacity: 1; } 100% { transform: scale(.2); opacity: 0; } }
@keyframes dShoot { 0%, 14% { transform: none; opacity: 1; } 52% { transform: translateY(-56px); opacity: 1; } 62% { transform: translateY(-56px); opacity: 0; } 74% { transform: none; opacity: 0; } 88%, 100% { transform: none; opacity: 1; } }
@keyframes dTrail { 0%, 14% { opacity: 0; } 40% { opacity: .9; } 62%, 100% { opacity: 0; } }
@keyframes dPlace { 0%, 30% { transform: scale(.3); opacity: 0; } 55%, 90% { transform: none; opacity: 1; } 100% { transform: scale(.3); opacity: 0; } }
@keyframes dFlip { 0%, 18% { transform: scaleY(1); fill: #2c4438; } 44% { transform: scaleY(.06); fill: #2c4438; } 72%, 100% { transform: scaleY(1); fill: #6fd3b0; } }
@keyframes dFall { 0%, 12% { transform: translateY(-34px); opacity: 0; } 26% { opacity: 1; } 60%, 100% { transform: none; opacity: 1; } }
@keyframes dDrop { 0%, 14% { transform: none; opacity: 1; } 52%, 74% { transform: translateY(42px); opacity: 1; } 82% { transform: translateY(42px); opacity: 0; } 90% { transform: none; opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes dDeal { 0%, 10% { transform: translate(26px, -44px) rotate(9deg); opacity: 0; } 30% { opacity: 1; } 62%, 100% { transform: none; opacity: 1; } }
@keyframes dSlideR { 0%, 26% { transform: none; } 58%, 100% { transform: translateX(29px); } }
@keyframes dSlideL { 0%, 26% { transform: none; } 58%, 100% { transform: translateX(-29px); } }
@keyframes dAdvance { 0%, 10% { transform: translateY(22px); } 58%, 100% { transform: none; } }
@keyframes dSwell { 0%, 20% { transform: scale(.72); } 62%, 100% { transform: scale(1); } }
@keyframes dEaten { 0%, 30% { transform: none; opacity: 1; } 58%, 92% { transform: scale(0); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes dRally { 0% { transform: translateX(-52px); } 50% { transform: translateX(52px); } 100% { transform: translateX(-52px); } }
@keyframes dPaddleA { 0%, 100% { transform: translateY(-9px); } 50% { transform: translateY(9px); } }
@keyframes dPaddleB { 0%, 100% { transform: translateY(9px); } 50% { transform: translateY(-9px); } }
@keyframes dDescend { 0%, 8% { transform: translateY(-13px); } 60%, 100% { transform: translateY(4px); } }
@keyframes dShot { 0%, 20% { transform: none; opacity: 0; } 30% { opacity: 1; } 66% { transform: translateY(-34px); opacity: 1; } 74%, 100% { transform: translateY(-34px); opacity: 0; } }
@keyframes dChase { 0%, 100% { transform: translateX(30px); } 50% { transform: translateX(-42px); } }
@keyframes dDrag { 0%, 100% { transform: translateX(19px); } 50% { transform: translateX(-19px); } }
@keyframes dUntie { 0%, 22% { opacity: 1; } 55%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .game-card.demo .game-art [class*="d-"] { animation: none !important; }
}
