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

body {
  font-family: 'Courier New', monospace;
  background: #0a0a0a;
  color: #00ff00;
  overflow-x: hidden;
  padding: 10px;
}

.scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 255, 0, 0) 50%, rgba(0, 255, 0, 0.02) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 1000;
  animation: scanline 8s linear infinite;
}

@keyframes scanline {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(4px);
  }
}

.container {
  max-width: 800px;
  margin: 0 auto;
  border: 2px solid #00ff00;
  padding: 20px;
  background: rgba(0, 20, 0, 0.9);
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.system-log {
  color: #00ff00;
  font-size: 0.9em;
  margin-bottom: 20px;
  text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.header {
  text-align: center;
  margin: 30px 0;
  border: 2px solid #00ff00;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

h1 {
  font-size: 2.5em;
  letter-spacing: 8px;
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.critical-hit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 4em;
  color: #ff0000;
  font-weight: bold;
  text-shadow: 0 0 20px #ff0000;
  z-index: 10;
  pointer-events: none;
  animation: criticalHit 1.5s ease-out forwards;
}

@keyframes criticalHit {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(-15deg);
    opacity: 0;
  }

  30% {
    transform: translate(-50%, -50%) scale(1.5) rotate(5deg);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -80%) scale(1) rotate(0deg);
    opacity: 0;
  }
}

.screen-shake {
  animation: shake 0.5s;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

.hp-bar {
  width: 100%;
  height: 30px;
  background: #001100;
  border: 2px solid #00ff00;
  margin: 20px 0;
  position: relative;
}

.hp-fill {
  height: 100%;
  width: 100%;
  background: #00ff00;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.hp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #000;
  font-weight: bold;
  font-size: 1.1em;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
}

.stat-box {
  border: 1px solid #00ff00;
  padding: 15px;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.3s;
}

.stat-box:hover {
  background: rgba(0, 255, 0, 0.1);
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.divider {
  height: 2px;
  background: #00ff00;
  margin: 30px 0;
  box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.christmas-message {
  background: rgba(255, 0, 0, 0.1);
  border: 3px solid #ff0000;
  padding: 30px;
  margin: 30px 0;
  text-align: center;
  animation: glow 2s infinite;
}

@keyframes glow {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
  }

  50% {
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.8);
  }
}

.christmas-message h2 {
  color: #ff0000;
  font-size: 2em;
  margin-bottom: 15px;
  text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

.christmas-message p {
  color: #00ff00;
  font-size: 1.2em;
  line-height: 1.6;
}

.tower-container {
  text-align: center;
  margin: 30px 0;
}

.tower-svg {
  max-width: 200px;
  filter: drop-shadow(0 0 10px rgba(0, 255, 0, 0.5));
  cursor: pointer;
  transition: all 0.3s;
}

.tower-svg:hover {
  filter: drop-shadow(0 0 20px rgba(0, 255, 0, 0.8));
  transform: scale(1.05);
}

.dice-card {
  border: 2px solid #9333ea;
  background: rgba(31, 41, 55, 0.8);
  padding: 25px;
  margin: 30px 0;
  border-radius: 8px;
}

.dice-title {
  font-size: 1.5em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #00ff00;
}

.dice-container-flex {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.d20-svg {
  width: 120px;
  height: 120px;
  cursor: pointer;
  transition: all 0.3s;
}

.d20-svg:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 15px rgba(0, 255, 0, 1)) drop-shadow(0 0 25px rgba(139, 92, 246, 0.8));
}

.d20-rolling {
  animation: rollDice 0.5s ease-in-out;
}

@keyframes rollDice {
  0% {
    transform: rotate(0deg) scale(1);
  }

  25% {
    transform: rotate(90deg) scale(1.1);
  }

  50% {
    transform: rotate(180deg) scale(0.9);
  }

  75% {
    transform: rotate(270deg) scale(1.1);
  }

  100% {
    transform: rotate(360deg) scale(1);
  }
}

.dice-result {
  flex: 1;
  min-width: 150px;
}

.result-number {
  font-size: 4em;
  font-weight: bold;
  animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.result-nat20 {
  color: #4ade80;
}

.result-fail {
  color: #ef4444;
}

.result-normal {
  color: #a78bfa;
}

.riddle-box {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #ff9900;
  padding: 25px;
  margin: 30px 0;
}

.riddle-title {
  color: #ff9900;
  font-size: 1.5em;
  margin-bottom: 15px;
  text-align: center;
}

.riddle-input {
  width: 100%;
  padding: 12px;
  font-family: 'Courier New', monospace;
  font-size: 1.1em;
  background: #001100;
  border: 2px solid #00ff00;
  color: #00ff00;
  margin: 10px 0;
  text-align: center;
}

button {
  background: #00ff00;
  color: #000;
  border: 2px solid #00ff00;
  padding: 12px 24px;
  font-size: 1em;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  margin: 5px;
  text-transform: uppercase;
}

button:hover {
  background: #000;
  color: #00ff00;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.inventory {
  border: 2px solid #ffff00;
  padding: 20px;
  margin: 30px 0;
  background: rgba(255, 255, 0, 0.05);
  display: none;
}

.inventory.unlocked {
  display: block;
  animation: fadeIn 0.5s;
}

@keyframes float {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateY(-100px) scale(1.5);
    opacity: 0;
  }
}

.inventory-title {
  color: #ffff00;
  font-size: 1.5em;
  text-align: center;
  margin-bottom: 20px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.inventory-item {
  border: 1px solid #ffff00;
  padding: 15px;
  text-align: center;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.inventory-item:hover {
  background: rgba(255, 255, 0, 0.1);
  transform: scale(1.05);
}

.message {
  text-align: center;
  padding: 15px;
  margin: 15px 0;
  border: 2px solid #00ff00;
  background: rgba(0, 255, 0, 0.1);
  display: none;
}

.message.error {
  border-color: #ff0000;
  color: #ff0000;
}

.easter-egg-counter {
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #00ff00;
  padding: 10px;
  font-size: 0.9em;
  z-index: 100;
}

.hint-section {
  text-align: center;
  color: #6b7280;
  font-size: 0.9em;
  margin-top: 40px;
  padding: 20px;
  border-top: 1px dashed #374151;
}

.hint-title {
  color: #9ca3af;
  margin-bottom: 10px;
}

.hint-text {
  font-size: 0.8em;
  margin-top: 8px;
  color: #4b5563;
}

.floating-emoji {
  position: fixed;
  font-size: 40px;
  cursor: pointer;
  z-index: 999;
  animation: floatEmoji 3s ease-out forwards;
  pointer-events: auto;
  user-select: none;
  transition: transform 0.2s;
}

.floating-emoji:hover {
  transform: scale(1.3);
}

@keyframes floatEmoji {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0);
  }

  10% {
    opacity: 1;
    transform: translateY(-20px) scale(1);
  }

  90% {
    opacity: 1;
    transform: translateY(-100px) scale(1.2);
  }

  100% {
    opacity: 0;
    transform: translateY(-120px) scale(0.8);
  }
}

.toast {
  position: fixed;
  top: 80px;
  right: 20px;
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid #00ff00;
  padding: 20px;
  border-radius: 8px;
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
  max-width: 300px;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}