/**
 * NTNU Games - Character Customizer Styles
 * Large expressive preview with arrow controls placed directly beside the head,
 * vertically stacked right above each other, with color palette tray.
 */

/* ========================================================== */
/* MODAL BACKDROP & DIALOG                                    */
/* ========================================================== */
.cc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(8, 12, 22, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 1;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  animation: ccFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cc-modal-backdrop.closing {
  opacity: 0;
}

@keyframes ccFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Modal Card */
.skribbl-modal-card {
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  background: linear-gradient(180deg, #131c31 0%, #0c1220 100%);
  border: 1.5px solid rgba(0, 180, 216, 0.28);
  border-radius: 24px;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.85),
    0 0 35px rgba(0, 180, 216, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f1f5f9;
  font-family: inherit;
}

.skribbl-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  background: rgba(10, 14, 25, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.skribbl-modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.skribbl-modal-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffd166;
}

.skribbl-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.cc-btn-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 1.4rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.cc-btn-close:hover {
  background: rgba(239, 71, 111, 0.25);
  color: #ef476f;
  border-color: rgba(239, 71, 111, 0.5);
  transform: rotate(90deg) scale(1.08);
}

.skribbl-modal-body {
  padding: 1.25rem 1.4rem;
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

.skribbl-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  padding: 0.95rem 1.4rem;
  background: rgba(10, 14, 25, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ========================================================== */
/* CUSTOMIZER WIDGET (Embedded & In-Modal)                    */
/* ========================================================== */
.skribbl-customizer-card {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  user-select: none;
}

/* Stage Box: Avatar in center, arrows stacked right above each other on the sides */
.skribbl-stage-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  padding: 1.6rem 1.2rem 1.3rem;
  background: #0d1321;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

/* Main stage content row: Left column arrows - Avatar bubble - Right column arrows */
.skribbl-stage-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  position: relative;
  z-index: 2;
  width: 100%;
}

/* Arrow Columns: Buttons are placed right above each other */
.skribbl-arrows-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 160px;
  width: 44px;
  flex-shrink: 0;
}

/* Navigation Arrow Buttons: Aligned vertically next to the head */
.skribbl-nav-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  color: #ffffff;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.skribbl-nav-btn:hover {
  background: rgba(0, 180, 216, 0.35);
  border-color: #00b4d8;
  color: #ffffff;
  transform: scale(1.12);
  box-shadow: 0 0 16px rgba(0, 180, 216, 0.5);
}

.skribbl-nav-btn:active {
  transform: scale(0.92);
}

/* Center Avatar Container (Pure visual preview, not clickable, no enclosing circle) */
.skribbl-canvas-bubble {
  position: relative;
  z-index: 2;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ccAvatarFloat 3.2s ease-in-out infinite;
  flex-shrink: 0;
  user-select: none;
}

.skribbl-canvas {
  width: 160px;
  height: 160px;
  image-rendering: -moz-crisp-edges;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

/* Floating Avatar Idle Animation */
@keyframes ccAvatarFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* Randomize Dice Button placed below avatar */
.skribbl-randomize-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.3rem;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.12);
  border: 1.5px solid rgba(255, 209, 102, 0.45);
  color: #ffd166;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.skribbl-randomize-btn:hover {
  background: rgba(255, 209, 102, 0.22);
  border-color: #ffd166;
  color: #ffffff;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 18px rgba(255, 209, 102, 0.35);
}

.skribbl-randomize-btn:active {
  transform: translateY(0) scale(0.96);
}

.skribbl-dice-icon {
  font-size: 1.1rem;
  display: inline-block;
  transition: transform 0.2s ease;
}

.skribbl-randomize-btn.spin .skribbl-dice-icon {
  animation: ccDiceSpin 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ccDiceSpin {
  0% {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(180deg) scale(1.3);
  }

  100% {
    transform: rotate(360deg) scale(1);
  }
}

/* ========================================================== */
/* COLOR SELECTION SECTION                                    */
/* ========================================================== */
.skribbl-colors-section {
  background: rgba(13, 19, 33, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.skribbl-colors-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
  width: 100%;
}

.skribbl-color-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.skribbl-color-dot:hover {
  transform: scale(1.25);
  border-color: #ffffff;
  z-index: 2;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.skribbl-color-dot.active {
  transform: scale(1.22);
  border-color: #ffffff;
  box-shadow: 0 0 0 2px #0d1321, 0 0 0 4px #ffffff, 0 2px 6px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.skribbl-color-dot.is-disabled {
  opacity: 0.22;
  filter: grayscale(0.7);
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
  border-color: rgba(255, 255, 255, 0.1);
}

.skribbl-color-dot.is-disabled::after {
  content: "✕";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

/* ========================================================== */
/* MODAL ACTION BUTTONS                                       */
/* ========================================================== */
.cc-btn-cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cc-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.cc-btn-save {
  background: linear-gradient(135deg, #00b4d8 0%, #0077b6 100%);
  border: 1px solid rgba(0, 180, 216, 0.6);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0.6rem 1.45rem;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 180, 216, 0.4);
  transition: all 0.15s ease;
}

.cc-btn-save:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 180, 216, 0.55);
}

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

/* ========================================================== */
/* RESPONSIVE DESIGN                                          */
/* ========================================================== */
@media (max-width: 400px) {
  .skribbl-stage-content {
    gap: 0.75rem;
  }

  .skribbl-canvas-bubble {
    width: 136px;
    height: 136px;
  }

  .skribbl-canvas {
    width: 136px;
    height: 136px;
  }

  .skribbl-arrows-col {
    height: 140px;
    width: 38px;
  }

  .skribbl-nav-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    font-size: 1.35rem;
  }

  .skribbl-color-dot {
    width: 22px;
    height: 22px;
  }
}