/* Reset & base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: #1e1e1e;
  color: #ffa1a9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-align: center;
  letter-spacing: 0.1em;
  color: #ff4b5c;
  text-shadow: 0 0 8px #ff4b5caa;
}

.tab-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tab-btn {
  background: transparent;
  border: 2px solid #ff4b5c;
  color: #ff4b5c;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  user-select: none;
}

.tab-btn.active,
.tab-btn:hover {
  background: #ff4b5c;
  color: #1e1e1e;
  box-shadow: 0 0 10px #ff4b5caa;
}

main {
  width: 100%;
  max-width: 900px;
  background: #2f1f24;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  box-shadow: 0 0 30px #ff4b5c44;
  min-height: 460px;
}

/* Tab content */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease forwards;
  min-height: 340px;
  position: relative;
}

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

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

/* MAIN TAB */
.battle-container {
  user-select: none;
  color: #ff4b5c;
  font-weight: 900;
  font-size: 5rem;
  text-align: center;
  position: relative;
  cursor: pointer;
  padding: 2rem 1rem;
  border-radius: 12px;
  box-shadow: 0 0 30px #ff4b5cbb;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 320px;
}

.score-display {
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

.click-hint {
  position: absolute;
  bottom: 15px;
  font-weight: 600;
  font-size: 1.1rem;
  color: #ff4b5c88;
  user-select: none;
  pointer-events: none;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  z-index: 2;
}

.paycheck-timer {
  margin-top: 0.7rem;
  font-weight: 700;
  font-size: 1.15rem;
  text-align: center;
  color: #ff4b5c;
  user-select: none;
}

/* SHOP INNER NAV */
.shop-inner-nav {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.shop-tab-btn {
  background: transparent;
  border: 2px solid #ff4b5c;
  color: #ff4b5c;
  padding: 0.4rem 1rem;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  user-select: none;
}

.shop-tab-btn.active,
.shop-tab-btn:hover {
  background: #ff4b5c;
  color: #1e1e1e;
  box-shadow: 0 0 8px #ff4b5caa;
}

/* Shop content tabs */
.shop-inner-content {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.shop-inner-content.active {
  display: block;
}

/* Shop grid */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.shop-item {
  background: #3e222a;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 0 15px #ff4b5c88;
  text-align: center;
  color: #ff9fa6;
  user-select: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.shop-item h3 {
  margin-bottom: 0.4rem;
  font-size: 1.3rem;
  color: #ff4b5c;
}

.shop-item p {
  font-size: 0.9rem;
  margin: 0.15rem 0;
}

.buy-btn {
  margin-top: auto;
  padding: 0.5rem 1.2rem;
  font-weight: 600;
  background: #ff4b5c;
  border: none;
  color: #1e1e1e;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.3s ease;
}

.buy-btn:hover:not(:disabled) {
  background: #ff7380;
}

.buy-btn:disabled {
  background: #bb3f44;
  cursor: not-allowed;
}

.owned-label {
  margin-top: 0.5rem;
  font-weight: 700;
  color: #a05a5a;
  font-style: italic;
}

/* Milestones */
.milestones-list {
  list-style: none;
  font-size: 1.1rem;
  color: #ff7a85;
  user-select: none;
  padding-left: 1rem;
}

.milestones-list li {
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed #ff4b5c66;
  font-weight: 600;
  letter-spacing: 0.03em;
  display: flex;
  justify-content: space-between;
}

.milestones-list li span {
  font-weight: 700;
  color: #ff4b5c;
}

/* Stats */
#stats {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

#stats p {
  font-size: 1.15rem;
  user-select: none;
}

#stats hr {
  border: 1px solid #ff4b5c44;
  margin: 1rem 0;
}

.discord-btn {
  background: #7289da;
  border: none;
  border-radius: 12px;
  padding: 0.6rem 1.5rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  box-shadow: 0 0 12px #7289daaa;
  transition: background 0.3s ease;
  user-select: none;
  margin: 0.7rem 0 1rem 0;
  width: 100%;
  max-width: 250px;
  font-size: 1.1rem;
}

.discord-btn:hover {
  background: #5b6eae;
}

/* Reset Button */
.reset-btn {
  background: #aa2e2e;
  color: #fff0f0;
  border: none;
  padding: 0.7rem 1.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 12px #aa2e2eaa;
  user-select: none;
  transition: background 0.3s ease;
  margin-top: 1rem;
}

.reset-btn:hover {
  background: #d63434;
}

/* Coinflip styles */
.casino-container {
  max-width: 360px;
  margin: 0 auto;
  text-align: center;
  color: #ff4b5c;
}

.coinflip-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.coinflip-form label {
  font-size: 1rem;
  user-select: none;
}

.coinflip-form input[type="number"] {
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 2px solid #ff4b5c;
  background: #2f1f24;
  color: #ff9fa6;
  text-align: center;
  user-select: text;
}

.coin-choice {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  font-weight: 600;
  user-select: none;
}

.coin-choice input[type="radio"] {
  accent-color: #ff4b5c;
  cursor: pointer;
}

.coin-choice label {
  cursor: pointer;
  font-size: 1rem;
}

.coinflip-form button {
  background: #ff4b5c;
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  color: #1e1e1e;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 0 12px #ff4b5caa;
  transition: background 0.3s ease;
}

.coinflip-form button:hover {
  background: #ff7380;
}

/* Coin animation */
.coin-animation {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 0.8rem;
  perspective: 600px;
  user-select: none;
}

.coin-side {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #ff4b5c;
  box-shadow: 0 0 15px #ff4b5cbb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 3rem;
  color: white;
  backface-visibility: hidden;
  border: 3px solid #aa2e2e;
}

.coin-heads {
  transform: rotateY(0deg);
  z-index: 2;
}

.coin-tails {
  background: #aa2e2e;
  transform: rotateY(180deg);
  z-index: 1;
}

.coinflip-animating {
  animation: coinflip-rotate 1.2s ease forwards;
}

@keyframes coinflip-rotate {
  0% { transform: rotateY(0); }
  100% { transform: rotateY(1440deg); }
}

/* Coinflip result text */
.coinflip-result {
  font-weight: 700;
  font-size: 1.2rem;
  min-height: 1.4rem;
  user-select: none;
  color: #ff4b5c;
}

/* Higher or Lower */
.higher-lower-coming-soon {
  margin-top: 3rem;
  text-align: center;
  user-select: none;
}

.coming-soon-text {
  font-style: italic;
  font-weight: 700;
  color: #ff4b5c88;
  font-size: 1.3rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,30,30,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: #2f1f24;
  padding: 2rem 2.5rem;
  border-radius: 16px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 0 20px #ff4b5ccc;
  text-align: center;
  color: #ff4b5c;
  user-select: none;
}

.modal-message {
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.modal-input-wrapper {
  margin-bottom: 1rem;
}

#modalInput {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 2px solid #ff4b5c;
  background: #1e1e1e;
  color: #ffa1a9;
  text-align: center;
  font-weight: 600;
}

.modal-buttons button {
  background: #ff4b5c;
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1.4rem;
  margin: 0 0.6rem;
  font-weight: 700;
  color: #1e1e1e;
  cursor: pointer;
  box-shadow: 0 0 15px #ff4b5cbb;
  transition: background 0.3s ease;
  user-select: none;
}

.modal-buttons button:hover {
  background: #ff7380;
}

/* Responsive */
@media (max-width: 520px) {
  .battle-container {
    font-size: 3.5rem;
    height: 220px;
  }

  .shop-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  main {
    padding: 1rem 1.5rem;
  }
}
