* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #080e1d;
  color: white;
}

.hidden {
  display: none !important;
}

.auth {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.auth-box,
.panel,
.modal-box {
  background: #171f35;
  padding: 25px;
  border-radius: 18px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 8px 30px #0008;
}

.auth-box {
  text-align: center;
}

h1 {
  color: #00e5a0;
}

input,
select {
  width: 100%;
  padding: 15px;
  margin: 8px 0;
  border: 1px solid #35415d;
  border-radius: 10px;
  background: #0c1428;
  color: white;
  font-size: 15px;
  outline: none;
}

input:focus,
select:focus {
  border-color: #00dfa0;
}

label {
  display: block;
  margin-top: 12px;
  color: #cbd5e1;
}

button {
  border: none;
  padding: 13px 18px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  margin: 5px 3px;
}

button:active {
  transform: scale(.97);
}

.main-btn,
.generate-btn,
.download-btn {
  background: #00cb91;
  color: #041c15;
}

.main-btn {
  width: 100%;
}

.logout-btn {
  background: #ef4444;
  color: white;
}

a {
  color: #00e5a0;
  text-decoration: none;
}

.right {
  text-align: right;
}

header {
  background: #151e34;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 4px 15px #0005;
}

header h2 {
  color: #00e5a0;
}

main {
  max-width: 1000px;
  margin: auto;
  padding: 20px;
}

.balance {
  background: linear-gradient(120deg,#075e50,#142b55);
  padding: 22px;
  border-radius: 18px;
  margin-bottom: 25px;
}

.balance h1 {
  color: white;
  margin-bottom: 0;
}

.heading {
  margin-bottom: 20px;
}

.heading p {
  color: #94a3b8;
}

.panel {
  max-width: 100%;
  margin-bottom: 25px;
}

.team-heading {
  margin-top: 30px;
}

/* TEAM CARD */

.team {
  background: #0d162b;
  border: 1px solid #34415c;
  border-radius: 13px;
  padding: 12px;
  margin: 15px 0;
  transition: .2s;
}

.team input {
  margin: 5px 0;
}

.team-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.team-actions button {
  flex: 1;
  min-width: 100px;
  font-size: 12px;
  opacity: .65;
}

.unlock-btn {
  background: #00c98b;
  color: #06251c;
}

.champion-btn {
  background: #d6a52b;
  color: #211700;
}

.unlock-btn.active {
  opacity: 1;
  outline: 2px solid #8effd2;
  box-shadow: 0 0 14px #00e5a077;
}

.champion-btn.active {
  opacity: 1;
  outline: 2px solid #fff0a0;
  box-shadow: 0 0 16px #ffc40088;
}

/* TEAM SPECIAL EFFECTS */

.team.unlocked {
  border: 2px solid #00e5a0;
  background: linear-gradient(120deg,#103b36,#101e32);
}

.team.champion {
  border: 2px solid #ffd34d;
  background: linear-gradient(120deg,#514018,#211c27);
  box-shadow: 0 0 15px #e9b42b55;
}

.team.champion.unlocked {
  border-color: #ffd34d;
}

.team-status {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.status-badge {
  display: none;
  font-size: 11px;
  font-weight: bold;
  padding: 5px 9px;
  border-radius: 20px;
}

.status-badge.show {
  display: inline-block;
}

.unlock-badge {
  color: #003c2b;
  background: #00e5a0;
}

.champion-badge {
  color: #392900;
  background: #ffd34d;
}

/* BUTTONS */

.add-btn {
  background: #087fba;
  color: white;
}

.generate-btn {
  margin-top: 15px;
}

.preview-heading {
  margin-top: 30px;
}

.preview {
  background: white;
  padding: 5px;
  border-radius: 14px;
  overflow-x: auto;
  margin-top: 15px;
  min-height: 100px;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.download-btn {
  width: 100%;
  max-width: 230px;
  margin-top: 12px;
  font-size: 16px;
  padding: 17px;
}

/* MODAL */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000d;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
}

.modal-box,
.image-box {
  background: #171f35;
  border-radius: 18px;
  padding: 25px;
  width: 100%;
  max-width: 450px;
  text-align: center;
  max-height: 90vh;
  overflow-y: auto;
}

.close {
  float: right;
  background: #ef4444;
  color: white;
}

.image-box img {
  display: block;
  width: 100%;
  height: auto;
  margin: 15px auto;
  border-radius: 8px;
  background: white;
}

.image-box button:last-child {
  background: #00c98b;
  color: #06251c;
}

/* MOBILE */

@media(max-width:600px) {
  header {
    display: block;
    text-align: center;
  }

  header h2 {
    font-size: 20px;
  }

  main {
    padding: 15px;
  }

  .team-actions button {
    min-width: 0;
    padding: 12px 8px;
  }

  .panel {
    padding: 18px;
  }
}