@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Poppins:wght@300;400;600&display=swap");

:root {
  --primary-color: #7000ff;
  --primary-glow: #9a49f7;
  --accent-color: #00d2ff;
  --accent-gold: #ffd700;
  --text-color: #ffffff;
  --input-bg: rgba(0, 0, 0, 0.6);
  --glass-border: 1px solid rgba(255, 255, 255, 0.15);
  --error-color: #ff4757;
  --success-color: #2ed573;
}

#game-view {
  width: 100vw;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  padding: 0;
  background-color: #050505;
  font-family: "Poppins", sans-serif;
  overflow: hidden;
  user-select: none;
}

.background-container {
    position: absolute; 
    top: 50%; 
    left: 50%;  
    width: 1440px;
    height: 720px;
    background: url("../assets/images/backgrounds/login.png") no-repeat center center;
    background-size: cover;
    display: flex; 
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    user-select: none;
}

.background-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(30, 10, 50, 0.2) 0%,
    rgba(0, 0, 0, 0.85) 90%
  );
  backdrop-filter: blur(2px);
  z-index: 0;
  pointer-events: none;
}

.login-box-wrapper {
  position: relative;
  z-index: 10;
  width: 360px;
  padding: 45px 40px;
  background: linear-gradient(
    180deg,
    rgba(30, 30, 40, 0.8) 0%,
    rgba(15, 15, 20, 0.95) 100%
  );
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(20px);
  animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.login-header {
  text-align: center;
  margin-bottom: 35px;
}

.game-title {
  font-family: "Cinzel", serif;
  font-size: 3.2rem;
  margin: 0;
  background: linear-gradient(to bottom, #fff 20%, #b8b8b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(154, 73, 247, 0.5);
  letter-spacing: 2px;
}

.game-subtitle {
  font-size: 0.75rem;
  letter-spacing: 6px;
  color: var(--accent-color);
  text-transform: uppercase;
  text-shadow: 0 0 8px var(--accent-color);
  display: block;
  margin-top: -5px;
  opacity: 0.9;
}

.login-form-content {
  width: 100%;
}

.input-group {
  position: relative;
  margin-bottom: 25px;
  width: 100%;
}

.input-group input {
  width: 100%;
  padding: 14px 15px;
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  outline: none;
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.input-group label {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  pointer-events: none;
  transition: 0.3s ease;
  font-size: 0.95rem;
  padding: 0 5px;
  background: transparent;
}

.input-group input:focus,
.input-group input:not(:placeholder-shown) {
  border-color: var(--primary-glow);
  background: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 15px rgba(154, 73, 247, 0.25);
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
  top: -10px;
  left: 12px;
  font-size: 0.75rem;
  color: var(--accent-color);
  background: #1e1e28;
  border-radius: 4px;
  font-weight: 600;
}

.input-group.hidden {
  display: none;
}

.options-group {
  margin-bottom: 30px;
  display: flex;
  width: 100%;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: #bbb;
  transition: 0.3s;
}
.custom-checkbox:hover {
  color: #fff;
}

.custom-checkbox input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  margin-right: 10px;
  position: relative;
  transition: 0.3s;
}

.custom-checkbox input:checked ~ .checkmark {
  background: var(--primary-color);
  border-color: var(--primary-glow);
  box-shadow: 0 0 10px var(--primary-glow);
}

.checkmark:after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 4px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  display: none;
}
.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}

.submit-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;

  background: linear-gradient(135deg, #7000ff 0%, #a239ff 100%);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: "Poppins", sans-serif;
  box-shadow: 0 5px 15px rgba(112, 0, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.submit-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 25px rgba(112, 0, 255, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  filter: brightness(1.1);
}

.submit-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(112, 0, 255, 0.4);
}

.submit-btn::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: rotate(45deg);
  transition: 0.5s;
  opacity: 0;
}
.submit-btn:hover::after {
  opacity: 1;
  left: 100%;
  transition: 0.7s;
}

.status-text {
  margin-top: 15px;
  font-size: 0.85rem;
  height: 20px;
  text-align: center;
}
.status-text.error {
  color: var(--error-color);
  text-shadow: 0 0 5px rgba(255, 71, 87, 0.4);
}
.status-text.success {
  color: var(--success-color);
}

.switch-mode-container {
  margin-top: 25px;
  font-size: 0.9rem;
  color: #888;
}
#switch-link {
  color: var(--accent-color);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-left: 5px;
  transition: 0.3s;
}
#switch-link:hover {
  color: #fff;
  text-shadow: 0 0 10px var(--accent-color);
}

.char-select-container {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.8s ease-out;
}

.char-select-header {
  position: absolute;
  top: 50px;
  text-align: center;
  width: 100%;
}
.char-select-header h1 {
  font-family: "Cinzel", serif;
  font-size: 3.5rem;
  color: #fff;
  text-shadow: 0 0 20px rgba(154, 73, 247, 0.6);
  margin: 0;
}

.logout-btn-styled {
  position: absolute;
  top: 30px;
  right: 40px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ddd;
  padding: 8px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  transition: 0.3s;
}
.logout-btn-styled:hover {
  background: rgba(255, 71, 87, 0.2);
  border-color: #ff4757;
  color: #ff4757;
}

.char-slots {
  display: flex;
  gap: 40px;
  margin-top: 60px;
  perspective: 1000px;
}

.char-slot {
  width: 280px;
  height: 440px;
  border-radius: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;

  background: linear-gradient(
    180deg,
    rgba(30, 30, 40, 0.4) 0%,
    rgba(10, 10, 15, 0.95) 80%
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.char-slot:hover {
  transform: translateY(-20px) scale(1.02);
  border-color: var(--primary-glow);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(154, 73, 247, 0.15) inset;
  background: linear-gradient(
    180deg,
    rgba(40, 35, 60, 0.5) 0%,
    rgba(20, 15, 30, 0.98) 100%
  );
}

.char-slot.empty-slot {
  background: rgba(0, 0, 0, 0.3);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  justify-content: center;
}
.char-slot.empty-slot:hover {
  border-color: var(--accent-color);
  background: rgba(0, 210, 255, 0.05);
  box-shadow: 0 0 30px rgba(0, 210, 255, 0.1) inset;
}

.create-char-btn {
  background: transparent;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  transition: 0.3s;
  font-size: 0.9rem;
  letter-spacing: 1px;
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.1);
}
.create-char-btn:hover {
  background: var(--accent-color);
  color: #000;
  box-shadow: 0 0 30px rgba(0, 210, 255, 0.6);
  transform: scale(1.05);
}

.char-preview-container {
  width: 100%;
  height: 260px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 20px;
  position: relative;
  z-index: 1;
}

.char-preview-container::after {
  content: "";
  position: absolute;
  bottom: 10px;
  width: 120px;
  height: 30px;
  background: radial-gradient(
    ellipse,
    rgba(154, 73, 247, 0.5) 0%,
    transparent 70%
  );
  opacity: 0.6;
  transition: 0.3s;
  transform: scale(0.8);
}
.char-slot:hover .char-preview-container::after {
  opacity: 1;
  transform: scale(1.2);
}

.char-preview-canvas {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s;
}
.char-slot:hover .char-preview-canvas {
  transform: scale(1.05);
}

.char-info {
  width: 100%;
  text-align: center;
  padding: 20px 15px;
  z-index: 2;
  margin-top: -40px;
  padding-top: 50px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(10, 10, 15, 0.9) 30%,
    rgba(10, 10, 15, 1) 100%
  );
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.char-name {
  font-family: "Poppins", sans-serif;
  font-size: 1.5rem;
  color: var(--accent-gold);
  margin: 0 0 5px 0;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

.char-details {
  color: #888;
  font-size: 0.85rem;
  margin: 3px 0;
  font-weight: 300;
}
.char-details span {
  color: #ccc;
  font-weight: 500;
}

.start-game-btn {
  width: 80%;
  margin: 10px auto 20px;
  padding: 12px;
  background: linear-gradient(90deg, #2ed573, #1e9d52);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 5px 15px rgba(46, 213, 115, 0.3);

  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.char-slot:hover .start-game-btn {
  opacity: 1;
  transform: translateY(0);
}
.start-game-btn:hover {
  box-shadow: 0 5px 20px rgba(46, 213, 115, 0.6);
  transform: scale(1.05);
}

.delete-char-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #aaa;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: 0.3s;
  z-index: 20;
}
.char-slot:hover .delete-char-btn {
  opacity: 1;
  transform: scale(1);
}
.delete-char-btn:hover {
  background: var(--error-color);
  color: white;
  border-color: var(--error-color);
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.hidden {
  display: none !important;
}

#class-selection-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.4s ease-out;
}

.creation-modal-content {
  background: linear-gradient(160deg, #16161d 0%, #0a0a0e 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  padding: 30px;
  border-radius: 24px;
  width: 1100px;
  max-width: 95%;
  height: 600px;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  position: relative;
}

.creation-left-col {
  flex: 1;
  background: radial-gradient(
    circle at center,
    rgba(112, 0, 255, 0.15) 0%,
    transparent 70%
  );
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 20px;
}

.creation-left-col::after {
  content: "";
  position: absolute;
  bottom: 140px;
  width: 180px;
  height: 30px;
  background: radial-gradient(
    ellipse,
    rgba(255, 215, 0, 0.4) 0%,
    transparent 70%
  );
  transform: scale(0.8);
  transition: 0.5s;
  pointer-events: none;
}
.creation-left-col.active::after {
  transform: scale(1.2);
  opacity: 1;
}

#creation-big-canvas {
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6));
  z-index: 2;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.selected-class-title {
  font-family: "Cinzel", serif;
  font-size: 2.5rem;
  color: var(--accent-gold);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  margin-top: 40px;
  text-transform: uppercase;
}

.selected-class-desc {
  color: #888;
  font-size: 0.9rem;
  margin-top: 5px;
  font-family: "Poppins", sans-serif;
  font-style: italic;
}

.creation-right-col {
  flex: 1.2;
  padding: 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.creation-header {
  font-family: "Cinzel", serif;
  font-size: 2rem;
  color: #fff;
  margin-bottom: 25px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
}

.name-group {
  width: 100%;
  margin-bottom: 20px;
  position: relative;
}
.name-group label {
  display: block;
  color: #aaa;
  margin-bottom: 5px;
  font-size: 0.9rem;
}
#player-name-input {
  width: 100%;
  padding: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 1.1rem;
  text-align: center;
  transition: 0.3s;
}
#player-name-input:focus {
  border-color: var(--primary-glow);
  box-shadow: 0 0 15px rgba(154, 73, 247, 0.3);
}

#class-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  margin-bottom: 30px;
}

.class-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 4px;

  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 120px;
  justify-content: flex-start;
}

.class-card canvas {
  margin-top: 0;
  margin-bottom: 5px;
}

.class-card h3 {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1;
  z-index: 2;
  position: relative;
  bottom: 2px;
}

.class-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-3px);
}
.class-card.selected {
  border-color: var(--accent-gold);
  background: rgba(255, 215, 0, 0.05);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2) inset;
}
.class-card.selected h3 {
  color: var(--accent-gold);
  font-weight: bold;
}

.creation-buttons {
  display: flex;
  gap: 15px;
  width: 100%;
}
.creation-btn {
  flex: 1;
  padding: 15px;
  border-radius: 12px;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  font-family: "Poppins", sans-serif;
  transition: 0.3s;
  border: none;
}
.creation-btn.cancel {
  background: rgba(255, 255, 255, 0.05);
  color: #888;
}
.creation-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.creation-btn.confirm {
  background: linear-gradient(90deg, #7000ff, #9a49f7);
  color: #fff;
  opacity: 0.5;
  pointer-events: none;
}
.creation-btn.confirm:not(:disabled) {
  opacity: 1;
  pointer-events: auto;
  box-shadow: 0 5px 20px rgba(112, 0, 255, 0.4);
}
.creation-btn.confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(112, 0, 255, 0.6);
}
