﻿/* 神秘字体导入 */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Philosopher:ital,wght@0,400;0,700;1,400&display=swap');
@import url(fonts/clear-sans.css);

/* 星空背景动画 */
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* 神秘发光效果 */
@keyframes mystical-glow {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3), 
                0 0 40px rgba(75, 0, 130, 0.2),
                0 0 60px rgba(138, 43, 226, 0.1);
  }
  50% { 
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.5), 
                0 0 60px rgba(75, 0, 130, 0.3),
                0 0 90px rgba(138, 43, 226, 0.2);
  }
}

html, body {
  margin: 0;
  padding: 0;
  /* 深色神秘背景 */
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%),
    linear-gradient(135deg, #0f0f23 0%, #1a1a2e 25%, #16213e 50%, #0f0f23 100%);
  color: #e6e6fa;
  font-family: "Philosopher", "Cinzel", "Clear Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 添加星空效果 */
html::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #eee, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 90px 40px, #fff, transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 160px 30px, #ddd, transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: twinkle 4s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}

body {
  margin: 0;
  position: relative;
  z-index: 1;
}

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

h1.title {
  font-size: 80px;
  font-weight: 700;
  margin: 0;
  display: block;
  float: left;
  font-family: "Cinzel", serif;
  background: linear-gradient(45deg, #ffd700, #ffb347, #daa520);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
  animation: mystical-glow 3s ease-in-out infinite; }

@-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: linear-gradient(145deg, #2d1b69, #1a0f3d);
  padding: 15px 25px;
  font-size: 25px;
  height: 25px;
  line-height: 47px;
  font-weight: bold;
  border-radius: 8px;
  color: #ffd700;
  margin-top: 8px;
  text-align: center;
  font-family: "Cinzel", serif;
  border: 2px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3), 
              inset 0 1px 0 rgba(255, 255, 255, 0.1); }
  .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: 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;
  -ms-touch-action: none;
  touch-action: none;
  background: linear-gradient(145deg, #1a0f3d, #2d1b69);
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(138, 43, 226, 0.4), 
              0 5px 15px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1),
              0 0 50px rgba(138, 43, 226, 0.2);
  width: 500px;
  height: 500px;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  border: 2px solid rgba(255, 215, 0, 0.2);
  animation: mystical-glow 4s ease-in-out infinite; }
  .game-container .game-message {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(26, 15, 61, 0.9);
    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;
    border-radius: 12px;
    border: 2px solid rgba(255, 215, 0, 0.3); }
    .game-container .game-message p {
      font-size: 48px;
      font-weight: bold;
      height: auto;
      line-height: 52px;
      margin-top: 120px;
      color: #ffd700;
      font-family: "Cinzel", serif;
      text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
      margin-bottom: 20px;
      text-align: center; }
    .game-container .game-message .game-over-title {
      font-size: 48px;
      font-weight: bold;
      display: block; }
    .game-container .game-message .game-over-subtitle {
      font-size: 24px;
      font-weight: normal;
      display: block;
      margin-top: 15px;
      line-height: 28px; }
    .game-container .game-message .lower {
      display: block;
      margin-top: 40px; }
    .game-container .game-message a {
      display: inline-block;
      background: linear-gradient(145deg, #2d1b69, #1a0f3d);
      border-radius: 8px;
      padding: 0 20px;
      text-decoration: none;
      color: #ffd700;
      height: 40px;
      line-height: 42px;
      margin-left: 9px;
      font-family: "Cinzel", serif;
      font-weight: 600;
      border: 2px solid rgba(255, 215, 0, 0.3);
      box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3),
                  inset 0 1px 0 rgba(255, 255, 255, 0.1); }
      .game-container .game-message a.keep-playing-button {
        display: none; }
    .game-container .game-message.game-won {
      background: rgba(255, 215, 0, 0.2);
      color: #ffd700; }
      .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;
  width: 470px;
  height: 470px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: repeat(4, 106.25px);
  grid-template-rows: repeat(4, 106.25px);
  gap: 15px; }

.grid-row {
  display: contents; }

.grid-cell {
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(26, 15, 61, 0.6), rgba(45, 27, 105, 0.4));
  border: 1px solid rgba(255, 215, 0, 0.1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3),
              0 1px 2px rgba(138, 43, 226, 0.2); }

.tile-container {
  position: absolute;
  z-index: 2;
  width: 470px;
  height: 470px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%); }

.tile, .tile .tile-inner {
  width: 106.25px;
  height: 106.25px;
  line-height: 106.25px; }
.tile.tile-position-1-1 {
  -webkit-transform: translate(0px, 0px);
  -moz-transform: translate(0px, 0px);
  transform: translate(0px, 0px); }
.tile.tile-position-1-2 {
  -webkit-transform: translate(0px, 121.25px);
  -moz-transform: translate(0px, 121.25px);
  transform: translate(0px, 121.25px); }
.tile.tile-position-1-3 {
  -webkit-transform: translate(0px, 242.5px);
  -moz-transform: translate(0px, 242.5px);
  transform: translate(0px, 242.5px); }
.tile.tile-position-1-4 {
  -webkit-transform: translate(0px, 363.75px);
  -moz-transform: translate(0px, 363.75px);
  transform: translate(0px, 363.75px); }
.tile.tile-position-2-1 {
  -webkit-transform: translate(121.25px, 0px);
  -moz-transform: translate(121.25px, 0px);
  transform: translate(121.25px, 0px); }
.tile.tile-position-2-2 {
  -webkit-transform: translate(121.25px, 121.25px);
  -moz-transform: translate(121.25px, 121.25px);
  transform: translate(121.25px, 121.25px); }
.tile.tile-position-2-3 {
  -webkit-transform: translate(121.25px, 242.5px);
  -moz-transform: translate(121.25px, 242.5px);
  transform: translate(121.25px, 242.5px); }
.tile.tile-position-2-4 {
  -webkit-transform: translate(121.25px, 363.75px);
  -moz-transform: translate(121.25px, 363.75px);
  transform: translate(121.25px, 363.75px); }
.tile.tile-position-3-1 {
  -webkit-transform: translate(242.5px, 0px);
  -moz-transform: translate(242.5px, 0px);
  transform: translate(242.5px, 0px); }
.tile.tile-position-3-2 {
  -webkit-transform: translate(242.5px, 121.25px);
  -moz-transform: translate(242.5px, 121.25px);
  transform: translate(242.5px, 121.25px); }
.tile.tile-position-3-3 {
  -webkit-transform: translate(242.5px, 242.5px);
  -moz-transform: translate(242.5px, 242.5px);
  transform: translate(242.5px, 242.5px); }
.tile.tile-position-3-4 {
  -webkit-transform: translate(242.5px, 363.75px);
  -moz-transform: translate(242.5px, 363.75px);
  transform: translate(242.5px, 363.75px); }
.tile.tile-position-4-1 {
  -webkit-transform: translate(363.75px, 0px);
  -moz-transform: translate(363.75px, 0px);
  transform: translate(363.75px, 0px); }
.tile.tile-position-4-2 {
  -webkit-transform: translate(363.75px, 121.25px);
  -moz-transform: translate(363.75px, 121.25px);
  transform: translate(363.75px, 121.25px); }
.tile.tile-position-4-3 {
  -webkit-transform: translate(363.75px, 242.5px);
  -moz-transform: translate(363.75px, 242.5px);
  transform: translate(363.75px, 242.5px); }
.tile.tile-position-4-4 {
  -webkit-transform: translate(363.75px, 363.75px);
  -moz-transform: translate(363.75px, 363.75px);
  transform: translate(363.75px, 363.75px); }

.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: 8px;
    background: transparent;
    text-align: center;
    font-weight: bold;
    z-index: 10;
    font-size: 55px;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3),
                0 2px 8px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease; }
  .tile.tile-2 .tile-inner {
    background: url('../jewels icon/Pebble-2.png') center center no-repeat;
    background-size: 90%;
    background-color: rgba(139, 69, 19, 0.2);
    color: transparent;
    box-shadow: 0 0 20px rgba(139, 69, 19, 0.4),
                0 0 40px rgba(160, 82, 45, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1); }
  .tile.tile-4 .tile-inner {
    background: url('../jewels icon/Crystal-4.png') center center no-repeat;
    background-size: 90%;
    background-color: rgba(220, 220, 220, 0.2);
    color: transparent;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.5),
                0 0 50px rgba(173, 216, 230, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2); }
  .tile.tile-8 .tile-inner {
    background: url('../jewels icon/Amethyst-8.png') center center no-repeat;
    background-size: 90%;
    background-color: rgba(147, 112, 219, 0.2);
    color: transparent;
    box-shadow: 0 0 30px rgba(147, 112, 219, 0.6),
                0 0 60px rgba(138, 43, 226, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.15); }
  .tile.tile-16 .tile-inner {
    background: url('../jewels icon/Topaz-16.png') center center no-repeat;
    background-size: 90%;
    background-color: rgba(255, 140, 0, 0.2);
    color: transparent;
    box-shadow: 0 0 35px rgba(255, 140, 0, 0.7),
                0 0 70px rgba(255, 165, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2); }
  .tile.tile-32 .tile-inner {
    background: url('../jewels icon/Sapphire-32.png') center center no-repeat;
    background-size: 90%;
    background-color: rgba(65, 105, 225, 0.2);
    color: transparent;
    box-shadow: 0 0 40px rgba(65, 105, 225, 0.8),
                0 0 80px rgba(0, 191, 255, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.25); }
  .tile.tile-64 .tile-inner {
    background: url('../jewels icon/Ruby-64.png') center center no-repeat;
    background-size: 90%;
    background-color: rgba(220, 20, 60, 0.2);
    color: transparent;
    box-shadow: 0 0 45px rgba(220, 20, 60, 0.9),
                0 0 90px rgba(255, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3); }
  .tile.tile-128 .tile-inner {
    background: url('../jewels icon/Jadeite-128.png') center center no-repeat;
    background-size: 90%;
    background-color: rgba(0, 128, 0, 0.2);
    color: transparent;
    box-shadow: 0 0 50px rgba(0, 255, 127, 1.0),
                0 0 100px rgba(50, 205, 50, 0.7),
                inset 0 1px 0 rgba(255, 255, 255, 0.35);
    font-size: 45px; }
    @media screen and (max-width: 520px) {
      .tile.tile-128 .tile-inner {
        font-size: 25px; } }
  .tile.tile-256 .tile-inner {
    background: url('../jewels icon/Emerald-256.png') center center no-repeat;
    background-size: 90%;
    background-color: rgba(0, 100, 0, 0.2);
    color: transparent;
    box-shadow: 0 0 60px rgba(0, 255, 0, 1.2),
                0 0 120px rgba(34, 139, 34, 0.8),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
    font-size: 45px; }
    @media screen and (max-width: 520px) {
      .tile.tile-256 .tile-inner {
        font-size: 25px; } }
  .tile.tile-512 .tile-inner {
    background: url('../jewels icon/Diamond-512.png') center center no-repeat;
    background-size: 90%;
    background-color: rgba(255, 255, 255, 0.1);
    color: transparent;
    box-shadow: 0 0 70px rgba(255, 255, 255, 1.5),
                0 0 140px rgba(173, 216, 230, 1.0),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    font-size: 45px; }
    @media screen and (max-width: 520px) {
      .tile.tile-512 .tile-inner {
        font-size: 25px; } }
  .tile.tile-1024 .tile-inner {
    background: url('../jewels icon/Fancy Diamond-1024.png') center center no-repeat;
    background-size: 90%;
    background-color: rgba(255, 215, 0, 0.2);
    color: transparent;
    box-shadow: 0 0 80px rgba(255, 215, 0, 1.8),
                0 0 160px rgba(255, 140, 0, 1.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.6);
    font-size: 35px; }
    @media screen and (max-width: 520px) {
      .tile.tile-1024 .tile-inner {
        font-size: 15px; } }
  .tile.tile-2048 .tile-inner {
    background: url('../jewels icon/Crown-2048.png') center center no-repeat;
    background-size: 90%;
    background-color: rgba(255, 215, 0, 0.3);
    color: transparent;
    box-shadow: 0 0 100px rgba(255, 215, 0, 2.0),
                0 0 200px rgba(255, 140, 0, 1.5),
                0 0 300px rgba(255, 69, 0, 1.0),
                inset 0 1px 0 rgba(255, 255, 255, 0.7);
    font-size: 35px;
    animation: mystical-glow 2s ease-in-out infinite; }
    @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);
    transform: scale(0); }

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

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

  100% {
    opacity: 1;
    -webkit-transform: scale(1);
    -moz-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);
    transform: scale(0); }

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

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

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

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

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

  100% {
    -webkit-transform: scale(1);
    -moz-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: linear-gradient(145deg, #2d1b69, #1a0f3d);
  border-radius: 8px;
  padding: 0 20px;
  text-decoration: none;
  color: #ffd700;
  height: 40px;
  line-height: 42px;
  display: block;
  text-align: center;
  float: right;
  font-family: "Cinzel", serif;
  font-weight: 600;
  border: 2px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease; }

.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: 8px 12px;
    min-width: 50px;
    font-size: 14px;
    height: 24px;
    line-height: 24px;
    background: linear-gradient(145deg, #2d1b69, #1a0f3d);
    border-radius: 6px;
    color: #ffd700;
    font-family: "Cinzel", serif;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 2px 8px rgba(138, 43, 226, 0.3), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    margin-right: 10px;
    flex-shrink: 0; }
    
  .score-container:after, .best-container:after {
    font-size: 10px;
    line-height: 10px;
    top: 6px; }

  .heading {
    margin-bottom: 10px; }
    
  .scores-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    margin-bottom: 10px;
    flex-shrink: 0; }

  .game-intro {
    display: none; }

  .restart-button {
    width: auto;
    min-width: 90px;
    padding: 8px 12px;
    display: inline-block;
    box-sizing: border-box;
    margin-top: 0;
    margin-left: 10px;
    font-size: 11px;
    height: 40px;
    line-height: 24px;
    background: linear-gradient(145deg, #2d1b69, #1a0f3d);
    border-radius: 6px;
    color: #ffd700;
    font-family: "Cinzel", serif;
    font-weight: 600;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 2px 8px rgba(138, 43, 226, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
    flex-shrink: 0; }

  .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: linear-gradient(145deg, #1a0f3d, #2d1b69);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(138, 43, 226, 0.4), 
                0 5px 15px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1),
                0 0 50px rgba(138, 43, 226, 0.2);
    width: 280px;
    height: 280px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    border: 2px solid rgba(255, 215, 0, 0.2);
    animation: mystical-glow 4s ease-in-out infinite; }
    .game-container .game-message {
      display: none;
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      background: rgba(26, 15, 61, 0.9);
      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;
      border-radius: 12px;
      border: 2px solid rgba(255, 215, 0, 0.3); }
      .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: linear-gradient(145deg, #2d1b69, #1a0f3d);
        border-radius: 8px;
        padding: 0 20px;
        text-decoration: none;
        color: #ffd700;
        height: 40px;
        line-height: 42px;
        margin-left: 9px;
        font-family: "Cinzel", serif;
        font-weight: 600;
        border: 2px solid rgba(255, 215, 0, 0.3);
        box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3),
                    inset 0 1px 0 rgba(255, 255, 255, 0.1); }
        .game-container .game-message a.keep-playing-button {
          display: none; }
      .game-container .game-message.game-won {
        background: rgba(255, 215, 0, 0.2);
        color: #ffd700; }
        .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;
    width: 260px;
    height: 260px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-columns: repeat(4, 57.5px);
    grid-template-rows: repeat(4, 57.5px);
    gap: 10px; }

  .grid-row {
    display: contents; }

  .grid-cell {
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(26, 15, 61, 0.6), rgba(45, 27, 105, 0.4));
    border: 1px solid rgba(255, 215, 0, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3),
                0 1px 2px rgba(138, 43, 226, 0.2); }

  .tile-container {
    position: absolute;
    z-index: 2;
    width: 260px;
    height: 260px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%); }

  .tile, .tile .tile-inner {
    width: 57.5px;
    height: 57.5px;
    line-height: 57.5px; }
  .tile.tile-position-1-1 {
    -webkit-transform: translate(0px, 0px);
    -moz-transform: translate(0px, 0px);
    transform: translate(0px, 0px); }
  .tile.tile-position-1-2 {
    -webkit-transform: translate(0px, 67.5px);
    -moz-transform: translate(0px, 67.5px);
    transform: translate(0px, 67.5px); }
  .tile.tile-position-1-3 {
    -webkit-transform: translate(0px, 135px);
    -moz-transform: translate(0px, 135px);
    transform: translate(0px, 135px); }
  .tile.tile-position-1-4 {
    -webkit-transform: translate(0px, 202.5px);
    -moz-transform: translate(0px, 202.5px);
    transform: translate(0px, 202.5px); }
  .tile.tile-position-2-1 {
    -webkit-transform: translate(67.5px, 0px);
    -moz-transform: translate(67.5px, 0px);
    transform: translate(67.5px, 0px); }
  .tile.tile-position-2-2 {
    -webkit-transform: translate(67.5px, 67.5px);
    -moz-transform: translate(67.5px, 67.5px);
    transform: translate(67.5px, 67.5px); }
  .tile.tile-position-2-3 {
    -webkit-transform: translate(67.5px, 135px);
    -moz-transform: translate(67.5px, 135px);
    transform: translate(67.5px, 135px); }
  .tile.tile-position-2-4 {
    -webkit-transform: translate(67.5px, 202.5px);
    -moz-transform: translate(67.5px, 202.5px);
    transform: translate(67.5px, 202.5px); }
  .tile.tile-position-3-1 {
    -webkit-transform: translate(135px, 0px);
    -moz-transform: translate(135px, 0px);
    transform: translate(135px, 0px); }
  .tile.tile-position-3-2 {
    -webkit-transform: translate(135px, 67.5px);
    -moz-transform: translate(135px, 67.5px);
    transform: translate(135px, 67.5px); }
  .tile.tile-position-3-3 {
    -webkit-transform: translate(135px, 135px);
    -moz-transform: translate(135px, 135px);
    transform: translate(135px, 135px); }
  .tile.tile-position-3-4 {
    -webkit-transform: translate(135px, 202.5px);
    -moz-transform: translate(135px, 202.5px);
    transform: translate(135px, 202.5px); }
  .tile.tile-position-4-1 {
    -webkit-transform: translate(202.5px, 0px);
    -moz-transform: translate(202.5px, 0px);
    transform: translate(202.5px, 0px); }
  .tile.tile-position-4-2 {
    -webkit-transform: translate(202.5px, 67.5px);
    -moz-transform: translate(202.5px, 67.5px);
    transform: translate(202.5px, 67.5px); }
  .tile.tile-position-4-3 {
    -webkit-transform: translate(202.5px, 135px);
    -moz-transform: translate(202.5px, 135px);
    transform: translate(202.5px, 135px); }
  .tile.tile-position-4-4 {
    -webkit-transform: translate(202.5px, 202.5px);
    -moz-transform: translate(202.5px, 202.5px);
    transform: translate(202.5px, 202.5px); }

  .tile .tile-inner {
    font-size: 35px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3),
                0 2px 8px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease; }

  .game-message p {
    font-size: 28px !important;
    height: auto !important;
    line-height: 32px !important;
    margin-top: 60px !important;
    color: #ffd700 !important;
    font-family: "Cinzel", serif !important;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5) !important;
    margin-bottom: 15px !important;
    text-align: center !important; }
  .game-message .game-over-title {
    font-size: 28px !important;
    font-weight: bold !important;
    display: block !important; }
  .game-message .game-over-subtitle {
    font-size: 16px !important;
    font-weight: normal !important;
    display: block !important;
    margin-top: 10px !important;
    line-height: 20px !important; }
  .game-message .lower {
    margin-top: 30px !important; } }
