* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: #f8f9fb;
  color: #1a1a1a;
}
header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
header a.back {
  color: #555; text-decoration: none; font-size: 14px;
  padding: 4px 10px; border-radius: 6px;
}
header a.back:hover { background: #eef; color: #333; }
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
header .count { margin-left: auto; color: #888; font-size: 13px; }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 80px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.grid.emoji {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.grid.unicode {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.section + .section { margin-top: 28px; }
.section-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.02em;
}

.unicode-item {
  cursor: pointer;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.1s;
  user-select: none;
}
.unicode-item:hover { transform: scale(1.06); }
.unicode-item:active { transform: scale(0.94); }
.unicode-item .char {
  font-size: 32px;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.unicode-item.copied::after {
  content: "복사됨!";
  position: absolute;
  bottom: 4px; left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: white;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  animation: fade 1.2s ease forwards;
}

.card {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.1s, box-shadow 0.1s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.card .thumb {
  aspect-ratio: 1/1;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
}
.card .thumb img {
  width: 92%; height: 92%; object-fit: contain;
}
.card .label {
  padding: 8px 10px;
  font-size: 13px;
  border-top: 1px solid #f0f2f5;
  word-break: keep-all;
  line-height: 1.3;
  min-height: 40px;
  display: flex; align-items: center;
}

.artist-card .thumb {
  background: #fff;
  font-size: 42px;
  font-weight: 700;
  color: #333;
}
.artist-card .thumb:has(> :not(img)) {
  background: linear-gradient(135deg, #ffe7b2, #ffd1d1);
}

.emoji-item {
  cursor: pointer;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.1s;
}
.emoji-item:hover { transform: scale(1.04); }
.emoji-item:active { transform: scale(0.96); }
.emoji-item img { width: 88%; height: 88%; object-fit: contain; pointer-events: none; }
.emoji-item.copied::after {
  content: "복사됨!";
  position: absolute;
  bottom: 4px; left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  animation: fade 1.2s ease forwards;
}
@keyframes fade {
  0% { opacity: 0; transform: translateX(-50%) translateY(4px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-4px); }
}

#toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: white;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 100;
}
#toast.show { opacity: 0.95; }
