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

/* Accessibility and UX improvements */
*:focus {
  outline: 2px solid #8f7a66;
  outline-offset: 2px;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loading states */
body.loading {
  opacity: 0;
  transform: translateY(20px);
}

body.loaded {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.3s ease;
}

/* New responsive layout */
.main-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  gap: 30px;
}

.game-area {
  flex: 1;
  max-width: 600px;
  margin: 0 auto;
}

.sidebar {
  width: 250px;
  flex-shrink: 0;
}

.left-sidebar, .right-sidebar {
  display: none; /* Hidden on mobile, shown on desktop */
}

.sidebar-content {
  background: #f8f6f2;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #8f7a66;
}

.sidebar-content h3 {
  color: #776e65;
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 16px;
}

.sidebar-content ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.sidebar-content li {
  padding: 6px 0;
  font-size: 14px;
  color: #776e65;
  border-bottom: 1px solid #eee4da;
}

.sidebar-content li:last-child {
  border-bottom: none;
}

.sidebar-content a {
  color: #8f7a66;
  text-decoration: none;
  font-weight: bold;
}

.sidebar-content a:hover {
  color: #776e65;
  text-decoration: underline;
}

/* Game header */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.game-header .title {
  font-size: 60px;
  font-weight: bold;
  margin: 0;
  color: #776e65;
}

.game-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.share-buttons {
  display: flex;
  gap: 8px;
}

/* Compact scores directly above game */
.game-scores {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

.score-box, .best-box {
  background: #bbada0;
  border-radius: 6px;
  padding: 10px 20px;
  text-align: center;
  min-width: 80px;
  position: relative;
}

.score-label {
  color: #eee4da;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 2px;
}

.score-container, .best-container {
  color: white;
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
}

/* Game intro text */
.game-intro {
  text-align: center;
  margin: 10px 0;
  color: #776e65;
  font-size: 16px;
}

/* Game container adjustments */
.game-container {
  margin-top: 10px;
}

/* Score animation */
@keyframes score-pop {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Mobile centering that aligns with tile positioning breakpoint */
@media screen and (max-width: 520px) {
  .game-container {
    margin: 0 auto;
    display: block;
    width: fit-content;
  }
}

/* Smooth transitions for better UX */
.share-btn, .restart-button, .wordle-link {
  transition: all 0.3s ease;
}

.share-btn:hover, .restart-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.score-box, .best-box {
  transition: all 0.3s ease;
}

/* Loading optimization */
.game-area {
  transition: opacity 0.3s ease;
}

/* Touch feedback for mobile */
@media (hover: none) and (pointer: coarse) {
  .share-btn:active, .restart-button:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
}

/* Game info section styling */
.game-info-section {
  margin: 12px 0;
  padding: 0;
}

.game-info-section p {
  margin: 6px 0;
}

.game-info {
  font-style: italic;
  text-align: center;
  color: #8f7a66;
  font-size: 16px;
}

/* Natural cross-promotion */
.more-games {
  text-align: center;
  margin: 20px 0 10px 0;
  padding: 15px;
  background: linear-gradient(135deg, #f6f9fc, #e9ecef);
  border-radius: 10px;
  border: 1px solid #e0e6ed;
}

.more-games p {
  margin: 0;
  color: #495057;
  font-size: 16px;
}

.wordle-link {
  color: #28a745;
  text-decoration: none;
  font-weight: bold;
  background: #d4edda;
  padding: 8px 16px;
  border-radius: 25px;
  margin-left: 10px;
  display: inline-block;
  transition: all 0.3s ease;
  border: 2px solid #28a745;
}

.wordle-link:hover {
  background: #28a745;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Content wrapper for bottom content */
.content-wrapper {
  max-width: 1200px;
  margin: 40px auto 0;
  padding: 0 20px;
}

/* Content sections for AdSense approval */
.game-content-sections {
  margin: 30px 0;
}

.content-section {
  background: #f8f6f2;
  padding: 20px;
  margin: 20px 0;
  border-radius: 8px;
  border-left: 4px solid #8f7a66;
}

.content-section h2 {
  color: #776e65;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 22px;
}

.content-section ul {
  padding-left: 20px;
}

.content-section li {
  margin: 8px 0;
  line-height: 1.5;
}

.content-section a {
  color: #8f7a66;
  text-decoration: none;
  font-weight: bold;
  border-bottom: 1px solid #8f7a66;
}

.content-section a:hover {
  color: #776e65;
  border-bottom-color: #776e65;
}

/* Footer styling */
.site-footer {
  margin-top: 40px;
  padding: 25px 0;
  border-top: 2px solid #eee4da;
  text-align: center;
}

.footer-links {
  margin-bottom: 15px;
}

.footer-links a {
  color: #8f7a66;
  text-decoration: none;
  margin: 0 15px;
  font-weight: bold;
  font-size: 14px;
}

.footer-links a:hover {
  color: #776e65;
  text-decoration: underline;
}

.copyright {
  color: #9f8a76;
  font-size: 12px;
  margin: 0;
}

/* Legal content styling */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  line-height: 1.6;
}

.legal-content h1 {
  color: #776e65;
  border-bottom: 3px solid #eee4da;
  padding-bottom: 10px;
}

.legal-content h2 {
  color: #8f7a66;
  margin-top: 30px;
  margin-bottom: 15px;
}

.legal-content ul {
  padding-left: 20px;
}

.legal-content li {
  margin: 8px 0;
}

.legal-content a {
  color: #8f7a66;
  text-decoration: none;
  border-bottom: 1px solid #8f7a66;
}

.legal-content a:hover {
  color: #776e65;
  border-bottom-color: #776e65;
}

.back-to-game {
  margin-top: 40px;
  text-align: center;
  padding: 20px;
  background: #f8f6f2;
  border-radius: 8px;
}

/* Visual feedback improvements */
.copy-link.success {
  background: #28a745 !important;
  transform: scale(1.05);
}

body {
  margin: 40px 0; }

/* Ad Container Styles */
.ad-container {
  text-align: center;
  margin: 2px 0;
  padding: 0;
}

.top-ad {
  margin: 8px 0 4px 0;
  padding: 0;
}

.bottom-ad {
  margin-top: 20px;
  margin-bottom: 15px;
}

/* Game Controls Styles */
.game-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.share-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.share-btn {
  background: #8f7a66;
  color: #f9f6f2;
  border: none;
  border-radius: 3px;
  padding: 10px 15px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s;
}

.share-btn:hover {
  background: #9f8a76;
}

.twitter-share {
  background: #1da1f2;
}

.twitter-share:hover {
  background: #0d8bd9;
}

.facebook-share {
  background: #4267b2;
}

.facebook-share:hover {
  background: #365899;
}

.copy-link {
  background: #28a745;
}

.copy-link:hover {
  background: #218838;
}

/* Desktop: Show sidebars */
@media screen and (min-width: 1024px) {
  .left-sidebar, .right-sidebar {
    display: block;
  }
  
  .sidebar-ad {
    margin: 0 0 20px 0;
  }
}

/* Tablet responsiveness */
@media screen and (max-width: 1023px) and (min-width: 769px) {
  .main-layout {
    padding: 15px;
    gap: 20px;
  }
  
  .game-header .title {
    font-size: 50px;
  }
}

/* Mobile Responsiveness */
@media screen and (max-width: 520px) {
  body {
    margin: 8px 0;
    padding: 0 8px;
  }
  
  .main-layout {
    flex-direction: column;
    padding: 8px;
    gap: 15px;
    align-items: center;
    max-width: 100%;
  }
  
  .game-area {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .game-header {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    margin-bottom: 15px;
    width: 100%;
  }
  
  .game-header .title {
    font-size: 48px;
    margin-bottom: 8px;
  }
  
  .game-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
  }
  
  .share-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .share-btn {
    padding: 12px 16px;
    font-size: 14px;
    min-width: 80px;
    white-space: nowrap;
    border-radius: 6px;
  }
  
  .restart-button {
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 6px;
    min-width: 120px;
  }
  
  .game-scores {
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    width: 100%;
  }
  
  .score-box, .best-box {
    min-width: 90px;
    padding: 12px 18px;
    border-radius: 8px;
  }
  
  .game-container {
    margin: 0 auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .game-intro {
    text-align: center;
    font-size: 15px;
    margin: 12px 0;
    line-height: 1.4;
  }
  
  .more-games {
    margin: 15px 0;
    text-align: center;
    width: 100%;
  }
  
  .wordle-link {
    display: inline-block;
    margin-top: 8px;
    padding: 12px 20px;
    font-size: 15px;
    border-radius: 8px;
  }
  
  .game-controls {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  
  .share-buttons {
    justify-content: center;
  }
  
  .share-btn {
    padding: 8px 12px;
    font-size: 12px;
    flex: 1;
    min-width: 80px;
  }
  
  .restart-button {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
  }
  
  .game-container {
    margin-top: 5px;
  }
  
  .above-game {
    margin-bottom: 8px;
  }
  
  .game-explanation {
    font-size: 16px;
    line-height: 1.4;
  }
  
  .ad-container {
    margin: 15px 0;
    padding: 5px;
  }
}

@media screen and (max-width: 480px) {
  .container {
    width: 260px;
  }
  
  h1.title {
    font-size: 40px;
  }
  
  .share-buttons {
    flex-direction: column;
  }
  
  .share-btn {
    width: 100%;
    margin-bottom: 5px;
  }
}

/* Tablet optimization */
@media screen and (min-width: 521px) and (max-width: 768px) {
  .container {
    width: 460px;
    margin: 0 auto;
  }
  
  .game-controls {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .share-buttons {
    margin-top: 10px;
  }
}

/* Touch improvements for mobile */
@media (hover: none) and (pointer: coarse) {
  .share-btn {
    padding: 12px 16px;
    font-size: 16px;
    min-height: 44px;
  }
  
  .restart-button {
    padding: 12px 20px;
    font-size: 16px;
    min-height: 44px;
  }
}

/* Image Sharing Styles */
.image-share-buttons {
  margin: 15px 0;
  text-align: center;
}

.share-image-btn, .download-image-btn {
  background: #8f7a66;
  color: #f9f6f2;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  margin: 5px 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.share-image-btn:hover, .download-image-btn:hover {
  background: #9f8a76;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.share-image-btn {
  background: linear-gradient(45deg, #ed4264, #ffedbc);
  color: white;
  font-weight: bold;
}

.share-image-btn:hover {
  background: linear-gradient(45deg, #d73754, #f0d9a0);
}

.download-image-btn {
  background: linear-gradient(45deg, #667eea, #764ba2);
}

.download-image-btn:hover {
  background: linear-gradient(45deg, #5a6fd8, #6a4190);
}

/* Platform Selection Styles */
.platform-selection {
  margin: 10px 0;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.platform-btn {
  background: #8f7a66;
  color: #f9f6f2;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  margin: 3px 5px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.platform-btn.twitter {
  background: #1da1f2;
}

.platform-btn.twitter:hover {
  background: #0d8bd9;
}

.platform-btn.facebook {
  background: #4267b2;
}

.platform-btn.facebook:hover {
  background: #365899;
}

.platform-btn.download {
  background: #28a745;
}

.platform-btn.download:hover {
  background: #218838;
}

/* Improve game over message styling */
.game-message {
  text-align: center;
}

.game-message p {
  margin-bottom: 10px;
}

/* Mobile optimizations for image sharing */
@media screen and (max-width: 520px) {
  .image-share-buttons {
    margin: 10px 0;
  }
  
  .share-image-btn, .download-image-btn {
    display: block;
    width: 90%;
    margin: 8px auto;
    padding: 14px 20px;
    font-size: 16px;
  }
  
  .platform-btn {
    display: block;
    width: 80%;
    margin: 5px auto;
    padding: 12px 16px;
    font-size: 16px;
  }
  
  .ad-container {
    margin: 1px 0;
    padding: 0;
  }
  
  .top-ad {
    margin: 4px 0 2px 0;
  }
}

.heading {
  margin-bottom: 5px;
}

.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; }
  /* Removed duplicate pseudo-element labels */
  .score-container .score-addition, .best-container .score-addition {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(119, 110, 101, 0.9);
    font-size: 18px;
    line-height: 18px;
    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; }

/* Removed duplicate labels - we now have proper HTML labels */

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: 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: 10px;
  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: 5px; }

  .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: 5px;
    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;
    left: 10px;
    top: 10px; }

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