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

body {
  background-image: url("2048.webp");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
}

@media (max-width: 768px) {
  body {
    background-attachment: scroll;
  }
}

.heading:after {
  content: "";
  display: block;
  clear: both; }

h1.title {
  font-size: 80px;
  font-weight: bold;
  margin: 0;
  display: block;
  float: left; }

@-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 {
  float: right;
  text-align: right; }

.score-container, .best-container {
  position: relative;
  display: inline-block;
  background: #bbada0;
  padding: 15px 25px;
  font-size: 25px;
  height: 25px;
  line-height: 47px;
  font-weight: bold;
  border-radius: 3px;
  color: white;
  margin-top: 8px;
  text-align: center; }
  .score-container:after, .best-container:after {
    position: absolute;
    width: 100%;
    top: 10px;
    left: 0;
    text-transform: uppercase;
    font-size: 13px;
    line-height: 13px;
    text-align: center;
    color: #eee4da; }
  .score-container .score-addition, .best-container .score-addition {
    position: absolute;
    right: 30px;
    color: red;
    font-size: 25px;
    line-height: 25px;
    font-weight: bold;
    color: rgba(119, 110, 101, 0.9);
    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: #776e65;
  font-weight: bold;
  text-decoration: underline;
  cursor: pointer; }

strong.important {
  text-transform: uppercase; }

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

.container {
  width: 500px;
  margin: 0px 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;
  -ms-touch-action: none;
  touch-action: none;
  background: #bbada0;
  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(238, 228, 218, 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: #8f7a66;
      border-radius: 3px;
      padding: 0 20px;
      text-decoration: none;
      color: #f9f6f2;
      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: #f9f6f2; }
      .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: #eee4da;
    text-align: center;
    font-weight: bold;
    z-index: 10;
    font-size: 55px; }
  .tile.tile-2 .tile-inner {
    background: #eee4da;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0), inset 0 0 0 1px rgba(255, 255, 255, 0); }
  .tile.tile-4 .tile-inner {
    background: #ede0c8;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0), inset 0 0 0 1px rgba(255, 255, 255, 0); }
  .tile.tile-8 .tile-inner {
    color: #f9f6f2;
    background: #f2b179; }
  .tile.tile-16 .tile-inner {
    color: #f9f6f2;
    background: #f59563; }
  .tile.tile-32 .tile-inner {
    color: #f9f6f2;
    background: #f67c5f; }
  .tile.tile-64 .tile-inner {
    color: #f9f6f2;
    background: #f65e3b; }
  .tile.tile-128 .tile-inner {
    color: #f9f6f2;
    background: #edcf72;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 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: #f9f6f2;
    background: #edcc61;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 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: #f9f6f2;
    background: #edc850;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 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: #f9f6f2;
    background: #edc53f;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 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: #f9f6f2;
    background: #edc22e;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 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-super .tile-inner {
    color: #f9f6f2;
    background: #3c3a32;
    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-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); } }
@-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; }

.game-intro {
  float: left;
  line-height: 42px;
  margin-bottom: 0; }

.restart-button {
  display: inline-block;
  background: #8f7a66;
  border-radius: 3px;
  padding: 0 20px;
  text-decoration: none;
  color: #f9f6f2;
  height: 40px;
  line-height: 42px;
  display: block;
  text-align: center;
  float: right; }

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

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

  body {
    margin: 20px 0;
    padding: 0 20px; }

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

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

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

  .heading {
    margin-bottom: 10px; }

  .game-intro {
    width: 55%;
    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; }

  .game-container {
    margin-top: 17px;
    position: relative;
    padding: 10px;
    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: #bbada0;
    border-radius: 6px;
    width: 280px;
    height: 280px;
    -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(238, 228, 218, 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: #8f7a66;
        border-radius: 3px;
        padding: 0 20px;
        text-decoration: none;
        color: #f9f6f2;
        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: #f9f6f2; }
        .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: 10px; }
    .grid-row:last-child {
      margin-bottom: 0; }
    .grid-row:after {
      content: "";
      display: block;
      clear: both; }

  .grid-cell {
    width: 57.5px;
    height: 57.5px;
    margin-right: 10px;
    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: 58px;
    height: 58px;
    line-height: 58px; }
  .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, 67px);
    -moz-transform: translate(0px, 67px);
    -ms-transform: translate(0px, 67px);
    transform: translate(0px, 67px); }
  .tile.tile-position-1-3 {
    -webkit-transform: translate(0px, 135px);
    -moz-transform: translate(0px, 135px);
    -ms-transform: translate(0px, 135px);
    transform: translate(0px, 135px); }
  .tile.tile-position-1-4 {
    -webkit-transform: translate(0px, 202px);
    -moz-transform: translate(0px, 202px);
    -ms-transform: translate(0px, 202px);
    transform: translate(0px, 202px); }
  .tile.tile-position-2-1 {
    -webkit-transform: translate(67px, 0px);
    -moz-transform: translate(67px, 0px);
    -ms-transform: translate(67px, 0px);
    transform: translate(67px, 0px); }
  .tile.tile-position-2-2 {
    -webkit-transform: translate(67px, 67px);
    -moz-transform: translate(67px, 67px);
    -ms-transform: translate(67px, 67px);
    transform: translate(67px, 67px); }
  .tile.tile-position-2-3 {
    -webkit-transform: translate(67px, 135px);
    -moz-transform: translate(67px, 135px);
    -ms-transform: translate(67px, 135px);
    transform: translate(67px, 135px); }
  .tile.tile-position-2-4 {
    -webkit-transform: translate(67px, 202px);
    -moz-transform: translate(67px, 202px);
    -ms-transform: translate(67px, 202px);
    transform: translate(67px, 202px); }
  .tile.tile-position-3-1 {
    -webkit-transform: translate(135px, 0px);
    -moz-transform: translate(135px, 0px);
    -ms-transform: translate(135px, 0px);
    transform: translate(135px, 0px); }
  .tile.tile-position-3-2 {
    -webkit-transform: translate(135px, 67px);
    -moz-transform: translate(135px, 67px);
    -ms-transform: translate(135px, 67px);
    transform: translate(135px, 67px); }
  .tile.tile-position-3-3 {
    -webkit-transform: translate(135px, 135px);
    -moz-transform: translate(135px, 135px);
    -ms-transform: translate(135px, 135px);
    transform: translate(135px, 135px); }
  .tile.tile-position-3-4 {
    -webkit-transform: translate(135px, 202px);
    -moz-transform: translate(135px, 202px);
    -ms-transform: translate(135px, 202px);
    transform: translate(135px, 202px); }
  .tile.tile-position-4-1 {
    -webkit-transform: translate(202px, 0px);
    -moz-transform: translate(202px, 0px);
    -ms-transform: translate(202px, 0px);
    transform: translate(202px, 0px); }
  .tile.tile-position-4-2 {
    -webkit-transform: translate(202px, 67px);
    -moz-transform: translate(202px, 67px);
    -ms-transform: translate(202px, 67px);
    transform: translate(202px, 67px); }
  .tile.tile-position-4-3 {
    -webkit-transform: translate(202px, 135px);
    -moz-transform: translate(202px, 135px);
    -ms-transform: translate(202px, 135px);
    transform: translate(202px, 135px); }
  .tile.tile-position-4-4 {
    -webkit-transform: translate(202px, 202px);
    -moz-transform: translate(202px, 202px);
    -ms-transform: translate(202px, 202px);
    transform: translate(202px, 202px); }

  .tile .tile-inner {
    font-size: 35px; }

  .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; } }







/* ===== LEADERBOARD 2048 STYLE (4 columns) ===== */

#leaderboard table {
  width: 100%;
  table-layout: fixed;
}

#leaderboard thead th {
  font-size: 13px;
  color: #776e65;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: 4px 10px;
}

/* Rows */
#leaderboard tbody tr {
  background: #eee4da;
  border-radius: 4px;
}

#leaderboard tbody tr td {
  padding: 10px;
  font-size: 16px;
  color: #776e65;
}

/* Rank column */
#leaderboard tbody tr td:first-child {
  font-weight: bold;
  width: 36px;
  text-align: center;
}

/* Player column (2nd) */
#leaderboard tbody tr td:nth-child(2) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Country column (3rd) */
#leaderboard tbody tr td:nth-child(3) {
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Score column (4th) */
#leaderboard tbody tr td:nth-child(4) {
  font-weight: 900;
  color: #f65e3b;
  text-align: right;
}

/* Column widths */
#leaderboard th:nth-child(1),
#leaderboard td:nth-child(1) {
  width: 12%;
  text-align: center;
}

#leaderboard th:nth-child(2),
#leaderboard td:nth-child(2) {
  width: 48%;
}

#leaderboard th:nth-child(3),
#leaderboard td:nth-child(3) {
  width: 18%;
  text-align: center;
}

#leaderboard th:nth-child(4),
#leaderboard td:nth-child(4) {
  width: 22%;
  text-align: right;
}

#leaderboard td img{
  display:inline-block;
  vertical-align:middle;
}


/* Hover effect */
#leaderboard tbody tr:hover {
  background: #ede0c8;
  transform: scale(1.01);
  transition: all 0.12s ease-in-out;
}

/* Mobile friendly */
@media (max-width: 520px) {
  #leaderboard tbody tr td {
    font-size: 14px;
    padding: 8px;
  }

  /* malo suzi player da stane */
  #leaderboard th:nth-child(2),
  #leaderboard td:nth-child(2) {
    width: 44%;
  }

  #leaderboard th:nth-child(3),
  #leaderboard td:nth-child(3) {
    width: 20%;
  }

  #leaderboard th:nth-child(4),
  #leaderboard td:nth-child(4) {
    width: 24%;
  }
}


#leaderboard .lb-dots{
  color:#776e65;
  font-weight:700;
  padding: 0 4px;
}


/* Top 3 medals */
#leaderboard tbody tr.lb-1 td:first-child,
#leaderboard tbody tr.lb-2 td:first-child,
#leaderboard tbody tr.lb-3 td:first-child {
  font-weight: 900;
}

#leaderboard tbody tr.lb-1 { background: #f2d27a; } /* gold-ish */
#leaderboard tbody tr.lb-2 { background: #d8dde5; } /* silver-ish */
#leaderboard tbody tr.lb-3 { background: #e3b08a; } /* bronze-ish */

#leaderboard tbody tr.lb-1 td:nth-child(3),
#leaderboard tbody tr.lb-2 td:nth-child(3),
#leaderboard tbody tr.lb-3 td:nth-child(3) {
  color: #776e65; /* score readable on medal bg */
}

/* Last saved highlight */
#leaderboard tbody tr.lb-last {
  outline: 3px solid #f65e3b;
  box-shadow: 0 0 0 4px rgba(246, 94, 59, 0.18);
}

#leaderboard tbody tr.lb-last td {
  position: relative;
}

#leaderboard tbody tr.lb-last td:first-child::after {
  content: "NEW";
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f65e3b;
  color: #f9f6f2;
  vertical-align: middle;
}

#leaderboard .lb-page {
  display:inline-block;
  margin:4px;
  padding:6px 10px;
  border-radius:4px;
  background:#eee4da;
  color:#776e65;
  font-weight:700;
  text-decoration:none;
}
#leaderboard .lb-page:hover {
  background:#ede0c8;
}
#leaderboard .lb-active {
  background:#f65e3b;
  color:#f9f6f2;
}

/* ===== SEO PAGES LINKS (2048 style) ===== */
.seo-links {
  max-width: 720px;
  width: calc(100% - 24px);
  margin: 26px auto;
  background: #bbada0;
  border-radius: 6px;
  padding: 14px;
}

.seo-links h2 {
  margin: 0 0 12px;
  color: #776e65;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.seo-card {
  display: block;
  background: #eee4da;
  border-radius: 6px;
  padding: 10px 12px;
  text-decoration: none;
  color: #776e65;
  font-weight: 800;
  line-height: 1.25;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}

.seo-card span {
  display: block;
  font-weight: 600;
  margin-top: 6px;
  font-size: 13px;
  color: #8f877d;
}

.seo-card:hover { background: #ede0c8; }
.seo-card:active { transform: translateY(1px); }

/* Responsive */
@media (max-width: 820px) {
  .seo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .seo-grid { grid-template-columns: 1fr; }
  .seo-links { padding: 12px; }
}

/* Make 2048 title clickable but visually unchanged */
.title .home-link {
  color: inherit;
  text-decoration: none;
}

.title .home-link:hover {
  opacity: 0.9;
}


.footer-nav{
  width:100%;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  margin:24px 0 12px;
  font-size:0.85rem;
  color: var(--text-muted);
}

.footer-nav a{
  color: var(--text-muted);
  text-decoration:none;
}

.footer-nav a:hover{
  color: var(--text);
  text-decoration:underline;
}

.footer-nav span{
  opacity:0.4;
}

@media (max-width:520px){
  .footer-nav{
    flex-wrap:wrap;
    gap:6px 10px;
  }
  .footer-nav span{
    display:none;
  }
}


#country-chart{
  margin: 26px auto;
  max-width: 520px;
  background: #bbada0;
  border-radius: 6px;
  padding: 16px;
}

#country-chart h2{
  margin: 0 0 12px;
  color: #776e65;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

#country-chart .chart-wrap{
  background: #eee4da;
  border-radius: 6px;
  padding: 10px;
  height: 320px;
}

#worldmap{
  margin: 26px auto;
  max-width: 720px;
  width: calc(100% - 24px);
  background: #bbada0;
  border-radius: 6px;
  padding: 14px;
}

#worldmap h2{
  margin: 0 0 12px;
  color: #776e65;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

#world-map{
  width: 100%;
  height: 420px;
  background: #eee4da;
  border-radius: 6px;
  overflow: hidden;
}

.map-legend{
  display:flex;
  justify-content:center;
  gap:10px;
  margin-top:10px;
  color:#776e65;
  font-weight:800;
  font-size:13px;
}

.map-legend .lg{
  background:#eee4da;
  padding:6px 10px;
  border-radius:6px;
}

.map-legend .low{ border-left:10px solid #ede0c8; }
.map-legend .mid{ border-left:10px solid #f2b179; }
.map-legend .high{ border-left:10px solid #f65e3b; }

@media (max-width: 520px){
  #world-map{ height: 320px; }
}




/* ===== NEW Country Chart (does NOT override old CSS) ===== */
#country-chart2{
  width: 500px;
  margin: 26px auto;
  background: #bbada0;
  border-radius: 6px;
  padding: 14px;
  box-sizing: border-box;
}

#country-chart2 h2{
  margin: 0 0 12px;
  color: #776e65;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

#country-chart2 .cc2-wrap{
  background: #eee4da;
  border-radius: 6px;
  padding: 10px;
  height: 260px;
  box-sizing: border-box;
  overflow: hidden;
}

#cc2Canvas{
  display:block;
  width: 100%;
  height: 100%;
}

@media (max-width: 520px){
  #country-chart2{
    width: 280px;
    padding: 12px;
  }
  #country-chart2 .cc2-wrap{
    height: 210px;
    padding: 8px;
  }
}

/* Modern Phaser engine mount */
.engine-game-container {
  overflow: hidden;
  touch-action: none;
  padding: 0;
}

#phaser-game,
#phaser-game canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  border-radius: 4px;
}

.score-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(250, 248, 239, 0.78);
  backdrop-filter: blur(6px);
  z-index: 9999;
}
.score-modal--open { display: flex; }
.score-modal__card {
  position: relative;
  width: min(420px, 100%);
  box-sizing: border-box;
  background: #f9f6f2;
  color: #776e65;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(119, 110, 101, 0.22);
}
.score-modal__card h3 { margin: 0 34px 10px 0; font-size: 28px; line-height: 1.15; }
.score-modal__text, .score-modal__status { margin: 0 0 14px; line-height: 1.45; }
.score-modal__form { display: grid; gap: 10px; }
.score-modal__form label { font-weight: 700; }
.score-modal__form input {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid #bbada0;
  border-radius: 10px;
  color: #776e65;
  font: inherit;
  background: #fff;
}
.score-modal__form button, .score-modal__close { border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.score-modal__form button { min-height: 48px; border-radius: 10px; background: #8f7a66; color: #f9f6f2; }
.score-modal__form button:disabled { opacity: 0.65; cursor: wait; }
.score-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #bbada0;
  color: #f9f6f2;
  font-size: 24px;
  line-height: 1;
}
@media screen and (max-width: 520px) {
  .score-modal__card { padding: 20px; border-radius: 14px; }
  .score-modal__card h3 { font-size: 24px; }
}

/* Mobile Phaser sizing fix: prevent the 500px canvas from being clipped inside the 280px legacy layout */
.engine-game-container {
  max-width: 100%;
}

@media screen and (max-width: 520px) {
  body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .container {
    width: min(100%, 390px);
  }

  .heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  h1.title {
    flex: 1 1 auto;
    min-width: 0;
  }

  .scores-container {
    float: none;
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
  }

  .score-container,
  .best-container {
    min-width: 46px;
    padding: 10px 8px;
  }

  .above-game {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 10px;
  }

  .game-intro {
    float: none;
    width: auto;
  }

  .restart-button {
    float: none;
    width: auto;
    min-width: 110px;
    white-space: nowrap;
  }

  .game-container.engine-game-container {
    width: min(100%, 340px);
    height: auto;
    aspect-ratio: 1 / 1;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    overflow: hidden;
  }

  #phaser-game {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
  }

  #phaser-game canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
  }

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

/* ===== Unified site shell and editorial pages (2026 refresh) ===== */
:root {
  --site-ink: #4f4740;
  --site-muted: #776e65;
  --site-paper: rgba(255, 253, 248, 0.96);
  --site-paper-solid: #fffdf8;
  --site-border: rgba(119, 110, 101, 0.2);
  --site-accent: #f65e3b;
  --site-accent-dark: #c9492d;
  --site-brown: #8f7a66;
  --site-soft: #f3ece3;
  --site-shadow: 0 24px 70px rgba(60, 58, 50, 0.16);
}

body.home-page,
body.article-page {
  background-color: #f2e6d4;
  background-image: linear-gradient(135deg, rgba(250, 248, 239, 0.9), rgba(238, 228, 218, 0.78)), url("2048.webp");
  color: var(--site-ink);
}

.home-shell,
.article-shell,
.home-shell *,
.article-shell * {
  box-sizing: border-box;
}

.home-shell,
.article-shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 8px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10000;
  padding: 10px 14px;
  border-radius: 8px;
  background: #3c3a32;
  color: #fff;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 74px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid var(--site-border);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 10px 32px rgba(60, 58, 50, 0.1);
  backdrop-filter: blur(12px);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--site-ink);
  text-decoration: none;
}

.site-brand span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #f2b179, #f65e3b);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 7px 16px rgba(246,94,59,.24);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.site-brand small {
  max-width: 76px;
  color: var(--site-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

.site-nav a {
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--site-muted);
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--site-soft);
  color: var(--site-ink);
}

.site-nav a.active {
  background: var(--site-brown);
  color: #fff;
}

.home-container {
  width: 550px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 22px;
  background: var(--site-paper);
  box-shadow: var(--site-shadow);
}

.home-kicker {
  clear: both;
  margin: -2px 0 20px;
  color: var(--site-muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.home-container .game-container { margin-top: 28px; }
.home-container .game-explanation { margin-bottom: 24px; }

.home-container #leaderboard,
.home-container #country-chart2,
.home-content,
.home-container .seo-links {
  margin-top: 32px;
  scroll-margin-top: 18px;
}

.home-container #leaderboard,
.home-content {
  padding: 22px;
  border: 1px solid var(--site-border);
  border-radius: 16px;
  background: #fffdf8;
}

.home-container #leaderboard h2,
.home-content h2,
.home-container .seo-links h2 {
  margin: 0 0 14px;
  color: var(--site-ink);
  font-size: 26px;
  line-height: 1.2;
}

.section-intro { margin-bottom: 14px; }

.home-feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 20px 0 26px;
}

.home-feature-grid section {
  padding: 15px;
  border-left: 5px solid #edc22e;
  border-radius: 10px;
  background: var(--site-soft);
}

.home-feature-grid h3 { margin: 0 0 5px; color: var(--site-ink); font-size: 18px; }
.home-feature-grid p { margin: 0; font-size: 16px; }
.steps-list { padding-left: 24px; }
.steps-list li { margin-bottom: 9px; line-height: 1.55; }

.home-container .seo-links {
  width: 100%;
  max-width: none;
  margin-right: 0;
  margin-left: 0;
  padding: 16px;
  background: var(--site-brown);
}

.home-container .seo-links h2 { color: #fff; }
.home-container .seo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-container .seo-card { min-height: 98px; }
.all-guides-link { margin: 14px 0 0; text-align: center; }
.all-guides-link .button-link { border-color: rgba(255,255,255,.5); color: #fff; }

.page-card {
  overflow: hidden;
  width: min(920px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 24px;
  background: var(--site-paper);
  box-shadow: var(--site-shadow);
}

.article-hero {
  padding: 44px 72px 36px;
  border-bottom: 1px solid var(--site-border);
  background: radial-gradient(circle at 92% 12%, rgba(242,177,121,.32), transparent 32%), linear-gradient(135deg, #fffdf8, #f5eee5);
}

.article-hero.compact-hero { padding-bottom: 30px; }

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 28px;
  color: var(--site-muted);
  font-size: 13px;
}

.breadcrumbs a { color: var(--site-muted); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

.eyebrow {
  margin: 0 0 9px;
  color: var(--site-accent-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  color: #3c3a32;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -.035em;
}

.subtitle {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--site-muted);
  font-size: 20px;
  line-height: 1.55;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  margin: 22px 0 0;
  color: var(--site-muted);
  font-size: 13px;
}

.article-meta span + span::before { content: "•"; margin-right: 18px; opacity: .55; }
.article-meta a { color: inherit; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 17px;
  border: 2px solid var(--site-brown);
  border-radius: 10px;
  color: var(--site-brown);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.button-link:hover { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(60,58,50,.12); }
.button-link.primary { border-color: var(--site-accent); background: var(--site-accent); color: #fff; }

.page-card > .content {
  max-width: 790px;
  margin: 0 auto;
  padding: 42px 54px 54px;
  color: var(--site-ink);
}

.page-card > .content h2 {
  margin: 40px 0 12px;
  color: #3c3a32;
  font-size: 29px;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.page-card > .content h2:first-child { margin-top: 0; }
.page-card > .content h3 { margin: 28px 0 10px; color: #3c3a32; font-size: 21px; line-height: 1.3; }
.page-card > .content p,
.page-card > .content li { font-size: 17px; line-height: 1.72; }
.page-card > .content ul,
.page-card > .content ol { padding-left: 25px; }
.page-card > .content li { margin-bottom: 8px; }
.page-card > .content a { color: #9d3f29; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.page-card > .content strong { color: #4a423b; }

.content-section + .content-section { margin-top: 34px; padding-top: 1px; }
.content-section.callout { padding: 24px; border: 1px solid rgba(246,94,59,.22); border-radius: 14px; background: #fff5ed; }
.content-section.callout h2 { margin-top: 0; }

.table-scroll { overflow-x: auto; margin: 18px 0 24px; border-radius: 12px; border: 1px solid var(--site-border); }
.table-scroll table { width: 100%; min-width: 560px; border-collapse: collapse; background: #fff; }
.table-scroll th,
.table-scroll td { padding: 12px 14px; border-bottom: 1px solid var(--site-border); text-align: left; vertical-align: top; }
.table-scroll th { background: var(--site-soft); color: var(--site-ink); font-size: 14px; }
.table-scroll tr:last-child td { border-bottom: 0; }

.related {
  margin-top: 42px;
  padding: 22px 24px;
  border-radius: 14px;
  background: var(--site-soft);
}

.related h3 { margin-top: 0 !important; }
.related ul { margin-bottom: 0; }

.guide-group + .guide-group { margin-top: 46px; }
.guide-group > h2 { margin-bottom: 6px !important; }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.guide-card {
  display: flex;
  flex-direction: column;
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--site-border);
  border-radius: 13px;
  background: #fff;
  color: var(--site-ink) !important;
  text-decoration: none !important;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.guide-card:hover { transform: translateY(-2px); border-color: rgba(246,94,59,.5); box-shadow: 0 10px 24px rgba(60,58,50,.1); }
.guide-card strong { font-size: 18px; }
.guide-card span { margin-top: 8px; color: var(--site-muted); font-size: 15px; font-weight: 500; line-height: 1.5; }

.error-card { padding: 70px; text-align: center; }
.error-card .subtitle { margin-right: auto; margin-left: auto; }
.error-card .hero-actions { justify-content: center; }

.site-footer {
  width: min(920px, 100%);
  margin: 24px auto 0;
  padding: 20px;
  color: var(--site-muted);
  text-align: center;
  font-size: 13px;
}

.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 16px; }
.site-footer a { color: var(--site-muted); font-size: 13px; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer p { margin: 13px 0 0; font-size: 13px; }

@media (max-width: 760px) {
  body.article-page { padding: 0; }
  .home-shell,
  .article-shell { width: min(100% - 20px, 1100px); padding-top: 10px; }
  .site-header { align-items: flex-start; gap: 12px; border-radius: 14px; }
  .site-brand small { display: none; }
  .site-nav { gap: 3px; }
  .site-nav a { padding: 8px; font-size: 13px; }
  .article-hero { padding: 32px 28px 28px; }
  .page-card > .content { padding: 34px 28px 40px; }
  .topic-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  body.home-page { padding-right: 0; padding-left: 0; }
  .home-shell { width: calc(100% - 16px); }
  .home-site-header { margin-bottom: 10px; }
  .home-container { width: 100%; padding: 14px; border-radius: 17px; }
  .home-container #leaderboard,
  .home-content { padding: 15px; }
  .home-container #country-chart2 { width: 100%; }
  .home-container .seo-grid { grid-template-columns: 1fr; }
  .home-container .seo-card { min-height: 0; }
  .site-header { display: block; padding: 10px; }
  .site-brand { margin-bottom: 9px; }
  .site-brand span { width: 44px; height: 44px; border-radius: 11px; font-size: 18px; }
  .site-nav { justify-content: flex-start; }
  .site-nav a { padding: 7px; font-size: 12px; }
  .site-nav a:nth-last-child(-n+2) { display: none; }
  .article-hero { padding: 26px 20px 24px; }
  .breadcrumbs { margin-bottom: 20px; }
  .page-title { font-size: 35px; }
  .subtitle { font-size: 17px; }
  .article-meta { display: block; }
  .article-meta span { display: block; margin-top: 5px; }
  .article-meta span + span::before { content: none; }
  .page-card > .content { padding: 28px 20px 34px; }
  .page-card > .content h2 { font-size: 25px; }
  .page-card > .content p,
  .page-card > .content li { font-size: 16px; }
  .hero-actions .button-link { width: 100%; }
  .error-card { padding: 42px 20px; }
}
