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

:root {
  --bg-dark: #0f0617;
  --bg-card: #1a0b2e;
  --bg-card-hover: #2d1453;
  --primary: #ff0066;
  --primary-glow: rgba(255, 0, 102, 0.5);
  --secondary: #00ffff;
  --secondary-glow: rgba(0, 255, 255, 0.5);
  --accent-purple: #bd00ff;
  --accent-orange: #ff6b35;
  --accent-green: #00ff88;
  --text-primary: #ffffff;
  --text-secondary: #b794f6;
  --border: rgba(189, 0, 255, 0.2);
  --shadow: 0 8px 32px rgba(189, 0, 255, 0.3);
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 3rem;
}

.background-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(rgba(189, 0, 255, 0.1) 2px, transparent 2px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.1) 2px, transparent 2px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
  animation: gridPulse 4s ease-in-out infinite;
}

@keyframes gridPulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.8;
  }
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2.5rem;
  background: linear-gradient(135deg, rgba(26, 11, 46, 0.95) 0%, rgba(15, 6, 23, 0.9) 100%);
  border-radius: 20px;
  border: 2px solid var(--primary);
  box-shadow: var(--shadow), 0 0 40px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(189, 0, 255, 0.1) 0%, transparent 70%);
  animation: headerGlow 6s ease-in-out infinite;
}

@keyframes headerGlow {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate(10%, 10%) scale(1.1);
    opacity: 0.8;
  }
}

.title {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 4px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
  animation: titlePulse 3s ease-in-out infinite;
}

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

.title-blood {
  color: var(--primary);
  text-shadow: 0 0 30px var(--primary-glow), 0 0 60px var(--primary-glow), 0 0 90px rgba(255, 0, 102, 0.3);
  filter: drop-shadow(0 2px 10px rgba(255, 0, 102, 0.8));
}

.title-strike {
  color: var(--secondary);
  text-shadow: 0 0 30px var(--secondary-glow), 0 0 60px var(--secondary-glow), 0 0 90px rgba(0, 255, 255, 0.3);
  filter: drop-shadow(0 2px 10px rgba(0, 255, 255, 0.8));
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  letter-spacing: 2px;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 10px rgba(183, 148, 246, 0.5);
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding-bottom: 0;
}

.card {
  background: linear-gradient(135deg, rgba(26, 11, 46, 0.8) 0%, rgba(15, 6, 23, 0.9) 100%);
  border-radius: 16px;
  overflow: visible;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
  box-shadow: var(--shadow), 0 0 20px rgba(189, 0, 255, 0.2);
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, rgba(189, 0, 255, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 40px var(--primary-glow);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid;
  position: relative;
  overflow: hidden;
}

.card-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  animation: borderFlow 3s linear infinite;
}

@keyframes borderFlow {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.ultra-header {
  background: linear-gradient(135deg, rgba(255, 0, 102, 0.3) 0%, rgba(255, 0, 102, 0.05) 100%);
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(255, 0, 102, 0.3);
}

.evo-header {
  background: linear-gradient(135deg, rgba(189, 0, 255, 0.3) 0%, rgba(189, 0, 255, 0.05) 100%);
  border-color: var(--accent-purple);
  box-shadow: 0 4px 20px rgba(189, 0, 255, 0.3);
}

.eterna-header {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.3) 0%, rgba(0, 255, 136, 0.05) 100%);
  border-color: var(--accent-green);
  box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
}

.eterna-char-header {
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.3) 0%, rgba(0, 255, 255, 0.05) 100%);
  border-color: var(--secondary);
  box-shadow: 0 4px 20px rgba(0, 255, 255, 0.3);
}

.ultra-char-header {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.3) 0%, rgba(255, 107, 53, 0.05) 100%);
  border-color: var(--accent-orange);
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}

.card-header h2 {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 0 15px currentColor;
}

.badge {
  background: rgba(189, 0, 255, 0.2);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--accent-purple);
  box-shadow: 0 0 10px rgba(189, 0, 255, 0.3);
}

.card-body {
  padding: 1.5rem;
}

.quantity-section {
  margin-bottom: 1rem;
}

.quantity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.add-btn {
  padding: 0.5rem 1.2rem;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--accent-purple) 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 255, 255, 0.4), 0 0 20px rgba(189, 0, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.add-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.add-btn:hover::before {
  width: 300px;
  height: 300px;
}

.add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 255, 255, 0.6), 0 0 30px rgba(189, 0, 255, 0.5);
}

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

.items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(189, 0, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(189, 0, 255, 0.3);
  transition: all 0.3s ease;
  position: relative;
  flex-wrap: wrap;
}

.item-number {
  font-weight: 800;
  color: var(--secondary);
  font-size: 1rem;
  min-width: 35px;
  text-shadow: 0 0 10px var(--secondary-glow);
}

.item-static {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
  min-width: 150px;
}

.type-select,
.level-select {
  flex: 1;
  min-width: 120px;
  padding: 0.6rem;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(189, 0, 255, 0.3);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 10px rgba(189, 0, 255, 0.1);
  /* Added padding-right and appearance to properly position arrow inside select */
  padding-right: 2.5rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300ffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
}

.type-select:focus,
.level-select:focus {
  outline: none;
  border-color: var(--secondary);
  background: rgba(0, 255, 255, 0.1);
  box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.2), 0 0 20px rgba(0, 255, 255, 0.3);
}

.type-select option,
.level-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.remove-btn {
  padding: 0.5rem 0.8rem;
  background: rgba(255, 0, 102, 0.2);
  border: 2px solid var(--primary);
  border-radius: 8px;
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 40px;
  box-shadow: 0 0 10px rgba(255, 0, 102, 0.2);
  flex-shrink: 0;
}

.remove-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 0 20px var(--primary-glow);
}

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

.quantity-label,
.select-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.quantity-label span,
.select-label span {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.quantity-input {
  width: 80px;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
}

.quantity-input:focus {
  outline: none;
  border-color: var(--secondary);
  background: rgba(0, 212, 255, 0.1);
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.upgrade-section {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkbox-label,
.radio-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.checkbox-label:hover,
.radio-label:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--secondary);
}

.checkbox-label input:checked + span,
.radio-label input:checked ~ span {
  color: var(--secondary);
  font-weight: 600;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-right: 0.75rem;
  cursor: pointer;
  accent-color: var(--primary);
}

.cost {
  color: var(--accent-green);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.info-text {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 0.5rem;
}

.result-card {
  background: linear-gradient(135deg, rgba(26, 11, 46, 0.95) 0%, rgba(15, 6, 23, 0.95) 100%);
  border-radius: 20px;
  padding: 2.5rem;
  border: 3px solid var(--primary);
  box-shadow: 0 0 60px var(--primary-glow), 0 0 100px rgba(189, 0, 255, 0.3), inset 0 0 40px rgba(189, 0, 255, 0.1);
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--primary) 90deg,
    transparent 180deg,
    var(--accent-purple) 270deg,
    transparent 360deg
  );
  animation: resultRotate 8s linear infinite;
  opacity: 0.3;
}

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

.result-card h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 3px;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 20px var(--primary-glow), 0 0 40px var(--primary-glow);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.result-item {
  text-align: center;
  padding: 1.5rem;
  background: rgba(189, 0, 255, 0.05);
  border-radius: 12px;
  border: 2px solid rgba(189, 0, 255, 0.3);
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.result-item:hover {
  transform: translateY(-4px);
  border-color: var(--secondary);
  box-shadow: 0 8px 25px rgba(0, 255, 255, 0.3);
}

.result-item.highlight {
  border-color: var(--primary);
  background: rgba(255, 0, 102, 0.15);
  box-shadow: 0 0 30px rgba(255, 0, 102, 0.3);
}

.result-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.result-value {
  display: block;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.result-value.gold {
  color: var(--accent-green);
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.6), 0 0 40px rgba(0, 255, 136, 0.3);
}

.reset-btn {
  width: 100%;
  padding: 1.2rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(255, 0, 102, 0.5), 0 0 40px rgba(189, 0, 255, 0.3);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.reset-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.reset-btn:hover::before {
  width: 400px;
  height: 400px;
}

.reset-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 0, 102, 0.7), 0 0 60px rgba(189, 0, 255, 0.5);
}

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

.account-value-section {
  margin: 2rem 0 1.5rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 255, 255, 0.1) 100%);
  border: 2px solid var(--accent-green);
  border-radius: 16px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 40px rgba(0, 255, 136, 0.3), inset 0 0 20px rgba(0, 255, 136, 0.1);
}

.account-value-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.6), 0 0 40px rgba(0, 255, 136, 0.3);
}

.account-value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.account-value-item {
  text-align: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 2px solid var(--accent-green);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.2), inset 0 0 10px rgba(0, 255, 136, 0.1);
  transition: all 0.3s ease;
}

.account-value-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 255, 136, 0.4);
  border-color: var(--secondary);
}

.account-value-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.account-value-amount {
  display: block;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent-green);
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.6), 0 0 40px rgba(0, 255, 136, 0.3);
}

.footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 2rem;
  border-top: 1px solid var(--border);
  margin-bottom: 2rem;
}

.footer p {
  margin: 0.25rem 0;
}

.deluxe-badge {
  flex: 1;
  text-align: center;
  padding: 0.6rem;
  background: rgba(189, 0, 255, 0.2);
  border: 2px solid var(--accent-purple);
  border-radius: 8px;
  color: var(--accent-purple);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 0 15px rgba(189, 0, 255, 0.3);
  text-shadow: 0 0 10px rgba(189, 0, 255, 0.5);
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .header {
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
  }

  .title {
    font-size: 2.5rem;
    letter-spacing: 2px;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .calculator-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-bottom: 1rem;
  }

  .card-header {
    padding: 1rem;
  }

  .card-header h2 {
    font-size: 1.25rem;
  }

  .card-body {
    padding: 1rem;
  }

  .item-row {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  .item-number {
    align-self: flex-start;
  }

  .type-select,
  .level-select {
    width: 100%;
    min-width: 100%;
  }

  .deluxe-badge {
    width: 100%;
  }

  .remove-btn {
    align-self: flex-end;
    width: auto;
  }

  .result-card {
    padding: 1.5rem 1rem;
  }

  .result-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .result-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .result-item {
    padding: 1rem;
  }

  .result-value {
    font-size: 1.5rem;
  }

  .account-value-section {
    padding: 1.5rem 1rem;
    margin-top: 1.5rem;
  }

  .account-value-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }

  .account-value-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .account-value-item {
    padding: 1rem;
  }

  .account-value-amount {
    font-size: 1.5rem;
  }

  .add-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .footer {
    padding: 1.5rem 1rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 1.5rem;
    letter-spacing: 1px;
  }

  .subtitle {
    font-size: 0.8rem;
  }

  .section-title {
    font-size: 0.85rem;
  }

  .result-value {
    font-size: 1.25rem;
  }

  .account-value-title {
    font-size: 1rem;
  }

  .account-value-amount {
    font-size: 1.25rem;
  }
}
