:root {
  color-scheme:light;
  --ink:#252c2a;
  --muted:#747b73;
  --paper:#f6f5f0;
  --line:#dddfd5;
  --green:#d5f36b;
  --orange:#ed7544;
  --radius:20px;
  font-family:"Nunito","Microsoft YaHei","PingFang SC",sans-serif;
  color:var(--ink);
  background:var(--paper)
}
* {
  box-sizing:border-box
}
body {
  margin:0
}
button,input {
  font:inherit
}
button,a,input {
  -webkit-tap-highlight-color:transparent
}
button {
  cursor:pointer
}
button,a {
  touch-action:manipulation
}
button {
  color:inherit
}
a {
  color:inherit;
  text-decoration:none
}
button:focus-visible,a:focus-visible,input:focus-visible,[tabindex]:focus-visible {
  outline:3px solid #488940;
  outline-offset:4px
}
button:disabled {
  opacity:.5;
  cursor:default
}
button {
  border:0
}
button:hover {
  filter:brightness(.97)
}
button:active {
  transform:translateY(1px)
}
[hidden] {
  display:none!important
}
.visually-hidden {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0
}
.topbar {
  background:#fffdf8;
  border-bottom:1px solid var(--line)
}
.header-inner {
  max-width:1320px;
  margin:auto;
  padding:25px 36px;
  display:flex;
  align-items:center;
  gap:48px
}
.brand {
  display:flex;
  align-items:center;
  gap:11px;
  font-size:25px;
  font-weight:900;
  white-space:nowrap;
  letter-spacing:-1px
}
.brand small {
  display:block;
  font-size:10px;
  letter-spacing:3px;
  font-weight:700;
  margin-top:3px
}
.brand-mark {
  display:grid;
  place-items:center;
  background:var(--green);
  width:48px;
  height:48px;
  border-radius:15px;
  font-size:48px;
  line-height:1
}
.header-inner form {
  display:flex;
  align-items:center;
  border:1px solid var(--line);
  background:#f7f7f2;
  border-radius:11px;
  max-width:490px;
  flex:1;
  padding:5px
}
.header-inner input {
  min-width:0;
  flex:1;
  border:0;
  background:transparent;
  padding:8px 12px;
  font-size:14px;
  outline-offset:0
}
.header-inner form button {
  background:var(--ink);
  color:white;
  padding:9px 18px;
  border-radius:7px;
  font-size:13px
}
.controller-button {
  display:flex;
  align-items:center;
  gap:8px;
  background:transparent;
  font-size:13px;
  margin-left:auto;
  white-space:nowrap;
  padding:10px
}
.status-dot {
  width:8px;
  height:8px;
  border-radius:50%;
  background:#b2b7a8
}
.controller-button.connected .status-dot {
  background:#47925c;
  box-shadow:0 0 0 4px #e2f2de
}
.page {
  max-width:1320px;
  padding:32px 36px 0;
  margin:auto
}
.hero {
  position:relative;
  overflow:hidden;
  display:flex;
  min-height:380px;
  border-radius:24px;
  background:#e5eddc
}
.hero-copy {
  position:relative;
  z-index:2;
  padding:35px 48px 30px;
  width:51%
}
.eyebrow {
  font-size:12px;
  letter-spacing:2px;
  color:#55624e;
  margin:0 0 17px;
  font-weight:700
}
.hero h1 {
  font-size:clamp(28px,3.2vw,45px);
  line-height:1.36;
  letter-spacing:-1.5px;
  margin:0 0 14px;
  font-weight:900
}
.hero h1 span {
  color:#527039
}
.hero-description {
  font-size:13px;
  line-height:1.9;
  margin:0 0 22px;
  color:#63705b
}
.primary-button {
  display:inline-flex;
  align-items:center;
  justify-content:space-between;
  gap:45px;
  border-radius:10px;
  background:var(--ink);
  color:white;
  padding:14px 20px;
  font-weight:700;
  font-size:14px
}
.primary-button span {
  font-size:21px;
  line-height:1
}
.hero-support {
  font-size:11px;
  color:#718069;
  margin:14px 0 0
}
.hero-art {
  flex:1;
  position:relative;
  display:grid;
  place-items:center;
  min-width:0
}
.hero-board {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  padding:10px;
  width:302px;
  height:302px;
  background:#bac9a9;
  border-radius:18px;
  transform:rotate(-8deg);
  box-shadow:18px 23px 0 #c8d6ba,0 20px 40px #4455331a;
  z-index:1
}
.hero-board>span {
  display:grid;
  place-items:center;
  background:#cbd8bd;
  border-radius:9px;
  font-weight:900;
  font-size:28px
}
.hero-board .tile {
  box-shadow:0 3px 0 #0000000b
}
.hero-board .t2 {
  background:#f9f8e9
}
.hero-board .t4 {
  background:#eef2c4
}
.hero-board .t8 {
  background:#d5eb86
}
.hero-board .t16 {
  background:#b9dc64
}
.hero-board .t32 {
  background:#8cb85a;
  color:#fff
}
.hero-board .t64 {
  background:#668f44;
  color:#fff
}
.hero-board .t128 {
  background:#e7a652;
  color:#fff;
  font-size:25px
}
.hero-board .t2048 {
  background:#ed7544;
  color:white;
  font-size:23px
}
.hero-index {
  position:absolute;
  right:0;
  bottom:-60px;
  color:#d8e3ce;
  font-size:210px;
  line-height:1;
  font-weight:900;
  letter-spacing:-15px;
  pointer-events:none
}
.art-spark {
  position:absolute;
  font-size:55px;
  color:#ed7544;
  z-index:2
}
.spark-one {
  right:15%;
  top:24px;
  transform:rotate(10deg)
}
.spark-two {
  left:2%;
  bottom:27px;
  font-size:30px;
  color:#7d995f
}
.library-nav {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:29px 0 23px;
  border-bottom:1px solid var(--line)
}
.categories,.personal-filters {
  display:flex;
  align-items:center;
  gap:7px
}
.categories button,.personal-filters button {
  background:transparent;
  white-space:nowrap;
  font-size:13px;
  padding:11px 17px;
  border-radius:8px
}
.categories button.active,.personal-filters button.active {
  background:var(--ink);
  color:white;
  font-weight:700
}
.personal-filters button {
  font-size:12px;
  color:#646b63;
  padding:10px
}
.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:29px 0 20px;
  gap:15px
}
.section-heading h2 {
  font-size:21px;
  letter-spacing:-.5px;
  margin:0
}
.section-heading h2 span {
  font-size:12px;
  margin-left:10px;
  font-weight:400;
  color:var(--muted);
  letter-spacing:0
}
.gamepad-filter {
  font-size:12px;
  display:flex;
  gap:7px;
  align-items:center;
  white-space:nowrap;
  color:#687160
}
.gamepad-filter input {
  accent-color:#537843;
  width:15px;
  height:15px
}
.game-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:21px
}
.game-card {
  position:relative;
  min-width:0;
  background:#fffdf8;
  border:1px solid #e4e5dc;
  border-radius:17px;
  overflow:hidden;
  transition:transform .16s,box-shadow .16s
}
.game-card:hover {
  transform:translateY(-5px);
  box-shadow:0 12px 25px #2c352c0a
}
.card-play {
  display:block;
  text-align:left;
  padding:0;
  width:100%;
  background:transparent
}
.card-cover {
  display:block;
  width:100%;
  aspect-ratio:1.5;
  object-fit:cover
}
.card-body {
  padding:18px 17px 19px
}
.card-category {
  font-size:10px;
  color:#81877c;
  margin:0 0 7px
}
.card-body h3 {
  font-size:18px;
  margin:0 0 8px;
  letter-spacing:-.5px
}
.card-body p {
  font-size:11px;
  color:#85897e;
  margin:0;
  line-height:1.7
}
.card-support {
  font-size:10px;
  padding:5px 8px;
  background:#ffffffd9;
  border-radius:5px;
  position:absolute;
  left:12px;
  top:12px;
  pointer-events:none
}
.favorite-button {
  position:absolute;
  right:10px;
  bottom:19px;
  font-size:11px;
  background:#f1f2e9;
  color:#68715f;
  padding:7px 9px;
  border-radius:7px
}
.favorite-button[aria-pressed=true] {
  background:#e8f2c5;
  color:#4b643a
}
.gamepad-focus {
  outline:4px solid #739a3e;
  outline-offset:4px;
  box-shadow:0 0 0 8px #d9ecb2
}
.controller-strip {
  margin-top:36px;
  display:flex;
  align-items:center;
  gap:22px;
  padding:25px 28px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#efefe7
}
.controller-symbol {
  font-size:42px;
  line-height:1;
  color:#647c46
}
.controller-strip h2 {
  font-size:16px;
  margin:0 0 7px
}
.controller-strip p {
  font-size:11px;
  color:#7a8173;
  line-height:1.8;
  margin:0
}
.secondary-button {
  padding:11px 16px;
  border:1px solid #d1d4c9;
  border-radius:8px;
  background:#fffdf8;
  font-size:12px;
  white-space:nowrap
}
.controller-strip .secondary-button {
  margin-left:auto
}
.connection-note {
  font-size:12px;
  color:#97582a;
  line-height:1.8
}
.footer {
  max-width:1320px;
  padding:32px 36px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  color:#969b8e;
  font-size:11px
}
.footer-brand {
  font-weight:800;
  color:#7f8975
}
.empty-state {
  padding:48px;
  text-align:center;
  background:#eeefe7;
  border-radius:16px;
  color:#78816f;
  font-size:14px
}
.empty-state .secondary-button {
  margin-top:9px
}
dialog {
  padding:0;
  border:1px solid #d8dccd;
  border-radius:20px;
  color:var(--ink);
  background:#f8f8f1;
  box-shadow:0 25px 100px #0005
}
dialog::backdrop {
  background:#172018b8;
  backdrop-filter:blur(5px)
}
#player-dialog {
  width:min(1040px,calc(100% - 32px));
  max-height:calc(100dvh - 32px)
}
.player-shell {
  padding:22px
}
.player-header,.player-toolbar,.player-bottom {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px
}
.player-header p {
  font-size:11px;
  color:var(--muted);
  margin:0 0 5px
}
.player-header h2 {
  font-size:23px;
  margin:0
}
.player-toolbar {
  padding:17px 0
}
.scoreboard {
  display:flex;
  gap:23px;
  font-size:12px;
  color:#79806e
}
.scoreboard strong {
  font-size:19px;
  color:var(--ink);
  margin-left:7px;
  font-variant-numeric:tabular-nums
}
.player-actions {
  display:flex;
  gap:6px
}
.player-actions button {
  font-size:12px;
  background:#e7eadc;
  padding:9px 12px;
  border-radius:7px
}
.game-stage {
  position:relative;
  display:grid;
  place-items:center;
  background:#202d2a;
  border-radius:12px;
  overflow:hidden;
  min-height:200px;
  touch-action:none
}
.game-stage canvas {
  display:block;
  max-width:100%;
  max-height:min(55dvh,560px);
  width:auto;
  height:auto;
  touch-action:none
}
.game-stage iframe {
  width:100%;
  height:min(65dvh,600px);
  border:0;
  background:#18242b
}
.tap-panel {
  width:min(100%, 400px);
  padding:16px;
  text-align:center
}
.tap-status {
  color:#f4f4df;
  font-size:1.1rem;
  font-weight:700;
  margin:0 0 14px
}
.tap-board {
  display:grid;
  width:min(100%, max(168px, 48dvh));
  margin:auto;
  grid-template-columns:repeat(3, 1fr);
  gap:8px
}
.tap-board button {
  aspect-ratio:1;
  padding:0;
  background:#faf5df;
  border-radius:10px;
  color:#31433a;
  font-size:clamp(1.6rem, 7vmin, 2.75rem);
  font-weight:800;
  line-height:1;
  font-variant-numeric:tabular-nums
}
.tap-board [data-mark]:disabled {
  opacity:1
}
.tap-board [data-mark="○"] {
  color:#a85739
}
.tap-board .winning-cell {
  background:#d5ef92
}
.player-bottom {
  align-items:flex-start;
  padding-top:12px
}
.player-bottom p {
  font-size:11px;
  margin:0;
  color:#717b67;
  line-height:1.8
}
.player-bottom #game-status {
  color:#526d34;
  text-align:right;
  max-width:48%
}
.touch-controls {
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  padding-top:14px;
  user-select:none
}
.touch-controls button {
  width:45px;
  height:38px;
  background:#e3e7d6;
  border-radius:8px;
  font-size:21px;
  touch-action:none
}
.touch-controls>div {
  display:flex;
  flex-direction:column;
  gap:5px
}
.touch-controls .touch-confirm {
  margin-left:20px;
  width:64px;
  height:50px;
  font-size:13px;
  background:#d4eb97
}
.game-stage:fullscreen {
  border-radius:0;
  width:100%;
  height:100%;
  background:#202d2a
}
.game-stage:fullscreen canvas {
  max-height:100dvh;
  max-width:100vw
}
.game-stage:fullscreen iframe {
  height:100dvh
}
.game-overlay {
  position:absolute;
  inset:0;
  background:#16231bd9;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:10px;
  text-align:center;
  color:white;
  padding:25px
}
.game-overlay h3 {
  font-size:27px;
  margin:0
}
.game-overlay p {
  font-size:13px;
  color:#d3ddc9;
  margin:0 0 9px;
  line-height:1.8
}
.game-overlay button {
  background:var(--green);
  color:var(--ink);
  font-size:14px;
  border-radius:8px;
  padding:12px 23px;
  font-weight:700
}
#controller-dialog {
  width:min(470px,calc(100% - 32px))
}
.settings-shell {
  padding:28px
}
.settings-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px
}
.settings-header h2 {
  font-size:21px;
  margin:0
}
.settings-header button {
  font-size:26px;
  background:transparent
}
.settings-shell>p {
  font-size:13px;
  line-height:1.9;
  overflow-wrap:anywhere
}
.controller-test {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin:22px 0
}
.controller-test div {
  padding:17px;
  background:#e9eddd;
  border-radius:10px;
  min-width:0
}
.controller-test span {
  display:block;
  font-size:11px;
  color:#7c866e;
  margin-bottom:8px
}
.controller-test strong {
  font-size:14px;
  overflow-wrap:anywhere
}
.settings-shell .settings-note {
  font-size:11px;
  color:#858d7c
}
@media(min-width:1100px) and (pointer:fine) {
  .touch-controls {
    display:none
  }
}
@media(max-width:1000px) {
  .header-inner {
    gap:25px;
    padding:22px 25px
  }
  .page {
    padding:25px 25px 0
  }
  .hero-copy {
    padding:32px
  }
  .hero-board {
    width:260px;
    height:260px;
    gap:7px
  }
  .hero-board>span {
    font-size:24px
  }
  .spark-one {
    right:8%;
    font-size:44px
  }
  .game-grid {
    gap:14px
  }
  .card-body {
    padding:15px 12px 50px
  }
  .favorite-button {
    bottom:14px;
    left:12px;
    right:auto
  }
  .card-body h3 {
    font-size:16px
  }
  .categories button {
    padding:10px 13px
  }
  .personal-filters button {
    padding:10px 7px
  }
  .footer {
    padding:27px 25px
  }
}
@media(max-width:680px) {
  .header-inner {
    padding:16px 18px;
    gap:14px;
    flex-wrap:wrap
  }
  .brand {
    font-size:21px;
    gap:9px
  }
  .brand-mark {
    width:40px;
    height:40px;
    font-size:39px;
    border-radius:12px
  }
  .brand small {
    font-size:8px;
    letter-spacing:2.5px
  }
  .controller-button {
    font-size:11px;
    padding:9px 0
  }
  .header-inner form {
    order:3;
    max-width:none;
    flex-basis:100%
  }
  .header-inner input {
    font-size:13px;
    padding:7px 9px
  }
  .page {
    padding:18px 16px 0
  }
  .hero {
    border-radius:18px;
    min-height:290px
  }
  .hero-copy {
    padding:25px 22px;
    width:56%
  }
  .eyebrow {
    font-size:9px;
    letter-spacing:1px;
    margin-bottom:13px
  }
  .hero h1 {
    font-size:27px;
    letter-spacing:-1px
  }
  .hero-description {
    font-size:10px;
    margin-bottom:19px;
    white-space:nowrap
  }
  .hero .primary-button {
    gap:19px;
    padding:11px 14px;
    font-size:12px
  }
  .hero-support {
    font-size:9px
  }
  .hero-art {
    overflow:visible
  }
  .hero-board {
    width:184px;
    height:184px;
    gap:5px;
    padding:6px;
    border-radius:12px;
    transform:translateX(14px) rotate(-8deg);
    box-shadow:9px 12px 0 #c8d6ba
  }
  .hero-board>span {
    border-radius:5px;
    font-size:17px
  }
  .hero-board .t128 {
    font-size:15px
  }
  .hero-board .t2048 {
    font-size:13px
  }
  .hero-index {
    font-size:120px;
    bottom:-28px;
    right:0;
    letter-spacing:-9px
  }
  .spark-one {
    right:13px;
    top:26px;
    font-size:33px
  }
  .spark-two {
    left:3px;
    bottom:22px;
    font-size:22px
  }
  .library-nav {
    padding:19px 0 16px;
    align-items:flex-start;
    gap:11px;
    flex-direction:column
  }
  .categories {
    flex-wrap:wrap;
    gap:6px;
    width:100%
  }
  .categories button {
    font-size:12px;
    padding:10px 15px
  }
  .personal-filters {
    gap:18px
  }
  .personal-filters button {
    font-size:11px;
    padding:4px 0
  }
  .personal-filters button.active {
    background:transparent;
    color:#3b6527;
    text-decoration:underline;
    text-underline-offset:5px
  }
  .section-heading {
    margin:22px 0 16px
  }
  .section-heading h2 {
    font-size:19px
  }
  .section-heading h2 span {
    font-size:10px;
    margin-left:6px
  }
  .gamepad-filter {
    font-size:10px;
    gap:5px
  }
  .game-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px 12px
  }
  .game-card {
    border-radius:12px
  }
  .card-cover {
    aspect-ratio:1.35
  }
  .card-body {
    padding:13px 12px 46px
  }
  .card-body h3 {
    font-size:16px
  }
  .card-category {
    font-size:9px
  }
  .card-body p {
    font-size:10px
  }
  .card-support {
    font-size:9px;
    left:8px;
    top:8px;
    padding:4px 5px
  }
  .favorite-button {
    font-size:10px;
    padding:6px 8px
  }
  .controller-strip {
    margin-top:26px;
    padding:21px 17px;
    gap:13px;
    flex-wrap:wrap
  }
  .controller-symbol {
    font-size:32px
  }
  .controller-strip>div {
    flex:1
  }
  .controller-strip h2 {
    font-size:14px
  }
  .controller-strip p {
    font-size:10px
  }
  .controller-strip .secondary-button {
    margin-left:45px;
    font-size:11px;
    padding:9px 13px
  }
  .footer {
    padding:24px 17px;
    gap:14px;
    font-size:9px
  }
  .player-shell {
    padding:13px
  }
  #player-dialog {
    width:calc(100% - 12px);
    max-height:calc(100dvh - 12px);
    border-radius:13px
  }
  .player-header h2 {
    font-size:20px
  }
  .player-header .secondary-button {
    font-size:11px;
    padding:9px 11px
  }
  .scoreboard {
    gap:12px;
    font-size:10px
  }
  .scoreboard strong {
    font-size:16px;
    margin-left:4px
  }
  .player-actions {
    gap:4px
  }
  .player-actions button {
    font-size:10px;
    padding:8px
  }
  .game-stage {
    min-height:150px
  }
  .game-stage canvas {
    max-height:48dvh
  }
  .player-bottom {
    flex-direction:column;
    gap:5px
  }
  .player-bottom p {
    font-size:10px
  }
  .player-bottom #game-status {
    max-width:100%;
    text-align:left
  }
  .touch-controls {
    padding-top:10px
  }
  .game-overlay h3 {
    font-size:22px
  }
}
@media(prefers-reduced-motion:reduce) {
  * {
    transition:none!important;
    scroll-behavior:auto!important
  }
}
