@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

:root {
  /* ── DARK NAVY + NEON THEME ── */
  --bg: #0b1426;
  --surface: #0f1c38;
  --surface-alt: #0d1730;
  --surface-alt-2: #091222;
  --soft-blush: #0d1730;
  --border: rgba(0, 229, 255, 0.18);
  --coral: #ff8166;
  --coral-bright: #ff5a39;
  --coral-dark: #ff3d9a;
  --coral-light: rgba(255, 61, 154, 0.22);
  --pink: #ff3d9a;
  --yellow: #ffd166;
  --accent-yellow: #ffd166;
  --accent-yellow-dark: #c98a1d;
  --text: #e0e8ff;
  --text-dim: #8899cc;
  --text-muted: #8899cc;
  --danger: #ff6b6b;
  --success: #3fae6b;
  --hero-accent: #00e5ff;
  --hero-accent-bg: rgba(0, 229, 255, 0.08);
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.40);
  --radius-pill: 999px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --gold: var(--accent-yellow);
  --gold-bright: var(--accent-yellow-dark);
  --panel: var(--surface);
  --panel-border: var(--border);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(160deg, #0b1426 0%, #121b33 60%, #0e1830 100%);
  color: var(--text);
  font-family: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

/* 별/점 배경 패턴 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Ccircle cx='12' cy='18' r='1.5' fill='%2300e5ff'/%3E%3Ccircle cx='80' cy='8' r='1' fill='%23ffffff'/%3E%3Ccircle cx='140' cy='42' r='2' fill='%2300e5ff'/%3E%3Ccircle cx='40' cy='70' r='1' fill='%23ff3d9a'/%3E%3Ccircle cx='110' cy='90' r='1.5' fill='%23ffffff'/%3E%3Ccircle cx='20' cy='130' r='2' fill='%2300e5ff'/%3E%3Ccircle cx='90' cy='148' r='1' fill='%23ff3d9a'/%3E%3Ccircle cx='150' cy='130' r='1' fill='%23ffffff'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* 모든 콘텐츠 블록이 body::before 위에 표시 */
.navbar, .container, .hero-outer, nav.bottom-nav, .auth-page, .reveal-stage {
  position: relative;
  z-index: 1;
}

a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.navbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 32px;
  padding-top: max(16px, calc(env(safe-area-inset-top) + 12px));
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.navbar .logo {
  grid-column: 2;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--coral-dark);
  text-align: center;
}

.navbar .nav-right {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}

.navbar .nav-right a {
  color: var(--text-dim);
  font-weight: 600;
}

.navbar .nav-right a:hover {
  color: var(--coral);
}

.navbar .nickname {
  color: var(--coral-dark);
  font-weight: 700;
}

.navbar button.logout-btn {
  width: auto;
  padding: 7px 16px;
  font-size: 12px;
  border-radius: 999px;
  border: 1.5px solid var(--coral-light);
  background: var(--surface);
  color: var(--coral-dark);
  cursor: pointer;
  box-shadow: none;
  font-family: inherit;
  font-weight: 700;
}

.navbar button.logout-btn:hover {
  background: var(--surface-alt);
}

/* --- notification bell + dropdown panel --- */
.notif-bell-wrap {
  position: relative;
}

.notif-bell-btn {
  position: relative;
  width: auto;
  padding: 6px 10px;
  font-size: 17px;
  line-height: 1;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  box-shadow: none;
  font-family: inherit;
}

.notif-bell-btn:hover {
  background: var(--surface-alt);
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-height: 440px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 9000;
}

.notif-panel-header {
  padding: 14px 16px 11px;
  font-weight: 800;
  font-size: 14px;
  color: var(--coral-dark);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.notif-list {
  flex: 1;
  max-height: 320px;
  overflow-y: auto;
}

.notif-item {
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.notif-item:hover {
  background: var(--surface-alt);
}

.notif-item.unread {
  background: rgba(255, 61, 154, 0.08);
}

.notif-item.unread:hover {
  background: rgba(255, 61, 154, 0.14);
}

.notif-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.notif-item-body {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item-time {
  font-size: 11px;
  color: var(--text-dim);
}

.notif-empty {
  padding: 36px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--surface);
}

.notif-mark-all-btn {
  width: 100%;
  padding: 11px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--coral-dark);
  cursor: pointer;
  font-family: inherit;
}

.notif-mark-all-btn:hover {
  background: var(--surface-alt);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px max(20px, env(safe-area-inset-right)) 120px max(20px, env(safe-area-inset-left));
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--coral-dark);
  margin-bottom: 20px;
  text-wrap: balance;
  letter-spacing: -0.01em;
}

/* --- home: search / sort / mode filters --- */
.board-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.search-box {
  position: relative;
  flex: 1;
}

.search-box input {
  margin-bottom: 0;
  padding-right: 40px;
}

.search-clear-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear-btn:hover {
  background: var(--coral-light);
  color: var(--coral-dark);
}

.sort-tabs {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
}

.sort-tabs .category-btn {
  padding: 8px 14px;
  font-size: 12px;
}

#mode-tabs {
  margin-bottom: 20px;
}

/* Contextual onboarding banner — shown when mode tab is non-default, localStorage-dismissable */
.mode-help-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 36px 11px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  position: relative;
  animation: mode-banner-enter 0.2s ease;
}

.mode-help-banner.hero-mode {
  background: var(--hero-accent-bg);
  border-color: rgba(155, 111, 224, 0.3);
  color: var(--text);
}

.mode-help-dismiss {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}

/* Expand tap target to 44×44px without changing visual size */
.mode-help-dismiss::before {
  content: '';
  position: absolute;
  inset: -11px;
}

.mode-help-dismiss:hover {
  background: rgba(0, 0, 0, 0.08);
  filter: none;
  transform: none;
  box-shadow: none;
}

@keyframes mode-banner-enter {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .mode-help-banner { animation: none; }
}

/* --- home: hero banner carousel (top boards, auto-sliding) --- */
.hero-banner {
  position: relative;
  border-radius: 0 0 28px 28px;
  overflow: hidden;
  height: 440px;
  margin-bottom: 0;
  box-shadow: 0 8px 36px rgba(255, 129, 102, 0.24);
  background: linear-gradient(135deg, var(--coral), var(--pink));
}

.hero-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; }
  .board-skeleton { animation: none; background: var(--surface-alt); }
  .stock-badge.urgent, .stock-badge.hero-urgent { animation: none; }
}

.hero-slide-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-slide-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  padding: 30px 36px;
  background: linear-gradient(180deg, rgba(40, 20, 10, 0) 35%, rgba(35, 18, 10, 0.7) 100%);
}

.hero-slide-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-yellow);
  color: #5a3d00;
  font-weight: 800;
  font-size: 12px;
}

.hero-slide-title {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: balance;
}

.hero-slide-sub {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.hero-slide-cta {
  margin-top: 4px;
  display: inline-flex;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.95);
  color: var(--coral-dark);
  font-weight: 800;
  font-size: 13px;
}

.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--coral-dark);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 3;
}

.hero-nav:hover {
  background: #fff;
  transform: translateY(-50%);
}

.hero-nav.prev { left: 14px; }
.hero-nav.next { right: 14px; }

.hero-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
}

.hero-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  position: relative;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: none;
  transition: width 0.25s ease, background 0.25s ease;
}

/* Expand touch target to 44×44px without changing visual size */
.hero-dot::before {
  content: '';
  position: absolute;
  inset: -18px;
}

.hero-dot:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: none;
}

.hero-dot.active {
  background: #fff;
  width: 20px;
}

/* --- quick category icon menu --- */
.quick-cats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 20px 4px 4px;
  margin-bottom: 20px;
}
.quick-cats::-webkit-scrollbar { display: none; }
.quick-cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 68px;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
.quick-cat-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  box-shadow: 0 2px 8px rgba(74, 58, 53, 0.06);
}
.quick-cat-item:hover .quick-cat-icon,
.quick-cat-item.active .quick-cat-icon {
  background: var(--surface-alt);
  border-color: var(--coral);
  transform: translateY(-2px);
}
.quick-cat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.quick-cat-item.active .quick-cat-label { color: var(--coral); }

/* --- home: board cards --- */
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
  justify-content: center;
  gap: 28px;
}

/* Category-grouped layout — replaces flat grid when categories exist */
.board-grid.has-categories {
  display: block;
}
.cat-section {
  margin-bottom: 40px;
}
.cat-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.cat-section-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--coral);
  margin: 0;
}
.cat-section-title.auto { color: var(--text); }
.cat-section-more {
  font-size: 12px;
  font-weight: 700;
  color: var(--coral);
  text-decoration: none;
  flex-shrink: 0;
  opacity: 0.8;
}
.cat-section-more:hover { opacity: 1; text-decoration: underline; }
.cat-section-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1000px) {
  .cat-section-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .cat-section-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .cat-section-row { grid-template-columns: 1fr; }
}

/* --- category detail view (전체보기 페이지 헤더) --- */
.cat-detail-header {
  /* grid-column: 1/-1 이 없으면 board-grid(auto-fit)에서 카드 한 칸 너비로 쪼그라듦 */
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0 18px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
}
.cat-back-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  transition: border-color 0.15s, color 0.15s;
}
.cat-back-link:hover {
  border-color: var(--coral);
  color: var(--coral);
  text-decoration: none;
}
.cat-detail-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--coral);
  margin: 0;
}
.empty-cat-msg {
  grid-column: 1 / -1;
  color: var(--text-dim);
  text-align: center;
  padding: 40px 0;
  font-size: 14px;
}

/* --- bottom navigation bar — deep navy theme --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: linear-gradient(90deg, #0b1426 0%, #121b33 55%, #0f1c38 100%); /* impeccable-disable design-system-color */
  border-top: 1px solid rgba(0, 229, 255, 0.18); /* impeccable-disable design-system-color */
  display: flex;
  align-items: stretch;
  z-index: 200;
  box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.55), 0 -1px 0 rgba(0, 229, 255, 0.12); /* impeccable-disable design-system-color */
  overflow: visible;
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: rgba(180, 200, 240, 0.65); /* impeccable-disable design-system-color */
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease;
  border: none;
  background: none;
  padding: 8px 0 2px;
  letter-spacing: -0.01em;
}
.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: #00e5ff; /* impeccable-disable design-system-color */
}
.bottom-nav-icon {
  font-size: 22px;
  line-height: 1;
}

/* Center kuji button — neon glow protrudes above nav */
.bottom-nav-kuji-slot {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bottom-nav-kuji-btn {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00e5ff 0%, #ff3d9a 100%); /* impeccable-disable design-system-color */
  border: 3px solid rgba(255, 255, 255, 0.25); /* impeccable-disable design-system-color */
  box-shadow:
    0 0 18px rgba(0, 229, 255, 0.65),
    0 0 36px rgba(255, 61, 154, 0.35),
    0 6px 18px rgba(0, 0, 0, 0.40); /* impeccable-disable design-system-color */
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.22s ease;
  z-index: 10;
  overflow: hidden;
}
.bottom-nav-kuji-btn:hover {
  transform: translateX(-50%) translateY(-6px) scale(1.12);
  box-shadow:
    0 0 28px rgba(0, 229, 255, 0.80),
    0 0 56px rgba(255, 61, 154, 0.45),
    0 12px 28px rgba(0, 0, 0, 0.40); /* impeccable-disable design-system-color */
}
.bottom-nav-kuji-btn:active {
  transform: translateX(-50%) scale(0.92);
  transition-duration: 0.08s;
}
.bottom-nav-kuji-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  pointer-events: none;
}
.bottom-nav-kuji-emoji {
  font-size: 28px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8)); /* impeccable-disable design-system-color */
}

.board-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  position: relative;
  box-shadow: var(--shadow);
  display: block;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* Image fills the top ~65% of the card (aspect-ratio, not a fixed px height,
   so it stays proportional whether the card is 200px or 340px wide across
   the different grids it's reused in) with the position/type badges overlaid
   on top of it; the text panel below is the remaining ~35%. */
.board-card-img {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0b1426; /* impeccable-disable design-system-color */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.board-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.board-card-img .placeholder-icon {
  font-size: 52px;
  opacity: 0.5;
}

.card-num-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.55); /* impeccable-disable design-system-color */
  color: #fff; /* impeccable-disable design-system-color */
  backdrop-filter: blur(3px);
}

.card-type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  backdrop-filter: blur(3px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); /* impeccable-disable design-system-color */
}

.card-type-badge.standard { background: rgba(255, 92, 92, 0.92); color: #fff; } /* impeccable-disable design-system-color */
.card-type-badge.hero { background: rgba(255, 61, 154, 0.92); color: #fff; } /* impeccable-disable design-system-color */
.card-type-badge.gacha { background: rgba(0, 210, 230, 0.92); color: #04222c; } /* impeccable-disable design-system-color */
.card-type-badge.unlimited { background: rgba(255, 140, 20, 0.92); color: #fff; } /* impeccable-disable design-system-color */
.card-type-badge.garapon { background: linear-gradient(135deg, #ffd700, #ff9900); color: #3a2500; } /* impeccable-disable design-system-color */

.board-card-body {
  padding: 14px 16px 16px;
}

.board-card .stock-line {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dim);
  margin-top: 6px;
}

.board-card .stock-line.urgent {
  color: var(--danger);
}

.board-card .stock-line.soldout {
  color: var(--text-dim);
  opacity: 0.7;
}

.board-card:hover {
  transform: translateY(-6px) scale(1.012);
  box-shadow: 0 20px 48px rgba(255, 111, 80, 0.22), 0 4px 12px rgba(74, 58, 53, 0.08);
}

.board-card:active {
  transform: translateY(-2px) scale(1.004);
  box-shadow: 0 10px 24px rgba(255, 111, 80, 0.18);
}

.board-card.hero {
  border-color: var(--hero-accent);
  background: linear-gradient(160deg, var(--hero-accent-bg), var(--surface) 65%);
}

.mode-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.mode-badge.standard {
  background: rgba(255, 111, 80, 0.14);
  color: var(--coral-dark);
}

.mode-badge.hero {
  background: var(--hero-accent-bg);
  color: var(--hero-accent);
}

.board-card .title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  min-height: 2.6em;
  margin-bottom: 2px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.board-card.hero:hover {
  box-shadow: 0 16px 32px rgba(155, 111, 224, 0.22);
}

.board-card.hero:active {
  transform: translateY(-1px);
}

.board-card .meta {
  font-size: 12px;
  color: var(--text-dim);
}

.board-card-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.board-card-footer .price-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 19px;
  font-weight: 900;
  color: var(--coral-dark);
}

.board-card-footer .price-tag::before {
  content: "🪙";
  font-size: 15px;
}

.board-card-footer .price-tag .unit {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  margin-left: 3px;
}

/* "OO명이 차례로 대기 중" badge — real queue/reservation headcount, not decorative */
.wait-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 61, 154, 0.12);
  color: #ff7ec8;
  border: 1px solid rgba(255, 61, 154, 0.28);
}

.wait-badge::before {
  content: "🙋";
  font-size: 12px;
}

.wait-badge.empty {
  background: var(--surface-alt);
  color: var(--text-dim);
}

.wait-badge.empty::before {
  content: '';
}

.wait-badge-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  background: rgba(255, 129, 102, 0.15);
  color: var(--coral-dark);
  cursor: help;
  flex-shrink: 0;
}

/* "OO장 남음!" stock badge + remaining/total progress bar — shared visual
   language between home board-cards and board-detail prize-tier cards.
   .urgent = low stock (scarcity, draws the eye); .soldout = fully gone;
   plain (no extra class) = healthy stock, calmer styling. Hero-mode boards
   reuse the same component but inverted: filling UP is the exciting state
   (closer to launching the group), so it gets the hero-accent purple instead
   of the coral "running out" framing. */
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: var(--surface-alt);
  color: var(--coral-dark);
}

.stock-badge.urgent {
  background: linear-gradient(135deg, #ffd9c4, #ffe7ad);
  color: #b6440f;
  animation: kupick-badge-pulse 1.6s ease-in-out infinite;
}

.stock-badge.soldout {
  background: #efe7e2;
  color: var(--text-dim);
  animation: none;
}

.stock-badge.hero-fill {
  background: var(--hero-accent-bg);
  color: var(--hero-accent);
}

.stock-badge.hero-urgent {
  background: linear-gradient(135deg, #e8d9fb, #d6c0f7);
  color: #6b3fa0;
  animation: kupick-badge-pulse 1.6s ease-in-out infinite;
}

@keyframes kupick-badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.stock-progress-track {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-alt);
  margin-top: 8px;
  overflow: hidden;
}

.stock-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--coral-light), var(--coral));
  transition: width 0.4s ease;
}

.stock-progress-fill.urgent {
  background: linear-gradient(90deg, #ff9a6b, var(--danger));
}

.stock-progress-fill.soldout {
  background: var(--text-dim);
}

.stock-progress-fill.hero {
  background: linear-gradient(90deg, #c9aef5, var(--hero-accent));
}

.stock-progress-fill.hero-urgent {
  background: linear-gradient(90deg, var(--hero-accent), #6b3fa0);
}


/* --- skeleton loading state --- */
@keyframes kupick-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.board-skeleton {
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--soft-blush, #fff5ef) 50%, var(--surface-alt) 75%);
  background-size: 800px 100%;
  animation: kupick-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-lg);
  height: 300px;
  border: 1px solid var(--border);
}

/* --- board error state --- */
.board-error-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
}

.board-error-icon {
  font-size: 36px;
  line-height: 1;
}

.board-error-msg {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.board-error-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
}

.board-error-retry {
  width: auto;
  margin-top: 8px;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface);
  border: 1.5px solid var(--coral-light);
  color: var(--coral-dark);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.board-error-retry:hover {
  background: var(--soft-blush, #fff5ef);
  border-color: var(--coral);
}

/* --- mode help icon --- */
.mode-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  font-style: normal;
  background: rgba(155, 111, 224, 0.18);
  color: var(--hero-accent);
  cursor: help;
  vertical-align: middle;
  margin-left: 2px;
  flex-shrink: 0;
}

.empty-msg {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 0;
}

/* --- auth forms (login/signup) --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.auth-box {
  width: 100%;
  max-width: 400px;
}

.brand {
  text-align: center;
  margin-bottom: 24px;
}

.brand .logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--coral-dark);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow);
}

h1 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 20px;
  color: var(--coral-dark);
  letter-spacing: -0.01em;
}

label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
}

input, textarea, select {
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  resize: vertical;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 111, 80, 0.15);
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
}

/* Board cards are <a> tags — their rounded corners need matching outline-radius treatment */
.board-card:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
  border-radius: var(--radius-lg);
}

@media (forced-colors: active) {
  button:focus-visible, a:focus-visible { outline: 3px solid ButtonText; }
  input:focus, textarea:focus, select:focus { outline: 3px solid ButtonText; }
}

button {
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-pill);
  border: none;
  background: linear-gradient(135deg, var(--coral-bright), var(--coral-dark));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 16px rgba(255, 111, 80, 0.3);
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

button:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 9px 20px rgba(255, 90, 57, 0.38); }
button:active { transform: scale(0.97) translateY(0); transition-duration: 0.05s; }

button.secondary {
  background: rgba(255, 129, 102, 0.10);
  border: 1.5px solid rgba(255, 61, 154, 0.4);
  color: var(--coral-dark);
  box-shadow: none;
}

button.secondary:hover {
  background: rgba(255, 129, 102, 0.18);
  filter: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(255, 129, 102, 0.18);
}

button:disabled {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(136, 153, 204, 0.45);
  cursor: not-allowed;
  box-shadow: none;
}

.inline-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.inline-row input { margin-bottom: 0; }

.inline-row button {
  width: auto;
  padding: 10px 14px;
  white-space: nowrap;
  font-size: 13px;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin: -4px 0 14px;
  min-height: 1em;
  font-weight: 600;
}

.success-msg {
  color: var(--success);
  font-size: 13px;
  margin: -4px 0 14px;
  font-weight: 600;
}

.hint {
  font-size: 12px;
  color: var(--text-dim);
  margin: -8px 0 14px;
}

.switch-link {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
}

.switch-link a {
  color: var(--coral-dark);
  font-weight: 700;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 9px 18px 9px 14px;
  border-radius: 999px;
  background: rgba(255, 61, 154, 0.14);
  border: 1.5px solid rgba(255, 61, 154, 0.4);
  color: var(--coral-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.back-btn .arrow {
  font-size: 19px;
  line-height: 1;
}

.back-btn:hover {
  background: var(--coral);
  color: #fff;
}

.back-btn:active {
  transform: scale(0.96);
}

/* --- board detail: sibling-board ("1세트/2세트/3세트") switcher --- */
.set-switcher {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.set-switcher-btn {
  width: auto;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--coral-dark);
  border: 1.5px solid var(--coral-light);
  box-shadow: none;
  padding: 9px 18px;
  font-size: 13px;
  white-space: nowrap;
}

.set-switcher-btn.active {
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  color: #fff;
  border-color: var(--coral-dark);
  box-shadow: 0 4px 12px rgba(255, 129, 102, 0.3);
}

.set-switcher-btn.soldout-set {
  opacity: 0.6;
}

/* --- board detail / selection / payment / reveal --- */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.detail-title {
  font-size: 25px;
  font-weight: 800;
}

.detail-price {
  font-size: 16px;
  color: var(--coral-dark);
  font-weight: 700;
  margin-top: 6px;
}

.detail-meta {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* prize tier grid (등상 일람): A상/B상/C상... cards, each with a circular
   grade badge overlaid on the product photo, remaining-count text, and a
   per-ticket square grid (instead of a single progress bar) so the exact
   number of remaining slots reads at a glance. */
.prize-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.prize-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.prize-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.prize-item-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.prize-item .img-box {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%); /* impeccable-disable design-system-color */
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 10px;
  overflow: hidden;
}

.prize-item .img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tier-circle {
  position: absolute;
  top: -9px;
  left: -9px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  box-shadow: 0 3px 8px rgba(255, 129, 102, 0.4), 0 0 0 3px var(--surface);
}

.prize-item-info {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.prize-item .name {
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 4px;
  word-break: break-word;
}

.prize-item .remain-text {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 6px;
}

.prize-item .remain-text strong {
  color: var(--coral-dark);
  font-weight: 800;
}

.prize-item .stock-badge {
  font-size: 10.5px;
  padding: 3px 8px;
  margin-top: 0;
  white-space: normal;
}

/* the per-ticket square grid: one little tile per ticket in this tier, the
   sold ones filled solid so the leftover count is visible as shape, not
   just a number */
.tier-cell-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 12px;
}

.tier-cell {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.tier-cell.sold {
  background: var(--coral-light);
  border-color: var(--coral-light);
}

/* --- 라스트원상 (last-one bonus prize): the same card shape, dressed up --- */
.prize-item.last-one {
  background: linear-gradient(165deg, rgba(255, 209, 102, 0.22), var(--surface) 68%);
  border: 1.5px solid var(--yellow);
  box-shadow: 0 10px 26px rgba(255, 212, 121, 0.35);
}

.last-one-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #ffd166;
  background: rgba(255, 209, 102, 0.15);
  box-shadow: 0 2px 6px rgba(255, 212, 121, 0.5);
}

.prize-item.last-one .tier-circle {
  background: radial-gradient(circle at 32% 28%, #fff6da, #ffd479 55%, #e8a93a);
  box-shadow: 0 0 0 3px var(--surface), 0 4px 12px rgba(232, 169, 58, 0.55);
  animation: kupick-shimmer 2.2s ease-in-out infinite;
}

.prize-item.last-one .tier-cell.sold {
  background: #f0c869;
  border-color: #e3b34a;
}

@keyframes kupick-shimmer {
  0%, 100% { box-shadow: 0 0 0 3px var(--surface), 0 4px 12px rgba(232, 169, 58, 0.55); }
  50% { box-shadow: 0 0 0 3px var(--surface), 0 7px 20px rgba(232, 169, 58, 0.85); }
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin: 24px 0 32px;
}

.summary-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.summary-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.summary-item.last-one {
  background: linear-gradient(165deg, rgba(255, 209, 102, 0.22), var(--surface) 68%);
  border: 1.5px solid var(--yellow);
  box-shadow: 0 10px 26px rgba(255, 212, 121, 0.35);
  animation: kupick-shimmer 2.2s ease-in-out infinite;
}

.summary-item.last-one .last-one-ribbon {
  margin-bottom: 8px;
}

.summary-item .tier-letter {
  display: inline-block;
  min-width: 28px;
  padding: 2px 9px;
  margin-bottom: 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--pink));
}

.summary-item .img-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%); /* impeccable-disable design-system-color */
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 11px;
  overflow: hidden;
  margin-bottom: 8px;
}

.summary-item .img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.summary-item .name {
  font-weight: 700;
  font-size: 13px;
}

.summary-item .ticket-number {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.auto-draw-row {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.auto-draw-btn {
  width: auto;
  background: var(--surface);
  color: var(--coral-dark);
  border: 1.5px solid var(--coral);
  padding: 10px 22px;
  font-size: 13px;
}

.auto-draw-btn:hover {
  background: var(--coral);
  color: #fff;
}

.prize-item .remain strong {
  color: var(--coral-dark);
}

.primary-action {
  width: 100%;
  max-width: 320px;
}

.queue-status-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.queue-status-box:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.queue-status-box .position {
  font-size: 28px;
  font-weight: 800;
  color: var(--coral-dark);
  margin: 8px 0;
}

/* Board summary strip above the ticket grid: title/remaining-stock/coin balance. */
.select-stats {
  display: flex;
  gap: 16px;
  margin: 8px 0 18px;
  font-size: 13px;
  font-weight: 700;
}

/* Full-width ticket grid — columns stretch (auto-fit + 1fr) to tile the
   entire board width edge to edge with no leftover side gap, wrapping into
   as many rows as needed. Cells are landscape rectangles (wider than tall)
   via aspect-ratio, sized for a phone-width app screen (~3 per row). */
.ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  padding: 2px;
}

.ticket-cell {
  width: 100%;
  aspect-ratio: 3 / 2;
  cursor: pointer;
  user-select: none;
  perspective: 400px; /* 3D flip depth for .ticket-cell-inner below */
}

.ticket-cell:active {
  transform: scale(0.95);
}

/* The actual flip target — kept separate from .ticket-cell itself so the
   press-down scale above and the selection flip below never fight over the
   same `transform` property. */
.ticket-cell-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
}

.ticket-cell.selected .ticket-cell-inner {
  transform: rotateY(180deg);
}

.ticket-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  background: var(--surface);
  border: 1.5px solid var(--coral-light);
  color: var(--text);
  backface-visibility: hidden;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.ticket-cell:hover .ticket-face-front {
  border-color: var(--coral);
  background: var(--surface-alt);
}

/* Revealed-result overlay (this buyer's own ticket, already drawn — see
   getTicketGrid's tierCode comment): the result is the whole point of this
   cell once it's drawn, so it's the dominant centered content — same spot
   the plain ticket number occupies on a not-yet-drawn cell. The ticket
   number itself becomes a small corner tag, since it's secondary once the
   result is known. */
.ticket-face-front .ticket-result-text {
  font-size: 20px;
  font-weight: 900;
}

.ticket-face-front .ticket-num-tag {
  position: absolute;
  right: 4px;
  top: 4px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.30);
  opacity: 0.85;
}

/* Back face only ever shows "selected", never the real prize/tier — the
   draw assignment is never exposed to any client before that specific
   ticket's post-payment reveal (BoardsService.lockDraw / architecture
   §3.4 anti-cheat guarantee), so this screen can't do a real prize-reveal
   flip no matter how it's styled. */
.ticket-face-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  color: #fff;
  font-size: 14px;
}

.ticket-cell.taken {
  cursor: not-allowed;
}

/* 품절 — dimmed to near-invisible per spec. */
.ticket-cell.taken .ticket-face-front {
  opacity: 0.3;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 229, 255, 0.07);
  color: rgba(136, 153, 204, 0.6);
}

.ticket-cell.taken:active {
  transform: none;
}

/* This buyer's own already-claimed ticket (from an earlier order on this
   board) — highlighted instead of dimmed like other buyers' taken tickets. */
.ticket-cell.taken.mine .ticket-face-front {
  opacity: 1;
  background: rgba(255, 61, 154, 0.14);
  border-color: var(--hero-accent);
  color: var(--hero-accent);
  box-shadow: 0 0 10px rgba(255, 61, 154, 0.30);
}

.selection-bar {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.05);
}

.selection-bar .count {
  font-size: 14px;
  color: var(--coral-dark);
  font-weight: 700;
}

.selection-bar button {
  width: auto;
  padding: 12px 28px;
}

.order-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.order-summary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.order-summary .row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.order-summary .row:last-child {
  border-bottom: none;
  font-weight: 800;
  color: var(--coral-dark);
}

.coin-pay-box {
  background: linear-gradient(135deg, #fff8e8, #fff3da);
  border: 1px solid #ffe3a3;
  border-radius: 16px;
  padding: 18px 24px;
  margin-bottom: 20px;
}

.coin-pay-box .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

.coin-discount-tag {
  font-size: 11px;
  font-weight: 700;
  color: #a16a00;
  margin-left: 6px;
}

#coin-pay-btn {
  margin-top: 8px;
}

/* --- reveal: ticket-tear animation --- */
.reveal-stage {
  text-align: center;
  padding: 40px 0;
}

.reveal-progress {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.reveal-card {
  background: var(--surface);
  border: 2px solid var(--coral-light);
  border-radius: 18px;
  padding: 16px 20px;
  max-width: 380px;
  min-height: 116px;
  margin: 0 auto 24px;
  position: relative;
  overflow: hidden;
}

.reveal-card.sealed .prize-reveal-content {
  opacity: 0;
}

.reveal-card .ticket-number {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 700;
}

.reveal-card .prize-reveal-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  height: 100%;
  justify-content: center;
}

.reveal-card .prize-main-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.reveal-card .prize-reveal-content .prize-text {
  flex: 1;
  min-width: 0;
}

/* --- 라스트원 보너스: 일반 등급 상품과 별도로 같은 reveal 카드에 추가
   표시되는 두 번째 줄. 별/반짝임으로 다른 등급보다 더 화려하게 강조 —
   board.html의 .last-one-ribbon/kupick-shimmer와 같은 금색 톤. --- */
.reveal-card.has-bonus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 212, 121, 0.35);
}

.last-one-bonus-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(255, 209, 102, 0.22), var(--surface) 75%);
  border: 1.5px solid var(--yellow);
  animation: kupick-shimmer 2.2s ease-in-out infinite;
}

.last-one-bonus-row .prize-main-row .img-box {
  box-shadow: 0 0 0 2px var(--surface), 0 4px 12px rgba(232, 169, 58, 0.55);
}

.last-one-bonus-row .prize-name {
  color: #ffd166;
}

.reveal-card .img-box {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%); /* impeccable-disable design-system-color */
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 11px;
  overflow: hidden;
}

.reveal-card .img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.reveal-card .prize-name {
  font-size: 19px;
  font-weight: 800;
  color: var(--coral-dark);
}

.seal-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.reveal-card.tearing-apart .seal-icon,
.reveal-card.revealed .seal-icon {
  opacity: 0;
}

/* --- reveal: torn-paper halves, shared by auto-draw and manual-drag completion --- */
.tear-left,
.tear-right {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.45s ease;
}

.tear-left {
  left: 0;
  width: 53%;
  clip-path: polygon(0% 0%, 86% 0%, 100% 11%, 82% 23%, 100% 35%, 82% 47%, 100% 59%, 82% 71%, 100% 83%, 86% 100%, 0% 100%);
}

.tear-right {
  right: 0;
  width: 53%;
  clip-path: polygon(14% 0%, 100% 0%, 100% 100%, 14% 100%, 0% 83%, 18% 71%, 0% 59%, 18% 47%, 0% 35%, 18% 23%, 0% 11%);
}

.reveal-card.tearing-apart .tear-left {
  transform: translate(-120%, -10%) rotate(-14deg);
  opacity: 0;
}

.reveal-card.tearing-apart .tear-right {
  transform: translate(120%, 10%) rotate(14deg);
  opacity: 0;
}

.reveal-card.revealed .tear-left,
.reveal-card.revealed .tear-right {
  display: none;
}

/* slider-mode keeps its drag-seal on top of (and visually identical to) the
   tear halves until the drag completes, so the crossfade from "draggable
   rail" to "torn paper" is seamless rather than a visible swap */
.reveal-card.slider-mode .tear-left,
.reveal-card.slider-mode .tear-right {
  opacity: 0;
}

.reveal-card.slider-mode.opened .tear-left,
.reveal-card.slider-mode.opened .tear-right {
  opacity: 1;
}

.reveal-card.slider-mode.opened .drag-seal {
  transition: opacity 0.15s ease;
  opacity: 0;
  pointer-events: none;
}

/* --- reveal: drag-to-slide-open ticket (manual mode) --- */
.drag-seal {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 61, 154, 0.32), rgba(255, 129, 102, 0.32));
  display: flex;
  align-items: center;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.drag-seal:active {
  cursor: grabbing;
}

.drag-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
}

.drag-hint {
  position: relative;
  z-index: 1;
  width: 100%;
  text-align: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.01em;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.drag-handle {
  position: absolute;
  top: 50%;
  left: 6px;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  z-index: 2;
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

.reveal-card.slider-mode.dragging .drag-handle,
.reveal-card.slider-mode.dragging .drag-fill {
  transition: none;
}

.reveal-card.slider-mode .drag-handle,
.reveal-card.slider-mode .drag-fill {
  transition: left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-card.shaking {
  animation: kupick-shake 0.45s ease-in-out;
}

.reveal-card.shaking.rare {
  animation: kupick-rare-shake 0.65s ease-in-out;
}

.prize-reveal-content {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.reveal-card.revealed .prize-reveal-content {
  opacity: 1;
  animation: kupick-zoom-bounce 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes kupick-shake {
  0%, 100% { transform: rotate(0deg) translateX(0); }
  20% { transform: rotate(-3deg) translateX(-3px); }
  40% { transform: rotate(3deg) translateX(3px); }
  60% { transform: rotate(-2deg) translateX(-2px); }
  80% { transform: rotate(2deg) translateX(2px); }
}

@keyframes kupick-rare-shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-7px, -3px) rotate(-5deg); }
  20% { transform: translate(7px, 3px) rotate(5deg); }
  30% { transform: translate(-7px, 3px) rotate(-4deg); }
  40% { transform: translate(7px, -3px) rotate(4deg); }
  50% { transform: translate(-5px, 2px) rotate(-3deg); }
  60% { transform: translate(5px, -2px) rotate(3deg); }
  70% { transform: translate(-3px, 1px) rotate(-2deg); }
  80% { transform: translate(3px, -1px) rotate(1deg); }
  90% { transform: translate(-1px, 1px) rotate(0deg); }
}

@keyframes kupick-zoom-bounce {
  0% { opacity: 0; transform: scale(0.35); }
  55% { opacity: 1; transform: scale(1.15); }
  75% { transform: scale(0.93); }
  100% { opacity: 1; transform: scale(1); }
}

/* --- reveal: screen-wide flash burst, timed to the moment of tearing --- */
.kupick-flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: radial-gradient(circle at center, #fff 0%, rgba(255, 255, 255, 0.6) 40%, transparent 75%);
  animation: kupick-flash 0.4s ease-out forwards;
}

.kupick-flash-overlay.rare {
  animation-duration: 0.6s;
  background: radial-gradient(circle at center, #fff 0%, rgba(255, 222, 130, 0.7) 45%, transparent 78%);
}

@keyframes kupick-flash {
  0% { opacity: 0; }
  15% { opacity: 0.9; }
  100% { opacity: 0; }
}

/* --- reveal: confetti burst for rare-tier (A상) prizes --- */
.kupick-confetti-piece {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 14px;
  border-radius: 2px; /* impeccable-disable design-system-radius */
  z-index: 9998;
  pointer-events: none;
  animation: kupick-confetti-fall 1.1s ease-in forwards;
}

@keyframes kupick-confetti-fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--kupick-confetti-dx), var(--kupick-confetti-dy)) rotate(var(--kupick-confetti-rot)); opacity: 0; }
}

/* extra-large shake on the whole page content for rare-tier reveals */
.container.rare-shake {
  animation: kupick-page-shake 0.5s ease-in-out;
}

@keyframes kupick-page-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(3px, 2px); }
}

.info-banner {
  background: var(--hero-accent-bg);
  border: 1px solid var(--hero-accent);
  color: var(--hero-accent);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  margin-top: 16px;
  font-weight: 600;
}

/* --- my page --- */
.my-section {
  margin-bottom: 36px;
}

.my-section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--coral-dark);
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}

.list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.list-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.list-item .list-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.list-item .info { flex: 1; min-width: 0; }
.list-item .title-row { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.list-item .sub-row { font-size: 12px; color: var(--text-dim); }
.list-item .actions { display: flex; gap: 8px; flex-shrink: 0; }
.list-item .actions button { width: auto; padding: 8px 14px; font-size: 12px; }

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-alt);
  color: var(--text-dim);
}
.status-badge.requested { background: rgba(255, 111, 80, 0.14); color: var(--coral-dark); }
.status-badge.shipped, .status-badge.delivered, .status-badge.paid, .status-badge.answered { background: rgba(63, 174, 107, 0.14); color: var(--success); }
.status-badge.pending, .status-badge.pending_payment, .status-badge.cancelled, .status-badge.expired, .status-badge.failed { background: rgba(229, 72, 77, 0.12); color: var(--danger); }

/* --- 고객센터 (support inquiries) --- */
.list-item.clickable {
  cursor: pointer;
}

.list-item.clickable:hover {
  border-color: var(--coral-light);
}

.category-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.category-btn {
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  box-shadow: none;
}

.category-btn.active {
  border-color: var(--coral);
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  color: #fff;
}

.inquiry-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.inquiry-message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.inquiry-message-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
}

.inquiry-message.customer {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.inquiry-message.customer .inquiry-message-meta {
  color: rgba(255, 255, 255, 0.75);
  text-align: right;
}

.inquiry-message.admin {
  align-self: flex-start;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.inquiry-reply-box textarea {
  margin-bottom: 10px;
}

.inquiry-reply-box button {
  width: auto;
  padding: 10px 20px;
}

.default-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--coral-dark);
  border: 1px solid var(--coral-light);
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 8px;
}

.shipping-request-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
}

.shipping-request-box select {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

.shipping-request-box button {
  width: auto;
  padding: 8px 14px;
  font-size: 12px;
  white-space: nowrap;
}

/* --- vote box --- */
.vote-box {
  background: var(--hero-accent-bg);
  border: 1px solid var(--hero-accent);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.vote-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(155, 111, 224, 0.22);
}

.vote-box-text {
  font-size: 14px;
  margin-bottom: 6px;
  font-weight: 600;
}

.vote-box-count {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.vote-box-count #vote-count {
  color: var(--hero-accent);
  font-weight: 800;
  font-size: 16px;
}

.vote-box button {
  width: auto;
  padding: 10px 24px;
  max-width: 280px;
  background: linear-gradient(135deg, var(--hero-accent), #7c52c4);
  box-shadow: 0 6px 16px rgba(155, 111, 224, 0.3);
}

.vote-box button.voted {
  background: var(--surface);
  border: 1.5px solid var(--text-dim);
  color: var(--text-dim);
  box-shadow: none;
}

/* --- my page tabs --- */
.my-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.my-tab-btn {
  flex: 1;
  width: auto;
  background: var(--surface);
  color: var(--coral-dark);
  border: 1.5px solid var(--coral-light);
  box-shadow: none;
  padding: 12px 14px;
  font-size: 14px;
}

.my-tab-btn.active {
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  color: #fff;
  border-color: var(--coral-dark);
  box-shadow: 0 6px 16px rgba(255, 111, 80, 0.3);
}

.my-tab-panel {
  display: none;
}

.my-tab-panel.active {
  display: block;
}

/* --- site footer --- */
.site-footer {
  margin-top: 48px;
  padding: 20px 16px 28px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  text-align: center;
}

.site-footer-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 8px;
}

.site-footer-links a {
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
}

.site-footer-links a:hover {
  color: var(--coral-dark);
  text-decoration: underline;
}

.site-footer-company {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.8;
}

.site-footer-copy {
  color: var(--text-dim);
  font-size: 12px;
}

/* --- birth-date prompt modal (minor-protection compliance) --- */
.birth-date-prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 16px;
}

.birth-date-prompt-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 22px;
  width: min(360px, 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.birth-date-prompt-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.birth-date-prompt-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 14px;
}

.birth-date-prompt-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* --- static legal pages (terms/privacy/refund) --- */
.legal-content h2 {
  font-size: 16px;
  color: var(--coral-dark);
  margin: 24px 0 8px;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p,
.legal-content li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

.legal-content ul {
  padding-left: 20px;
  margin: 4px 0;
}

.legal-content .legal-note {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
}

/* --- my page: inventory grid (won prizes, merged by quantity) --- */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.inventory-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.inventory-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.inventory-item .qty-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  /* dark-navy text, not white — in the site's neon theme --coral and
     --coral-dark are both the same bright cyan (#00c6e0), and white text on
     that background sits at ~2:1 contrast (fails WCAG's 4.5:1 for small
     text); var(--bg) against it measures ~10:1. */
  color: var(--bg);
  font-size: 12px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(255, 111, 80, 0.35);
  z-index: 1;
}

.inventory-item .img-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%); /* impeccable-disable design-system-color */
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 11px;
  overflow: hidden;
  margin-bottom: 10px;
}

.inventory-item .img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.inventory-item .name {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}

.inventory-item .board-name {
  font-size: 11px;
  color: var(--text-dim);
}

.inventory-item.last-one {
  background: linear-gradient(165deg, rgba(255, 209, 102, 0.22), var(--surface) 68%);
  border: 1.5px solid var(--yellow);
  box-shadow: 0 10px 26px rgba(255, 212, 121, 0.35);
}

.inventory-item.last-one .last-one-ribbon {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
}

/* --- sound mute toggle (injected by sound.js) --- */
#kupick-sound-toggle {
  position: fixed;
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 16px));
  right: max(20px, calc(env(safe-area-inset-right) + 16px));
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--surface);
  border: 1.5px solid var(--coral-light);
  color: var(--coral-dark);
  box-shadow: 0 6px 18px rgba(255, 111, 80, 0.3);
  z-index: 999;
}

#kupick-sound-toggle:active { transform: scale(0.92); }

/* --- 공지사항 (notices) --- */
.notice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.notice-row:hover {
  border-color: var(--coral-light);
  background: var(--surface-alt);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.notice-row.pinned {
  border-color: var(--coral);
  background: var(--coral-light);
}

.notice-title {
  flex: 1;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-meta {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.notice-pin-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--coral-dark);
  white-space: nowrap;
}

.notice-category-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-alt);
  color: var(--text-dim);
  white-space: nowrap;
}

.notice-category-badge.event {
  background: rgba(255, 200, 87, 0.25);
  color: #a16a00;
}

.notice-category-badge.maintenance {
  background: rgba(110, 130, 230, 0.14);
  color: #4a59c4;
}

.notice-category-badge.urgent {
  background: rgba(229, 72, 77, 0.12);
  color: var(--danger);
}

.notice-detail-header {
  margin-bottom: 20px;
}

.notice-detail-header .notice-category-badge {
  margin-bottom: 10px;
}

.notice-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

.notice-content p {
  margin: 0 0 12px;
  white-space: pre-wrap;
}

.notice-image {
  max-width: 100%;
  border-radius: 12px;
  margin: 8px 0 16px;
  display: block;
}

/* --- 리뷰 (reviews) --- */
.review-summary {
  font-size: 14px;
  font-weight: 700;
  color: var(--coral-dark);
  margin-top: 6px;
}

.review-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.review-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.review-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.review-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.review-stars {
  color: var(--yellow);
  font-size: 14px;
  letter-spacing: 1px;
}

.review-author {
  font-size: 13px;
  font-weight: 700;
}

.review-date {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: auto;
}

.review-content {
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.review-images {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.review-images img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
}

.star-picker {
  display: flex;
  gap: 6px;
  font-size: 32px;
  color: var(--border);
  margin-bottom: 14px;
  cursor: pointer;
  user-select: none;
}

.star-pick.filled {
  color: var(--yellow);
}

.write-review-btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.write-review-btn:hover {
  background: var(--coral-dark);
}

/* --- 코인 (coins) --- */
.coin-balance-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe9a8, #ffd479);
  color: #8a5a00;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.coin-balance-badge:hover {
  filter: brightness(0.93);
  transform: translateY(-1px);
  color: #8a5a00;
}

.coin-balance-display {
  font-size: 28px;
  font-weight: 800;
  color: #a16a00;
  background: linear-gradient(135deg, #fff3da, #ffe9a8);
  border-radius: 14px;
  padding: 18px 22px;
  text-align: center;
}

/* --- 교환소 (exchange) --- */
.exchange-rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.exchange-rule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.exchange-rule-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.exchange-rule-formula {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.exchange-rule-formula .arrow {
  color: var(--coral);
  font-size: 18px;
}

.exchange-reward-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%); /* impeccable-disable design-system-color */
  margin: 0 auto;
  display: block;
}

.exchange-owned-line {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

.exchange-owned-line.sufficient {
  color: var(--success);
  font-weight: 700;
}

.exchange-redeem-btn {
  margin-top: 4px;
}

.exchange-redeem-btn:disabled {
  background: var(--border);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
}

.exchangeable-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(110, 130, 230, 0.14);
  color: #4a59c4;
  font-size: 10px;
  font-weight: 700;
  margin-top: 4px;
}

@media (max-width: 700px) {
  .navbar { padding: 12px 16px; flex-wrap: wrap; gap: 8px; row-gap: 6px; }
  .navbar .logo { font-size: 18px; }
  .navbar .nav-right { font-size: 12px; gap: 8px; flex-wrap: wrap; }
  .navbar button.logout-btn { padding: 6px 12px; font-size: 11px; }
  .container { padding: 16px 12px 120px; }
  .board-grid { grid-template-columns: 1fr; }
  .quick-cat-icon { width: 52px; height: 52px; font-size: 22px; border-radius: 14px; }
  .prize-list { grid-template-columns: 1fr; }
  .tier-cell { width: 9px; height: 9px; }
  .detail-title { font-size: 21px; }
  .selection-bar { padding: 14px 18px; flex-wrap: wrap; gap: 8px; }
  #kupick-sound-toggle { width: 42px; height: 42px; bottom: max(14px, calc(env(safe-area-inset-bottom) + 10px)); right: max(14px, calc(env(safe-area-inset-right) + 10px)); font-size: 17px; }
  .board-filters { flex-direction: column; gap: 10px; }
  .board-filters #sort-tabs { width: 100%; }
  .my-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .my-tab-btn { flex: none; white-space: nowrap; }
  .hero-banner { height: 260px; border-radius: 0 0 20px 20px; }
  .hero-slide-overlay { padding: 18px 20px; }
  .hero-slide-title { font-size: 19px; }
  .hero-slide-sub { font-size: 12px; }
  .hero-slide-cta { font-size: 12px; padding: 7px 14px; }
  .hero-nav { width: 32px; height: 32px; font-size: 18px; }
}

/* Landscape phone: hero banner takes up too much of the short viewport */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-banner { height: 140px; }
  .hero-slide-overlay { padding: 12px 18px; gap: 4px; }
  .hero-slide-title { font-size: 16px; }
  .hero-slide-sub { display: none; }
  .container { padding-top: 16px; }
}

/* Coarse pointer (touch/stylus): increase interactive target density */
@media (pointer: coarse) {
  .category-btn { min-height: 44px; padding: 10px 20px; }
  .hero-nav { width: 44px; height: 44px; }
  select { min-height: 44px; }
}

/* No hover capability: don't rely on hover for visual affordance */
@media (hover: none) {
  .board-card:hover { transform: none; box-shadow: var(--shadow); }
}

/* --- 주문 영수증 (receipt) --- */
.order-receipt-toggle {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.order-receipt-toggle .hint-text {
  font-size: 12px;
  color: var(--text-dim);
}

.order-receipt-toggle .view-receipt-btn {
  width: auto;
  padding: 8px 14px;
  font-size: 12px;
}

.receipt-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(40, 30, 26, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.receipt-modal {
  background: var(--surface);
  border-radius: 16px;
  padding: 28px 26px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 12px 40px rgba(40, 30, 26, 0.25);
}

.receipt-modal h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--coral-dark);
  margin: 0 0 18px;
  text-align: center;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.receipt-row:last-of-type {
  border-bottom: none;
}

.receipt-label {
  color: var(--text-dim);
  flex-shrink: 0;
}

.receipt-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.receipt-modal-actions button {
  flex: 1;
}

@media print {
  body * {
    visibility: hidden;
  }
  .receipt-modal, .receipt-modal * {
    visibility: visible;
  }
  .receipt-modal-overlay {
    position: absolute;
    inset: auto;
    top: 0;
    left: 0;
    background: none;
    padding: 0;
  }
  .receipt-modal {
    box-shadow: none;
    max-width: none;
  }
  .receipt-modal-actions {
    display: none;
  }
}

/* --- 친구 추천 코드 (referral) --- */
.referral-code-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.referral-code-value {
  flex: 1;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--coral-dark);
}

.referral-stats-row {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 10px;
}

/* ============================================================
   SCROLL-REVEAL ANIMATIONS
   Cards and section items fade-in + slide-up as they enter
   the viewport. The .reveal-item class is the default state
   (invisible, shifted down). JS adds .revealed via
   IntersectionObserver. prefers-reduced-motion skips motion.
   ============================================================ */
.reveal-item {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.48s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-item.revealed {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal-item { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   RECENT WINS SECTION
   "최근 당첨 소식" — compact horizontal scrolling strip
   ============================================================ */
.wins-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.wins-strip::-webkit-scrollbar { display: none; }

.win-chip {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(74,58,53,0.06);
  display: flex;
  align-items: center;
  gap: 6px;
  animation: chip-slide-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.win-chip .win-tier {
  font-weight: 800;
  color: var(--coral);
}
.win-chip.is-last-one .win-tier { color: var(--accent-yellow-dark); }

@keyframes chip-slide-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .win-chip { animation: none; }
}

/* ============================================================
   PERSONALIZED SECTION ("내가 좋아할 만한 쿠지")
   ============================================================ */
.personalized-section {
  margin-bottom: 32px;
}

/* ============================================================
   BOARD STATS (board detail page)
   ============================================================ */
.board-stats-row {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.board-stat-card {
  flex: 1;
  min-width: 100px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
}
.board-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--coral);
  line-height: 1.1;
}
.board-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  font-weight: 600;
}

/* ============================================================
   RELATED BOARDS (board detail page)
   ============================================================ */
.related-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.related-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 16px;
}
.related-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

/* ============================================================
   EMPTY STATES (My page tabs)
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 52px 24px 40px;
}
.empty-state-icon {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 16px;
  display: block;
}
.empty-state-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 8px;
}
.empty-state-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 24px;
  line-height: 1.6;
}
.empty-state-cta {
  display: inline-block;
  background: var(--coral);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.empty-state-cta:hover {
  background: var(--coral-dark);
  transform: translateY(-1px);
}

/* last-one bonus badge in inventory/shipping lists */
.last-one-bonus-tag {
  background: linear-gradient(135deg, var(--accent-yellow), var(--yellow));
  color: var(--text);
}

/* ============================================================
   COUNT-UP NUMBER ANIMATION
   ============================================================ */
.count-up {
  display: inline-block;
}

/* ============================================================
   ADMIN DASHBOARD STATS CARDS
   ============================================================ */
.admin-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.admin-stat-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  padding: 20px 20px 18px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.admin-stat-card-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 10px;
  display: block;
}
.admin-stat-card-value {
  font-size: 26px;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1.1;
}
.admin-stat-card-label {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
  font-weight: 600;
}
.admin-stat-card.alert .admin-stat-card-value { color: #e5484d; }
.admin-stat-card.success .admin-stat-card-value { color: #3fae6b; }

/* ═══════════════════════════════════════════════════════════════════
   KUPICK DARK NAVY THEME — Global CSS-variable override (2026-06-27)
   Remaps coral/beige :root tokens → deep navy + neon cyan/pink.
   Pages with <style id="kupick-dark-theme"> blocks keep their own
   !important rules; every other page goes dark via these vars.
   ═══════════════════════════════════════════════════════════════════ */
/* impeccable-disable design-system-color */
/* impeccable-disable gradient-text */
:root {
  --bg:                #0b1426;
  --surface:           #0f1c38;
  --surface-alt:       #121b33;
  --surface-alt-2:     #162040;
  --border:            rgba(0, 229, 255, 0.14);
  --coral:             #00c6e0;
  --coral-bright:      #ff3d9a;
  --coral-dark:        #00c6e0;
  --coral-light:       rgba(0, 198, 224, 0.18);
  --pink:              #ff3d9a;
  --yellow:            #ffd166;
  --accent-yellow:     #ffd166;
  --accent-yellow-dark:#ffab40;
  --text:              #e0e8ff;
  --text-dim:          rgba(180, 200, 240, 0.50);
  --text-muted:        rgba(180, 200, 240, 0.50);
  --danger:            #ff6b6b;
  --success:           #2be09a;
  --hero-accent:       #ff3d9a;
  --hero-accent-bg:    rgba(255, 61, 154, 0.10);
  --shadow:            0 10px 28px rgba(0, 0, 0, 0.55);
  --shadow-sm:         0 6px 16px rgba(0, 0, 0, 0.40);
}
/* Logo gradient on all pages */
.navbar .logo, .brand .logo {
  background: linear-gradient(90deg, #00e5ff, #ff3d9a);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
/* Primary button: dark text on cyan bg */
button:not(.secondary):not(.logout-btn):not([class*="hero-nav"]):not([class*="notif"]):not([class*="search"]):not([class*="category"]):not([class*="quick-cat"]):not([class*="mode-help"]):not(.draw-btn):not(.btn-again):not(.btn-confirm):not(.count-chip):not(.confirm-cancel-btn):not(.confirm-ok-btn) {
  color: #0b1426;
}
/* Auth pages: full-screen dark gradient */
.auth-page { background: linear-gradient(160deg, #0b1426 0%, #121b33 60%, #0e1830 100%); }
.auth-box   { background: transparent; }
/* Inputs dark */
input:not([type="checkbox"]):not([type="radio"]), textarea, select {
  background: rgba(15, 28, 56, 0.90);
  border-color: rgba(0, 229, 255, 0.22);
  color: #e0e8ff;
}
input:not([type="checkbox"]):not([type="radio"])::placeholder, textarea::placeholder {
  color: rgba(180, 200, 240, 0.32);
}
input:not([type="checkbox"]):not([type="radio"]):focus, textarea:focus, select:focus {
  border-color: #00e5ff;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
  outline: none;
}
/* Back button / page-title */
.back-btn   { color: rgba(0, 229, 255, 0.72); }
.page-title { color: #e0e8ff; }
/* Event / notice / review cards */
.event-card, .notice-list-item, .notice-card, .review-list-item, .review-card {
  background: rgba(15, 28, 56, 0.80);
  border-color: rgba(0, 229, 255, 0.12);
  color: #e0e8ff;
}
.event-card:hover, .notice-list-item:hover {
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.18), 0 12px 32px rgba(0, 0, 0, 0.45);
}
.event-card-body, .notice-item-title, .event-title, .event-meta { color: #e0e8ff; }
/* Site footer */
.site-footer {
  background: rgba(11, 20, 38, 0.80);
  border-top: 1px solid rgba(0, 229, 255, 0.10);
  color: rgba(224, 232, 255, 0.40);
}
.site-footer a { color: rgba(0, 229, 255, 0.55); }
/* Notification panel dark */
.notif-panel { background: #0f1c38; border-color: rgba(0, 229, 255, 0.18); }
.notif-panel-header { color: #e0e8ff; border-bottom-color: rgba(0, 229, 255, 0.10); }
.notif-item { color: #e0e8ff; border-bottom-color: rgba(0, 229, 255, 0.08); }
.notif-item.unread { background: rgba(0, 229, 255, 0.05); }
.notif-item-body { color: rgba(180, 200, 240, 0.70); }
.notif-item-time { color: rgba(180, 200, 240, 0.45); }
.notif-empty { color: rgba(180, 200, 240, 0.50); }
.notif-mark-all-btn { color: rgba(0, 229, 255, 0.70); background: transparent; border-color: rgba(0, 229, 255, 0.15); }
/* Star rating on write-review */
.star-rating .star { color: rgba(180, 200, 240, 0.25); }
.star-rating .star.selected, .star-rating .star:hover { color: #ffd166; }
