/* Splash screen */
.splash-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.splash-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.splash-fade {
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  transition: opacity 0.5s ease-in;
  pointer-events: none;
}

.splash-fade.active {
  opacity: 1;
}

/* Home screen */
.home-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
}

.home-btn {
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
}

.home-btn:hover {
  transform: scale(1.08);
}

.home-btn img {
  max-width: 300px;
  height: auto;
}

/* Login screen */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.login-window {
  position: relative;
  width: 500px;
}

.login-bg-image {
  width: 100%;
  height: auto;
}

.login-form {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 70%;
}

/* Signup screen */
.signup-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 40px;
  padding: 40px;
}

.signup-right, .signup-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.signup-center {
  max-width: 500px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 40px;
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
}

.character-preview canvas {
  border-radius: 16px;
  background: rgba(255,255,255,0.8);
}

.paint-cans-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.paint-can {
  width: 60px;
  height: 80px;
  border: 3px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  background: none;
  transition: transform 0.2s;
  position: relative;
}

.paint-can:hover {
  transform: scale(1.1);
}

.paint-can.selected {
  border-color: var(--color-purple);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}

.paint-can-base {
  position: relative;
  width: 100%;
  height: 100%;
}

.paint-can-svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.paint-can-color-overlay {
  position: absolute;
  inset: 15% 15% 30% 15%;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0.85;
}

/* World screen */
.screen.active:has(#world-canvas) {
  background: #000;
  align-items: center;
  justify-content: center;
}

.world-container {
  position: relative;
  overflow: hidden;
}

#world-canvas {
  display: block;
  cursor: pointer;
}

.world-hud {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 12px;
  z-index: 10;
}

.hud-btn {
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
  width: clamp(40px, 5vw, 70px);
  height: clamp(40px, 5vw, 70px);
}

.hud-btn:hover {
  transform: scale(1.1);
}

.hud-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Profile menu */
.profile-wrapper {
  position: relative;
}

.profile-btn {
  width: clamp(40px, 5vw, 70px);
  height: clamp(40px, 5vw, 70px);
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-btn:hover {
  transform: scale(1.1);
}

.profile-btn svg {
  width: 40px;
  height: 40px;
  fill: rgba(255, 255, 255, 0.9);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  min-width: 180px;
  padding: 12px 0;
  z-index: 30;
  display: none;
  font-family: var(--font-main);
}

.profile-dropdown.open {
  display: block;
}

.profile-dropdown-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 12px;
  border-bottom: 1px solid #E5E7EB;
  direction: rtl;
}

.profile-dropdown-color {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.profile-dropdown-username {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1F2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-dropdown-logout {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-red);
  text-align: right;
  transition: background 0.2s;
  direction: rtl;
}

.profile-dropdown-logout:hover {
  background: rgba(239, 68, 68, 0.1);
}

.logout-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.logout-modal {
  background: white;
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  padding: 32px;
  text-align: center;
  font-family: var(--font-main);
  min-width: 280px;
}

.logout-modal-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 24px;
}

.logout-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.logout-modal-btn {
  padding: 10px 28px;
  border: none;
  border-radius: var(--radius-button);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.logout-modal-btn:hover {
  transform: scale(1.05);
}

.logout-modal-btn--confirm {
  background: var(--color-red);
  color: white;
}

.logout-modal-btn--cancel {
  background: #E5E7EB;
  color: #1F2937;
}

.admin-banner {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--color-purple);
  color: var(--color-yellow);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 10;
}

#world-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

#world-overlays > * {
  pointer-events: auto;
}

.admin-wrapper {
  position: relative;
}

.admin-menu-btn {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  padding: 4px;
  z-index: 30;
  min-width: 220px;
  direction: rtl;
}

.admin-dropdown.open {
  display: block;
}

.admin-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font-main);
}

.admin-menu-item:hover {
  background: #f8f7ff;
}

.admin-menu-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.admin-menu-title {
  font-weight: 700;
  font-size: 0.85rem;
}

.admin-menu-desc {
  font-size: 0.7rem;
  color: #888;
}

.admin-online-banner {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--color-purple);
  color: var(--color-yellow);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 10;
}

/* Responsive — Mobile */
@media (max-width: 768px) {
  .login-window {
    width: 90vw;
  }

  .signup-layout {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .signup-center {
    padding: 20px;
    max-width: 90vw;
  }

  .home-btn img {
    max-width: 200px;
  }

  .hud-btn {
    width: clamp(40px, 8vw, 70px);
    height: clamp(40px, 8vw, 70px);
  }

  .paint-cans-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }

  .paint-can {
    width: 40px;
    height: 55px;
  }

  .profile-btn {
    width: clamp(40px, 8vw, 70px);
    height: clamp(40px, 8vw, 70px);
  }

  .profile-btn svg {
    width: 24px;
    height: 24px;
  }

  .profile-dropdown {
    min-width: 150px;
  }

  .logout-modal {
    min-width: auto;
    width: 85vw;
    max-width: 320px;
  }
}

/* Responsive — Tablet */
@media (min-width: 769px) and (max-width: 1200px) {
  .login-window {
    width: 400px;
  }

  .hud-btn {
    width: 55px;
    height: 55px;
  }

  .profile-btn {
    width: 55px;
    height: 55px;
  }

  .profile-btn svg {
    width: 32px;
    height: 32px;
  }
}

/* Responsive — Large screens */
@media (min-width: 1921px) {
  .hud-btn {
    width: 90px;
    height: 90px;
  }

  .profile-btn {
    width: 90px;
    height: 90px;
  }

  .profile-btn svg {
    width: 50px;
    height: 50px;
  }
}
