@import "https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500&display=swap";

/* src/styles.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Quicksand", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(
      135deg,
      #1a1a2e 0%,
      #16213e 50%,
      #0f3460 100%);
  color: #e8e8e8;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ambient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 20s ease-in-out infinite;
}
.ambient::before {
  background:
    radial-gradient(
      circle,
      #4a90a4 0%,
      transparent 70%);
  top: 10%;
  left: 10%;
}
.ambient::after {
  background:
    radial-gradient(
      circle,
      #8b5a8b 0%,
      transparent 70%);
  bottom: 10%;
  right: 10%;
  animation-delay: -10s;
}
@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}
.container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
h1 {
  font-weight: 300;
  font-size: 2rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #a8c0c8;
  text-shadow: 0 0 30px rgba(168, 192, 200, 0.3);
}
.controls-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 8px;
}
.avg-display {
  font-weight: 300;
  font-size: 1rem;
  letter-spacing: 0.15em;
  color: #7a9ea8;
}
.gem-slider-container {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gem-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.gem-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #7a9ea8;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}
.gem-slider::-webkit-slider-thumb:hover {
  background: #95d5b2;
}
.gem-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #7a9ea8;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.gem-slider-value {
  font-size: 0.85rem;
  color: #7a9ea8;
  min-width: 1.5em;
  text-align: center;
}
.floating-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(42, 62, 66, 0.95);
  color: #a8c5cf;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 100;
}
.floating-message.visible {
  opacity: 1;
}
.avg-display span {
  color: #95d5b2;
  font-weight: 400;
}
.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.board.processing {
  cursor: wait;
}
.board.processing .cell {
  pointer-events: none;
}
.board.processing .cell:hover {
  transform: none;
}
.board.processing::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: rgba(126, 200, 227, 0.6);
  border-radius: 1px;
  animation: processingBar 1.5s ease-in-out infinite;
  z-index: 10;
}
@keyframes processingBar {
  0% {
    transform: scaleX(0);
    transform-origin: left;
  }
  50% {
    transform: scaleX(1);
    transform-origin: left;
  }
  51% {
    transform: scaleX(1);
    transform-origin: right;
  }
  100% {
    transform: scaleX(0);
    transform-origin: right;
  }
}
.cell {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
  position: relative;
}
.cell:hover {
  transform: scale(1.08);
}
.gem {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.3),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
  user-select: none;
  -webkit-user-select: none;
}
.gem.empty {
  opacity: 0;
}
.gem.selected {
  transform: scale(1.15);
  box-shadow:
    0 0 20px currentColor,
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
  animation: selectedPulse 0.8s ease-in-out infinite;
}
.gem.swap-target {
  animation: targetPulse 1s ease-in-out infinite;
  box-shadow:
    0 0 8px rgba(126, 200, 227, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
}
@keyframes targetPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(126, 200, 227, 0.3), 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 14px rgba(126, 200, 227, 0.6), 0 4px 12px rgba(0, 0, 0, 0.3);
  }
}
@keyframes selectedPulse {
  0%, 100% {
    box-shadow: 0 0 20px currentColor, 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 30px currentColor, 0 4px 16px rgba(0, 0, 0, 0.4);
  }
}
.gem.matched {
  animation: vanish 0.3s ease-out forwards;
}
@keyframes vanish {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.5;
  }
  100% {
    transform: scale(0);
    opacity: 0;
  }
}
.gem.exploding {
  animation: explode 0.5s ease-out forwards;
}
@keyframes explode {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  30% {
    transform: scale(1.8);
    opacity: 1;
  }
  100% {
    transform: scale(0);
    opacity: 0;
  }
}
.gem.line-cleared {
  animation: lineClear 0.4s ease-out forwards;
}
@keyframes lineClear {
  0% {
    transform: scale(1) scaleX(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2) scaleX(1.5);
    opacity: 0.8;
  }
  100% {
    transform: scale(0) scaleX(2);
    opacity: 0;
  }
}
.gem.rainbow-cleared {
  animation: rainbowClear 0.5s ease-out forwards;
}
@keyframes rainbowClear {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    filter: hue-rotate(0deg);
  }
  50% {
    transform: scale(1.5) rotate(180deg);
    opacity: 0.8;
    filter: hue-rotate(180deg);
  }
  100% {
    transform: scale(0) rotate(360deg);
    opacity: 0;
    filter: hue-rotate(360deg);
  }
}
.gem.invalid {
  animation: shake 0.4s ease-in-out;
}
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(6px);
  }
}
.gem.falling {
  transition: top 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.gem.swapping {
  transition: all 0.2s ease-in-out;
  z-index: 10;
}
.gem.pending-match {
  animation: tremble 0.1s ease-in-out infinite;
  filter: brightness(1.3);
}
@keyframes tremble {
  0% {
    transform: translate(-1px, -1px);
  }
  25% {
    transform: translate(2px, 0px);
  }
  50% {
    transform: translate(-1px, 2px);
  }
  75% {
    transform: translate(1px, -1px);
  }
  100% {
    transform: translate(-1px, -1px);
  }
}
.gem.activating {
  z-index: 20;
}
.gem.activating::before {
  content: "" !important;
  position: absolute !important;
  inset: -8px !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255, 255, 255, 0.8) !important;
  animation: activationPulse 0.3s ease-out forwards !important;
  z-index: 20;
}
@keyframes activationPulse {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}
.gem.just-created {
  animation: specialAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes specialAppear {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.gem-0 {
  background:
    linear-gradient(
      135deg,
      #7ec8e3 0%,
      #5ba3c0 100%);
  color: #7ec8e3;
}
.gem-1 {
  background:
    linear-gradient(
      135deg,
      #e07a5f 0%,
      #c0634b 100%);
  color: #e07a5f;
}
.gem-2 {
  background:
    linear-gradient(
      135deg,
      #95d5b2 0%,
      #74b893 100%);
  color: #95d5b2;
}
.gem-3 {
  background:
    linear-gradient(
      135deg,
      #f4d35e 0%,
      #d4b34e 100%);
  color: #f4d35e;
}
.gem-4 {
  background:
    linear-gradient(
      135deg,
      #dda0dd 0%,
      #b87db8 100%);
  color: #dda0dd;
}
.gem-5 {
  background:
    linear-gradient(
      135deg,
      #e8a87c 0%,
      #c38d6e 100%);
  color: #e8a87c;
}
.gem-6 {
  background:
    linear-gradient(
      135deg,
      #4ecdc4 0%,
      #3ba89f 100%);
  color: #4ecdc4;
}
.gem-7 {
  background:
    linear-gradient(
      135deg,
      #ff9f43 0%,
      #d98436 100%);
  color: #ff9f43;
}
.gem-8 {
  background:
    linear-gradient(
      135deg,
      #5f6caf 0%,
      #4a5590 100%);
  color: #5f6caf;
}
.gem-9 {
  background:
    linear-gradient(
      135deg,
      #ff6b9d 0%,
      #d9577f 100%);
  color: #ff6b9d;
}
.gem.special-bomb {
  border-radius: 50%;
  position: relative;
}
.gem.special-bomb::before {
  content: "";
  position: absolute;
  font-size: 18px;
  filter: drop-shadow(0 0 4px rgba(255, 200, 100, 0.8));
  animation: bombPulse 1.5s ease-in-out infinite;
}
.gem.special-bomb::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid rgba(255, 200, 100, 0.6);
  border-radius: 50%;
  animation: bombRing 1.5s ease-in-out infinite;
}
@keyframes bombPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}
@keyframes bombRing {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.3;
  }
}
.gem.special-line {
  border-radius: 8px;
  position: relative;
}
.gem.special-line::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
  animation: lineGlow 1s ease-in-out infinite;
}
.gem.special-line.horizontal::after {
  width: 100%;
  height: 4px;
}
.gem.special-line.vertical::after {
  width: 4px;
  height: 100%;
}
.gem.special-line.cross::before,
.gem.special-line.cross::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}
.gem.special-line.cross::before {
  width: 100%;
  height: 4px;
}
.gem.special-line.cross::after {
  width: 4px;
  height: 100%;
}
@keyframes lineGlow {
  0%, 100% {
    opacity: 0.9;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 20px rgba(255, 255, 255, 1);
  }
}
.gem.special-rainbow {
  position: relative;
  border-radius: 50%;
}
.gem.special-rainbow::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    conic-gradient(
      from 0deg,
      #e8a87c,
      #7ec8e3,
      #95d5b2,
      #dda0dd,
      #f4d35e,
      #e07a5f,
      #e8a87c);
  -webkit-mask:
    radial-gradient(
      circle,
      transparent 45%,
      black 55%);
  mask:
    radial-gradient(
      circle,
      transparent 45%,
      black 55%);
  animation: rainbowSpin 3s linear infinite;
}
.gem.special-rainbow::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: inherit;
  box-shadow: 0 0 8px currentColor;
}
@keyframes rainbowSpin {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}
.explosion-effect {
  position: absolute;
  pointer-events: none;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      rgba(255, 200, 100, 0.8) 0%,
      rgba(255, 100, 50, 0.4) 50%,
      transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  animation: explosionWave 0.5s ease-out forwards;
  z-index: 50;
}
@keyframes explosionWave {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}
.line-effect {
  position: absolute;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.8),
      transparent);
  z-index: 50;
  animation: lineWave 0.4s ease-out forwards;
}
.line-effect.horizontal {
  height: 48px;
  width: 100%;
  left: 0;
}
.line-effect.vertical {
  width: 48px;
  height: 100%;
  top: 0;
  background:
    linear-gradient(
      180deg,
      transparent,
      rgba(255, 255, 255, 0.8),
      transparent);
}
@keyframes lineWave {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.combo-counter {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 1.5rem;
  font-weight: 400;
  color: #f4d35e;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
  text-shadow: 0 0 15px rgba(244, 211, 94, 0.4);
  pointer-events: none;
}
.combo-counter.show {
  opacity: 1;
  transform: scale(1);
}
.combo-counter.warm {
  color: #e8a87c;
  font-size: 1.7rem;
  text-shadow: 0 0 20px rgba(232, 168, 124, 0.5);
}
.combo-counter.hot {
  color: #e07a5f;
  font-size: 1.9rem;
  text-shadow: 0 0 25px rgba(224, 122, 95, 0.6);
}
.combo-counter.epic {
  color: #ff6b9d;
  font-size: 2.2rem;
  text-shadow: 0 0 30px rgba(255, 107, 157, 0.7);
  animation: comboEpic 0.5s ease-in-out;
}
@keyframes comboEpic {
  0% {
    transform: scale(1.5);
  }
  50% {
    transform: scale(1.8);
  }
  100% {
    transform: scale(1);
  }
}
.board.combo-flash {
  animation: boardFlash 0.6s ease-out;
}
@keyframes boardFlash {
  0% {
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.05),
      0 0 60px rgba(255, 107, 157, 0.4);
  }
  100% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
}
.score-popup {
  position: absolute;
  pointer-events: none;
  font-size: 1.2rem;
  font-weight: 500;
  color: #f4d35e;
  text-shadow: 0 0 10px rgba(244, 211, 94, 0.5);
  animation: scoreFloat 1s ease-out forwards;
  z-index: 100;
  transform: translateX(-50%);
  white-space: nowrap;
  --drift: 30px;
}
.score-popup.bonus {
  color: #dda0dd;
  text-shadow: 0 0 15px rgba(221, 160, 221, 0.5);
}
@keyframes scoreFloat {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(calc(-50% + var(--drift, 30px))) translateY(-40px) scale(1.2);
  }
}
.hint-text {
  font-size: 0.85rem;
  color: #5a7a84;
  letter-spacing: 0.1em;
  margin-top: 8px;
}
.shuffle-notice {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 20px 40px;
  border-radius: 12px;
  font-size: 1.3rem;
  color: #a8c0c8;
  letter-spacing: 0.2em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 200;
}
.shuffle-notice.show {
  opacity: 1;
}
.back-link {
  position: fixed;
  top: 20px;
  left: 20px;
  color: #5a7a84;
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  transition: color 0.2s ease;
}
.back-link:hover {
  color: #a8c0c8;
}
.stats-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.distribution-history {
  display: flex;
  gap: 2px;
  height: 24px;
  align-items: flex-end;
}
.dist-bar {
  width: 4px;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 1px;
  overflow: hidden;
}
.dist-segment {
  width: 100%;
  transition: height 0.2s ease;
}
.avg-sparkline {
  height: 24px;
  opacity: 0.8;
}
.score-history {
  display: flex;
  gap: 10px;
  font-size: 0.75rem;
  color: #7a9ea8;
}
.score-history span {
  white-space: nowrap;
  opacity: 0.5;
}
.score-history span:first-child {
  opacity: 1;
  color: #f4d35e;
}
.score-history span.live {
  opacity: 1;
  color: #95d5b2;
  animation: livePulse 0.5s ease-in-out infinite alternate;
}
@keyframes livePulse {
  from {
    opacity: 0.7;
  }
  to {
    opacity: 1;
  }
}
.new-game-btn {
  background: rgba(149, 213, 178, 0.2);
  border: 1px solid rgba(149, 213, 178, 0.3);
  color: #95d5b2;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.1em;
}
.new-game-btn:hover {
  background: rgba(149, 213, 178, 0.4);
  border-color: rgba(149, 213, 178, 0.6);
  color: #c5f0d6;
}
.how-to-play {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 80vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.how-to-play-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 20px;
  background: rgba(15, 20, 40, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #7a9ea8;
  font-family: "Quicksand", sans-serif;
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
}
.how-to-play-toggle::-webkit-details-marker {
  display: none;
}
.how-to-play-toggle::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #7a9ea8;
  border-top: 1.5px solid #7a9ea8;
  transform: rotate(-45deg) translateY(2px);
  transition: transform 0.3s ease;
}
.how-to-play[open] .how-to-play-toggle::after {
  transform: rotate(135deg) translateY(-1px);
}
.how-to-play-toggle:hover {
  color: #a8c0c8;
}
.how-to-play-toggle:hover::after {
  border-color: #a8c0c8;
}
.how-to-play-content {
  background: rgba(15, 20, 40, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 24px 32px 28px;
  max-width: 640px;
  margin: 0 auto;
}
.help-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}
.help-col h3 {
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #a8c0c8;
  margin-bottom: 8px;
}
.help-col h3:not(:first-child) {
  margin-top: 16px;
}
.help-col p {
  font-size: 0.78rem;
  line-height: 1.6;
  color: #8a9ea8;
  margin-bottom: 8px;
}
.help-col dl {
  font-size: 0.78rem;
  line-height: 1.6;
  color: #8a9ea8;
}
.help-col dt {
  font-weight: 500;
  color: #a8c0c8;
  margin-top: 6px;
}
.help-col dd {
  margin-left: 0;
  margin-bottom: 4px;
}
.help-col strong {
  color: #c5d5db;
  font-weight: 500;
}
@media (max-width: 640px) {
  .help-columns {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .how-to-play-content {
    padding: 20px;
  }
}
/*# sourceMappingURL=app.css.map */
