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

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FBFBFB;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
}

/* ── Card ── */
.card {
  zoom: 1.2;
  background: #FFFFFF;
  border: 1px solid #ebebeb;
  border-radius: 12px;
  padding: 40px 20px 24px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  overflow: hidden;
  box-shadow: 0px 6px 32px rgba(0, 0, 0, 0.04);
}

/* ── Top section ── */
.section-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 44px;
  flex-shrink: 0;
}

.card-title {
  color: #000;
  font-size: 18px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: -0.18px;
  white-space: nowrap;
}

/* ── Name input ── */
.name {
    height: 30px;
    width: 160px;
    background-color: #ffffff;
    border: 1.2px solid #E5E5E5;
    border-radius: 100px;
    margin-top: -16px;
  font-family: inherit;
  font-size: 12px;
  color: #000;
  text-align: center;
  outline: none;
  caret-color: #2883DF;
  transition: border-color 0.15s;
}
.name::placeholder {
  color: rgba(0, 0, 0, 0.3);
  text-align: center;
}
.name:focus {
  border-color: #2883DF;
  box-shadow: 0 0 0 1px #2883DF;
}

/* ── Avatar row ── */
.avatar-row {
  display: flex;
  align-items: center;
  gap: 52px;
  flex-shrink: 0;
}

.chevron-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}
.chevron-btn:hover  { opacity: 0.6; }
.chevron-btn:active { opacity: 0.35; }
.chevron-btn img    { width: 24px; height: 24px; display: block; }

/* Wrapper: positioning context for the sticker */
.avatar-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

/* Avatar circle: clips base image only */
.avatar-container {
  width: 90px;
  height: 90px;
  border-radius: 999px;
  border: 1.5px solid #E5E5E5;
  box-shadow: 0px 4px 20px 0px rgba(0,0,0,0.10);
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.avatar-container img {
  /* Figma: left:-14.63%, top:-14.18%, size:128.21% */
  position: absolute;
  width: 128.21%;
  height: 128.21%;
  left: -14.63%;
  top: -14.18%;
  max-width: none;
}

/* Sticker overlaid on avatar */
.avatar-sticker {
  position: absolute;
  pointer-events: none;
}
.avatar-sticker.slide-in {
    animation: slideInRight 0.28s ease forwards;
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(60px); }
    to   { opacity: 1; transform: translateX(0); }
}

.avatar-sticker.flipped.slide-in {
    animation: slideInRightFlipped 0.28s ease forwards;
}
@keyframes slideInRightFlipped {
    from { opacity: 0; transform: scaleX(-1) translateX(60px); }
    to   { opacity: 1; transform: scaleX(-1) translateX(0); }
}


/* ── Deco title ── */
.deco-title {
  font-size: 10px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.4);
  align-self: flex-start;
}

/* ── Bottom section ── */
.section-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
    width: 100%;
}

/* ── Decoration container ── */
.deco-container {
  background: #F9F8F7;
  border-radius: 12px;
  padding: 16px;
  flex-shrink: 0;
}

/* 8-col × 2-row grid, each cell 55×47, gap 10 */
.deco-grid {
  display: grid;
  grid-template-columns: repeat(8, 60px);
  grid-template-rows: repeat(2, 48px);
  gap: 10px;
}

.deco-item {
  width: 60px;
  height: 48px;
  background: #FFFFFF;
  border: 1px solid rgb(244, 244, 244);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  position: relative;
  user-select: none;
  overflow: hidden;
}
.deco-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.deco-item:hover {
  background-color: #eae9e6;
  z-index: 1;
}
.deco-item.selected {
  border-color: #2883DF;
  box-shadow: 0 0 0 1px #2883DF;
}

/* ── Button row ── */
.btn-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  flex-shrink: 0;
}

.btn {
  padding: 4px 6px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: -0.12px;
  min-width: 45px;
  text-align: center;
  transition: background 0.12s, opacity 0.12s;
}
.btn-reset       { color: #000; }
.btn-reset:hover { background: rgba(0,0,0,0.05); }
.btn-done        { background: #2883DF; color: #fff; border-radius: 4px; overflow: hidden; }
.btn-done:hover  { background: #1a6dc4; }

/* ── Tooltip ── */
.tooltip {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: white;
  color: #1C1C1C;
  padding: 16px 20px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  opacity: 0;
  pointer-events: none;
  width: 280px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.tooltip.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.tooltip-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}
.tooltip-text {
  color: #666;
  font-size: 13px;
  line-height: 1.4;
}
