:root {
  --bg: #2a2520;
  --keyboard-bg: #d4c5a9;
  --key-bg: #f5e6d3;
  --key-shadow: #8b7355;
  --key-pressed: #c4b59a;
  --text: #3a3028;
  --text-light: #f5e6d3;
  --panel-bg: #1a1510;
  --accent: #d4a574;
  --upgrade-bg: rgba(212, 197, 169, 0.1);
  --upgrade-border: rgba(212, 197, 169, 0.3);
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--keyboard-bg);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-y: auto;
}

.game-container {
  max-width: 1200px;
  width: 100%;
  position: relative;
}

.notifications-sidebar {
  position: fixed;
  right: 20px;
  top: 20px;
  width: 300px;
  max-height: 80vh;
  background: var(--panel-bg);
  border: 2px solid var(--upgrade-border);
  border-radius: 12px;
  padding: 15px;
  overflow-y: auto;
  z-index: 500;
  display: none; /* Hidden - replaced by corner notifications */
}

/* Corner Notifications (Top Right) */
.notifications-corner {
  position: fixed;
  right: 20px;
  top: 20px;
  width: 320px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 500;
  pointer-events: none;
}

.corner-notification {
  background: linear-gradient(135deg, #3a2f28, #2a2520);
  border: 2px solid #5a4a3a;
  border-radius: 8px;
  padding: 12px 15px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.corner-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.corner-notification.dismissed {
  opacity: 0;
  transform: translateX(100%);
}

.corner-notification:hover {
  background: linear-gradient(135deg, #4a3f38, #3a3028);
  border-color: var(--accent);
  transform: translateX(-5px);
}

.corner-notif-title {
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 5px;
  font-size: 14px;
}

.corner-notif-message {
  font-size: 12px;
  opacity: 0.9;
  color: var(--keyboard-bg);
}

.notifications-sidebar h3 {
  color: var(--accent);
  margin: 0 0 15px 0;
  font-size: 18px;
  text-align: center;
  border-bottom: 2px solid var(--upgrade-border);
  padding-bottom: 10px;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-notification {
  background: var(--upgrade-bg);
  border: 1px solid var(--upgrade-border);
  border-radius: 8px;
  padding: 12px;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
}

.sidebar-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.sidebar-notif-title {
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 5px;
  font-size: 14px;
}

.sidebar-notif-message {
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 5px;
}

.sidebar-notif-time {
  font-size: 10px;
  opacity: 0.6;
  text-align: right;
}

.notifications-sidebar::-webkit-scrollbar {
  width: 6px;
}

.notifications-sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.notifications-sidebar::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.notifications-sidebar::-webkit-scrollbar-thumb:hover {
  background: #e4b584;
}

.stats-panel {
  background: rgba(26, 21, 16, 0.5);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
  border: 2px solid var(--upgrade-border);
  position: relative;
  backdrop-filter: blur(10px);
}

.reset-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 107, 107, 0.2);
  border: 2px solid rgba(255, 107, 107, 0.5);
  color: #ff6b6b;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.reset-btn:hover {
  background: rgba(255, 107, 107, 0.4);
  border-color: #ff6b6b;
  transform: scale(1.05);
}

.rebirth-btn {
  position: absolute;
  top: 10px;
  right: 250px;
  background: rgba(255, 215, 0, 0.2);
  border: 2px solid rgba(255, 215, 0, 0.5);
  color: #ffd700;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.minigame-btn {
  position: absolute;
  top: 10px;
  right: 380px;
  background: rgba(138, 43, 226, 0.2);
  border: 2px solid rgba(138, 43, 226, 0.5);
  color: #ba55d3;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.minigame-btn:hover {
  background: rgba(138, 43, 226, 0.4);
  border-color: #ba55d3;
  transform: scale(1.05);
}

.daily-bonus-btn {
  position: absolute;
  top: 10px;
  right: 500px;
  background: rgba(255, 140, 0, 0.2);
  border: 2px solid rgba(255, 140, 0, 0.5);
  color: #ff8c00;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.daily-bonus-btn:hover {
  background: rgba(255, 140, 0, 0.4);
  border-color: #ff8c00;
  transform: scale(1.05);
}

.daily-bonus-btn.available {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.4), rgba(255, 140, 0, 0.4));
  border-color: #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.daily-bonus-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.daily-bonus-content {
  background: var(--panel-bg);
  border: 3px solid var(--accent);
  border-radius: 20px;
  padding: 60px;
  text-align: center;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.rebirth-btn:hover {
  background: rgba(255, 215, 0, 0.4);
  border-color: #ffd700;
  transform: scale(1.05);
}

.rebirth-btn.rebirth-ready {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.4), rgba(255, 165, 0, 0.4));
  border-color: #ffd700;
  animation: rebirthPulse 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

@keyframes rebirthPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
  }
}

.sound-toggle-btn {
  position: absolute;
  top: 10px;
  right: 120px;
  background: rgba(122, 162, 255, 0.2);
  border: 2px solid rgba(122, 162, 255, 0.5);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.sound-toggle-btn:hover {
  background: rgba(122, 162, 255, 0.4);
  border-color: var(--accent);
  transform: scale(1.05);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.stat-label {
  font-size: 14px;
  opacity: 0.8;
}

.stat-value {
  font-size: 28px;
  font-weight: bold;
  color: var(--accent);
}

.keyboard-container {
  background: var(--keyboard-bg);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  margin-bottom: 30px;
  animation: keyboardFloat 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
  transition: background 0.5s ease;
}

.keyboard-container.transparent-keyboard {
  background: rgba(212, 197, 169, 0.03) !important;
}

.keyboard-container.transparent-keyboard .key {
  background: rgba(245, 230, 211, 0.08);
  backdrop-filter: blur(3px);
  border: 1px solid rgba(245, 230, 211, 0.3);
}

.keyboard-container.transparent-keyboard .key:hover {
  background: rgba(255, 255, 255, 0.15);
}

.keyboard-container .animated-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.keyboard-row {
  position: relative;
  z-index: 1;
}

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

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

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

.key {
  background: var(--key-bg);
  color: var(--text);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 0 var(--key-shadow);
  transition: all 0.05s ease;
  position: relative;
  top: 0;
  animation: keyIdle 2s ease-in-out infinite;
  animation-delay: calc(var(--key-index, 0) * 0.05s);
  z-index: 2;
}

@keyframes keyIdle {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.02);
  }
}

.key:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--key-shadow);
  animation: none;
}

.key:active,
.key.pressed {
  background: var(--key-pressed);
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--key-shadow);
  animation: keyPress 0.1s ease;
}

@keyframes keyPress {
  0% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(2px) scale(0.95);
  }
  100% {
    transform: translateY(4px) scale(1);
  }
}

.key.spacebar {
  width: 400px;
}

.upgrades-panel {
  background: rgba(26, 21, 16, 0.5);
  padding: 30px;
  border-radius: 12px;
  border: 2px solid var(--upgrade-border);
  backdrop-filter: blur(10px);
}

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

.tab-btn {
  background: var(--upgrade-bg);
  border: 2px solid var(--upgrade-border);
  color: var(--keyboard-bg);
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.shop-container {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.customize-container {
  max-width: 600px;
  margin: 0 auto;
}

.customize-container h3 {
  color: var(--accent);
  font-size: 24px;
  margin-bottom: 10px;
  text-align: center;
}

.customize-desc {
  opacity: 0.8;
  margin-bottom: 30px;
  text-align: center;
}

.customize-section {
  margin-bottom: 25px;
}

.customize-section label {
  display: block;
  color: var(--accent);
  font-weight: bold;
  margin-bottom: 10px;
}

.key-input {
  width: 100%;
  max-width: 300px;
  padding: 12px;
  font-size: 18px;
  text-align: center;
  border: 2px solid var(--upgrade-border);
  border-radius: 8px;
  background: var(--upgrade-bg);
  color: var(--keyboard-bg);
  display: block;
  margin: 0 auto;
}

.key-hint {
  text-align: center;
  font-size: 12px;
  opacity: 0.6;
  margin-top: 5px;
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 400px;
  margin: 0 auto;
}

.color-option {
  width: 100%;
  height: 60px;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 24px;
  transition: all 0.2s;
}

.color-option:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sticker-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-width: 500px;
  margin: 0 auto;
}

.sticker-option {
  width: 100%;
  height: 50px;
  border: 2px solid var(--upgrade-border);
  border-radius: 8px;
  background: var(--upgrade-bg);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.sticker-option:hover {
  transform: scale(1.1);
  border-color: var(--accent);
}

.customize-preview-section {
  margin: 30px 0;
}

.external-size-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin: 10px 0;
  padding: 10px;
  background: var(--upgrade-bg);
  border: 1px solid var(--upgrade-border);
  border-radius: 8px;
}

.sticker-label {
  font-weight: bold;
  color: var(--accent);
  min-width: 100px;
}

.size-display {
  min-width: 45px;
  text-align: center;
  font-family: monospace;
  color: var(--keyboard-bg);
}

.delete-sticker-btn {
  background: rgba(255, 107, 107, 0.2);
  border: 1px solid rgba(255, 107, 107, 0.5);
  color: #ff6b6b;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.2s;
}

.delete-sticker-btn:hover {
  background: rgba(255, 107, 107, 0.4);
  transform: scale(1.05);
}

.size-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--upgrade-bg);
  color: var(--keyboard-bg);
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.size-btn:hover {
  background: var(--accent);
  transform: scale(1.1);
}

.customize-preview-key {
  width: 60px;
  height: 60px;
  background: var(--key-bg);
  border-radius: 8px;
  position: relative;
  overflow: visible;
  margin: 15px auto;
  box-shadow: 0 4px 0 var(--key-shadow);
  font-size: 18px;
  font-weight: bold;
  color: var(--text);
}

.customize-preview-key.spacebar-preview {
  width: 400px;
  height: 60px;
}

.customize-preview-key.spacebar-preview::before {
  content: 'SPACE';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: bold;
  color: var(--text);
  opacity: 0.3;
  pointer-events: none;
}

.preview-sticker {
  position: absolute;
  font-size: 32px;
  cursor: grab;
  user-select: none;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: filter 0.2s;
}

.preview-sticker:hover {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.preview-sticker:active {
  cursor: grabbing;
}

.customize-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
}

.customize-apply-btn,
.customize-clear-btn {
  padding: 15px 30px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.customize-apply-btn {
  background: linear-gradient(135deg, var(--accent), #9bb8ff);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.customize-cost {
  font-size: 14px;
  opacity: 0.9;
}

.customize-apply-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(122, 162, 255, 0.4);
}

.customize-clear-btn {
  background: rgba(255, 107, 107, 0.2);
  border: 2px solid rgba(255, 107, 107, 0.5);
  color: #ff6b6b;
}

.customize-clear-btn:hover {
  background: rgba(255, 107, 107, 0.4);
  transform: scale(1.05);
}

.shop-container {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.shop-container h3 {
  color: var(--accent);
  font-size: 24px;
  margin-bottom: 20px;
}

.shop-section {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 2px solid var(--upgrade-border);
}

.shop-section:last-child {
  border-bottom: none;
}

.shop-section h4 {
  color: var(--accent);
  font-size: 20px;
  margin-bottom: 10px;
}

.shop-desc {
  opacity: 0.8;
  margin-bottom: 20px;
}

.shop-buy-btn {
  background: linear-gradient(135deg, var(--accent), #9bb8ff);
  border: none;
  padding: 20px 40px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0 auto 30px;
  color: var(--text);
  box-shadow: 0 4px 15px rgba(122, 162, 255, 0.3);
}

.shop-buy-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(122, 162, 255, 0.5);
}

.shop-buy-btn:active {
  transform: scale(0.98);
}

.shop-item-name {
  font-size: 24px;
}

.shop-item-cost {
  font-size: 16px;
  opacity: 0.9;
}

.discovered-combos {
  background: var(--upgrade-bg);
  border: 2px solid var(--upgrade-border);
  border-radius: 12px;
  padding: 20px;
  margin-top: 30px;
}

.discovered-combos h4 {
  color: var(--accent);
  margin-bottom: 15px;
}

.combo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(212, 165, 116, 0.1);
  border-radius: 8px;
  margin-bottom: 8px;
}

.combo-name {
  font-weight: bold;
  color: var(--accent);
}

.combo-keys {
  font-family: monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 12px;
  border-radius: 4px;
}

.combo-bonus {
  color: #7aa2ff;
  font-weight: bold;
}

.upgrades-panel h2 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--accent);
  font-size: 24px;
}

.upgrades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 10px;
}

.upgrades-grid::-webkit-scrollbar {
  width: 8px;
}

.upgrades-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.upgrades-grid::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.upgrades-grid::-webkit-scrollbar-thumb:hover {
  background: #e4b584;
}

.upgrade-card {
  background: var(--upgrade-bg);
  border: 2px solid var(--upgrade-border);
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  pointer-events: auto;
}

.upgrade-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: transparent;
  transition: all 0.5s ease;
}

.upgrade-card.max-level {
  border-color: #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  animation: maxLevelPulse 2s ease-in-out infinite;
}

.upgrade-card.max-level::before {
  background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
  animation: maxLevelRotate 4s linear infinite;
}

@keyframes maxLevelPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
  }
}

@keyframes maxLevelRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.upgrade-card.max-level h3 {
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.upgrade-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.upgrade-card h3 {
  color: var(--accent);
  margin-bottom: 6px;
  font-size: 16px;
}

.upgrade-card p {
  opacity: 0.8;
  margin-bottom: 12px;
  font-size: 13px;
}

.upgrade-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.upgrade-level {
  font-size: 14px;
  opacity: 0.9;
}

.upgrade-btn {
  background: var(--accent);
  color: var(--text);
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.upgrade-btn:hover {
  background: #e4b584;
  transform: scale(1.05);
}

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

.upgrade-btn:disabled {
  background: #666;
  cursor: not-allowed;
  opacity: 0.5;
}

@media (max-width: 768px) {
  .key {
    width: 45px;
    height: 45px;
    font-size: 14px;
  }
  
  .key.spacebar {
    width: 300px;
  }
  
  .keyboard-container {
    padding: 20px;
  }
  
  .upgrades-grid {
    grid-template-columns: 1fr;
  }
}


.notifications-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  align-items: center;
  max-width: 90vw;
  z-index: 1000;
  pointer-events: none;
}

.combo-notification {
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.15), rgba(155, 184, 255, 0.15));
  color: var(--text);
  padding: 30px 50px;
  border-radius: 16px;
  font-size: 32px;
  font-weight: bold;
  box-shadow: 0 10px 50px rgba(212, 165, 116, 0.3);
  animation: comboAppear 0.3s ease;
  text-align: center;
  white-space: nowrap;
  backdrop-filter: blur(5px);
  border: 2px solid rgba(212, 165, 116, 0.3);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.combo-notification.fade-out {
  animation: comboFadeOut 0.5s ease forwards;
}

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

@keyframes comboFadeOut {
  to {
    transform: translateY(-20px) scale(0.8);
    opacity: 0;
  }
}


.customization-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  overflow-y: auto;
  padding: 20px;
}

.modal-content {
  background: var(--panel-bg);
  border: 3px solid var(--accent);
  border-radius: 16px;
  padding: 30px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  color: var(--accent);
  margin-bottom: 15px;
  font-size: 28px;
}

.modal-content p {
  margin: 10px 0;
  color: var(--keyboard-bg);
}

.key-selector {
  margin: 20px 0;
}

.key-selector input {
  width: 100px;
  padding: 15px;
  font-size: 24px;
  text-align: center;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--bg);
  color: var(--keyboard-bg);
}

.color-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.color-btn {
  width: 100%;
  height: 60px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

.color-btn:hover {
  transform: scale(1.1);
}

.modal-close {
  background: var(--accent);
  color: var(--text);
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin: 10px 5px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #8ab3ff;
  transform: scale(1.05);
}


.sticker-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 20px 0;
}

.sticker-btn {
  width: 100%;
  height: 50px;
  border: 2px solid var(--upgrade-border);
  border-radius: 8px;
  background: var(--upgrade-bg);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.sticker-btn:hover {
  transform: scale(1.1);
  border-color: var(--accent);
}

.sticker-preview {
  margin: 20px 0;
  display: flex;
  justify-content: center;
}

.preview-key {
  width: 120px;
  height: 120px;
  background: var(--key-bg);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 0 var(--key-shadow);
}

.preview-sticker {
  position: absolute;
  font-size: 32px;
  cursor: grab;
  user-select: none;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: filter 0.2s;
}

.preview-sticker:hover {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.preview-sticker:active {
  cursor: grabbing;
}

.key-sticker {
  position: absolute;
  font-size: 24px;
  user-select: none;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

.key {
  position: relative;
  overflow: hidden;
}


.sticker-controls {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.9);
  padding: 6px;
  border-radius: 8px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.control-btn {
  width: 32px;
  height: 32px;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: var(--upgrade-bg);
  color: var(--keyboard-bg);
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.control-btn:hover {
  background: var(--accent);
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(122, 162, 255, 0.5);
}

.rotate-btn {
  background: linear-gradient(135deg, var(--upgrade-bg), rgba(122, 162, 255, 0.2));
}

.delete-btn {
  background: linear-gradient(135deg, #ff6b6b, #ff5252);
  border-color: #ff6b6b;
  color: white;
}

.delete-btn:hover {
  background: linear-gradient(135deg, #ff5252, #ff3838);
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.5);
}

.size-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
  opacity: 0.7;
  transition: all 0.2s;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.size-arrow:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.3);
  filter: drop-shadow(0 0 8px var(--accent));
}

.size-arrow-left {
  left: -30px;
}

.size-arrow-right {
  right: -30px;
}

.preview-sticker {
  position: relative;
}

.preview-sticker:hover .sticker-controls,
.preview-sticker:hover .size-arrow {
  display: flex;
}

.custom-glow {
  animation: customGlow 0.3s ease;
  box-shadow: 0 0 20px currentColor, 0 4px 0 var(--key-shadow);
}

@keyframes customGlow {
  0%, 100% {
    box-shadow: 0 4px 0 var(--key-shadow);
  }
  50% {
    box-shadow: 0 0 30px currentColor, 0 4px 0 var(--key-shadow);
  }
}

.ability-notifications-container {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  max-width: 90vw;
  z-index: 1500;
  pointer-events: none;
}

.ability-notification {
  background: linear-gradient(135deg, rgba(122, 162, 255, 0.15), rgba(212, 165, 116, 0.15));
  color: white;
  padding: 20px 40px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: bold;
  box-shadow: 0 8px 30px rgba(122, 162, 255, 0.4);
  animation: abilityAppear 0.3s ease;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  backdrop-filter: blur(5px);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.ability-notification.fade-out {
  animation: abilityFadeOut 0.5s ease forwards;
}

@keyframes abilityAppear {
  0% {
    transform: scale(0.7) rotate(-5deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.05) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes abilityFadeOut {
  to {
    transform: translateY(-20px) scale(0.8);
    opacity: 0;
  }
}


/* Popups positioned relative to keyboard */
.keyboard-container {
  position: relative;
}

.notifications-container {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  flex-direction: column !important;
  max-width: 600px !important;
  align-items: center !important;
}

.ability-notifications-container {
  position: absolute !important;
  left: 50% !important;
  top: 30% !important;
  transform: translate(-50%, -50%) !important;
  flex-direction: column !important;
  max-width: 600px !important;
  align-items: center !important;
}

/* Golden Key Effects */
.golden-key {
  background: linear-gradient(135deg, #ffd700, #ffed4e, #ffd700) !important;
  animation: goldenPulse 0.8s ease-in-out infinite, goldenFloat 2s ease-in-out infinite, goldenShine 2s linear infinite !important;
  box-shadow: 
    0 0 20px rgba(255, 215, 0, 1),
    0 0 40px rgba(255, 215, 0, 0.8),
    0 0 60px rgba(255, 215, 0, 0.6),
    0 4px 0 #b8860b,
    inset 0 0 20px rgba(255, 255, 255, 0.5) !important;
  position: relative;
  z-index: 100;
  border: 2px solid #ffed4e !important;
}

.golden-key::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  animation: goldenSweep 1.5s linear infinite;
  border-radius: 8px;
  pointer-events: none;
}

.golden-key::after {
  content: '✨';
  position: absolute;
  top: -15px;
  right: -15px;
  font-size: 32px;
  animation: sparkle 1s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 1));
}

@keyframes goldenPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 
      0 0 20px rgba(255, 215, 0, 1),
      0 0 40px rgba(255, 215, 0, 0.8),
      0 0 60px rgba(255, 215, 0, 0.6),
      0 4px 0 #b8860b,
      inset 0 0 20px rgba(255, 255, 255, 0.5);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 
      0 0 30px rgba(255, 215, 0, 1),
      0 0 60px rgba(255, 215, 0, 0.9),
      0 0 90px rgba(255, 215, 0, 0.7),
      0 4px 0 #b8860b,
      inset 0 0 30px rgba(255, 255, 255, 0.7);
  }
}

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

@keyframes goldenShine {
  0% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.3) saturate(1.5);
  }
  100% {
    filter: brightness(1) saturate(1);
  }
}

@keyframes goldenSweep {
  0% {
    transform: translateX(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(200%) rotate(45deg);
  }
}

@keyframes sparkle {
  0%, 100% {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
  25% {
    opacity: 0.7;
    transform: rotate(90deg) scale(1.3);
  }
  50% {
    opacity: 0.4;
    transform: rotate(180deg) scale(1.5);
  }
  75% {
    opacity: 0.7;
    transform: rotate(270deg) scale(1.3);
  }
}

body.golden-mode {
  animation: goldenBackground 1s ease-in-out infinite;
}

body.golden-mode::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 215, 0, 0.1), transparent);
  pointer-events: none;
  z-index: 1;
  animation: goldenPulseOverlay 2s ease-in-out infinite;
}

@keyframes goldenBackground {
  0%, 100% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.15) saturate(1.3) hue-rotate(5deg);
  }
}

@keyframes goldenPulseOverlay {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

/* Achievements */
.achievements-container {
  max-width: 800px;
  margin: 0 auto;
}

.achievements-container h3 {
  color: var(--accent);
  font-size: 24px;
  margin-bottom: 20px;
  text-align: center;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 10px;
}

.achievements-grid::-webkit-scrollbar {
  width: 8px;
}

.achievements-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.achievements-grid::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.achievement-card {
  background: var(--upgrade-bg);
  border: 2px solid var(--upgrade-border);
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  transition: all 0.3s ease;
}

.achievement-card.unlocked {
  border-color: #ffd700;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
}

.achievement-card.locked {
  opacity: 0.5;
  filter: grayscale(1);
}

.achievement-card .achievement-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.achievement-card .achievement-name {
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 5px;
  font-size: 14px;
}

.achievement-card.unlocked .achievement-name {
  color: #ffd700;
}

.achievement-card .achievement-desc {
  font-size: 12px;
  opacity: 0.8;
}

/* Achievement Unlock Popup */
.achievement-unlock {
  position: fixed;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #3a3028;
  padding: 20px 30px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(255, 215, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 15px;
  animation: achievementSlideIn 0.5s ease;
  max-width: 400px;
}

.achievement-unlock.fade-out {
  animation: achievementSlideOut 0.5s ease forwards;
}

@keyframes achievementSlideIn {
  0% {
    transform: translateY(-50%) translateX(-100%);
    opacity: 0;
  }
  100% {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
  }
}

@keyframes achievementSlideOut {
  0% {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-50%) translateX(-100%);
    opacity: 0;
  }
}

.achievement-unlock .achievement-icon {
  font-size: 48px;
}

.achievement-unlock .achievement-content {
  flex: 1;
}

.achievement-unlock .achievement-title {
  font-size: 12px;
  font-weight: bold;
  opacity: 0.8;
  margin-bottom: 5px;
}

.achievement-unlock .achievement-name {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 5px;
}

.achievement-unlock .achievement-desc {
  font-size: 14px;
  opacity: 0.9;
}

.achievement-unlock .achievement-more {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 5px;
  font-style: italic;
}

/* Backgrounds Grid */
.backgrounds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.background-card {
  background: var(--upgrade-bg);
  border: 2px solid var(--upgrade-border);
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s ease;
  text-align: center;
}

.background-card.owned {
  border-color: var(--accent);
}

.background-card.active {
  border-color: #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.background-card:hover {
  transform: translateY(-3px);
}

.bg-preview {
  width: 100%;
  height: 100px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 2px solid var(--upgrade-border);
}

.bg-info {
  margin-bottom: 10px;
}

.bg-name {
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 5px;
}

.bg-desc {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 8px;
}

.bg-cost {
  font-size: 14px;
  color: #7aa2ff;
  font-weight: bold;
}

.bg-btn {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: var(--text);
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.bg-btn:hover {
  background: #e4b584;
  transform: scale(1.05);
}

.background-card.locked .bg-btn {
  background: rgba(122, 162, 255, 0.3);
}

.background-card.active .bg-btn {
  background: #ffd700;
  cursor: default;
}

/* Background Animations */
.animated-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -10;
  pointer-events: none;
}

@keyframes floatShape {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(20px, -30px) rotate(90deg);
  }
  50% {
    transform: translate(-10px, -50px) rotate(180deg);
  }
  75% {
    transform: translate(-30px, -20px) rotate(270deg);
  }
}

@keyframes chaosAppear {
  0%, 20% {
    opacity: 0;
  }
  30%, 70% {
    opacity: 1;
  }
  80%, 100% {
    opacity: 0;
  }
}

@keyframes monsterEmerge {
  0%, 25% {
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
    opacity: 0;
  }
  35% {
    transform: translate(-50%, -50%) scale(1.2) rotate(10deg);
    opacity: 1;
  }
  40%, 60% {
    transform: translate(-50%, -50%) scale(1) rotate(-5deg);
    opacity: 1;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
    opacity: 1;
  }
  75%, 100% {
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
    opacity: 0;
  }
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.5);
  }
}

@keyframes matrixFall {
  0% {
    top: -100%;
  }
  100% {
    top: 100%;
  }
}

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

.shop-section {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 2px solid var(--upgrade-border);
}

.shop-section:last-child {
  border-bottom: none;
}

.shop-section h4 {
  color: var(--accent);
  font-size: 20px;
  margin-bottom: 10px;
}

/* Money Background Animations */
@keyframes moneyFall {
  0% {
    top: -50px;
    transform: rotate(0deg);
  }
  100% {
    top: 110%;
    transform: rotate(720deg);
  }
}

@keyframes moneyPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@keyframes coinFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-20px) rotate(90deg);
  }
  50% {
    transform: translateY(-30px) rotate(180deg);
  }
  75% {
    transform: translateY(-20px) rotate(270deg);
  }
}

/* Aurora Animations */
@keyframes auroraWave {
  0%, 100% {
    transform: translateX(0) scaleY(1);
    opacity: 0.3;
  }
  50% {
    transform: translateX(50%) scaleY(1.5);
    opacity: 0.6;
  }
}

/* Fire Animations */
@keyframes flameRise {
  0% {
    bottom: -50px;
    opacity: 1;
    transform: scale(1);
  }
  100% {
    bottom: 110%;
    opacity: 0;
    transform: scale(0.5);
  }
}

/* Lightning Animations */
@keyframes lightningStrike {
  0%, 90%, 100% {
    top: -50px;
    opacity: 0;
  }
  95% {
    top: 50%;
    opacity: 1;
  }
}

/* Nebula Animations */
@keyframes nebulaDrift {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(50px, 30px) scale(1.2);
  }
}

/* Plasma Animations */
@keyframes plasmaFlow {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(30px, -30px) scale(1.3);
    opacity: 0.8;
  }
}

/* Diamond Animations */
@keyframes diamondFall {
  0% {
    top: -50px;
    transform: rotate(0deg);
  }
  100% {
    top: 110%;
    transform: rotate(360deg);
  }
}

/* Galaxy Animations */
@keyframes galaxySpin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Rainbow Animations */
@keyframes rainbowFlow {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(25%);
  }
}

/* Cosmic Animations */
@keyframes cosmicChaos {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  25% {
    transform: translate(30px, -20px) rotate(90deg) scale(1.2);
  }
  50% {
    transform: translate(-20px, 30px) rotate(180deg) scale(0.8);
  }
  75% {
    transform: translate(-30px, -30px) rotate(270deg) scale(1.1);
  }
}

/* Quantum Animations */
@keyframes quantumFlux {
  0%, 100% {
    transform: scale(1);
    opacity: 0.2;
  }
  50% {
    transform: scale(2);
    opacity: 1;
  }
}

/* Infinity Animations */
@keyframes infinityPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.8;
  }
}

@keyframes infinityOrbit {
  0% {
    transform: rotate(0deg) translateX(150px) rotate(0deg);
  }
  100% {
    transform: rotate(360deg) translateX(150px) rotate(-360deg);
  }
}

/* Offline Earnings Popup */
.offline-earnings-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.offline-earnings-popup.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

.offline-earnings-content {
  background: linear-gradient(135deg, var(--panel-bg), var(--bg));
  border: 3px solid var(--accent);
  border-radius: 16px;
  padding: 40px;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  animation: popIn 0.3s ease;
}

.offline-earnings-content h2 {
  color: var(--accent);
  font-size: 32px;
  margin-bottom: 20px;
}

.offline-earnings-content p {
  font-size: 18px;
  margin: 10px 0;
  color: var(--keyboard-bg);
}

.offline-earnings-amount {
  font-size: 36px !important;
  font-weight: bold;
  color: #4ade80 !important;
  margin: 20px 0 !important;
  text-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

.offline-earnings-note {
  font-size: 14px !important;
  opacity: 0.7;
  font-style: italic;
}

.offline-earnings-close {
  background: linear-gradient(135deg, var(--accent), #9bb8ff);
  color: var(--text);
  border: none;
  padding: 15px 40px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.2s;
}

.offline-earnings-close:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(122, 162, 255, 0.4);
}

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

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

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

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

@keyframes chaosShapeMove {
  0%, 100% {
    transform: rotate(0deg) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: rotate(180deg) scale(1.2);
    opacity: 0.8;
  }
}

@keyframes particleFloat {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0.3;
  }
  25% {
    transform: translateY(-30px) translateX(20px);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-50px) translateX(-10px);
    opacity: 1;
  }
  75% {
    transform: translateY(-30px) translateX(-30px);
    opacity: 0.8;
  }
}


/* Golden Key Timer */
.golden-key-timer {
  position: fixed;
  top: 100px;
  right: 20px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 165, 0, 0.95));
  border: 3px solid #ffd700;
  border-radius: 12px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 1000;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
  animation: goldenTimerPulse 1s ease-in-out infinite;
}

.golden-timer-icon {
  font-size: 40px;
  animation: goldenTimerSpin 2s linear infinite;
}

.golden-timer-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.golden-timer-multiplier {
  font-size: 28px;
  font-weight: bold;
  color: #000;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.golden-timer-countdown {
  font-size: 18px;
  font-weight: bold;
  color: #000;
}

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

@keyframes goldenTimerSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Rebirth Animation */
.rebirth-animation {
  animation: fadeIn 0.3s ease;
}

@keyframes explodeKey {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(
      calc((50vw - 50%) * (var(--random-x, 1))),
      calc((50vh - 50%) * (var(--random-y, 1)))
    ) rotate(720deg) scale(0);
    opacity: 0;
  }
}

@keyframes floatWord {
  0%, 100% {
    transform: translateY(0) translateX(0) rotate(0deg);
  }
  25% {
    transform: translateY(-30px) translateX(20px) rotate(5deg);
  }
  50% {
    transform: translateY(-50px) translateX(-10px) rotate(-5deg);
  }
  75% {
    transform: translateY(-30px) translateX(-30px) rotate(3deg);
  }
}

@keyframes floatEmoji {
  0%, 100% {
    transform: translateY(0) translateX(0) rotate(0deg) scale(1);
  }
  25% {
    transform: translateY(-40px) translateX(30px) rotate(90deg) scale(1.2);
  }
  50% {
    transform: translateY(-60px) translateX(-20px) rotate(180deg) scale(0.8);
  }
  75% {
    transform: translateY(-40px) translateX(-40px) rotate(270deg) scale(1.1);
  }
}

@keyframes fadeInWord {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes flashWhite {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Additional Background Animations */

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(-20px) translateX(10px);
  }
  50% {
    transform: translateY(-30px) translateX(-10px);
  }
  75% {
    transform: translateY(-20px) translateX(-15px);
  }
}

@keyframes shootingStar {
  0% {
    left: -100px;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    left: 120%;
    opacity: 0;
  }
}

@keyframes rainbowSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

@keyframes lightningFlash {
  0%, 90%, 100% {
    opacity: 0;
  }
  92%, 96% {
    opacity: 1;
  }
  94% {
    opacity: 0.5;
  }
}

@keyframes quantumWave {
  0%, 100% {
    opacity: 0;
    transform: rotate(0deg) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: rotate(180deg) scale(1.5);
  }
}

@keyframes glitchFlash {
  0%, 80%, 100% {
    opacity: 0;
  }
  85%, 95% {
    opacity: 1;
  }
  90% {
    opacity: 0.3;
  }
}

@keyframes quantumLine {
  0%, 100% {
    opacity: 0;
    transform: scaleX(0);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes infinityTrail {
  0%, 100% {
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) rotate(180deg) scale(1.5);
    opacity: 0.8;
  }
}

@keyframes infinityRing {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.3;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.6;
  }
}

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

@keyframes riftPulse {
  0%, 100% {
    opacity: 0.3;
    box-shadow: 0 0 10px currentColor;
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 30px currentColor;
  }
}

/* Enhanced Rebirth Animations */

@keyframes expandRing {
  0% {
    width: 100px;
    height: 100px;
    opacity: 1;
  }
  100% {
    width: 800px;
    height: 800px;
    opacity: 0;
  }
}

@keyframes phoenixPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    filter: drop-shadow(0 0 30px rgba(255, 100, 0, 1));
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2) rotate(10deg);
    filter: drop-shadow(0 0 50px rgba(255, 150, 0, 1));
  }
}

@keyframes explodeKeyEnhanced {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(
      calc((50vw - 50%) * var(--random-x, 1)),
      calc((50vh - 50%) * var(--random-y, 1))
    ) rotate(720deg) scale(0);
    opacity: 0;
  }
}

@keyframes progressFill {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes titlePulse {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    text-shadow: 0 0 30px currentColor, 0 0 60px currentColor;
  }
  50% {
    transform: translateX(-50%) scale(1.05);
    text-shadow: 0 0 40px currentColor, 0 0 80px currentColor;
  }
}

@keyframes finalFlash {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Flame Crackle Animation */
@keyframes flameCrackle {
  0% {
    transform: scaleY(1) scaleX(1);
    opacity: 0.9;
  }
  100% {
    transform: scaleY(1.3) scaleX(0.9);
    opacity: 1;
  }
}

/* Shop Items Grid */
.shop-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.shop-item-card {
  background: var(--upgrade-bg);
  border: 2px solid var(--upgrade-border);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all 0.3s;
  position: relative;
}

.shop-item-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
}

.shop-item-card.owned {
  background: rgba(212, 165, 116, 0.15);
  border-color: var(--accent);
}

.shop-item-card.locked {
  opacity: 0.6;
}

.item-icon {
  font-size: 32px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-weight: bold;
  color: var(--text-light);
  margin-bottom: 5px;
  font-size: 14px;
}

.item-desc {
  font-size: 12px;
  color: rgba(245, 230, 211, 0.7);
  line-height: 1.4;
  margin-bottom: 8px;
}

.item-status {
  font-size: 11px;
  color: var(--accent);
  font-style: italic;
  margin-top: 5px;
}

.item-cost {
  font-size: 13px;
  color: var(--accent);
  font-weight: bold;
  margin-top: 5px;
}

.item-btn {
  padding: 8px 16px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: var(--panel-bg);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 12px;
  white-space: nowrap;
  align-self: center;
}

.item-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(212, 165, 116, 0.4);
}

.shop-item-card.owned .item-btn {
  background: rgba(212, 165, 116, 0.3);
  color: var(--text-light);
}

.shop-item-card.locked .item-btn {
  background: rgba(139, 115, 85, 0.3);
  cursor: not-allowed;
}

/* Key Animations */
@keyframes keyPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 8px var(--key-shadow); }
  50% { transform: scale(1.1); box-shadow: 0 6px 16px var(--accent), 0 0 20px var(--accent); }
}

/* Screen Shake */
@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  10%, 30%, 50%, 70%, 90% { transform: translate(-5px, 0); }
  20%, 40%, 60%, 80% { transform: translate(5px, 0); }
}

/* Key Skins */
.key.neon-skin {
  background: linear-gradient(135deg, #00f5ff, #ff00ff);
  border: 2px solid #00f5ff;
  box-shadow: 0 0 20px #00f5ff, 0 4px 8px rgba(0, 0, 0, 0.3);
  color: #fff;
  text-shadow: 0 0 10px #fff;
}

.key.retro-skin {
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  color: #fff;
  font-family: 'Courier New', monospace;
  font-weight: bold;
}

.key.glass-skin {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  color: var(--text-light);
}

.key.holographic-skin {
  background: linear-gradient(45deg, #ff0080, #ff8c00, #40e0d0, #ff0080);
  background-size: 300% 300%;
  animation: holographicShift 3s ease infinite;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
  color: #fff;
  text-shadow: 0 0 10px #000;
}

@keyframes holographicShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Cursor Effects */
body.cursor-sparkle * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><circle cx="12" cy="12" r="8" fill="%23ffd700" opacity="0.8"/><circle cx="12" cy="12" r="4" fill="%23fff"/></svg>') 12 12, auto;
}

body.cursor-fire * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><circle cx="12" cy="12" r="8" fill="%23ff4500" opacity="0.8"/><circle cx="12" cy="12" r="4" fill="%23ff8c00"/></svg>') 12 12, auto;
}

body.cursor-lightning * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><circle cx="12" cy="12" r="8" fill="%2300f5ff" opacity="0.8"/><circle cx="12" cy="12" r="4" fill="%23fff"/></svg>') 12 12, auto;
}

body.cursor-rainbow * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><circle cx="12" cy="12" r="8" fill="%23ff00ff" opacity="0.8"/><circle cx="12" cy="12" r="4" fill="%2300ffff"/></svg>') 12 12, auto;
}

/* Notification Styles */
.notifications-corner.notif-minimal .notification {
  background: rgba(26, 21, 16, 0.7);
  border: 1px solid rgba(212, 165, 116, 0.3);
  padding: 8px 12px;
  font-size: 11px;
}

.notifications-corner.notif-bold .notification {
  background: var(--accent);
  color: var(--panel-bg);
  border: 3px solid var(--panel-bg);
  font-weight: bold;
  font-size: 14px;
  text-transform: uppercase;
}

.notifications-corner.notif-retro .notification {
  background: #000;
  color: #0f0;
  border: 2px solid #0f0;
  font-family: 'Courier New', monospace;
  text-shadow: 0 0 5px #0f0;
}

.notifications-corner.notif-futuristic .notification {
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.2), rgba(255, 0, 255, 0.2));
  border: 1px solid rgba(0, 245, 255, 0.5);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

/* New Ascension Background Animations */

@keyframes portalSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes singularityPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 100px rgba(0, 255, 136, 1), 0 0 200px rgba(0, 255, 136, 0.5);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 150px rgba(0, 255, 136, 1), 0 0 300px rgba(0, 255, 136, 0.8);
  }
}

@keyframes quantumSuck {
  0% {
    opacity: 1;
  }
  100% {
    left: 50%;
    top: 50%;
    opacity: 0;
    transform: scale(0);
  }
}

@keyframes gravitationalWave {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

@keyframes eternalFlame {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.3) rotate(180deg);
    opacity: 1;
  }
}

@keyframes celestialPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
}

@keyframes crownFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-30px) rotate(10deg);
  }
}

@keyframes divineSpiral {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes radiantBurst {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

@keyframes fireSpiral {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
  to {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
  }
}

/* Upgrade Ascension Tiers */
.upgrade-card.ascension-1 {
  border-color: #00d9ff;
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.15), rgba(0, 217, 255, 0.05));
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

.upgrade-card.ascension-1 h3 {
  color: #00d9ff;
  text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

.upgrade-card.ascension-1::before {
  background: radial-gradient(circle, rgba(0, 217, 255, 0.1) 0%, transparent 70%);
  animation: ascensionRotate 4s linear infinite;
}

.upgrade-card.ascension-2 {
  border-color: #d946ef;
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.15), rgba(217, 70, 239, 0.05));
  box-shadow: 0 0 20px rgba(217, 70, 239, 0.4);
}

.upgrade-card.ascension-2 h3 {
  color: #d946ef;
  text-shadow: 0 0 10px rgba(217, 70, 239, 0.5);
}

.upgrade-card.ascension-2::before {
  background: radial-gradient(circle, rgba(217, 70, 239, 0.15) 0%, transparent 70%);
  animation: ascensionRotate 3s linear infinite;
}

.upgrade-card.ascension-3 {
  border-color: #ffd700;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
}

.upgrade-card.ascension-3 h3 {
  color: #ffd700;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
}

.upgrade-card.ascension-3::before {
  background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
  animation: ascensionRotate 2s linear infinite;
}

@keyframes ascensionRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.ascension-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  z-index: 5;
}

.ascension-badge.tier-1 {
  background: linear-gradient(135deg, #00d9ff, #00a8cc);
  color: #000;
  box-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

.ascension-badge.tier-2 {
  background: linear-gradient(135deg, #d946ef, #a020f0);
  color: #fff;
  box-shadow: 0 0 10px rgba(217, 70, 239, 0.5);
}

.ascension-badge.tier-3 {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #000;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
  animation: divinePulse 2s ease-in-out infinite;
}

@keyframes divinePulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
  }
  50% {
    box-shadow: 0 0 25px rgba(255, 215, 0, 1);
  }
}

/* Minigame Modal */
.minigame-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 15000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

/* Minigame Selection Screen */
.minigame-selection-container {
  width: 100vw;
  height: 100vh;
  padding: 60px 40px;
  background: var(--panel-bg);
  overflow-y: auto;
}

.minigame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  max-width: 1400px;
  margin: 20px auto;
  padding: 20px;
}

.minigame-card {
  background: var(--upgrade-bg);
  border: 2px solid var(--upgrade-border);
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.minigame-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(212, 165, 116, 0.3);
}

.minigame-icon {
  font-size: 64px;
  margin-bottom: 15px;
}

.minigame-card h3 {
  color: var(--accent);
  font-size: 24px;
  margin-bottom: 10px;
}

.minigame-card p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 15px;
  opacity: 0.8;
}

.minigame-difficulty {
  color: var(--accent);
  font-weight: bold;
  font-size: 16px;
}

.minigame-container {
  width: 100vw;
  height: 100vh;
  background: var(--panel-bg);
  border: none;
  border-radius: 0;
  position: relative;
  overflow: hidden;
}

.minigame-header {
  background: rgba(212, 165, 116, 0.2);
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--accent);
}

.minigame-score {
  font-size: 32px;
  font-weight: bold;
  color: var(--accent);
}

.minigame-exit {
  background: rgba(255, 107, 107, 0.3);
  border: 2px solid #ff6b6b;
  color: #ff6b6b;
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.minigame-exit:hover {
  background: rgba(255, 107, 107, 0.5);
  transform: scale(1.05);
}

.minigame-canvas {
  width: 100%;
  height: calc(100vh - 80px);
  position: relative;
  background: linear-gradient(180deg, rgba(42, 37, 32, 0.3) 0%, rgba(26, 21, 16, 0.8) 100%);
}

.minigame-target-zone {
  position: absolute;
  bottom: 150px;
  left: 0;
  width: 100%;
  height: 100px;
  background: rgba(212, 165, 116, 0.1);
  border-top: 4px solid rgba(212, 165, 116, 0.5);
  border-bottom: 4px solid rgba(212, 165, 116, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: rgba(212, 165, 116, 0.3);
  font-weight: bold;
}

.falling-letter {
  position: absolute;
  font-size: 64px;
  font-weight: bold;
  color: var(--accent);
  text-shadow: 0 0 15px var(--accent);
  animation: letterFall linear;
  pointer-events: none;
}

@keyframes letterFall {
  from {
    top: 0;
  }
  to {
    top: 100%;
  }
}

.minigame-upgrades {
  padding: 15px 20px;
  background: rgba(26, 21, 16, 0.5);
  border-top: 2px solid var(--upgrade-border);
  display: flex;
  gap: 10px;
  justify-content: space-around;
}

.minigame-upgrade-btn {
  flex: 1;
  padding: 10px;
  background: var(--upgrade-bg);
  border: 2px solid var(--upgrade-border);
  border-radius: 8px;
  color: var(--keyboard-bg);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-size: 12px;
}

.minigame-upgrade-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.minigame-upgrade-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.minigame-hit-feedback {
  position: absolute;
  font-size: 32px;
  font-weight: bold;
  animation: hitFeedback 0.5s ease forwards;
  pointer-events: none;
  z-index: 100;
}

.minigame-hit-feedback.perfect {
  color: #ffd700;
  text-shadow: 0 0 20px #ffd700;
}

.minigame-hit-feedback.good {
  color: #4ade80;
  text-shadow: 0 0 20px #4ade80;
}

.minigame-hit-feedback.miss {
  color: #ff6b6b;
  text-shadow: 0 0 20px #ff6b6b;
}

@keyframes hitFeedback {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1) translateY(-50px);
    opacity: 0;
  }
}

/* Word Race Minigame */
.word-race-game {
  width: 100%;
  height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(42, 37, 32, 0.3) 0%, rgba(26, 21, 16, 0.8) 100%);
}

.word-race-display {
  text-align: center;
  padding: 40px;
}

.word-race-current-word {
  font-size: 96px;
  font-weight: bold;
  margin-bottom: 30px;
  letter-spacing: 8px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.word-race-typed {
  font-size: 48px;
  color: var(--accent);
  margin-bottom: 40px;
  min-height: 60px;
  font-family: monospace;
}

.word-race-next-words {
  font-size: 24px;
  color: var(--text-light);
  opacity: 0.6;
  min-height: 40px;
}

.minigame-stats {
  font-size: 20px;
  color: var(--text);
  display: flex;
  gap: 20px;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

/* Speed Test Minigame */
.speed-test-game {
  width: 100%;
  height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(42, 37, 32, 0.3) 0%, rgba(26, 21, 16, 0.8) 100%);
}

.speed-test-display {
  text-align: center;
  padding: 60px;
  max-width: 1200px;
}

.speed-test-prompt {
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 40px;
  line-height: 1.8;
  letter-spacing: 2px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font-family: 'Courier New', monospace;
}

.speed-test-input-display {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 30px;
  min-height: 40px;
  font-family: 'Courier New', monospace;
  opacity: 0.7;
}

.speed-test-progress {
  width: 100%;
  height: 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--accent);
}

.speed-test-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #4ade80);
  width: 0%;
  transition: width 0.2s ease;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

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

/* Accuracy Challenge Minigame */
.accuracy-game {
  width: 100%;
  height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(42, 37, 32, 0.3) 0%, rgba(26, 21, 16, 0.8) 100%);
}

.accuracy-display {
  text-align: center;
  padding: 60px;
  max-width: 1000px;
}

.accuracy-instruction {
  font-size: 24px;
  color: var(--text-light);
  margin-bottom: 30px;
  opacity: 0.8;
}

.accuracy-target {
  font-size: 72px;
  font-weight: bold;
  margin-bottom: 40px;
  letter-spacing: 12px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', monospace;
}

.accuracy-input-display {
  font-size: 36px;
  color: var(--accent);
  margin-bottom: 30px;
  min-height: 50px;
  font-family: 'Courier New', monospace;
  opacity: 0.7;
}

.accuracy-feedback {
  font-size: 32px;
  font-weight: bold;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Powers Tab */
.powers-container {
  max-width: 800px;
  margin: 0 auto;
}

.powers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 10px;
}

.powers-grid::-webkit-scrollbar {
  width: 8px;
}

.powers-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.powers-grid::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.power-card {
  background: var(--upgrade-bg);
  border: 2px solid var(--upgrade-border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.power-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.power-card.active {
  border-color: #4ade80;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.15), rgba(74, 222, 128, 0.05));
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
}

.power-card.cooldown {
  opacity: 0.6;
  border-color: #666;
}

.power-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.power-icon {
  font-size: 40px;
}

.power-info {
  flex: 1;
}

.power-name {
  font-weight: bold;
  color: var(--accent);
  font-size: 18px;
  margin-bottom: 5px;
}

.power-card.active .power-name {
  color: #4ade80;
}

.power-desc {
  font-size: 13px;
  opacity: 0.8;
  margin-bottom: 15px;
}

.power-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.power-timer {
  font-size: 14px;
  font-weight: bold;
  color: #4ade80;
}

.power-cooldown {
  font-size: 14px;
  font-weight: bold;
  color: #ff6b6b;
}

.power-activate-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent), #9bb8ff);
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.power-activate-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(122, 162, 255, 0.4);
}

.power-activate-btn:disabled {
  background: #666;
  cursor: not-allowed;
  opacity: 0.5;
}

.power-card.active .power-activate-btn {
  background: linear-gradient(135deg, #4ade80, #22c55e);
}

.power-card.active .power-activate-btn:disabled {
  background: #4ade80;
  opacity: 0.7;
}

.no-powers-message {
  text-align: center;
  padding: 60px 20px;
  opacity: 0.7;
}

.no-powers-message h4 {
  color: var(--accent);
  font-size: 20px;
  margin-bottom: 10px;
}

.no-powers-message p {
  font-size: 14px;
  margin-bottom: 20px;
}

.go-to-shop-btn {
  padding: 12px 30px;
  background: linear-gradient(135deg, var(--accent), #9bb8ff);
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.go-to-shop-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(122, 162, 255, 0.4);
}

/* Packs Tab */
.packs-container {
  max-width: 800px;
  margin: 0 auto;
}

.packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 10px;
}

.packs-grid::-webkit-scrollbar {
  width: 8px;
}

.packs-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.packs-grid::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.pack-card {
  background: var(--upgrade-bg);
  border: 2px solid var(--upgrade-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.pack-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.pack-card.active {
  border-color: #4ade80;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.15), rgba(74, 222, 128, 0.05));
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
}

.pack-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.pack-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.pack-name {
  font-weight: bold;
  color: var(--accent);
  font-size: 18px;
  margin-bottom: 10px;
}

.pack-card.active .pack-name {
  color: #4ade80;
}

.pack-desc {
  font-size: 13px;
  opacity: 0.8;
  margin-bottom: 15px;
}

.pack-cost {
  font-size: 14px;
  color: #ffd700;
  font-weight: bold;
  margin-bottom: 10px;
}

.pack-status {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 10px;
}

.pack-status.owned {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

.pack-status.locked {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
}

/* Pack Options Modal */
.pack-option-btn {
  padding: 12px 20px;
  background: var(--upgrade-bg);
  border: 2px solid var(--upgrade-border);
  border-radius: 8px;
  color: var(--keyboard-bg);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.pack-option-btn:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.pack-option-btn.active {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  border-color: #4ade80;
  color: #000;
}

/* Game Theme Variations */
body.theme-dark {
  --bg: #000000;
  --keyboard-bg: #1a1a1a;
  --key-bg: #2a2a2a;
  --key-shadow: #0a0a0a;
  --key-pressed: #3a3a3a;
  --text: #ffffff;
  --text-light: #e0e0e0;
  --panel-bg: #0a0a0a;
  --accent: #00d9ff;
  --upgrade-bg: rgba(0, 217, 255, 0.1);
  --upgrade-border: rgba(0, 217, 255, 0.3);
}

body.theme-dark .stat-value,
body.theme-dark .upgrade-card h3,
body.theme-dark .pack-name,
body.theme-dark .power-name {
  color: #00d9ff !important;
}

body.theme-neon {
  --bg: #0a0014;
  --keyboard-bg: #1a0a2e;
  --key-bg: #2d1b4e;
  --key-shadow: #0f0520;
  --key-pressed: #3d2b5e;
  --text: #00ffff;
  --text-light: #ff00ff;
  --panel-bg: #0f0520;
  --accent: #ff00ff;
  --upgrade-bg: rgba(255, 0, 255, 0.1);
  --upgrade-border: rgba(255, 0, 255, 0.3);
}

body.theme-neon .stat-label,
body.theme-neon .upgrade-card p,
body.theme-neon .pack-desc,
body.theme-neon .power-desc {
  color: #00ffff !important;
  opacity: 1 !important;
}

body.theme-sunset {
  --bg: #1a0a0a;
  --keyboard-bg: #3a1a0a;
  --key-bg: #5a2a1a;
  --key-shadow: #2a0a0a;
  --key-pressed: #4a1a0a;
  --text: #ffaa00;
  --text-light: #ff6b35;
  --panel-bg: #2a0a0a;
  --accent: #ff6b35;
  --upgrade-bg: rgba(255, 107, 53, 0.1);
  --upgrade-border: rgba(255, 107, 53, 0.3);
}

body.theme-sunset .stat-label,
body.theme-sunset .upgrade-card p,
body.theme-sunset .pack-desc,
body.theme-sunset .power-desc {
  color: #ffcc88 !important;
  opacity: 1 !important;
}

body.theme-ocean {
  --bg: #0a1a2a;
  --keyboard-bg: #1a2a3a;
  --key-bg: #2a3a4a;
  --key-shadow: #0a1a2a;
  --key-pressed: #1a2a3a;
  --text: #00d9ff;
  --text-light: #4ecdc4;
  --panel-bg: #0a1520;
  --accent: #4ecdc4;
  --upgrade-bg: rgba(78, 205, 196, 0.1);
  --upgrade-border: rgba(78, 205, 196, 0.3);
}

body.theme-ocean .stat-label,
body.theme-ocean .upgrade-card p,
body.theme-ocean .pack-desc,
body.theme-ocean .power-desc {
  color: #88e6dd !important;
  opacity: 1 !important;
}

body.theme-forest {
  --bg: #0a1a0a;
  --keyboard-bg: #1a2a1a;
  --key-bg: #2a3a2a;
  --key-shadow: #0a1a0a;
  --key-pressed: #1a2a1a;
  --text: #a8e6cf;
  --text-light: #dcedc1;
  --panel-bg: #0a1510;
  --accent: #7cb342;
  --upgrade-bg: rgba(124, 179, 66, 0.1);
  --upgrade-border: rgba(124, 179, 66, 0.3);
}

body.theme-forest .stat-label,
body.theme-forest .upgrade-card p,
body.theme-forest .pack-desc,
body.theme-forest .power-desc {
  color: #c8f0b8 !important;
  opacity: 1 !important;
}

/* Enhanced Cursor Effects - Proper cursor styling only, no widgets */

/* Default Cursor */
body.cursor-default,
body.cursor-default * {
  cursor: default;
}

/* Sparkle Cursor - Colorful glowing cursor */
body.cursor-sparkle,
body.cursor-sparkle * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><defs><filter id="glow"><feGaussianBlur stdDeviation="3" result="coloredBlur"/><feMerge><feMergeNode in="coloredBlur"/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><g filter="url(%23glow)"><path d="M 24 4 L 26 22 L 44 24 L 26 26 L 24 44 L 22 26 L 4 24 L 22 22 Z" fill="%23FFD700" stroke="%23FFF" stroke-width="2"/><circle cx="24" cy="24" r="6" fill="%23FFF"/></g></svg>') 24 24, auto !important;
}

/* Fire Cursor - Flame shaped glowing cursor */
body.cursor-fire,
body.cursor-fire * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><defs><filter id="glow"><feGaussianBlur stdDeviation="4" result="coloredBlur"/><feMerge><feMergeNode in="coloredBlur"/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><g filter="url(%23glow)"><path d="M 24 4 Q 28 12 28 20 Q 32 16 36 20 Q 36 32 24 44 Q 12 32 12 20 Q 16 16 20 20 Q 20 12 24 4 Z" fill="%23FF4500" stroke="%23FF8C00" stroke-width="2"/><ellipse cx="24" cy="28" rx="8" ry="12" fill="%23FFD700"/></g></svg>') 24 24, auto !important;
}

/* Lightning Cursor - Electric bolt cursor */
body.cursor-lightning,
body.cursor-lightning * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><defs><filter id="glow"><feGaussianBlur stdDeviation="3" result="coloredBlur"/><feMerge><feMergeNode in="coloredBlur"/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><g filter="url(%23glow)"><path d="M 28 4 L 16 24 L 24 24 L 20 44 L 32 24 L 24 24 Z" fill="%2300F5FF" stroke="%23FFF" stroke-width="2"/><circle cx="24" cy="24" r="4" fill="%23FFF"/></g></svg>') 24 24, auto !important;
}

/* Rainbow Cursor - Multi-colored glowing cursor */
body.cursor-rainbow,
body.cursor-rainbow * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><defs><filter id="glow"><feGaussianBlur stdDeviation="4" result="coloredBlur"/><feMerge><feMergeNode in="coloredBlur"/><feMergeNode in="SourceGraphic"/></feMerge></filter><linearGradient id="rainbow" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" style="stop-color:%23FF0080"/><stop offset="33%25" style="stop-color:%2300F5FF"/><stop offset="66%25" style="stop-color:%23FFD700"/><stop offset="100%25" style="stop-color:%23FF0080"/></linearGradient></defs><g filter="url(%23glow)"><circle cx="24" cy="24" r="16" fill="url(%23rainbow)" stroke="%23FFF" stroke-width="3"/><circle cx="24" cy="24" r="8" fill="%23FFF"/></g></svg>') 24 24, auto !important;
}

/* Retro Cursor - Pixelated 8-bit style cursor */
body.cursor-retro,
body.cursor-retro * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><defs><filter id="glow"><feGaussianBlur stdDeviation="2" result="coloredBlur"/><feMerge><feMergeNode in="coloredBlur"/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><g filter="url(%23glow)" shape-rendering="crispEdges"><rect x="20" y="8" width="8" height="4" fill="%23FFF"/><rect x="16" y="12" width="16" height="4" fill="%23FFF"/><rect x="12" y="16" width="24" height="4" fill="%23FFF"/><rect x="16" y="20" width="16" height="4" fill="%23FFF"/><rect x="20" y="24" width="8" height="4" fill="%23FFF"/><rect x="22" y="28" width="4" height="8" fill="%23FFF"/><rect x="18" y="10" width="12" height="2" fill="%23FF00FF"/><rect x="14" y="14" width="20" height="2" fill="%2300FFFF"/><rect x="18" y="18" width="12" height="2" fill="%23FFD700"/></g></svg>') 24 24, auto !important;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Cursor Trail Particles */
.cursor-particle {
  position: fixed;
  pointer-events: none;
  z-index: 99998;
  animation: particleFade 1s ease-out forwards;
}

@keyframes particleFade {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0);
  }
}


/* ========================================
   INFINITY LOOP BACKGROUND - ULTIMATE
   ======================================== */

/* Infinity background with animated gradient */
body[data-background="infinity"] {
  background: linear-gradient(45deg, 
    #000000 0%, 
    #1a0033 10%, 
    #330066 20%, 
    #4d0099 30%, 
    #6600cc 40%, 
    #7f00ff 50%, 
    #6600cc 60%, 
    #4d0099 70%, 
    #330066 80%, 
    #1a0033 90%, 
    #000000 100%
  );
  background-size: 400% 400%;
  animation: infinityGradient 15s ease infinite;
  position: relative;
}

/* Animated gradient movement */
@keyframes infinityGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Infinity keyboard container with holographic effect */
body[data-background="infinity"] .keyboard-container {
  background: linear-gradient(135deg, 
    rgba(127, 0, 255, 0.1) 0%,
    rgba(255, 0, 255, 0.1) 25%,
    rgba(0, 255, 255, 0.1) 50%,
    rgba(255, 0, 255, 0.1) 75%,
    rgba(127, 0, 255, 0.1) 100%
  );
  background-size: 400% 400%;
  animation: infinityKeyboardGlow 10s ease infinite;
  border: 2px solid rgba(127, 0, 255, 0.5);
  box-shadow: 
    0 0 30px rgba(127, 0, 255, 0.5),
    0 0 60px rgba(255, 0, 255, 0.3),
    inset 0 0 30px rgba(127, 0, 255, 0.1);
  position: relative;
}

@keyframes infinityKeyboardGlow {
  0%, 100% {
    background-position: 0% 50%;
    box-shadow: 
      0 0 30px rgba(127, 0, 255, 0.5),
      0 0 60px rgba(255, 0, 255, 0.3),
      inset 0 0 30px rgba(127, 0, 255, 0.1);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 
      0 0 40px rgba(255, 0, 255, 0.6),
      0 0 80px rgba(127, 0, 255, 0.4),
      inset 0 0 40px rgba(255, 0, 255, 0.2);
  }
}

/* Infinity keys with rainbow shimmer */
body[data-background="infinity"] .key {
  background: linear-gradient(135deg,
    rgba(20, 20, 30, 0.9) 0%,
    rgba(40, 20, 60, 0.9) 50%,
    rgba(20, 20, 30, 0.9) 100%
  );
  border: 2px solid rgba(127, 0, 255, 0.6);
  box-shadow: 
    0 4px 15px rgba(127, 0, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  color: #ffffff;
  text-shadow: 
    0 0 10px rgba(127, 0, 255, 0.8),
    0 0 20px rgba(255, 0, 255, 0.6);
  position: relative;
  overflow: hidden;
}

/* Shimmer effect on keys */
body[data-background="infinity"] .key::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  animation: infinityShimmer 3s linear infinite;
}

@keyframes infinityShimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

/* Key hover effect */
body[data-background="infinity"] .key:hover {
  background: linear-gradient(135deg,
    rgba(60, 20, 100, 0.9) 0%,
    rgba(100, 20, 140, 0.9) 50%,
    rgba(60, 20, 100, 0.9) 100%
  );
  border-color: rgba(255, 0, 255, 0.8);
  box-shadow: 
    0 6px 25px rgba(255, 0, 255, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

/* Key active effect */
body[data-background="infinity"] .key:active,
body[data-background="infinity"] .key.active {
  background: linear-gradient(135deg,
    rgba(100, 20, 140, 1) 0%,
    rgba(140, 20, 180, 1) 50%,
    rgba(100, 20, 140, 1) 100%
  );
  box-shadow: 
    0 2px 10px rgba(255, 0, 255, 0.8),
    inset 0 2px 5px rgba(0, 0, 0, 0.5);
  transform: translateY(2px);
}

/* Floating particles effect */
body[data-background="infinity"]::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(127, 0, 255, 0.8), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(255, 0, 255, 0.8), transparent),
    radial-gradient(2px 2px at 80% 10%, rgba(0, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 90% 60%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(2px 2px at 30% 80%, rgba(127, 0, 255, 0.8), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(255, 0, 255, 0.8), transparent);
  background-size: 200% 200%;
  background-position: 0% 0%;
  animation: infinityParticles 20s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes infinityParticles {
  0% {
    background-position: 0% 0%;
    opacity: 0.6;
  }
  50% {
    background-position: 100% 100%;
    opacity: 1;
  }
  100% {
    background-position: 0% 0%;
    opacity: 0.6;
  }
}

/* Infinity symbol overlay */
body[data-background="infinity"]::after {
  content: '∞';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 300px;
  color: rgba(127, 0, 255, 0.05);
  z-index: 0;
  animation: infinityPulse 4s ease-in-out infinite;
  pointer-events: none;
  font-weight: bold;
}

@keyframes infinityPulse {
  0%, 100% {
    opacity: 0.05;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.15;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

/* Panel styling for infinity background */
body[data-background="infinity"] .stats-panel,
body[data-background="infinity"] .upgrades-panel {
  background: rgba(10, 0, 20, 0.85);
  border: 2px solid rgba(127, 0, 255, 0.4);
  box-shadow: 
    0 0 20px rgba(127, 0, 255, 0.3),
    inset 0 0 20px rgba(127, 0, 255, 0.1);
  backdrop-filter: blur(10px);
}

/* Accent color for infinity */
body[data-background="infinity"] .stat-value,
body[data-background="infinity"] .upgrade-name,
body[data-background="infinity"] .tab-btn.active {
  color: #bf00ff;
  text-shadow: 0 0 10px rgba(191, 0, 255, 0.8);
}

/* Button glow for infinity */
body[data-background="infinity"] button {
  border-color: rgba(127, 0, 255, 0.5);
  box-shadow: 0 0 10px rgba(127, 0, 255, 0.3);
}

body[data-background="infinity"] button:hover {
  border-color: rgba(255, 0, 255, 0.8);
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

/* Ensure content is above effects */
body[data-background="infinity"] .game-container {
  position: relative;
  z-index: 2;
}


/* ========================================
   ETERNAL INFINITY (REBIRTH 250) - ULTIMATE
   ======================================== */

/* Eternal Infinity background with animated gradient */
body[data-background="rebirth250"] {
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(255, 0, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(255, 0, 170, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(153, 0, 204, 0.1) 0%, transparent 60%),
    linear-gradient(135deg, 
      #000000 0%, 
      #1a0033 10%, 
      #330066 20%, 
      #660099 30%, 
      #9900cc 40%, 
      #cc00ff 50%, 
      #9900cc 60%, 
      #660099 70%, 
      #330066 80%, 
      #1a0033 90%, 
      #000000 100%
    );
  background-size: 200% 200%, 200% 200%, 150% 150%, 400% 400%;
  animation: eternalGradient 20s ease infinite, eternalRadiance 15s ease-in-out infinite;
  position: relative;
}

@keyframes eternalGradient {
  0%, 100% {
    background-position: 0% 50%, 100% 50%, 50% 50%, 0% 50%;
  }
  50% {
    background-position: 100% 50%, 0% 50%, 50% 50%, 100% 50%;
  }
}

@keyframes eternalRadiance {
  0%, 100% {
    filter: brightness(1) contrast(1);
  }
  50% {
    filter: brightness(1.2) contrast(1.1);
  }
}

/* Eternal keyboard container */
body[data-background="rebirth250"] .keyboard-container {
  background: 
    radial-gradient(circle at 30% 40%, rgba(255, 0, 255, 0.2) 0%, transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(255, 0, 170, 0.2) 0%, transparent 40%),
    radial-gradient(ellipse at center,
      rgba(255, 0, 255, 0.15) 0%,
      rgba(153, 0, 204, 0.1) 40%,
      rgba(102, 0, 136, 0.05) 70%,
      transparent 100%
    );
  background-size: 150% 150%, 150% 150%, 100% 100%;
  background-position: 30% 40%, 70% 60%, center;
  border: 3px solid rgba(255, 0, 255, 0.6);
  box-shadow: 
    0 0 40px rgba(255, 0, 255, 0.6),
    0 0 80px rgba(255, 0, 170, 0.4),
    0 0 120px rgba(255, 0, 85, 0.2),
    inset 0 0 40px rgba(255, 0, 255, 0.1);
  animation: eternalKeyboardPulse 6s ease-in-out infinite, eternalKeyboardShift 12s ease-in-out infinite;
}

@keyframes eternalKeyboardPulse {
  0%, 100% {
    box-shadow: 
      0 0 40px rgba(255, 0, 255, 0.6),
      0 0 80px rgba(255, 0, 170, 0.4),
      0 0 120px rgba(255, 0, 85, 0.2),
      inset 0 0 40px rgba(255, 0, 255, 0.1);
    border-color: rgba(255, 0, 255, 0.6);
  }
  50% {
    box-shadow: 
      0 0 60px rgba(255, 0, 255, 0.9),
      0 0 120px rgba(255, 0, 170, 0.7),
      0 0 180px rgba(255, 0, 85, 0.5),
      inset 0 0 60px rgba(255, 0, 255, 0.3);
    border-color: rgba(255, 0, 255, 1);
  }
}

@keyframes eternalKeyboardShift {
  0%, 100% {
    background-position: 30% 40%, 70% 60%, center;
  }
  50% {
    background-position: 70% 60%, 30% 40%, center;
  }
}

/* Eternal keys with magenta glow */
body[data-background="rebirth250"] .key {
  background: 
    radial-gradient(circle at 30% 30%, rgba(80, 0, 100, 0.6) 0%, transparent 50%),
    linear-gradient(135deg,
      rgba(30, 0, 40, 0.95) 0%,
      rgba(60, 0, 80, 0.95) 50%,
      rgba(30, 0, 40, 0.95) 100%
    );
  border: 2px solid rgba(255, 0, 255, 0.7);
  box-shadow: 
    0 4px 20px rgba(255, 0, 255, 0.5),
    0 0 30px rgba(255, 0, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    inset 0 0 20px rgba(255, 0, 255, 0.1);
  color: #ffffff;
  text-shadow: 
    0 0 10px rgba(255, 0, 255, 1),
    0 0 20px rgba(255, 0, 170, 0.8),
    0 0 30px rgba(255, 0, 85, 0.6),
    0 2px 4px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
}

/* Energy pulse on keys */
body[data-background="rebirth250"] .key::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 50% 50%, rgba(255, 0, 255, 0.4) 0%, transparent 60%),
    radial-gradient(circle at 30% 30%, rgba(255, 0, 170, 0.3) 0%, transparent 50%);
  animation: eternalPulse 3s ease-in-out infinite;
}

/* Energy shimmer on keys */
body[data-background="rebirth250"] .key::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 0, 255, 0.3) 50%,
    transparent 70%
  );
  animation: eternalShimmer 4s linear infinite;
}

@keyframes eternalPulse {
  0%, 100% {
    transform: scale(0.8) rotate(0deg);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.3) rotate(180deg);
    opacity: 0.7;
  }
}

@keyframes eternalShimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

/* Key hover effect */
body[data-background="rebirth250"] .key:hover {
  background: 
    radial-gradient(circle at 30% 30%, rgba(120, 0, 160, 0.8) 0%, transparent 50%),
    linear-gradient(135deg,
      rgba(80, 0, 100, 0.95) 0%,
      rgba(120, 0, 160, 0.95) 50%,
      rgba(80, 0, 100, 0.95) 100%
    );
  border-color: rgba(255, 0, 255, 1);
  box-shadow: 
    0 6px 35px rgba(255, 0, 255, 0.9),
    0 0 50px rgba(255, 0, 255, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    inset 0 0 30px rgba(255, 0, 255, 0.2);
  transform: translateY(-4px) scale(1.02);
  text-shadow: 
    0 0 15px rgba(255, 0, 255, 1),
    0 0 30px rgba(255, 0, 170, 1),
    0 0 45px rgba(255, 0, 85, 0.8);
}

/* Key active effect */
body[data-background="rebirth250"] .key:active,
body[data-background="rebirth250"] .key.active {
  background: 
    radial-gradient(circle at 50% 50%, rgba(200, 0, 255, 1) 0%, transparent 60%),
    linear-gradient(135deg,
      rgba(150, 0, 200, 1) 0%,
      rgba(200, 0, 255, 1) 50%,
      rgba(150, 0, 200, 1) 100%
    );
  box-shadow: 
    0 2px 20px rgba(255, 0, 255, 1),
    0 0 40px rgba(255, 0, 255, 0.8),
    inset 0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 0 20px rgba(255, 0, 255, 0.3);
  transform: translateY(2px) scale(0.98);
  text-shadow: 
    0 0 20px rgba(255, 0, 255, 1),
    0 0 40px rgba(255, 0, 170, 1);
}

/* Orbiting rings animation */
@keyframes orbitSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Particle glow animation */
@keyframes particleGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 0, 255, 1);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 0, 255, 1);
    transform: scale(1.5);
  }
}

/* Floating orb animation */
@keyframes floatOrb {
  0%, 100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(20px, -20px);
  }
  50% {
    transform: translate(-10px, -40px);
  }
  75% {
    transform: translate(-30px, -20px);
  }
}

@keyframes orbGlow {
  0%, 100% {
    filter: blur(1px) brightness(1);
  }
  50% {
    filter: blur(3px) brightness(1.5);
  }
}

/* Lightning flash animation */
@keyframes lightningFlash {
  0%, 90%, 100% {
    opacity: 0;
  }
  92%, 94%, 96% {
    opacity: 1;
  }
  93%, 95% {
    opacity: 0.3;
  }
}

/* Dust float animation */
@keyframes dustFloat {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translate(100px, -500px) rotate(360deg);
    opacity: 0;
  }
}

/* Rift pulse animation */
@keyframes riftPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scaleY(1);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.5);
  }
}

/* Panel styling for eternal infinity */
body[data-background="rebirth250"] .stats-panel,
body[data-background="rebirth250"] .upgrades-panel {
  background: rgba(20, 0, 30, 0.9);
  border: 2px solid rgba(255, 0, 255, 0.5);
  box-shadow: 
    0 0 30px rgba(255, 0, 255, 0.4),
    inset 0 0 30px rgba(255, 0, 255, 0.1);
  backdrop-filter: blur(15px);
}

/* Accent color for eternal infinity */
body[data-background="rebirth250"] .stat-value,
body[data-background="rebirth250"] .upgrade-name,
body[data-background="rebirth250"] .tab-btn.active {
  color: #ff00ff;
  text-shadow: 0 0 15px rgba(255, 0, 255, 1);
}

/* Button glow for eternal infinity */
body[data-background="rebirth250"] button {
  border-color: rgba(255, 0, 255, 0.6);
  box-shadow: 0 0 15px rgba(255, 0, 255, 0.4);
}

body[data-background="rebirth250"] button:hover {
  border-color: rgba(255, 0, 255, 1);
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.6);
}

/* Cosmic background overlay with enhanced particles */
body[data-background="rebirth250"]::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(3px 3px at 10% 20%, rgba(255, 0, 255, 1), transparent),
    radial-gradient(4px 4px at 90% 80%, rgba(255, 0, 170, 1), transparent),
    radial-gradient(2px 2px at 50% 50%, rgba(255, 0, 85, 1), transparent),
    radial-gradient(3px 3px at 30% 70%, rgba(255, 0, 255, 0.9), transparent),
    radial-gradient(2px 2px at 70% 30%, rgba(255, 0, 170, 0.9), transparent),
    radial-gradient(4px 4px at 15% 85%, rgba(255, 0, 255, 0.8), transparent),
    radial-gradient(3px 3px at 85% 15%, rgba(255, 0, 170, 0.8), transparent),
    radial-gradient(2px 2px at 40% 60%, rgba(255, 0, 85, 0.7), transparent),
    radial-gradient(3px 3px at 60% 40%, rgba(255, 0, 255, 0.7), transparent);
  background-size: 300% 300%, 350% 350%, 250% 250%, 400% 400%, 320% 320%, 280% 280%, 360% 360%, 290% 290%, 310% 310%;
  animation: cosmicDrift 30s linear infinite, cosmicTwinkle 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}

@keyframes cosmicDrift {
  0% {
    background-position: 0% 0%, 100% 100%, 50% 50%, 0% 100%, 100% 0%, 25% 75%, 75% 25%, 40% 60%, 60% 40%;
  }
  100% {
    background-position: 100% 100%, 0% 0%, 50% 50%, 100% 0%, 0% 100%, 75% 25%, 25% 75%, 60% 40%, 40% 60%;
  }
}

@keyframes cosmicTwinkle {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

/* Ensure content is above effects */
body[data-background="rebirth250"] .game-container {
  position: relative;
  z-index: 2;
}
