* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Prevent zoom on double-click */
html,
body {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body {
  font-family: "Roboto Condensed", sans-serif;
  font-optical-sizing: auto;
  background: #1e293b;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e2e8f0;
  letter-spacing: 0.07em;
}

.container {
  background: #1e293b;
  border-radius: 20px;
  /* box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); */
  padding: 40px;
  max-width: 600px;
  width: 95%;
  text-align: center;
  /* border: 1px solid #334155; */
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #f1f5f9;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-family: "Playwrite AU QLD", cursive;
  font-optical-sizing: auto;
}

h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: #f1f5f9;
}

.game-description {
  font-size: 1.1rem;
  color: #cbd5e1;
  margin-bottom: 30px;
  line-height: 1.6;
  ul {
    list-style-type: none;
    li {
      margin-bottom: 10px;
      .highlight {
        color: #f87171;
        font-weight: bold;
        font-size: 1.5rem;
      }
    }
  }
}

.difficulty-selector {
  margin-bottom: 30px;
  text-align: center;
}

.difficulty-selector label {
  display: block;
  font-size: 1.1rem;
  color: #cbd5e1;
  margin-bottom: 15px;
  font-weight: 500;
}

.difficulty-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.difficulty-btn {
  background: #334155;
  color: #cbd5e1;
  border: 2px solid #475569;
  padding: 8px 16px;
  font-size: 0.9rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Roboto Condensed", sans-serif;
  font-optical-sizing: auto;
}

.difficulty-btn:hover {
  background: #475569;
  border-color: #64748b;
}

.difficulty-btn.active {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-color: #3b82f6;
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
  font-family: "Roboto Condensed", sans-serif;
  font-optical-sizing: auto;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.btn:active {
  transform: translateY(0);
}

.game-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px;
  background: #334155;
  border-radius: 15px;
  border: 1px solid #475569;
}

.timer,
.round {
  font-size: 1.1rem;
  font-weight: bold;
  color: #f1f5f9;
}

.timer {
  color: #f87171;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.timer-bar {
  width: 200px;
  height: 4px;
  background: #334155;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  margin: 0 auto 20px;
}

.timer-progress {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 2px;
  transition: width 0.1s linear;
  position: absolute;
  top: 0;
  left: 0;
}

.game-board {
  position: relative;
  width: 400px;
  height: 400px;
  margin: 0 auto 30px;
  overflow: visible;
  max-width: 400px;
  min-width: 400px;
}

.grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  background: #475569;
  padding: 0px;
  /* border-radius: 15px; */
  border: 2px solid #475569;
  transition: all 0.5s ease;
  transform: translateX(100%);
  opacity: 0;
}

.grid.active {
  transform: translateX(0);
  opacity: 1;
  /* border-color: #3b82f6;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); */
}

.grid.sliding-out {
  transform: translateX(-100%);
  opacity: 0;
}

.grid-number {
  position: absolute;
  bottom: -75px;
  left: 50%;
  transform: translateX(-50%);
  /* background: #3b82f6; */
  color: #b2b2ef;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 2rem;
  font-weight: bold;
  z-index: 10;
}

.cell {
  background: #1e293b;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  color: #f1f5f9;
  margin: 0;
  width: 100%;
  height: 100%;
}

.cell:hover {
  background: #475569;
  border-color: #3b82f6;
}

.cell.x {
  color: #f87171;
  background: #7f1d1d;
  border-color: #f87171;
}

.cell.o {
  color: #60a5fa;
  background: #1e3a8a;
  border-color: #60a5fa;
}

.cell.winning {
  background: #065f46;
  border-color: #10b981;
  color: #10b981;
  animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

#end-message {
  font-size: 1rem;
  margin-bottom: 30px;
  padding: 5px;
  /* border-radius: 15px; */
  font-weight: normal;
}

#end-message.win {
  color: #10b981;
  /* background: #064e3b; */
  /* border: 1px solid #10b981; */
}

#end-message.lose {
  color: #f87171;
  /* background: #7f1d1d; */
  /* border: 1px solid #f87171; */
}

.game-summary-info {
  margin-bottom: 20px;
  text-align: center;
}

.difficulty-display {
  display: inline-block;
  background: #334155;
  color: #cbd5e1;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid #475569;
}

.difficulty-display span:first-child {
  color: #94a3b8;
  margin-right: 5px;
}

.difficulty-display span:last-child {
  color: #f1f5f9;
  font-weight: bold;
}

.grid-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  justify-content: center;
  margin: 20px 0;
  padding: 5px;
  /* background: #334155; */
  /* border-radius: 15px; */
  /* border: 1px solid #475569; */
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 1px;
  width: 120px;
  height: 120px;
  background: #475569;
  padding: 0px;
  border-radius: 0px;
  border: 1px solid #475569;
  position: relative;
}

.summary-grid::before {
  content: attr(data-grid-number);
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  /* background: #3b82f6; */
  color: white;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: bold;
  z-index: 10;
}

.summary-cell {
  background: #1e293b;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
  user-select: none;
  position: relative;
  color: #f1f5f9;
  margin: 0;
  width: 100%;
  height: 100%;
}

.summary-cell.x {
  color: #f87171;
  background: #7f1d1d;
  border-color: #f87171;
}

.summary-cell.o {
  color: #60a5fa;
  background: #1e3a8a;
  border-color: #60a5fa;
}

.summary-cell.o.winning {
  background: #065f46;
  border-color: #10b981;
  color: #10b981;
}

.summary-cell.o.winning::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: #f87171;
  transform: translateY(-50%);
  z-index: 5;
}

.summary-cell.o.winning::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #f87171;
  transform: translateX(-50%);
  z-index: 5;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 20px;
    width: 95%;
    max-width: 400px;
  }

  h1 {
    font-size: 2rem;
  }

  .game-header {
    flex-direction: column;
    gap: 10px;
  }

  .game-board {
    width: 400px;
    height: 340px;
    max-width: 400px;
    min-width: 400px;
  }

  .cell {
    font-size: 2.8rem;
  }
}

@media (max-width: 480px) {
  .container {
    max-width: 400px;
  }

  .game-board {
    width: 400px;
    height: 280px;
    max-width: 400px;
    min-width: 400px;
  }

  .cell {
    font-size: 2.2rem;
  }
}

@media (max-width: 450px) {
  .container {
    padding: 15px;
    max-width: 100%;
    width: 100%;
  }

  .game-board {
    width: 200px;
    height: 240px;
    max-width: 200px;
    min-width: 200px;
  }

  .cell {
    font-size: 1.8rem;
  }

  .game-header {
    flex-direction: column;
    gap: 5px;
  }

  .timer,
  .round {
    font-size: 0.9rem;
  }
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Quicksand", sans-serif;
  background: #222f3d;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
}

button {
  font-family: "Quicksand", sans-serif;
}

.game-container {
  text-align: center;
  background: #222f3d;
  padding: 10px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
}

.game-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-header h1 {
  font-size: 1.5rem;
  font-weight: normal;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 0px;
}

.game-instructions {
  color: #999;
}

.game-info {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.2rem;
  font-weight: normal;
  margin-top: 10px;
}

#gameCanvas {
  border: 3px solid #293847;
  border-radius: 10px;
  background: #2c3e50;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
}

.game-controls {
  margin-top: 10px;
  font-size: 1.1rem;
}

.game-controls p {
  margin: 5px 0;
}

.difficulty-buttons {
  display: flex;
  justify-content: center;
  gap: 5px 10px;
  margin-bottom: 20px;
}

.difficulty-btn {
  padding: 5px 15px;
  font-size: 1rem;
  /* background: linear-gradient(45deg, #95a5a6, #7f8c8d); */
  border: 1px solid #999;
  background: transparent;
  color: #999;
  /* border: none; */
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.difficulty-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.difficulty-btn.active {
  background: linear-gradient(45deg, #2b2929, #1b1c1b);
  /* box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4); */
  color: white;
}

.game-over {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.game-over h2 {
  font-size: 3rem;
  margin-bottom: 20px;
  color: #e74c3c;
}

.game-over p {
  font-size: 1.5rem;
  margin-bottom: 30px;
}

#restart-btn {
  padding: 15px 30px;
  font-size: 1.2rem;
  background: linear-gradient(45deg, #3498db, #2980b9);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

#restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.hidden {
  display: none !important;
}

.lane-change-btn {
  margin-top: 20px;
  padding: 12px 28px;
  font-size: 1.1rem;
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.1s, transform 0.1s;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.lane-change-btn:hover {
  background: linear-gradient(45deg, #764ba2, #667eea);
  transform: translateY(-2px);
}
.lane-change-btn:active {
  transform: translateY(0px);
  transition: transform 0.05s;
}

@media (max-width: 768px) {
  .game-container {
    padding: 15px;
    margin: 10px;
  }

  .game-header h1 {
    font-size: 2rem;
  }

  #gameCanvas {
    width: 100%;
    max-width: 400px;
    /* height: auto; */
    height: 500px;
  }
}

/* Desktop styles - limit max width to 400px */
@media (min-width: 769px) {
  .game-container {
    max-width: 600px;
    margin: 0 auto;
  }

  #gameCanvas {
    max-width: 600px;
    width: 100%;
    height: 500px;
  }
}
/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base styles */
body {
  font-family: "Arial", sans-serif;
  background: #1a1c1f;
  color: #fff;
  overflow: hidden;
  height: 100vh;
}

.game-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  position: relative;
  touch-action: manipulation;
}

.game-area {
  flex: 1;
  width: 100%;
  max-width: 500px;
  position: relative;
  overflow: visible;
}

/* Sword base container */
.sword-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0;
}

/* Base mask to create semicircle */
.base-mask {
  width: 300px;
  height: 150px;
  overflow: visible;
  position: relative;
  border-radius: 150px 150px 0 0;
  background: rgba(0, 0, 0, 0.1);
  margin: 0;
  padding: 0;
  z-index: 1;
}

/* Rotating base */
.sword-base {
  width: 300px;
  height: 300px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(45deg, #2c3e50, #34495e);
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.3s ease;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
  overflow: visible;
  z-index: 1;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  transform-origin: center center;
}

/* Decorative curves around the circumference */
.sword-base::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #4a5568 0deg,
    #2d3748 30deg,
    #4a5568 60deg,
    #2d3748 90deg,
    #4a5568 120deg,
    #2d3748 150deg,
    #4a5568 180deg,
    #2d3748 210deg,
    #4a5568 240deg,
    #2d3748 270deg,
    #4a5568 300deg,
    #2d3748 330deg,
    #4a5568 360deg
  );
  z-index: 0;
  opacity: 1;
}

/* Sword blade */
.sword-blade {
  position: absolute;
  left: 50%;
  top: -150px;
  width: 12px;
  height: 150px;
  background: linear-gradient(
    to right,
    transparent 0%,
    #95a5a6 40%,
    #ffffff 50%,
    #95a5a6 60%,
    transparent 100%
  );
  transform: translateX(-50%);
  transform-origin: center bottom;
  z-index: 20;
  clip-path: path(
    "M6,150 L12,140 C12,140 12,40 10,30 C8,20 6,10 6,0 C6,10 4,20 2,30 C0,40 0,140 0,140 L6,150"
  );
}

/* Blade edge highlight */
.sword-blade::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    transparent 45%,
    rgba(255, 255, 255, 0.8) 48%,
    rgba(255, 255, 255, 0.9) 50%,
    rgba(255, 255, 255, 0.8) 52%,
    transparent 55%
  );
  z-index: 22;
}

/* Remove the old curved edge */
.sword-blade::after {
  display: none;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Arial", sans-serif;
  background: #1a1c1f;
  color: #fff;
  overflow: hidden;
  height: 100vh;
}

.game-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  position: relative;
  /* Prevent double-tap zoom */
  touch-action: manipulation;
}

/* UI Top */
.ui-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 800px;
  font-size: 18px;

  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  position: relative;
}

.score {
  padding: 10px;

  font-weight: bold;
  font-size: 24px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #464343;
}

#score {
  color: #4ecdc4;
}

/* Mute Button */
.mute-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: #fff;
  position: relative;
  backdrop-filter: blur(10px);
}

.mute-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.mute-btn:active {
  transform: scale(0.95);
}

.mute-btn.muted {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.5);
  color: #ff6b6b;
}

.mute-btn.muted:hover {
  background: rgba(255, 107, 107, 0.3);
  border-color: rgba(255, 107, 107, 0.7);
}

.sound-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
}

/* Add X slash for muted state */
.mute-btn.muted .sound-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 2px;
  background: #ff6b6b;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 1px;
}

/* Game Area */
.game-area {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  overflow: visible;
  padding-top: 20px;
  position: relative;
}

/* Score Line */
.score-line {
  position: absolute;
  top: 25%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #555555 20%,
    #333333 50%,
    #555555 80%,
    transparent 100%
  );
  transform: translateY(-50%);
  z-index: 1;
  box-shadow: 0 0 10px rgba(85, 85, 85, 0.5);
}

.score-line::before {
  content: "2 PTS";
  position: absolute;
  top: -25px;
  left: 10px;
  font-size: 12px;
  font-weight: bold;
  color: #4ecdc4;
  text-shadow: 0 0 5px rgba(78, 205, 196, 0.8);
  transition: all 0.3s ease;
}

.score-line::after {
  content: "1 PT";
  position: absolute;
  bottom: -25px;
  left: 10px;
  font-size: 12px;
  font-weight: bold;
  color: #ffa726;
  text-shadow: 0 0 5px rgba(255, 167, 38, 0.8);
  transition: all 0.3s ease;
}

/* Highlight animations for scoring */
.score-line.highlight-2pts::before {
  color: #00ffff;
  text-shadow: 0 0 15px rgba(0, 255, 255, 1), 0 0 25px rgba(78, 205, 196, 0.8);
  transform: scale(1.3);
  font-weight: 900;
}

.score-line.highlight-1pt::after {
  color: #ff9500;
  text-shadow: 0 0 15px rgba(255, 149, 0, 1), 0 0 25px rgba(255, 167, 38, 0.8);
  transform: scale(1.3);
  font-weight: 900;
}

/* Coin System */
.coin {
  position: absolute;
  width: 60px;
  height: 60px;
  left: 50%;
  bottom: -200px;
  transform: translateX(-50%);
  transform-style: preserve-3d;
  transition: transform 0.1s ease;
  z-index: 0;
}

.coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid #b8860b;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
}

.coin-front {
  background: linear-gradient(
    135deg,
    #ffd700 0%,
    #ffed4e 25%,
    #ffc107 50%,
    #ff8f00 75%,
    #ff6f00 100%
  );
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.3), 0 4px 8px rgba(0, 0, 0, 0.2);
}

.coin-back {
  background: linear-gradient(
    135deg,
    #c9b037 0%,
    #b8860b 25%,
    #daa520 50%,
    #b8860b 75%,
    #8b6914 100%
  );
  transform: rotateY(180deg);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.2), 0 4px 8px rgba(0, 0, 0, 0.2);
}

.coin-bullet-shape {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Coin Flip Animation */
@keyframes coinFlip {
  0% {
    bottom: -200px;
    left: 50%;
    transform: translateX(-50%) rotateX(0deg);
    opacity: 1;
  }
  10% {
    bottom: 40%;
    left: 50%;
    transform: translateX(-50%) rotateX(720deg);
    opacity: 1;
  }
  20% {
    bottom: 70%;
    left: 50%;
    transform: translateX(-50%) rotateX(1440deg);
    opacity: 1;
  }
  30% {
    bottom: 85%;
    left: 50%;
    transform: translateX(-50%) rotateX(2160deg);
    opacity: 1;
  }
  50% {
    bottom: 90%;
    left: 50%;
    transform: translateX(-50%) rotateX(3600deg);
    opacity: 1;
  }
  100% {
    bottom: -200px;
    left: 50%;
    transform: translateX(-50%) rotateX(3600deg);
    opacity: 1;
  }
}

.coin.flipping {
  animation: coinFlip 7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Coin Break Animation - Success */
@keyframes coinBreak {
  0% {
    transform: translateX(-50%) scale(1) rotateY(0deg);
    opacity: 1;
  }
  50% {
    transform: translateX(-50%) scale(1.4) rotateY(180deg);
    opacity: 0.8;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
  }
  100% {
    transform: translateX(-50%) scale(0.1) rotateY(360deg);
    opacity: 0;
  }
}

.coin.breaking {
  animation: coinBreak 0.6s ease-out forwards;
}

/* Revolver Container */
.revolver-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0;
}

.cylinder-mask {
  width: 400px;
  height: 200px;
  overflow: hidden;
  position: relative;
  border-radius: 200px 200px 0 0;
  background: rgba(0, 0, 0, 0.1);
  margin: 0;
  padding: 0;
}

.cylinder {
  width: 400px;
  height: 400px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(45deg, #2c3e50, #34495e);
  position: absolute;
  top: 0;
  left: 0;
  cursor: grab;
  transition: transform 0.3s ease;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
  overflow: visible;
  z-index: 1;
  /* Hardware acceleration for smoother mobile performance */
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  /* Optimize for smooth rotation */
  transform-origin: center center;
  image-rendering: optimizeSpeed;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: optimize-contrast;
  /* Prevent double-tap zoom */
  touch-action: manipulation;
}

/* Add decorative curves around the circumference */
.cylinder::before {
  content: "";
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #4a5568 0deg,
    #2d3748 30deg,
    #4a5568 60deg,
    #2d3748 90deg,
    #4a5568 120deg,
    #2d3748 150deg,
    #4a5568 180deg,
    #2d3748 210deg,
    #4a5568 240deg,
    #2d3748 270deg,
    #4a5568 300deg,
    #2d3748 330deg,
    #4a5568 360deg
  );
  z-index: 0;
  opacity: 1;
  will-change: transform;
}

/* Add inner decorative ring with notches */
.cylinder::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border-radius: 50%;
  border: 2px solid #718096;
  background: repeating-conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 28deg,
    #718096 29deg,
    #718096 31deg,
    transparent 32deg,
    transparent 60deg
  );
  z-index: 3;
  pointer-events: none;
  opacity: 1;
  will-change: transform;
}

/* Add radial grooves for more detail */
.cylinder-grooves {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    transparent 35%,
    rgba(113, 128, 150, 0.3) 36%,
    rgba(113, 128, 150, 0.3) 37%,
    transparent 38%,
    transparent 42%,
    rgba(113, 128, 150, 0.2) 43%,
    rgba(113, 128, 150, 0.2) 44%,
    transparent 45%
  );
  pointer-events: none;
  z-index: 4;
}

.cylinder:active {
  cursor: grabbing;
}

.chamber {
  position: absolute;
  width: 80px;
  height: 80px;
  border: 4px solid #2d3748;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    #f4e4a6 0%,
    #d4af37 25%,
    #b8941f 50%,
    #9c7a1a 75%,
    #7d6118 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  opacity: 1;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 2px rgba(255, 215, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  /* Hardware acceleration for smoother mobile performance */
  transform: translateZ(0);
  backface-visibility: hidden;
  /* Optimize for smooth rotation */
  transform-origin: center center;
  image-rendering: optimizeSpeed;
}

/* Chamber positions - using precise trigonometry for perfect equal spacing */
/* Center of cylinder: (200px, 200px), Radius: 130px, Chamber size: 80px */
/* 6 chambers at exactly 60° intervals starting from top: 0°, 60°, 120°, 180°, 240°, 300° */
.chamber-0 {
  top: 30px; /* 200 - 130*cos(0°) - 40 = 200 - 130 - 40 = 30px (TOP) */
  left: 160px; /* 200 + 130*sin(0°) - 40 = 200 + 0 - 40 = 160px */
}
.chamber-1 {
  top: 95px; /* 200 - 130*cos(60°) - 40 = 200 - 65 - 40 = 95px */
  left: 273px; /* 200 + 130*sin(60°) - 40 = 200 + 112.6 - 40 = 273px */
}
.chamber-2 {
  top: 225px; /* 200 - 130*cos(120°) - 40 = 200 - (-65) - 40 = 225px */
  left: 273px; /* 200 + 130*sin(120°) - 40 = 200 + 112.6 - 40 = 273px */
}
.chamber-3 {
  top: 290px; /* 200 - 130*cos(180°) - 40 = 200 - (-130) - 40 = 290px (BOTTOM) */
  left: 160px; /* 200 + 130*sin(180°) - 40 = 200 + 0 - 40 = 160px */
}
.chamber-4 {
  top: 225px; /* 200 - 130*cos(240°) - 40 = 200 - (-65) - 40 = 225px */
  left: 47px; /* 200 + 130*sin(240°) - 40 = 200 + (-112.6) - 40 = 47px */
}
.chamber-5 {
  top: 95px; /* 200 - 130*cos(300°) - 40 = 200 - 65 - 40 = 95px */
  left: 47px; /* 200 + 130*sin(300°) - 40 = 200 + (-112.6) - 40 = 47px */
}

/* Bullet Shapes - SVG based */
.bullet-shape {
  width: 25px;
  height: 25px;
  transition: all 0.3s ease;
  color: #d4af37; /* Bright brass/gold color */
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3))
    drop-shadow(0 0 4px rgba(212, 175, 55, 0.4));
}

.bullet-shape.circle {
}

.bullet-shape.square {
}

.bullet-shape.triangle {
  margin-top: -8px;
}

.bullet-shape.star {
}

.bullet-shape.heart {
}

.bullet-shape.cross {
}

/* Trigger */
.trigger-container {
  position: absolute;
  top: 120px; /* Moved lower from 100px */
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
}

.trigger {
  width: 90px;
  height: 90px;
  font-size: 16px;
  font-weight: bold;
  background: linear-gradient(
    135deg,
    #e8e8e8 0%,
    #c0c0c0 25%,
    #a8a8a8 50%,
    #808080 75%,
    #696969 100%
  );
  color: #2c3e50;
  border: none !important;
  outline: none !important;
  border-radius: 50%; /* Make it perfectly circular */
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4),
    inset 0 1px 3px rgba(255, 255, 255, 0.3),
    inset 0 -1px 3px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
  /* Prevent double-tap zoom */
  touch-action: manipulation;
}

.trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5),
    inset 0 1px 3px rgba(255, 255, 255, 0.4),
    inset 0 -1px 3px rgba(0, 0, 0, 0.3);
  background: linear-gradient(
    135deg,
    #f0f0f0 0%,
    #d0d0d0 25%,
    #b8b8b8 50%,
    #909090 75%,
    #787878 100%
  );
}

.trigger:active {
  transform: translateY(0);
}

/* Game Over Screen */
.game-over {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.game-over h2 {
  font-size: 48px;
  margin-bottom: 20px;
  color: #ff6b6b;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-over p {
  font-size: 24px;
  margin-bottom: 30px;
}

.restart-btn {
  padding: 15px 30px;
  font-size: 20px;
  font-weight: bold;
  background: linear-gradient(45deg, #1abc9c, #16a085);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(26, 188, 156, 0.4);
  transition: all 0.3s ease;
}

.restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 188, 156, 0.6);
}

/* Animations */
@keyframes shoot {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(0);
    opacity: 0;
  }
}

@keyframes hit {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
    background: #ffd700;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes miss {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
  100% {
    transform: translateX(0);
  }
}

.shoot-animation {
  animation: shoot 0.5s ease-out forwards;
}

.hit-animation {
  animation: hit 0.5s ease-out;
}

.miss-animation {
  animation: miss 0.5s ease-out;
}

/* Special handling for triangle shape which has margin-top */
.bullet-shape.triangle {
  transition: none !important;
  transform-origin: center center !important;
  margin-top: -8px !important; /* Maintain the triangle positioning */
}

/* Responsive Design */
@media (max-width: 768px) {
  .cylinder-mask {
    width: 320px;
    height: 160px;
    border-radius: 160px 160px 0 0;
    margin: 0;
    padding: 0;
  }

  .cylinder {
    width: 320px;
    height: 320px;
    top: 0;
    left: 0;
  }

  .chamber {
    width: 60px;
    height: 60px;
    border: 3px solid #2d3748;
  }

  /* Precise trigonometry for mobile - Center: (160px, 160px), Radius: 112px */
  /* 6 chambers at exactly 60° intervals: 0°, 60°, 120°, 180°, 240°, 300° */
  .chamber-0 {
    top: 23px; /* 160 - 112*cos(0°) - 25 = 160 - 112 - 25 = 23px */
    left: 135px; /* 160 + 112*sin(0°) - 25 = 160 + 0 - 25 = 135px */
  }
  .chamber-1 {
    top: 79px; /* 160 - 112*cos(60°) - 25 = 160 - 56 - 25 = 79px */
    left: 232px; /* 160 + 112*sin(60°) - 25 = 160 + 97 - 25 = 232px */
  }
  .chamber-2 {
    top: 191px; /* 160 - 112*cos(120°) - 25 = 160 - (-56) - 25 = 191px */
    left: 232px; /* 160 + 112*sin(120°) - 25 = 160 + 97 - 25 = 232px */
  }
  .chamber-3 {
    top: 247px; /* 160 - 112*cos(180°) - 25 = 160 - (-112) - 25 = 247px */
    left: 135px; /* 160 + 112*sin(180°) - 25 = 160 + 0 - 25 = 135px */
  }
  .chamber-4 {
    top: 191px; /* 160 - 112*cos(240°) - 25 = 160 - (-56) - 25 = 191px */
    left: 38px; /* 160 + 112*sin(240°) - 25 = 160 + (-97) - 25 = 38px */
  }
  .chamber-5 {
    top: 79px; /* 160 - 112*cos(300°) - 25 = 160 - 56 - 25 = 79px */
    left: 38px; /* 160 + 112*sin(300°) - 25 = 160 + (-97) - 25 = 38px */
  }

  .bullet-shape {
    width: 22px;
    height: 22px;
  }

  .trigger-container {
    top: 100px; /* Moved lower for mobile as well */
  }

  .ui-top {
    font-size: 20px;
  }

  /* Mobile decorative elements */
  .cylinder::before {
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
  }

  .cylinder::after {
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border-width: 1px;
  }
}

/* Chamber Arrow Indicator */
.chamber-arrow {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid #a7a9a2;
  z-index: 15;
  /* filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); */
}

/* Background Coins Display */
.coins-bg-display {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 120px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.05);
  z-index: 0;
  pointer-events: none;
  font-family: "Arial", sans-serif;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background-color: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.game-container {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  padding: 20px;
  width: 90%;
  max-width: 600px;
  text-align: center;
}

.game-info {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
}

h1 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.timer {
  font-size: 1.2rem;
  font-weight: bold;
  color: #555;
  margin-bottom: 10px;
}

.instructions {
  color: #666;
  margin-bottom: 15px;
}

.game-area {
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.controls {
  margin-top: 20px;
}

.red-text {
  color: #FF4081;
}

.green-text {
  color: #4CAF50;
}

button {
  background-color: #4CAF50;
  border: none;
  color: white;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 10px 2px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #45a049;
}

.control-info {
  color: #777;
  font-size: 0.9em;
  margin-bottom: 10px;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 20px;
  border-radius: 10px;
  width: 80%;
  max-width: 400px;
  text-align: left;

  .instructions {
      padding: 15px 0px;
      p {
          margin: 15px 0px;
      }
  }
}

#gameOverMessage {
  margin-bottom: 15px;
  color: #333;
}

#gameOverReason {
  margin-bottom: 20px;
  color: #555;
}

/* For mobile devices */
@media (max-width: 600px) {
  .game-container {
      width: 95%;
      padding: 15px;
  }
  
  .game-area {
      max-width: 300px;
  }
  
  button {
      padding: 8px 16px;
      font-size: 14px;
  }
}
:root {
  --purple-color: #9c27b0;
  --yellow-color: #ffeb3b;
  --red-color: #f5f5f5;   
  --bg-color: #222;
  --border-color: #333;
 }
     
 body {
     margin: 0;
     padding: 0;
     display: flex;
     justify-content: center;
     align-items: center;
     min-height: 100vh;
     background-color: var(--bg-color);
     font-family: Arial, sans-serif;
     color: white;
 }
 
 .game-wrapper {
     position: relative;
     width: 80%;
     max-width: 800px;
     padding-top: 50px;
 
     @media (max-width: 768px) {
         width: 95%;
     }
 }
 
 .timer-container {
     position: absolute;
     top: 0;
     right: 0;
     z-index: 10;
 }
 
 .timer {
     background-color: #333;
     color: #7e7e7e;
     padding: 8px 15px;
     border-radius: 5px;
     font-size: 18px;
     font-weight: bold;
     box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
 }
 
 .game-container {
     position: relative;
     width: 100%;
     height: 600px;
     background-color: #000;
     border-radius: 10px;
     overflow: hidden;
     box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);

     @media (max-width: 768px) {
        height: 500px;
    }
 }
 
 #gameCanvas {
     width: 100%;
     height: 100%;
     display: block;
 }
 
 .controls-outer {
     position: fixed;
     bottom: 20px;
     left: 0;
     right: 0;
     display: flex;
     justify-content: center;
     z-index: 100;
 }
 
 /* Button layout styles */
 .thread-controls {
     display: flex;
     justify-content: center;
 }
 
 #startButton {
     padding: 10px 20px;
     background-color: #4CAF50;
     color: white;
     border: none;
     border-radius: 5px;
     cursor: pointer;
     font-size: 16px;
     transition: background-color 0.3s;
 }
 
 #startButton:hover {
     background-color: #45a049;
 }
 
 .score {
     color: white;
     font-size: 18px;
     font-weight: bold;
 }
 
 .thread-controls {
     display: flex;
     margin-top: 10px;
 }
 
 .control-columns {
     display: flex;
     gap: 40px;
     @media (max-width: 768px) {
         justify-content: space-between;
     }
 }
 
 .purple-controls, .yellow-controls {
     display: flex;
     flex-direction: row;
     gap: 20px;
 }
 
 .purple-btn, .yellow-btn {
     padding: 15px;
     border: none;
     border-radius: 10px;
     font-weight: normal;
     cursor: pointer;
     transition: all 0.3s ease;
     font-size: 28px;
     width: 80px;
     height: 80px;
     display: flex;
     justify-content: center;
     align-items: center;
     box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
     background-color: transparent;
     border: 2px solid var(--border-color);
 }
 
 .purple-btn {
     color: var(--purple-color);
 }
 
 .purple-btn:hover {
     box-shadow: 0 0 15px rgba(156, 39, 176, 0.8);
     transform: translateY(-3px);
 }
 
 .purple-btn:active {
     transform: translateY(1px);
     box-shadow: 0 0 5px rgba(156, 39, 176, 0.6);
 }
 
 .yellow-btn {
     color: var(--yellow-color);
 }
 
 .yellow-btn:hover {
     box-shadow: 0 0 15px rgba(255, 235, 59, 0.8);
     transform: translateY(-3px);
 }
 
 .yellow-btn:active {
     transform: translateY(1px);
     box-shadow: 0 0 5px rgba(255, 235, 59, 0.6);
 }
 
 /* Modal Styles */
 .modal {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(0, 0, 0, 0.8);
     display: flex;
     justify-content: center;
     align-items: center;
     z-index: 1000;
 }
 
 .modal-content {
     background-color: #333;
     padding: 30px;
     border-radius: 10px;
     text-align: center;
     max-width: 500px;
     box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
     color: white;
 }
 
 .modal-content h2 {
     font-size: 36px;
     margin-bottom: 15px;
     color: #fff;
     text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
 }
 
 .modal-content p {
     margin-bottom: 15px;
     font-size: 18px;
     line-height: 1.5;
 }
 
 .instructions {
     background-color: #222;
     padding: 15px;
     border-radius: 8px;
     margin: 20px 0;
     text-align: left;
 }
 
 .purple-text {
     color: #9c27b0;
     font-weight: bold;
 }
 
 .yellow-text {
     color: #ffeb3b;
     font-weight: bold;
 }
 
 .red-text {
     color: #d81212;
     font-weight: bold;
 }
 
 .start-btn, .restart-btn {
     padding: 12px 30px;
     color: white;
     border: none;
     border-radius: 5px;
     cursor: pointer;
     font-size: 18px;
     font-weight: bold;
     transition: all 0.3s ease;
     margin-top: 10px;
 }
 
 .start-btn {
     background-color: #4CAF50;
 }
 
 .start-btn:hover {
     background-color: #45a049;
     box-shadow: 0 0 15px rgba(76, 175, 80, 0.7);
     transform: scale(1.05);
 }
 
 .restart-btn {
     background-color: #f44336;
 }
 
 .restart-btn:hover {
     background-color: #d32f2f;
     box-shadow: 0 0 15px rgba(244, 67, 54, 0.7);
     transform: scale(1.05);
 }
 
 .final-score {
     font-size: 28px;
     font-weight: bold;
     color: #ff9800;
     display: block;
     margin: 10px 0;
     text-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
 }
 
 .score-display {
     background-color: #222;
     padding: 15px;
     border-radius: 8px;
     margin: 20px 0;
 }
 
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --text-color: #ffffff;
  --text-grey: #9a9aa5;

  --primary-color: #674fc9;
  --secondary-color: #6751be;
}

/* Prevent zoom on double-click */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

input,
textarea,
select {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px; /* Prevents zoom on iOS */
  touch-action: manipulation;
}

/* Prevent double-tap zoom on buttons */
button {
  touch-action: manipulation;
}

/* Prevent double-tap zoom on letter boxes */
.letter-box {
  touch-action: manipulation;
}

/* Additional mobile input optimizations */
.letter-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 0;
}

/* Prevent iOS Safari from adding rounded corners to inputs */
.letter-input {
  -webkit-border-radius: 0;
  border-radius: 0;
}

/* Token Spending Animations */
@keyframes tokenSpend {
  0% {
    transform: scale(1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  }
}

@keyframes letterReveal {
  0% {
    transform: scale(0.8);
    opacity: 0;
    background: #f0f0f0;
  }
  50% {
    transform: scale(1.1);
    background: #34495e;
  }
  100% {
    transform: scale(1.05);
    opacity: 1;
    background: #34495e;
  }
}

@keyframes tokenGlow {
  0% {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 5px 25px rgba(103, 79, 201, 0.6),
      0 0 20px rgba(103, 79, 201, 0.4);
  }
  100% {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  }
}

@keyframes particleFloat {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-20px) scale(0);
    opacity: 0;
  }
}

@keyframes tokenBounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Token button animation classes */
.token-btn.spending {
  animation: tokenSpend 0.6s ease-in-out;
}

.token-btn.glowing {
  animation: tokenGlow 0.8s ease-in-out;
}

.token-btn.bouncing {
  animation: tokenBounce 0.8s ease-in-out;
}

/* Letter reveal animation */
.letter-box.revealing {
  animation: letterReveal 0.8s ease-out;
}

/* Particle effect */
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #674fc9;
  border-radius: 50%;
  pointer-events: none;
  animation: particleFloat 1s ease-out forwards;
}

/* Token counter animation */
@keyframes counterPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
    color: #674fc9;
  }
  100% {
    transform: scale(1);
  }
}

.counter-pulse {
  animation: counterPulse 0.6s ease-in-out;
}

/* Success animation for correct reveals */
@keyframes successGlow {
  0% {
    box-shadow: 0 0 0 rgba(76, 175, 80, 0);
  }
  50% {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
  }
  100% {
    box-shadow: 0 0 0 rgba(76, 175, 80, 0);
  }
}

.letter-box.success-glow {
  animation: successGlow 0.8s ease-in-out;
}

body {
  font-family: "Inter", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1b2733 0%, #2c3e50 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  min-width: 400px;
  max-width: 500px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 300px; /* Add space for fixed bottom section */
}

header {
  text-align: center;
  margin-bottom: 10px;
  color: white;
}

header h1 {
  font-size: 1.25rem;
  margin-bottom: 5px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
  font-size: 0.9rem;
  color: var(--text-grey);
}

.game-stats {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin-bottom: 20px;
}

.stat {
  text-align: center;
  min-width: 100px;
}

.label {
  display: block;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 5px;
  font-size: 0.8rem;
  opacity: 0.9;
}

.value {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-color);
}

.word-display {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  padding: 20px 0px;
  border-radius: 15px;
}

.total-used-tokens {
  text-align: center;
  color: #ffd700;
}

.submit-section {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  align-items: center;
  gap: 10px;
}

.submit-section .value {
  font-size: 1rem;
  font-weight: normal;
}

.submit-section .btn {
  /* min-width: 150px; */
  padding: 10px 20px;
  font-size: 1.1rem;
}

.word-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.letter-box {
  width: 60px;
  height: 60px;
  border: 3px solid #34495e;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: bold;
  background: white;
  color: #333;
  transition: all 0.3s ease;
}

.letter-box.revealed {
  background: #34495e;
  color: white;
  transform: scale(1.05);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.revealed-letter {
  font-size: 1.8rem;
  font-weight: bold;
  line-height: 1;
}

.token-value {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.6rem;
  font-weight: bold;
  color: #ffd700;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.letter-box.hidden {
  background: #f0f0f0;
  color: transparent;
}

.letter-input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 30px; /* Prevents zoom on mobile */
  font-weight: bold;
  color: #333;
  outline: none;
  text-transform: uppercase;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.letter-input:focus {
  background: rgba(52, 73, 94, 0.1);
}

.letter-input:disabled {
  background: #f0f0f0;
  color: #999;
  cursor: not-allowed;
  border: 2px dashed #ccc;
}

.letter-input.revealed {
  background: #34495e;
  color: white;
  font-weight: bold;
}

.bottom-section {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  /* background: linear-gradient(135deg, #1b2733 0%, #2c3e50 100%); */
  padding: 20px;
  z-index: 1000;
  /* box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3); */
  max-width: 500px;
  margin: 0 auto;
}

.token-trading {
  /* background: rgba(255, 255, 255, 0.95); */
  padding: 15px;
  border-radius: 15px;
  margin-bottom: 10px;
  color: #9a9aa5;
  margin-bottom: 15px; /* Space before game controls */
}

.token-trading .value {
  font-weight: normal;
  color: #ffd700;
  font-size: 1rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 5px 10px;
}

.token-trading h3 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--text-grey);
  font-size: 0.9rem;
  font-weight: 400;
}

.token-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.token-btn {
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(45deg, #2c3e50, #34495e);
  color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.token-text {
  font-size: 1.5rem;
}

.letters-text {
  font-size: 0.8rem;
  font-weight: normal;
  opacity: 0.9;
}

.token-btn:hover {
  transform: translateY(-2px);
}

.token-btn:disabled,
.token-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(100%);
  display: none;
}

.token-btn {
  color: white;
}

.game-controls {
  display: none;
  justify-content: center;
  gap: 20px;
  margin-bottom: 0; /* Remove bottom margin since it's in fixed section */
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: linear-gradient(45deg, #6257dc, #373abf);
  color: white;
}

.btn-secondary {
  background: linear-gradient(45deg, #5d6d7e, #85929e);
  color: white;
}

.btn-success {
  color: #ffd700;
  background: rgba(0, 0, 0, 0.3);
}

.btn-success.success {
  background: linear-gradient(45deg, #4caf50, #45a049);
  color: white;
  font-weight: bold;
  animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.message {
  text-align: center;
  padding: 5px;
  margin-bottom: 30px;
  border-radius: 5px;
  font-weight: normal;
  min-height: 20px;
  color: white;
}

.message.success {
  background: rgba(76, 175, 80, 1);
}

.message.error {
  background: rgba(244, 67, 54, 1);
}

.message.info {
  background: rgba(33, 150, 243, 1);
}

.rules {
  background: rgba(255, 255, 255, 0.95);
  padding: 25px;
  border-radius: 15px;
}

.rules h3 {
  margin-bottom: 15px;
  color: #333;
}

.rules ul {
  list-style: none;
  padding-left: 0;
}

.rules li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  position: relative;
  padding-left: 25px;
}

.rules li:before {
  content: "•";
  color: #34495e;
  font-weight: bold;
  position: absolute;
  left: 0;
}

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

.virtual-keyboard {
  background: #000000;
  padding: 10px;
  border-radius: 15px;
  margin: 5px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  margin-bottom: 5px; /* Add space before token trading section */
  margin-top: 25px;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 5px;
}

.keyboard-row:last-child {
  margin-bottom: 0;
}

.key {
  width: 40px;
  height: 50px;
  background: #333333;
  color: white;
  border: 1px solid #000000;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  touch-action: manipulation;
}

.key:hover {
  background: #444444;
  transform: scale(1.05);
}

.key:active {
  background: #555555;
  transform: scale(0.95);
}

.key.special-key {
  width: 60px;
  font-size: 0.8rem;
}

.key.special-key[data-key="BACKSPACE"] {
  width: 60px;
}

.key.special-key[data-key="BACKSPACE"] svg {
  width: 16px;
  height: 16px;
}

.key.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.help-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-color);
}

.help-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.help-icon svg {
  width: 20px;
  height: 20px;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: linear-gradient(135deg, #1b2733 0%, #2c3e50 100%);
  margin: 5% auto;
  padding: 0;
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
  color: var(--text-color);
  margin: 0;
  font-size: 1.5rem;
}

.close {
  color: var(--text-grey);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close:hover {
  color: var(--text-color);
}

.modal-body {
  padding: 25px;
}

.modal-body .rules {
  background: transparent;
  padding: 0;
  margin: 0;
}

.modal-body .rules h3 {
  color: var(--text-color);
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.modal-body .rules ul {
  list-style: none;
  padding-left: 0;
}

.modal-body .rules li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  padding-left: 30px;
  color: var(--text-color);
}

.modal-body .rules li:before {
  content: "•";
  color: var(--primary-color);
  font-weight: bold;
  position: absolute;
  left: 0;
  font-size: 1.2rem;
}

.modal-body .rules li:last-child {
  border-bottom: none;
}

@media (max-width: 600px) {
  .container {
    padding: 15px;
  }

  header h1 {
    font-size: 1.1rem;
  }

  .game-stats {
    /* flex-direction: column; */
    gap: 15px;
  }

  .token-buttons {
    gap: 10px;
  }

  .token-btn {
    /* min-width: 100px; */
    padding: 10px 15px;
  }

  .letters-text {
    font-size: 0.7rem;
  }

  .letter-box {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .revealed-letter {
    font-size: 1.5rem;
  }

  .token-value {
    width: 14px;
    height: 14px;
    font-size: 0.5rem;
    top: 1px;
    right: 1px;
  }

  .letter-input {
    font-size: 16px; /* Keep 16px to prevent zoom on mobile */
  }

  .game-controls {
    flex-direction: column;
    align-items: center;
  }

  .key {
    width: 35px;
    height: 45px;
    font-size: 0.9rem;
  }

  .key.special-key {
    width: 50px;
    font-size: 0.7rem;
  }

  .key.special-key[data-key="BACKSPACE"] {
    width: 50px;
  }
}

@media (max-width: 600px) {
  .modal-content {
    margin: 10% auto;
    width: 95%;
    max-height: 85vh;
  }

  .modal-header {
    padding: 15px 20px;
  }

  .modal-header h2 {
    font-size: 1.3rem;
  }

  .modal-body {
    padding: 20px;
  }

  .help-icon {
    top: 15px;
    right: 15px;
    width: 28px;
    height: 28px;
  }

  .help-icon svg {
    width: 18px;
    height: 18px;
  }
}
:root {
  --text-color: #121213;
  --bg-color: #f8f8f8;
  --light-gray: #c1c1c4;
  --lightest-gray: #f1f1f1;
  --text-gradient: -webkit-gradient(45deg, #cacacd, #0e0f11);
  --text-gradient-2: -webkit-gradient(45deg, #636a83, #0e0f11);
}

* {
  font-family: "Manrope", sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  
  padding: 0px;
  margin: 0px;
}

a {
  color: var(--text-color);
}

.container {
  max-width: 1100px;
  margin: 0rem auto 0rem;
  padding: 10px;
}

.header {
  padding: 10px 0;
  position: sticky;
  top: 0;
  padding: 10px 16px;
  background: var(--bg-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: solid 1px var(--light-gray);
  z-index: 100;

  @media screen and (max-width: 768px) {
    font-size: 12px;
  }

  .logo-wrap {
    font-size: 24px;
    font-weight: bold;
    a {
      display: flex;
      align-items: center;
      gap: 10px;
      text-decoration: none;

      @media screen and (max-width: 768px) {
        .logo-text {
          display: none;
        }
      }
      
    }
  }
  img {
    width: 40px;
  }

  .score-board {
    display: flex;
    align-items: center;
    gap: 5px;
    &.hide {
      display: none;
    }
    .scored {
      padding: 10px;
      background-color: #a3e7c0;
    }
    .total {
      padding: 10px;
      background-color: var(--lightest-gray);
    }
  }

  .toggle-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
  }
}

h4 {
  font-weight: normal;
  font-size: 1.25rem;
}

.for-game {
  &.hide-game {
    display: none !important;
  }
}

.page-columns {
  display: flex;
  gap: 20px;

  @media screen and (max-width: 768px) {
    flex-direction: column;
  }

  .content {
    width: 75%;
    @media screen and (max-width: 768px) {
      width: 100%;
    }
  }
  .right-column {
    width: 25%;
    padding: 10px;
    /* position: fixed;
    right: 0; */

    .more-list {
      display: flex;
      flex-direction: column;
      gap: 15px;
      /* height: 500px; 
      overflow: auto; */
      a {
        text-decoration: none;
        &:hover {
          text-decoration: underline;
        }
      }
    }

    @media screen and (max-width: 768px) {
      width: 100%;
      position: static;
      right: auto;
      
      .more-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 30px;
        height: auto;
      }
    }
  }
}

.toggle-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  width: 70px;
  background: #fffc41;
  border-radius: 20px;
  padding: 1px 5px;
  height: 35px;
  position: relative;
  border: solid 1px var(--light-gray);

  .toggle-circle {
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    transition: transform 0.3s ease-in-out;
    border: solid 1px var(--light-gray);
  }

  .toggle-text {
    flex: 1;
  }

  &.on .toggle-text {
    text-align: left;
    color: var(--text-color);
    padding-left: 10px;
  }

  &.off .toggle-text {
    text-align: right;
    color: var(--text-color);
    padding-right: 10px;
  }

  &.off .toggle-circle {
    transform: translateX(0px);
  }

  &.on .toggle-circle {
    transform: translateX(39px);
  }

  &.off {
    background: #e9e9e5;
  }
}

.heading {
  font-size: 24px;
  font-weight: bold;
  background: -webkit-gradient(linear, left top, left bottom, from(#494950), to(#0e0f11));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.global-share {
  button {
    border-radius: 5px; 
    border: solid 1px var(--light-gray);
    padding: 5px 10px;
    margin-left: 10px;
  }
}

.footer {
  padding-bottom: 200px;
  margin-top: 5rem;
  
  .top-row {
    display: flex;
    gap: 30px;
    /* justify-content: center; */
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
  }

  .craft {
    margin-top: 5px;
  }
  .follow {
    .icons {
      display: flex;
      gap: 10px;
      justify-content: center;
    }
  }
}

.quiz-wrap {
  h1 {
    font-size: 1.25rem;
    font-weight: bold;
    span {
      font-size: 0.9rem;
    }
  }

  .alpha-list {
    display: flex;
    margin-top: 2rem;

    @media screen and (max-width: 768px) {
      flex-direction: column;
    }
    .alphabet {
      
      min-width: 100px;
      display: flex;
      text-align: center;
      /* justify-content: center; */
      /* align-items: center; */

      border-right: solid 1px var(--light-gray);

      
      @media screen and (max-width: 768px) {
        min-width: auto;
        padding: 0.5rem;
        border-right: none;;
        border-bottom: solid 1px var(--light-gray);
      }

      span {
        font-size: 7rem;
        font-weight: bold;
        background: -webkit-gradient(linear, left top, left bottom, from(#a5a5ac), to(#0e0f11));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;

        @media screen and (max-width: 768px) {
          font-size: 3rem;
        }
      }
    }

    .list-column {
      padding: 2rem;
      width: 100%;
      box-sizing: border-box;
      .item-wrap {
        margin-bottom: 4rem;
        &.country-name {
          margin-bottom: 1rem;
        }
      }
      .input-answer {
        margin-bottom: 15px;
        display: flex;
        gap: 10px;
        align-items: center;
        justify-content: space-between;
        input {
          width: 100%;
          border: none;
          border-bottom: solid 1px var(--light-gray);
          padding: 10px;
        }
        .press-enter {
          border: solid 1px var(--light-gray);
          padding: 10px 15px;
          box-sizing: border-box;
          &:hover {
            border: solid 1px var(--text-color);
          }
        }

        button {
          flex: 0;
          width: auto;
          white-space: nowrap;
          border: none;
          background-color: transparent;
          cursor: pointer;
          color: var(--light-gray);
          &:hover {
            color: var(--text-color);
          }

          &.show-all-answers {
            display: none;
          }
        }
      }

      .item-question {
        font-size: 20px;
        margin-bottom: 10px;
      }

      .answer-list {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        margin-bottom: 15px;

        &.multiple-choice {
          flex-direction: column;
          .option {
            display: flex;
            gap: 10px;
            align-items: center;
          }
          .answer-cover {
            width: fit-content;
          }
        }
        .answer-wrap {
          display: flex;
          align-items: center;
          gap: 20px;
          /* margin-bottom: 10px; */

          .label {
            font-weight: bold;
          }
        }

        .answer-cover {
          --radius: 10px;
          border: solid 1px var(--light-gray);
          border-radius: var(--radius);
          padding: 10px 20px;
          position: relative;
          box-sizing: border-box;
          .blur-cover {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: var(--lightest-gray);
            border-radius: var(--radius);
            display: flex;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
            text-indent: -100000px;
            &.show-hint {
              text-indent: 0;
            }
          }

          &.already-answered {
            .blur-cover {
              display: none;
            }
          }
        }
        
      }
    }
  }
}

.made-in {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  img {
    width: 20px;
    height: auto;
    margin-left: 10px;
  }
}

/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 
 */

 @import 'quiz';
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --cell-size: 50px;
  --cell-color: #fbf6ef;
  --cell-selected-bg: #690412;
  --cell-selected-color: #27ae60;
}

body {
  font-family: "Inter", sans-serif;
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

button {
  font-family: "Open Sans", sans-serif;
}

.container {
  background: white;
  border-radius: 20px;
  padding: 10px;

  max-width: 600px;
  width: 100%;
}

h1 {
  text-align: center;
  color: #333;
  margin-bottom: 10px;
  font-size: 1.25rem;
  font-weight: bold;
}

.word-info {
  text-align: center;
  color: #666;
  margin-bottom: 15px;
  font-size: 0.9rem;
  font-weight: 500;
}

.game-info {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.1rem;
  font-weight: normal;
}

.attempts {
  color: #e74c3c;
}

.score {
  color: #27ae60;
}

.timer {
  color: #333;
  font-weight: normal;
}

.grid-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(8, var(--cell-size));
  gap: 2px;
  padding: 10px;
  border-radius: 10px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  min-width: var(--cell-size);
  min-height: var(--cell-size);
  border: none;
  background: var(--cell-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 5px;
  color: #333;
  flex-shrink: 0;
}

.cell:hover {
  background: #f0f0f0;
  transform: scale(1.05);
}

.cell.word-cell {
  background: var(--cell-color);
  border: 2px solid var(--cell-color);
}

.cell.target-word {
  /* background: #e3f2fd;
  border: 2px solid #2196f3; */
}

.cell.selected {
  background: var(--cell-selected-bg);
  color: white;
  transform: scale(1.1);
}

.cell.revealed {
  background: #27ae60;
  color: white;
  animation: reveal 0.5s ease;
}

.cell.revealed.target-word {
  background: #52f195;
}

.cell.correct-swap {
  background: #ace9c6;
  color: white;
  animation: correctSwap 0.5s ease;
}

.cell.incorrect-swap {
  background: #e74c3c;
  color: white;
  animation: incorrectSwap 0.5s ease;
}

@keyframes reveal {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes correctSwap {
  0% {
    transform: scale(1);
    background: #27ae60;
  }
  50% {
    transform: scale(1.2);
    background: #2ecc71;
  }
  100% {
    transform: scale(1);
    background: #27ae60;
  }
}

@keyframes incorrectSwap {
  0% {
    transform: scale(1);
    background: #e74c3c;
  }
  50% {
    transform: scale(1.2);
    background: #c0392b;
  }
  100% {
    transform: scale(1);
    background: #e74c3c;
  }
}

.controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.swap-btn,
.reset-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.swap-btn {
  background: var(--cell-selected-bg);
  color: white;
}

.swap-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.swap-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
}

.reset-btn {
  background: #e74c3c;
  color: white;
}

.reset-btn:hover {
  background: #c0392b;
  transform: translateY(-2px);
}

.help-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #dddddf;
  color: white;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message {
  text-align: center;
  min-height: 30px;
  font-weight: bold;
  font-size: 1.1rem;
}

.message.success {
  color: #27ae60;
}

.message.error {
  color: #e74c3c;
}

@media (max-width: 600px) {
  :root {
    --cell-size: 35px;
  }

  .cell {
    width: var(--cell-size);
    height: var(--cell-size);
    min-width: var(--cell-size);
    min-height: var(--cell-size);
    font-size: 0.8rem;
    position: relative;
  }

  .grid {
    grid-template-columns: repeat(8, var(--cell-size));
    gap: 1px;
    width: fit-content;
    margin: 0 auto;
    padding: 5px;
  }

  .grid-container {
    justify-content: center;
    width: 100%;
  }

  .game-info {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .container {
    padding: 5px;
  }

  h1 {
    font-size: 1.1rem;
  }

  .word-info {
    font-size: 0.8rem;
  }

  .game-info {
    font-size: 0.9rem;
  }

  .swap-btn,
  .reset-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    min-width: 100px;
  }

  .help-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 15px 15px 0 0;
}

.modal-header h2 {
  margin: 0;
  color: #333;
  font-size: 1.5rem;
}

.close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close:hover {
  color: #333;
}

.modal-body {
  padding: 25px;
}

.modal-body h3 {
  color: #333;
  margin: 20px 0 10px 0;
  font-size: 1.2rem;
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-body p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
}

.modal-body ul {
  color: #666;
  line-height: 1.6;
  margin-bottom: 20px;
  padding-left: 20px;
}

.modal-body li {
  margin-bottom: 8px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 30px;
  /* box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); */
  max-width: 800px;
  width: 100%;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  color: #333;
  font-size: 2rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
  color: #666;
  font-size: 1.1rem;
}

.game-board {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 30px;
}

.word-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 5px;
  border-radius: 15px;
}

.word-column:hover {
  background: rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.word-column.dragging {
  background: rgba(102, 126, 234, 0.2);
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.letter-slot {
  width: 50px;
  height: 70px;
  background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
  border-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.letter-slot:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 6px 12px rgba(0, 0, 0, 0.15);
}

.letter-slot.dragging {
  transform: scale(1.05);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 8px 16px rgba(0, 0, 0, 0.2);
  background: linear-gradient(145deg, #e8e8e8, #d8d8d8);
}

.letter-slot.correct {
  background: linear-gradient(145deg, #4caf50, #45a049);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2),
    0 4px 8px rgba(76, 175, 80, 0.3);
}

.letter {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
  transition: all 0.3s ease;
  text-align: center;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  pointer-events: none;
}

.letter-slot.correct .letter {
  background-color: rgb(11, 212, 75);
  color: white;
}

/* Half success - word found but not in correct position */
.letter-slot.half-correct {
  background: linear-gradient(145deg, #ffa726, #ff9800);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2),
    0 4px 8px rgba(255, 167, 38, 0.3);
}

.letter-slot.half-correct .letter {
  background-color: #ffa726;
  color: white;
}

/* Full success - word found in correct position */
.letter-slot.full-correct {
  background: linear-gradient(145deg, #4caf50, #45a049);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2),
    0 4px 8px rgba(76, 175, 80, 0.3);
}

.letter-slot.full-correct .letter {
  background-color: #31e339;
  color: white;
}

/* Dummy slot styling */
.letter-slot.dummy-slot {
  opacity: 0.3;
  background: linear-gradient(145deg, #d0d0d0, #c0c0c0);
  border: 2px dashed #999;
}

.letter-slot.dummy-slot .letter {
  color: #666;
  font-size: 1.5rem;
}

/* Playable slot highlighting */
.letter-slot.playable-slot {
  background: linear-gradient(145deg, #f8f8f8, #e8e8e8);
  border: 2px solid #667eea;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1),
    0 4px 8px rgba(102, 126, 234, 0.2);
}

.letter-slot.playable-slot:hover {
  background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
  transform: translateY(-2px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1),
    0 6px 12px rgba(102, 126, 234, 0.3);
}

.letter-slot.dragging .letter {
  color: #555;
  font-weight: 700;
}

/* Vertical scrolling animations with directional sliding */
.letter-slot.scrolling-up .letter {
  animation: slideOutDown 0.2s ease-out, slideInDown 0.2s ease-in 0.2s;
}

.letter-slot.scrolling-down .letter {
  animation: slideOutUp 0.2s ease-out, slideInUp 0.2s ease-in 0.2s;
}

@keyframes slideOutUp {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-40px);
    opacity: 0;
  }
}

@keyframes slideInUp {
  0% {
    transform: translateY(40px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutDown {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(40px);
    opacity: 0;
  }
}

@keyframes slideInDown {
  0% {
    transform: translateY(-40px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.letter-slot.changing .letter {
  animation: letterChange 0.3s ease-in-out;
}

@keyframes letterChange {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.controls {
  /* display: flex; */
  display: none;
  gap: 15px;
  justify-content: center;
  margin-bottom: 20px;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

.status {
  text-align: center;
}

.message {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 10px;
  min-height: 30px;
}

.message.success {
  color: #4caf50;
}

.message.error {
  color: #f44336;
}

.message.info {
  color: #2196f3;
}

.score {
  font-size: 1.1rem;
  color: #666;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 20px;
    margin: 10px;
  }

  header h1 {
    font-size: 2rem;
  }

  .letter-slot {
    width: 50px;
    height: 70px;
  }

  .letter {
    font-size: 1.5rem;
  }

  .word-column {
    gap: 8px;
  }

  .controls {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 200px;
  }
}

@media (max-width: 480px) {
  .letter-slot {
    width: 45px;
    height: 60px;
  }

  .letter {
    font-size: 1.3rem;
  }

  .word-column {
    gap: 6px;
  }
}

/* Success animation */
@keyframes success {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.letter-slot.correct {
  animation: success 0.6s ease-in-out;
}

.green-underline {
  border-bottom: 4px solid #31e339;
  border-radius: 2px;
  padding-bottom: 2px;
}

.hide-dummy {
  visibility: hidden !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
