@import url(fonts/clear-sans.css);
html, body {
  margin: 0;
  padding: 0;
  background: #e8f5e9;
  color: #2d5016;
  font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px; }

body {
  margin: 80px 0; }

@supports (padding-top: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top); }
  body:before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top);
    background: #81c784;
    pointer-events: none;
    z-index: 9999; } }

/* Intro loading screen */
.intro-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0c1c12;
  z-index: 5000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.intro-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.intro-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.intro-card {
  width: 100vw;
  height: 100vh;
  background: transparent;
  color: #f0f9f4;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  padding: max(40px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
  display: grid;
  gap: 18px;
  text-align: center;
  transform: translateY(6px) scale(0.98);
  transition: transform 240ms ease, opacity 240ms ease;
  place-content: center;
}
.intro-overlay.visible .intro-card {
  transform: translateY(0) scale(1);
}
.intro-face {
  width: 140px;
  height: 140px;
  margin: 0 auto;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.10) center center / contain no-repeat;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.intro-title {
  font-family: "Inter", "Clear Sans", "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  font-size: clamp(34px, 6vw, 54px);
  letter-spacing: 0.01em;
}
.intro-quote {
  font-size: clamp(18px, 3.2vw, 26px);
  line-height: 1.45;
  color: rgba(240, 249, 244, 0.9);
  min-height: 70px;
  max-width: 34ch;
  margin: 0 auto;
}
.intro-hint {
  font-size: clamp(14px, 2.6vw, 18px);
  color: rgba(240, 249, 244, 0.8);
}

.heading:after {
  content: "";
  display: block;
  clear: both; }
.heading {
  display: grid;
  gap: 10px; }

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

h1.title {
  font-family: "Inter", "Clear Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(32px, 7vw, 46px);
  font-weight: 800;
  margin: 0;
  display: block;
  float: none; }

@-webkit-keyframes move-up {
  0% {
    top: 25px;
    opacity: 1; }

  100% {
    top: -50px;
    opacity: 0; } }
@-moz-keyframes move-up {
  0% {
    top: 25px;
    opacity: 1; }

  100% {
    top: -50px;
    opacity: 0; } }
@keyframes move-up {
  0% {
    top: 25px;
    opacity: 1; }

  100% {
    top: -50px;
    opacity: 0; } }
.scores-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
  align-items: stretch;
  width: 100%;
  max-width: 320px; }
.beezy-reaction {
  font-size: 25px;
  font-weight: 600;
  color: #2d5016;
  display: inline-flex;
  align-items: center;
  gap: 8px; }
.beezy-reaction-face {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #f4fbf4 center center / contain no-repeat;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15), inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.65); }

.score-container, .best-container {
  position: relative;
  display: block;
  background: rgba(129, 199, 132, 0.18);
  padding: 12px 14px;
  font-size: 26px;
  height: auto;
  line-height: 1.1;
  font-weight: 700;
  border-radius: 12px;
  color: #0f2e1f;
  margin-top: 0;
  text-align: left;
  border: 1px solid rgba(129, 199, 132, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
  .score-container:after, .best-container:after {
    position: relative;
    display: block;
    text-transform: uppercase;
    font-size: 12px;
    line-height: 1.2;
    color: rgba(13, 42, 25, 0.7);
    margin-top: 4px; }
  .score-container .score-addition, .best-container .score-addition {
    position: absolute;
    right: 10px;
    top: 10px;
    color: rgba(45, 80, 22, 0.9);
    font-size: 18px;
    line-height: 1.2;
    font-weight: bold;
    z-index: 100;
    -webkit-animation: move-up 600ms ease-in;
    -moz-animation: move-up 600ms ease-in;
    animation: move-up 600ms ease-in;
    -webkit-animation-fill-mode: both;
    -moz-animation-fill-mode: both;
    animation-fill-mode: both; }

.score-container:after {
  content: "Score"; }

.best-container:after {
  content: "Best"; }

p {
  margin-top: 0;
  margin-bottom: 10px;
  line-height: 1.65; }

a {
  color: #2d5016;
  font-weight: bold;
  text-decoration: underline;
  cursor: pointer; }

strong.important {
  text-transform: uppercase; }

hr {
  border: none;
  border-bottom: 1px solid #a5d6a7;
  margin-top: 20px;
  margin-bottom: 30px; }

.container {
  width: 500px;
  margin: 0 auto; }

@-webkit-keyframes fade-in {
  0% {
    opacity: 0; }

  100% {
    opacity: 1; } }
@-moz-keyframes fade-in {
  0% {
    opacity: 0; }

  100% {
    opacity: 1; } }
@keyframes fade-in {
  0% {
    opacity: 0; }

  100% {
    opacity: 1; } }
.game-container {
  margin-top: 40px;
  position: relative;
  padding: 15px;
  cursor: default;
  -webkit-touch-callout: none;
  -ms-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -ms-touch-action: none;
  touch-action: none;
  background: #81c784;
  border-radius: 6px;
  width: 500px;
  height: 500px;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box; }
  .game-container .game-message {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(200, 230, 201, 0.5);
    z-index: 100;
    text-align: center;
    -webkit-animation: fade-in 800ms ease 1200ms;
    -moz-animation: fade-in 800ms ease 1200ms;
    animation: fade-in 800ms ease 1200ms;
    -webkit-animation-fill-mode: both;
    -moz-animation-fill-mode: both;
    animation-fill-mode: both; }
    .game-container .game-message p {
      font-size: 60px;
      font-weight: bold;
      height: 60px;
      line-height: 60px;
      margin-top: 222px; }
    .game-container .game-message .lower {
      display: block;
      margin-top: 59px; }
    .game-container .game-message a {
      display: inline-block;
      background: #66bb6a;
      border-radius: 3px;
      padding: 0 20px;
      text-decoration: none;
      color: #f0f9f4;
      height: 40px;
      line-height: 42px;
      margin-left: 9px; }
      .game-container .game-message a.keep-playing-button {
        display: none; }
    .game-container .game-message.game-won {
      background: rgba(237, 194, 46, 0.5);
      color: #f0f9f4; }
      .game-container .game-message.game-won a.keep-playing-button {
        display: inline-block; }
    .game-container .game-message.game-won, .game-container .game-message.game-over {
      display: block; }

.grid-container {
  position: absolute;
  z-index: 1; }

.grid-row {
  margin-bottom: 15px; }
  .grid-row:last-child {
    margin-bottom: 0; }
  .grid-row:after {
    content: "";
    display: block;
    clear: both; }

.grid-cell {
  width: 106.25px;
  height: 106.25px;
  margin-right: 15px;
  float: left;
  border-radius: 3px;
  background: rgba(238, 228, 218, 0.35); }
  .grid-cell:last-child {
    margin-right: 0; }

.tile-container {
  position: absolute;
  z-index: 2; }

.tile, .tile .tile-inner {
  width: 107px;
  height: 107px;
  line-height: 107px; }
.tile.tile-position-1-1 {
  -webkit-transform: translate(0px, 0px);
  -moz-transform: translate(0px, 0px);
  -ms-transform: translate(0px, 0px);
  transform: translate(0px, 0px); }
.tile.tile-position-1-2 {
  -webkit-transform: translate(0px, 121px);
  -moz-transform: translate(0px, 121px);
  -ms-transform: translate(0px, 121px);
  transform: translate(0px, 121px); }
.tile.tile-position-1-3 {
  -webkit-transform: translate(0px, 242px);
  -moz-transform: translate(0px, 242px);
  -ms-transform: translate(0px, 242px);
  transform: translate(0px, 242px); }
.tile.tile-position-1-4 {
  -webkit-transform: translate(0px, 363px);
  -moz-transform: translate(0px, 363px);
  -ms-transform: translate(0px, 363px);
  transform: translate(0px, 363px); }
.tile.tile-position-2-1 {
  -webkit-transform: translate(121px, 0px);
  -moz-transform: translate(121px, 0px);
  -ms-transform: translate(121px, 0px);
  transform: translate(121px, 0px); }
.tile.tile-position-2-2 {
  -webkit-transform: translate(121px, 121px);
  -moz-transform: translate(121px, 121px);
  -ms-transform: translate(121px, 121px);
  transform: translate(121px, 121px); }
.tile.tile-position-2-3 {
  -webkit-transform: translate(121px, 242px);
  -moz-transform: translate(121px, 242px);
  -ms-transform: translate(121px, 242px);
  transform: translate(121px, 242px); }
.tile.tile-position-2-4 {
  -webkit-transform: translate(121px, 363px);
  -moz-transform: translate(121px, 363px);
  -ms-transform: translate(121px, 363px);
  transform: translate(121px, 363px); }
.tile.tile-position-3-1 {
  -webkit-transform: translate(242px, 0px);
  -moz-transform: translate(242px, 0px);
  -ms-transform: translate(242px, 0px);
  transform: translate(242px, 0px); }
.tile.tile-position-3-2 {
  -webkit-transform: translate(242px, 121px);
  -moz-transform: translate(242px, 121px);
  -ms-transform: translate(242px, 121px);
  transform: translate(242px, 121px); }
.tile.tile-position-3-3 {
  -webkit-transform: translate(242px, 242px);
  -moz-transform: translate(242px, 242px);
  -ms-transform: translate(242px, 242px);
  transform: translate(242px, 242px); }
.tile.tile-position-3-4 {
  -webkit-transform: translate(242px, 363px);
  -moz-transform: translate(242px, 363px);
  -ms-transform: translate(242px, 363px);
  transform: translate(242px, 363px); }
.tile.tile-position-4-1 {
  -webkit-transform: translate(363px, 0px);
  -moz-transform: translate(363px, 0px);
  -ms-transform: translate(363px, 0px);
  transform: translate(363px, 0px); }
.tile.tile-position-4-2 {
  -webkit-transform: translate(363px, 121px);
  -moz-transform: translate(363px, 121px);
  -ms-transform: translate(363px, 121px);
  transform: translate(363px, 121px); }
.tile.tile-position-4-3 {
  -webkit-transform: translate(363px, 242px);
  -moz-transform: translate(363px, 242px);
  -ms-transform: translate(363px, 242px);
  transform: translate(363px, 242px); }
.tile.tile-position-4-4 {
  -webkit-transform: translate(363px, 363px);
  -moz-transform: translate(363px, 363px);
  -ms-transform: translate(363px, 363px);
  transform: translate(363px, 363px); }

.tile {
  position: absolute;
  -webkit-transition: 100ms ease-in-out;
  -moz-transition: 100ms ease-in-out;
  transition: 100ms ease-in-out;
  -webkit-transition-property: -webkit-transform;
  -moz-transition-property: -moz-transform;
  transition-property: transform; }
  .tile .tile-inner {
    border-radius: 3px;
    background: #f7f2eb;
    text-align: center;
    font-weight: bold;
    z-index: 10;
    font-size: 55px;
    display: flex;
    align-items: center;
    justify-content: center; }
  .tile .tile-inner .tile-image {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain; }
  .tile.tile-2 .tile-inner {
    background: #f7f2eb;
    color: #2d5016; }
  .tile.tile-4 .tile-inner {
    background: #e9e1ff;
    color: #2d5016; }
  .tile.tile-8 .tile-inner {
    color: #f0f9f4;
    background: #ffd27f; }
  .tile.tile-16 .tile-inner {
    color: #f0f9f4;
    background: #ffb347; }
  .tile.tile-32 .tile-inner {
    color: #f0f9f4;
    background: #ff8c42; }
  .tile.tile-64 .tile-inner {
    color: #f0f9f4;
    background: #ff5f5f; }
  .tile.tile-128 .tile-inner {
    color: #f0f9f4;
    background: #66d6d1;
    box-shadow: 0 0 18px 6px rgba(129, 199, 132, 0.2381), inset 0 0 0 1px rgba(255, 255, 255, 0.14286);
    font-size: 45px; }
    @media screen and (max-width: 520px) {
      .tile.tile-128 .tile-inner {
        font-size: 25px; } }
  .tile.tile-256 .tile-inner {
    color: #f0f9f4;
    background: #4db5ff;
    box-shadow: 0 0 18px 6px rgba(129, 199, 132, 0.31746), inset 0 0 0 1px rgba(255, 255, 255, 0.19048);
    font-size: 45px; }
    @media screen and (max-width: 520px) {
      .tile.tile-256 .tile-inner {
        font-size: 25px; } }
  .tile.tile-512 .tile-inner {
    color: #f0f9f4;
    background: #5c7cfa;
    box-shadow: 0 0 18px 6px rgba(129, 199, 132, 0.39683), inset 0 0 0 1px rgba(255, 255, 255, 0.2381);
    font-size: 45px; }
    @media screen and (max-width: 520px) {
      .tile.tile-512 .tile-inner {
        font-size: 25px; } }
  .tile.tile-1024 .tile-inner {
    color: #f0f9f4;
    background: #9b6bff;
    box-shadow: 0 0 18px 6px rgba(129, 199, 132, 0.47619), inset 0 0 0 1px rgba(255, 255, 255, 0.28571);
    font-size: 35px; }
    @media screen and (max-width: 520px) {
      .tile.tile-1024 .tile-inner {
        font-size: 15px; } }
  .tile.tile-2048 .tile-inner {
    color: #f0f9f4;
    background: #f5c400;
    box-shadow: 0 0 18px 6px rgba(129, 199, 132, 0.55556), inset 0 0 0 1px rgba(255, 255, 255, 0.33333);
    font-size: 35px; }
    @media screen and (max-width: 520px) {
      .tile.tile-2048 .tile-inner {
        font-size: 15px; } }
  .tile.tile-4096 .tile-inner {
    color: #f0f9f4;
    background: #2e7d32;
    box-shadow: 0 0 18px 6px rgba(129, 199, 132, 0.61111), inset 0 0 0 1px rgba(255, 255, 255, 0.36111);
    font-size: 35px; }
    @media screen and (max-width: 520px) {
      .tile.tile-4096 .tile-inner {
        font-size: 15px; } }
  .tile.tile-super .tile-inner {
    color: #f0f9f4;
    background: #2e7d32;
    font-size: 30px; }
    @media screen and (max-width: 520px) {
      .tile.tile-super .tile-inner {
        font-size: 10px; } }

@-webkit-keyframes appear {
  0% {
    opacity: 0;
    -webkit-transform: scale(0);
    -moz-transform: scale(0);
    -ms-transform: scale(0);
    transform: scale(0); }

  100% {
    opacity: 1;
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1); } }
@-moz-keyframes appear {
  0% {
    opacity: 0;
    -webkit-transform: scale(0);
    -moz-transform: scale(0);
    -ms-transform: scale(0);
    transform: scale(0); }

  100% {
    opacity: 1;
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1); } }
@keyframes appear {
  0% {
    opacity: 0;
    -webkit-transform: scale(0);
    -moz-transform: scale(0);
    -ms-transform: scale(0);
    transform: scale(0); }

  100% {
    opacity: 1;
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1); } }
.tile-new .tile-inner {
  -webkit-animation: appear 200ms ease 100ms;
  -moz-animation: appear 200ms ease 100ms;
  animation: appear 200ms ease 100ms;
  -webkit-animation-fill-mode: backwards;
  -moz-animation-fill-mode: backwards;
  animation-fill-mode: backwards;
  -webkit-animation: appear 200ms ease 100ms, celebrate 420ms ease-out;
  -moz-animation: appear 200ms ease 100ms, celebrate 420ms ease-out;
  animation: appear 200ms ease 100ms, celebrate 420ms ease-out; }

@-webkit-keyframes pop {
  0% {
    -webkit-transform: scale(0);
    -moz-transform: scale(0);
    -ms-transform: scale(0);
    transform: scale(0); }

  50% {
    -webkit-transform: scale(1.2);
    -moz-transform: scale(1.2);
    -ms-transform: scale(1.2);
    transform: scale(1.2); }

  100% {
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1); } }

@-webkit-keyframes celebrate {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.55), 0 0 0 0 rgba(255, 255, 255, 0);
    -webkit-transform: scale(0.9);
    -moz-transform: scale(0.9);
    -ms-transform: scale(0.9);
    transform: scale(0.9); }

  50% {
    box-shadow: 0 0 0 10px rgba(76, 175, 80, 0), 0 0 24px 8px rgba(255, 255, 255, 0.18);
    -webkit-transform: scale(1.08);
    -moz-transform: scale(1.08);
    -ms-transform: scale(1.08);
    transform: scale(1.08); }

  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0), 0 0 0 0 rgba(255, 255, 255, 0);
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1); } }

@keyframes celebrate {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.55), 0 0 0 0 rgba(255, 255, 255, 0);
    -webkit-transform: scale(0.9);
    -moz-transform: scale(0.9);
    -ms-transform: scale(0.9);
    transform: scale(0.9); }

  50% {
    box-shadow: 0 0 0 10px rgba(76, 175, 80, 0), 0 0 24px 8px rgba(255, 255, 255, 0.18);
    -webkit-transform: scale(1.08);
    -moz-transform: scale(1.08);
    -ms-transform: scale(1.08);
    transform: scale(1.08); }

  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0), 0 0 0 0 rgba(255, 255, 255, 0);
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1); } }
@-moz-keyframes pop {
  0% {
    -webkit-transform: scale(0);
    -moz-transform: scale(0);
    -ms-transform: scale(0);
    transform: scale(0); }

  50% {
    -webkit-transform: scale(1.2);
    -moz-transform: scale(1.2);
    -ms-transform: scale(1.2);
    transform: scale(1.2); }

  100% {
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1); } }
@keyframes pop {
  0% {
    -webkit-transform: scale(0);
    -moz-transform: scale(0);
    -ms-transform: scale(0);
    transform: scale(0); }

  50% {
    -webkit-transform: scale(1.2);
    -moz-transform: scale(1.2);
    -ms-transform: scale(1.2);
    transform: scale(1.2); }

  100% {
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1); } }
.tile-merged .tile-inner {
  z-index: 20;
  -webkit-animation: pop 200ms ease 100ms;
  -moz-animation: pop 200ms ease 100ms;
  animation: pop 200ms ease 100ms;
  -webkit-animation-fill-mode: backwards;
  -moz-animation-fill-mode: backwards;
  animation-fill-mode: backwards; }

.above-game:after {
  content: "";
  display: block;
  clear: both; }

.header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.game-intro {
  float: none;
  line-height: 1.4;
  margin: 0;
  font-size: 15px;
  color: #2d5016; }

.restart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(120deg, #66bb6a, #2e7d32);
  border-radius: 999px;
  padding: 0 16px;
  text-decoration: none;
  color: #f9f6f2;
  height: 40px;
  line-height: 40px;
  text-align: center;
  float: none;
  box-shadow: 0 10px 22px rgba(46, 125, 50, 0.25);
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 0;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease; }
.restart-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(46, 125, 50, 0.35); }

.game-explanation {
  margin-top: 50px; }

.tile-order-card {
  margin-top: 18px;
  background: rgba(12, 28, 18, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25); }
  .tile-order-card summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    color: #f0f9f4;
    display: flex;
    align-items: center;
    gap: 8px;
    outline: none; }
  .tile-order-card .tile-order-body {
    margin-top: 10px;
    display: grid;
    gap: 12px; }
  .tile-order-card .tile-order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .tile-order-card .tile-order-description {
    color: #f0f9f4;
  }
  .tile-order-card #tile-order-shuffle,
  .tile-order-card #tile-order-restore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(120deg, #66bb6a, #2e7d32);
    border-radius: 999px;
    padding: 0 14px;
    text-decoration: none;
    color: #f0f9f4;
    height: 34px;
    line-height: 34px;
    border: 0;
    font-size: 14px;
    flex: 1 1 120px;
    min-width: 120px; }
  .tile-order-card #tile-order-restore {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
  .tile-order-card .tile-order-label {
    font-size: 13px;
    color: rgba(240, 249, 244, 0.75);
  }
  .tile-order-card .tile-order-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
  }
  .tile-order-card .tile-order-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #f0f9f4;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
    .tile-order-card .tile-order-chip img {
      width: 34px;
      height: 34px;
      object-fit: contain;
      display: block;
      border-radius: 8px;
      background: rgba(0, 0, 0, 0.06);
      padding: 4px; }
    .tile-order-card .tile-order-chip.tile-color-2 { background: #f7f2eb; color: #2d5016; }
    .tile-order-card .tile-order-chip.tile-color-4 { background: #e9e1ff; color: #2d5016; }
    .tile-order-card .tile-order-chip.tile-color-8 { background: #ffd27f; color: #2d5016; }
    .tile-order-card .tile-order-chip.tile-color-16 { background: #ffb347; color: #f0f9f4; }
    .tile-order-card .tile-order-chip.tile-color-32 { background: #ff8c42; color: #f0f9f4; }
    .tile-order-card .tile-order-chip.tile-color-64 { background: #ff5f5f; color: #f0f9f4; }
    .tile-order-card .tile-order-chip.tile-color-128 { background: #66d6d1; color: #f0f9f4; }
    .tile-order-card .tile-order-chip.tile-color-256 { background: #4db5ff; color: #f0f9f4; }
    .tile-order-card .tile-order-chip.tile-color-512 { background: #5c7cfa; color: #f0f9f4; }
    .tile-order-card .tile-order-chip.tile-color-1024 { background: #9b6bff; color: #f0f9f4; }
    .tile-order-card .tile-order-chip.tile-color-2048 { background: #f5c400; color: #f0f9f4; }
    .tile-order-card .tile-order-chip.tile-color-4096 { background: #2e7d32; color: #f0f9f4; }

.install-banner {
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  z-index: 1000;
  background: #f0f9f4;
  border: 1px solid #c7e3c1;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  padding: 12px; }
  .install-banner .install-banner__content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap; }
  .install-banner .install-banner__text {
    display: flex;
    flex-direction: column;
    gap: 2px; }
    .install-banner .install-banner__text strong {
      font-size: 15px;
      color: #2d5016; }
    .install-banner .install-banner__text span {
      font-size: 13px;
      color: #234012; }
  .install-banner .install-banner__actions {
    display: flex;
    gap: 8px;
    margin-left: auto; }
  .install-banner .install-banner__button {
    display: inline-block;
    background: #4f8b5f;
    border-radius: 3px;
    padding: 0 12px;
    text-decoration: none;
    color: #f0f9f4;
    height: 34px;
    line-height: 34px;
    border: 0;
    font-size: 13px;
    cursor: pointer; }
    .install-banner .install-banner__button--ghost {
      background: transparent;
      color: #2d5016;
      box-shadow: inset 0 0 0 1px #c7e3c1; }

.howto-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0px;
  z-index: 1200;
  width: 100vw;
  height: 100vh;
  overflow: hidden; }
  .howto-overlay.hidden {
    display: none; }
  .howto-overlay .howto-card {
    background: #f0f9f4;
    border-radius: 8px;
    padding: 20px;
    max-width: 420px;
    width: min(420px, calc(100vw - 40px));
    margin: 0 auto;
    box-sizing: border-box;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
    border: 1px solid #c7e3c1; }
  .howto-overlay h2 {
    margin: 0 0 12px; }
  .howto-overlay .howto-steps {
    margin: 0 0 16px 18px;
    padding: 0;
    line-height: 1.5; }
  .howto-overlay .howto-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center; }
  .howto-overlay .howto-primary, .howto-overlay .howto-secondary {
    display: inline-block;
    background: #4f8b5f;
    border-radius: 3px;
    padding: 0 16px;
    text-decoration: none;
    color: #f0f9f4;
    height: 38px;
    line-height: 38px;
    border: 0;
    cursor: pointer; }
  .howto-overlay .howto-secondary {
    background: transparent;
    color: #2d5016;
    box-shadow: inset 0 0 0 1px #c7e3c1; }

.mode-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease; }
.mode-overlay.visible {
  opacity: 1;
  pointer-events: auto; }
.mode-overlay.hidden {
  opacity: 0;
  pointer-events: none; }
.mode-card {
  background: rgba(12, 28, 18, 0.92);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 18px 16px;
  width: min(480px, 100%);
  color: #f0f9f4;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 10px; }
.mode-card h2 {
  margin: 0;
  font-size: 20px; }
.mode-subtitle {
  margin: 0;
  color: rgba(240, 249, 244, 0.8);
  font-size: 14px;
  line-height: 1.5; }
.mode-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr; }
.mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2e7d32;
  border-radius: 999px;
  padding: 0 18px;
  text-decoration: none;
  color: #f0f9f4;
  height: 42px;
  line-height: 42px;
  border: 0;
  font-size: 14px;
  cursor: pointer;
  width: 100%; }
.mode-btn.mode-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12); }

body.howto-open {
  overflow: hidden; }

@media screen and (max-width: 520px) {
  html, body {
    font-size: 15px; }

  body {
    margin: 12px 0;
    padding: 0 8px; }

  h1.title {
    font-size: 27px;
    margin-top: 15px; }

  .container {
    width: 100%;
    max-width: none;
    margin: 0 auto; }

  .score-container, .best-container {
    margin-top: 0;
    padding: 15px 10px;
    min-width: 40px; }

  .heading {
    margin-bottom: 10px; }

  .game-intro {
    display: block;
    box-sizing: border-box;
    line-height: 1.65; }

  .restart-button {
    width: 42%;
    padding: 0;
    display: block;
    box-sizing: border-box;
    margin-top: 2px; }

  .tile-order-card {
    padding: 10px 12px; }
    .tile-order-card #tile-order-shuffle {
      width: 100%;
      max-width: 180px; }
    .tile-order-card .tile-order-label {
      display: block; }
    .tile-order-card .tile-order-actions {
      align-items: flex-start; }

  .game-container {
    margin-top: 10px;
    position: relative;
    padding: 6px;
    cursor: default;
    -webkit-touch-callout: none;
    -ms-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -ms-touch-action: none;
    touch-action: none;
    background: #81c784;
    border-radius: 6px;
    --board: min(100vw - 12px, 520px);
    --pad: 6px;
    --tile-gap: 4px;
    --tile-size: calc((var(--board) - (2 * var(--pad)) - (3 * var(--tile-gap))) / 4);
    --tile-step: calc(var(--tile-size) + var(--tile-gap));
    width: var(--board);
    height: var(--board);
    padding: var(--pad);
    margin-top: 10px;
    max-width: none;
    aspect-ratio: 1 / 1;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box; }
    .game-container .game-message {
      display: none;
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      background: rgba(200, 230, 201, 0.5);
      z-index: 100;
      text-align: center;
      -webkit-animation: fade-in 800ms ease 1200ms;
      -moz-animation: fade-in 800ms ease 1200ms;
      animation: fade-in 800ms ease 1200ms;
      -webkit-animation-fill-mode: both;
      -moz-animation-fill-mode: both;
      animation-fill-mode: both; }
      .game-container .game-message p {
        font-size: 60px;
        font-weight: bold;
        height: 60px;
        line-height: 60px;
        margin-top: 222px; }
      .game-container .game-message .lower {
        display: block;
        margin-top: 59px; }
      .game-container .game-message a {
        display: inline-block;
        background: #66bb6a;
        border-radius: 3px;
        padding: 0 20px;
        text-decoration: none;
        color: #f0f9f4;
        height: 40px;
        line-height: 42px;
        margin-left: 9px; }
        .game-container .game-message a.keep-playing-button {
          display: none; }
      .game-container .game-message.game-won {
        background: rgba(237, 194, 46, 0.5);
        color: #f0f9f4; }
        .game-container .game-message.game-won a.keep-playing-button {
          display: inline-block; }
      .game-container .game-message.game-won, .game-container .game-message.game-over {
        display: block; }

  .grid-container,
  .tile-container {
    width: calc(100% - (2 * var(--pad)));
    height: calc(100% - (2 * var(--pad))); }

  .grid-container {
    position: absolute;
    z-index: 1; }

  .grid-row {
    margin-bottom: var(--tile-gap); }
    .grid-row:last-child {
      margin-bottom: 0; }
    .grid-row:after {
      content: "";
      display: block;
      clear: both; }

  .grid-cell {
    width: var(--tile-size);
    height: var(--tile-size);
    margin-right: var(--tile-gap);
    float: left;
    border-radius: 3px;
    background: rgba(200, 230, 201, 0.35); }
    .grid-cell:last-child {
      margin-right: 0; }

  .tile-container {
    position: absolute;
    z-index: 2; }

  .tile, .tile .tile-inner {
    width: var(--tile-size);
    height: var(--tile-size);
    line-height: var(--tile-size); }
  .tile.tile-position-1-1 {
    -webkit-transform: translate(0, 0);
    -moz-transform: translate(0, 0);
    -ms-transform: translate(0, 0);
    transform: translate(0, 0); }
  .tile.tile-position-1-2 {
    -webkit-transform: translate(0, var(--tile-step));
    -moz-transform: translate(0, var(--tile-step));
    -ms-transform: translate(0, var(--tile-step));
    transform: translate(0, var(--tile-step)); }
  .tile.tile-position-1-3 {
    -webkit-transform: translate(0, calc(var(--tile-step) * 2));
    -moz-transform: translate(0, calc(var(--tile-step) * 2));
    -ms-transform: translate(0, calc(var(--tile-step) * 2));
    transform: translate(0, calc(var(--tile-step) * 2)); }
  .tile.tile-position-1-4 {
    -webkit-transform: translate(0, calc(var(--tile-step) * 3));
    -moz-transform: translate(0, calc(var(--tile-step) * 3));
    -ms-transform: translate(0, calc(var(--tile-step) * 3));
    transform: translate(0, calc(var(--tile-step) * 3)); }
  .tile.tile-position-2-1 {
    -webkit-transform: translate(var(--tile-step), 0);
    -moz-transform: translate(var(--tile-step), 0);
    -ms-transform: translate(var(--tile-step), 0);
    transform: translate(var(--tile-step), 0); }
  .tile.tile-position-2-2 {
    -webkit-transform: translate(var(--tile-step), var(--tile-step));
    -moz-transform: translate(var(--tile-step), var(--tile-step));
    -ms-transform: translate(var(--tile-step), var(--tile-step));
    transform: translate(var(--tile-step), var(--tile-step)); }
  .tile.tile-position-2-3 {
    -webkit-transform: translate(var(--tile-step), calc(var(--tile-step) * 2));
    -moz-transform: translate(var(--tile-step), calc(var(--tile-step) * 2));
    -ms-transform: translate(var(--tile-step), calc(var(--tile-step) * 2));
    transform: translate(var(--tile-step), calc(var(--tile-step) * 2)); }
  .tile.tile-position-2-4 {
    -webkit-transform: translate(var(--tile-step), calc(var(--tile-step) * 3));
    -moz-transform: translate(var(--tile-step), calc(var(--tile-step) * 3));
    -ms-transform: translate(var(--tile-step), calc(var(--tile-step) * 3));
    transform: translate(var(--tile-step), calc(var(--tile-step) * 3)); }
  .tile.tile-position-3-1 {
    -webkit-transform: translate(calc(var(--tile-step) * 2), 0);
    -moz-transform: translate(calc(var(--tile-step) * 2), 0);
    -ms-transform: translate(calc(var(--tile-step) * 2), 0);
    transform: translate(calc(var(--tile-step) * 2), 0); }
  .tile.tile-position-3-2 {
    -webkit-transform: translate(calc(var(--tile-step) * 2), var(--tile-step));
    -moz-transform: translate(calc(var(--tile-step) * 2), var(--tile-step));
    -ms-transform: translate(calc(var(--tile-step) * 2), var(--tile-step));
    transform: translate(calc(var(--tile-step) * 2), var(--tile-step)); }
  .tile.tile-position-3-3 {
    -webkit-transform: translate(calc(var(--tile-step) * 2), calc(var(--tile-step) * 2));
    -moz-transform: translate(calc(var(--tile-step) * 2), calc(var(--tile-step) * 2));
    -ms-transform: translate(calc(var(--tile-step) * 2), calc(var(--tile-step) * 2));
    transform: translate(calc(var(--tile-step) * 2), calc(var(--tile-step) * 2)); }
  .tile.tile-position-3-4 {
    -webkit-transform: translate(calc(var(--tile-step) * 2), calc(var(--tile-step) * 3));
    -moz-transform: translate(calc(var(--tile-step) * 2), calc(var(--tile-step) * 3));
    -ms-transform: translate(calc(var(--tile-step) * 2), calc(var(--tile-step) * 3));
    transform: translate(calc(var(--tile-step) * 2), calc(var(--tile-step) * 3)); }
  .tile.tile-position-4-1 {
    -webkit-transform: translate(calc(var(--tile-step) * 3), 0);
    -moz-transform: translate(calc(var(--tile-step) * 3), 0);
    -ms-transform: translate(calc(var(--tile-step) * 3), 0);
    transform: translate(calc(var(--tile-step) * 3), 0); }
  .tile.tile-position-4-2 {
    -webkit-transform: translate(calc(var(--tile-step) * 3), var(--tile-step));
    -moz-transform: translate(calc(var(--tile-step) * 3), var(--tile-step));
    -ms-transform: translate(calc(var(--tile-step) * 3), var(--tile-step));
    transform: translate(calc(var(--tile-step) * 3), var(--tile-step)); }
  .tile.tile-position-4-3 {
    -webkit-transform: translate(calc(var(--tile-step) * 3), calc(var(--tile-step) * 2));
    -moz-transform: translate(calc(var(--tile-step) * 3), calc(var(--tile-step) * 2));
    -ms-transform: translate(calc(var(--tile-step) * 3), calc(var(--tile-step) * 2));
    transform: translate(calc(var(--tile-step) * 3), calc(var(--tile-step) * 2)); }
  .tile.tile-position-4-4 {
    -webkit-transform: translate(calc(var(--tile-step) * 3), calc(var(--tile-step) * 3));
    -moz-transform: translate(calc(var(--tile-step) * 3), calc(var(--tile-step) * 3));
    -ms-transform: translate(calc(var(--tile-step) * 3), calc(var(--tile-step) * 3));
    transform: translate(calc(var(--tile-step) * 3), calc(var(--tile-step) * 3)); }

  .tile .tile-inner {
    font-size: 38px;
    display: flex;
    align-items: center;
    justify-content: center; }
  .tile .tile-inner .tile-image {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain; }

  .game-message p {
    font-size: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
    margin-top: 90px !important; }
  .game-message .lower {
    margin-top: 30px !important; } }

/* Merge celebration popup */
.merge-toast {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.merge-toast.visible {
  opacity: 1;
  pointer-events: auto;
}
.merge-toast.hidden {
  opacity: 0;
  pointer-events: none;
}
.merge-toast__card {
  background: rgba(8, 14, 26, 0.95);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 22px 20px;
  min-width: 260px;
  max-width: 90vw;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.94);
  transition: transform 220ms ease, opacity 220ms ease;
}
.merge-toast.visible .merge-toast__card {
  transform: scale(1);
  opacity: 1;
}
.merge-toast__img {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px;
  object-fit: contain;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.merge-toast__text {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.01em;
  color: #e8f1ff;
  line-height: 1.35;
}

/* Progress tracker */
.progress-track {
  margin: 12px 0 8px;
  display: grid;
  gap: 8px;
}
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: #2d5016;
}
.progress-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(45, 80, 22, 0.8);
}
.progress-value {
  font-weight: 700;
}
.progress-bar {
  position: relative;
  width: 100%;
  height: 10px;
  background: rgba(45, 80, 22, 0.1);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(45, 80, 22, 0.15);
}
.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, #66bb6a, #2e7d32);
  box-shadow: 0 6px 12px rgba(46, 125, 50, 0.25);
  transition: width 200ms ease;
}

/* Delight pulse */
.game-container.delight {
  box-shadow: 0 0 0 3px rgba(102, 187, 106, 0.35), 0 12px 32px rgba(46, 125, 50, 0.25);
  transition: box-shadow 200ms ease;
}
.game-container.win-celebrate {
  box-shadow: 0 0 0 4px rgba(255, 215, 64, 0.5), 0 18px 38px rgba(255, 215, 64, 0.3);
  animation: win-pop 500ms ease;
}

@keyframes win-pop {
  0% { transform: scale(0.98); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}
