/* =========================================================
   다해 쿠지 (Dahye Kuji) - 공통 스타일
   색상 컨셉: 딥 블랙 + 레드 + 골드 (이치방쿠지 느낌)
   기본적으로 모바일 화면(최대 480px 폭)에 맞춰 구성되어 있습니다.
========================================================= */

:root {
  --bg: #0f0f12;
  --bg-soft: #17171c;
  --panel: #1e1e25;
  --panel-2: #262631;
  --border: #33333e;
  --text: #f2f0ea;
  --text-dim: #a9a7b3;
  --red: #e63946;
  --red-dark: #b3222d;
  --gold: #f4a300;
  --green: #2ecc71;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --mobile-width: 480px;
  font-size: 16px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", -apple-system,
    BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  overscroll-behavior-y: none;
}

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

button {
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

/* ---------- Layout ---------- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background: linear-gradient(180deg, #000 0%, #141418 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background-color: var(--gold);
  background-image: url('/imgs/chiwi3.jpeg');
  background-size: cover;
  background-position: center 35%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px #000 inset;
}

.brand small {
  display: block;
  font-size: 0.6rem;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.user-chip strong {
  color: var(--text);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: transform 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  background: var(--panel-2);
  transform: rotate(25deg);
}

.container {
  /* 기본적으로 모바일 화면 폭에 맞춤: 데스크톱에서도 폰 화면처럼 중앙에 좁게 표시됩니다. */
  max-width: var(--mobile-width);
  margin: 0 auto;
  padding: 18px 16px calc(60px + env(safe-area-inset-bottom));
}

.container.wide {
  /* 관리자 화면은 콘텐츠가 많아 조금 더 넓게 사용하되, 860px 이하에서는 1단으로 접힙니다. */
  max-width: 1180px;
}

/* ---------- Hero banner (메인 화면 상단 장식) ---------- */

.hero-banner {
  position: relative;
  width: 100%;
  height: 160px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 53%;
}

.hero-banner-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), transparent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---------- Step indicator ---------- */

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 6px 0 28px;
  flex-wrap: wrap;
}

.steps .step {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.steps .dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.steps .step.active .dot {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.steps .step.done .dot {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}

.steps .step.active {
  color: var(--text);
}

.steps .sep {
  width: 22px;
  height: 1px;
  background: var(--border);
}

/* ---------- Card / Panel ---------- */

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

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .badge {
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.section-title .title-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 53%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--border);
}

.hint {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #c97e00);
  color: #201400;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}

.btn-danger {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* ---------- Form elements ---------- */

.field {
  margin-bottom: 16px;
}

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

.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--red);
}

.field textarea {
  resize: vertical;
  min-height: 70px;
}

/* ---------- Modal ---------- */

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

.modal-backdrop.hidden {
  display: none;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
  text-align: center;
}

.modal h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.modal p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0 0 18px;
}

/* ---------- Toast ---------- */

#toast-wrap {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast {
  background: #222229;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease;
}

.toast.error {
  border-color: var(--red);
  color: #ffb4ba;
}

.toast.success {
  border-color: var(--green);
  color: #b9f6ca;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Board list (메인화면) ---------- */

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.board-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
}

.board-card:hover {
  transform: translateY(-4px);
  border-color: var(--red);
}

.board-card .thumb {
  height: 110px;
  background: linear-gradient(135deg, #2b0a10, #150507);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  font-size: 2.2rem;
  position: relative;
  overflow: hidden;
}

.board-card .thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0.55;
}

.board-card .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10, 4, 6, 0.85), rgba(10, 4, 6, 0.15) 60%);
}

.board-card .thumb-label {
  position: relative;
  z-index: 1;
  padding: 8px 12px;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 1px;
}

.board-card .body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.board-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.board-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.5;
  flex: 1;
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
}

.progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--red));
}

.board-card .meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

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

.empty-state .big-emoji {
  font-size: 2.6rem;
  margin-bottom: 10px;
}

/* ---------- Ticket grid (쿠지 선택 화면) ---------- */

.ticket-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 999px;
}

.stepper button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.stepper span {
  min-width: 20px;
  text-align: center;
  font-weight: 700;
}

.ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.ticket {
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  background-image: linear-gradient(160deg, rgba(35, 35, 42, 0.72), rgba(18, 18, 22, 0.85)), url('/imgs/chiwi2.jpeg');
  background-size: cover;
  background-position: center 30%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  font-size: 1.3rem;
  color: #f0f0f0;
  transition: transform 0.12s ease, border-color 0.12s ease;
  user-select: none;
}

.ticket:hover {
  transform: translateY(-3px);
}

.ticket .pos {
  position: absolute;
  bottom: 3px;
  right: 5px;
  font-size: 0.55rem;
  color: #eee;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.ticket.selected {
  border-color: var(--red);
  background-image: linear-gradient(160deg, rgba(74, 18, 24, 0.75), rgba(28, 7, 9, 0.88)), url('/imgs/chiwi2.jpeg');
  color: #ffd7da;
  box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.35);
}

.ticket.reserved {
  cursor: not-allowed;
  background-image: linear-gradient(rgba(38, 38, 48, 0.85), rgba(38, 38, 48, 0.85)), url('/imgs/chiwi2.jpeg');
  filter: grayscale(0.7);
  color: #9d9da6;
}

.ticket.drawn {
  cursor: not-allowed;
  background-image: linear-gradient(rgba(23, 23, 28, 0.9), rgba(23, 23, 28, 0.9)), url('/imgs/chiwi2.jpeg');
  filter: grayscale(0.85);
  border-style: dashed;
  color: #6b6b75;
}

.ticket.drawn .grade-tag {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.6rem;
  background: var(--gold);
  color: #000;
  border-radius: 4px;
  padding: 1px 4px;
  font-weight: 700;
}

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.legend .sw {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}

.legend .sw.available {
  background: linear-gradient(160deg, #3a3a44, #202027);
  border: 1px solid var(--border);
}
.legend .sw.selected {
  background: #4a1218;
  border: 1px solid var(--red);
}
.legend .sw.reserved {
  background: #2c2c37;
}
.legend .sw.drawn {
  background: var(--bg-soft);
  border: 1px dashed #45454f;
}

/* ---------- Prize list ---------- */

.prize-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prize-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.prize-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 1rem;
}

.prize-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prize-info {
  flex: 1;
  min-width: 0;
}

.prize-info .grade {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
}

.prize-info .name {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prize-count {
  font-size: 0.85rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.prize-count strong {
  color: var(--text);
}

/* ---------- Waiting screen ---------- */

.waiting-wrap {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid var(--border);
  border-top-color: var(--red);
  margin: 0 auto 22px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.waiting-wrap h2 {
  margin: 0 0 8px;
}

.waiting-wrap p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ---------- 쿠지 뜯기 화면 ---------- */

.open-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.open-progress {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.open-progress strong {
  color: var(--gold);
}

.open-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.open-card {
  perspective: 900px;
  aspect-ratio: 3 / 4;
  cursor: pointer;
}

.open-card.opened {
  cursor: default;
}

.open-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-style: preserve-3d;
}

.open-card.opened .open-card-inner {
  transform: rotateY(180deg);
}

.open-card-face {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
}

.open-card-front {
  background-image: linear-gradient(160deg, rgba(35, 35, 42, 0.65), rgba(18, 18, 22, 0.8)), url('/imgs/chiwi2.jpeg');
  background-size: cover;
  background-position: center 30%;
  border: 2px solid var(--border);
  color: #f0f0f0;
}

.open-card-front .pos {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.open-card-back {
  transform: rotateY(180deg);
  border: 2px solid var(--gold);
  color: #fff;
  gap: 4px;
  overflow: hidden;
}

.open-card-back .grade {
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
}

.open-card-back .name {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0 6px;
  line-height: 1.3;
}

.open-card-back img {
  width: 100%;
  height: 55%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0.35;
}

.open-card-back .content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* 리빌 오버레이 (짜자잔!) */

.reveal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
}

.reveal-backdrop.hidden {
  display: none;
}

.reveal-box {
  background: var(--panel);
  border: 2px solid var(--gold);
  border-radius: 20px;
  padding: 24px 22px;
  text-align: center;
  width: 100%;
  max-width: 300px;
  position: relative;
  overflow: hidden;
  animation: pop-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

@keyframes pop-in {
  from {
    transform: scale(0.75);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.reveal-pos-label {
  display: inline-block;
  margin: 0 auto 12px;
  padding: 3px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 1px;
}

/* ---------- 슬라이드 리빌 (쿠지 종이를 밀어서 확인) ---------- */

.slide-reveal {
  position: relative;
  width: 100%;
  max-width: 210px;
  aspect-ratio: 3 / 4;
  margin: 0 auto 14px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

.slide-reveal-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  gap: 2px;
}

.slide-reveal-back .jajan {
  color: #fff;
  font-weight: 900;
  font-size: 1.25rem;
  margin-bottom: 6px;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.slide-reveal-back .reveal-thumb {
  width: 82px;
  height: 82px;
  border-radius: 12px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 1.2rem;
  overflow: hidden;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25) inset;
}

.slide-reveal-back .reveal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-reveal-back .reveal-grade {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  margin-bottom: 2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.slide-reveal-back .reveal-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.slide-reveal-front {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}

.slide-reveal-front:active {
  cursor: grabbing;
}

.slide-reveal-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: brightness(0.5) saturate(1.1);
  pointer-events: none;
}

.slide-reveal-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.slide-reveal-icon {
  font-size: 1.7rem;
}

.slide-reveal-text {
  font-size: 0.82rem;
  font-weight: 800;
}

.slide-reveal-arrow {
  font-size: 1.3rem;
  animation: slide-nudge 1.1s ease-in-out infinite;
}

@keyframes slide-nudge {
  0%, 100% {
    transform: translateX(0);
    opacity: 0.75;
  }
  50% {
    transform: translateX(10px);
    opacity: 1;
  }
}

.confetti-piece {
  position: absolute;
  top: -10px;
  width: 8px;
  height: 14px;
  opacity: 0.9;
  animation: confetti-fall linear forwards;
  z-index: 5;
}

@keyframes confetti-fall {
  to {
    transform: translateY(360px) rotate(540deg);
    opacity: 0;
  }
}

/* ---------- Result summary ---------- */

.result-banner {
  width: 100%;
  height: 100px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.result-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.result-table th,
.result-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.result-table th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.78rem;
}

.result-row-thumb {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Admin ---------- */

.admin-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 860px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.prize-builder-row {
  display: grid;
  grid-template-columns: 70px 1.4fr 1.4fr 90px 34px;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.prize-builder-row input {
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.85rem;
  width: 100%;
}

.prize-builder-row .grade-chip {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 0.85rem;
  justify-self: center;
}

.count-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.count-stepper button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.count-stepper span {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
}

.remove-row {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.remove-row:hover {
  border-color: var(--red);
  color: var(--red);
}

.add-grade-row {
  display: flex;
  gap: 8px;
  margin: 6px 0 16px;
}

.add-grade-row input {
  flex: 0 0 90px;
}

.total-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-dim);
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  margin-top: 6px;
}

.total-line strong {
  color: var(--gold);
}

.admin-board-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--bg-soft);
}

.admin-board-item .row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.admin-board-item h4 {
  margin: 0;
  font-size: 0.98rem;
}

.status-tag {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.status-tag.active {
  background: rgba(46, 204, 113, 0.15);
  color: #6bf0a0;
}

.status-tag.closed {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

.admin-board-item .stats {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.admin-board-item .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.request-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.request-item .info b {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.request-item .info span {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.request-item .actions {
  display: flex;
  gap: 8px;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.tab-btn {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
}

.tab-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.tab-panel {
  display: none;
}

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

/* ---------- misc ---------- */

.center-text {
  text-align: center;
}

.mt-24 {
  margin-top: 24px;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.loading-inline {
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 30px 0;
  text-align: center;
}
