/* 기록 등록 요청 폼 — 리더보드 신버전과 같은 XP(Luna) 톤 */

:root {
  --xp-face: #ece9d8;
  --xp-face-alt: #f5f4ea;
  --xp-shadow: #aca899;
  --xp-dark: #716f64;
  --xp-title-1: #0058ee;
  --xp-title-2: #3a93ff;
  --xp-title-3: #0855dd;
  --xp-blue-border: #0054e3;
  --xp-font:
    "Tahoma", "Pretendard Variable", "Pretendard", -apple-system,
    "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* {
  box-sizing: border-box;
  font-family: var(--xp-font);
}

body {
  margin: 0;
  padding: 24px 16px 48px;
  background: linear-gradient(
      180deg,
      #4b8bd4 0%,
      #6ba7e4 30%,
      #9ccbf0 46%,
      #7fb04a 52%,
      #558b2f 72%,
      #3f6f22 100%
    )
    fixed;
  min-height: 100vh;
  font-size: 13px;
  color: #000;
}

/* ── 창 ──────────────────────────────────────────────── */
.xp-window {
  max-width: 720px;
  margin: 0 auto;
  background: var(--xp-face);
  border: 1px solid var(--xp-blue-border);
  border-radius: 8px 8px 0 0;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25),
    0 10px 30px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.xp-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 4px 0 8px;
  background: linear-gradient(
    180deg,
    var(--xp-title-2) 0%,
    var(--xp-title-1) 42%,
    var(--xp-title-3) 88%,
    #26a0ff 100%
  );
  border-bottom: 1px solid #003fc4;
}

.xp-titlebar-text {
  flex: 1;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.55);
}

.xp-btn {
  width: 21px;
  height: 21px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 3px;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  display: grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
  background: linear-gradient(180deg, #5babff 0%, #1c65d8 55%, #0d4fbd 100%);
}

.xp-btn.close {
  background: linear-gradient(180deg, #f7a08a 0%, #d5442a 45%, #a92d17 100%);
}

.xp-btn:hover {
  filter: brightness(1.18);
}

.xp-window-body {
  padding: 16px 18px 20px;
}

/* ── 안내 상자 ───────────────────────────────────────── */
.xp-infobox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--xp-shadow);
  padding: 11px 13px;
  margin-bottom: 16px;
  font-size: 12px;
  line-height: 1.65;
}

.xp-info-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #5babff, #0d4fbd);
  color: #fff;
  font-weight: bold;
  font-style: italic;
  display: grid;
  place-items: center;
}

/* ── 그룹 박스 ───────────────────────────────────────── */
.xp-group {
  border: 1px solid var(--xp-shadow);
  background: var(--xp-face-alt);
  padding: 14px 14px 16px;
  margin: 0 0 16px;
}

.xp-group > legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: bold;
  color: #003399;
}

/* ── 입력 ────────────────────────────────────────────── */
.field {
  margin-bottom: 14px;
}

.field:last-child {
  margin-bottom: 0;
}

.field > label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: bold;
}

.field b {
  color: #c00;
}

.xp-input {
  width: 100%;
  padding: 5px 8px;
  font-size: 13px;
  border: 1px solid var(--xp-dark);
  background: #fff;
  box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.22);
}

.xp-input:focus {
  outline: none;
  border-color: var(--xp-blue-border);
  box-shadow:
    inset 1px 1px 1px rgba(0, 0, 0, 0.22),
    0 0 3px rgba(0, 84, 227, 0.6);
}

.hint {
  margin: 5px 0 0;
  font-size: 11px;
  color: #555;
  line-height: 1.6;
}

/* 시간 입력 */
.time-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.xp-input.time {
  width: 76px;
  text-align: right;
}

.time-row span {
  font-size: 12px;
  color: #444;
}

/* 입력 예시 이미지 */
.example {
  margin: 8px 0 0;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--xp-shadow);
}

.example img {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  border: 1px solid #ddd;
}

.example figcaption {
  margin-top: 6px;
  font-size: 11px;
  color: #555;
}

.example code {
  font-family: "Consolas", "Menlo", monospace;
  background: var(--xp-face-alt);
  border: 1px solid #ddd;
  padding: 1px 5px;
}

/* 값 확인 경고 */
.warn-box {
  margin: 8px 0 0;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.65;
  background: #fdf6d8;
  border: 1px solid #e0a900;
  color: #6b4d00;
}

.warn-box[hidden] {
  display: none;
}

/* 색상 */
.color-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-row .xp-input {
  flex: 1;
}

#colorPicker {
  width: 40px;
  height: 28px;
  padding: 2px;
  border: 1px solid var(--xp-dark);
  background: #fff;
  cursor: pointer;
}

/* 라디오 / 체크박스 */
.radio,
.check {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 5px 0;
  font-size: 12.5px;
  line-height: 1.55;
  cursor: pointer;
}

.radio input,
.check input {
  margin: 2px 0 0;
  cursor: pointer;
}

.checks {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e0ddcd;
}

/* 채널 확인 결과 */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #0645ad;
  text-decoration: underline;
  cursor: pointer;
  font-size: 11px;
}

.channel-result {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  min-height: 15px;
}

.channel-result.ok {
  color: #1d4a18;
  font-weight: bold;
}

.channel-result.warn {
  color: #8a5a00;
}

/* ── 버튼 ────────────────────────────────────────────── */
.xp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 6px 18px;
  font-size: 12.5px;
  color: #000;
  text-decoration: none;
  background: linear-gradient(
    180deg,
    #fff 0%,
    #f2f1e8 45%,
    #e3e0d0 55%,
    #d6d2c2 100%
  );
  border: 1px solid #8e8d78;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px #fff;
  cursor: pointer;
}

.xp-button:hover {
  background: linear-gradient(
    180deg,
    #fff 0%,
    #fdf6d8 45%,
    #f7e9a8 55%,
    #f0dd8c 100%
  );
  border-color: #e0a900;
}

.xp-button.agree {
  font-weight: bold;
  color: #12420f;
  border-color: #4b7d45;
  background: linear-gradient(
    180deg,
    #fbfff9 0%,
    #ddf0d5 45%,
    #bfe3b2 55%,
    #a5d495 100%
  );
}

.xp-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

/* ── 상태 조회 ───────────────────────────────────────── */
.lookup-row {
  display: flex;
  gap: 8px;
}

.lookup-row .xp-input {
  flex: 1;
}

/* 조회 방식 탭 */
.lookup-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.lookup-tabs .tab {
  padding: 6px 14px;
  font-size: 12px;
  background: linear-gradient(180deg, #fff 0%, #e8e5d8 100%);
  border: 1px solid #8e8d78;
  border-radius: 3px;
  cursor: pointer;
}

.lookup-tabs .tab.active {
  background: linear-gradient(180deg, #fff 0%, #fdf6d8 100%);
  border-color: #e0a900;
  font-weight: bold;
}

/* 이름 검색 결과 */
.search-results {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  border: 1px solid var(--xp-shadow);
  background: #fff;
}

.search-results[hidden] {
  display: none;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  font-size: 12.5px;
  border-bottom: 1px solid #eeebdd;
  cursor: pointer;
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover,
.search-item:focus {
  background: #eaf1fc;
  outline: none;
}

.search-id {
  flex: 0 0 auto;
  font-size: 11px;
  color: #666;
}

.search-name {
  font-weight: bold;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-league,
.search-time {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: #555;
  white-space: nowrap;
}

.search-item .status-badge {
  flex: 0 0 auto;
  font-size: 10.5px;
  padding: 2px 8px;
}

.status-card {
  border: 1px solid var(--xp-shadow);
  background: #fff;
  margin-top: 16px;
}

.status-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--xp-face-alt);
  border-bottom: 1px solid #e0ddcd;
}

.status-badge {
  padding: 3px 12px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: bold;
  border: 1px solid;
}

.status-badge.pending {
  background: #fdf6d8;
  border-color: #e0a900;
  color: #6b4d00;
}

.status-badge.approved {
  background: #ddf0d5;
  border-color: #4b7d45;
  color: #1d4a18;
}

.status-badge.rejected {
  background: #f6d9d9;
  border-color: #a4565a;
  color: #6d1a1e;
}

.status-id {
  margin-left: auto;
  font-size: 11.5px;
  color: #666;
}

.status-body {
  padding: 12px;
}

/* ⚠ display:flex 는 hidden 속성을 덮어씁니다.
   아래 [hidden] 규칙이 없으면 숨긴 행의 라벨이 그대로 보입니다. */
.field-row[hidden] {
  display: none;
}

.field-row {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.9;
}

.field-row .k {
  flex: 0 0 92px;
  color: #555;
}

.field-row .v {
  flex: 1;
  word-break: break-all;
}

.status-msg {
  margin: 0;
  padding: 11px 12px;
  border-top: 1px solid #e0ddcd;
  background: var(--xp-face-alt);
  font-size: 12px;
  line-height: 1.65;
  /* 안내 문구의 줄바꿈을 그대로 반영 */
  white-space: pre-line;
}

/* ── 캡차 ────────────────────────────────────────────── */
.captcha-row {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.captcha-row[hidden] {
  display: none;
}

/* ── 오류 / 완료 ─────────────────────────────────────── */
.errors {
  background: #fff4f4;
  border: 1px solid #c1272d;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #6d1a1e;
}

.errors ul {
  margin: 6px 0 0;
  padding-left: 18px;
  line-height: 1.7;
}

.done {
  text-align: center;
  padding: 26px 10px 10px;
}

.done-icon {
  font-size: 40px;
}

.done h2 {
  margin: 10px 0 8px;
  font-size: 16px;
}

.done p {
  margin: 4px 0;
  font-size: 12.5px;
}

.done .actions {
  margin-top: 20px;
}

@media (max-width: 560px) {
  .time-row {
    flex-wrap: wrap;
  }
  .xp-input.time {
    width: 64px;
  }
}

/* =========================================================
   모바일
   ========================================================= */
@media (max-width: 560px) {
  body {
    padding: 12px 10px 32px;
  }

  .xp-window {
    border-radius: 0;
  }

  .xp-window-body {
    padding: 14px 12px 18px;
  }

  /* iOS 는 16px 미만 입력에 포커스하면 화면을 자동 확대합니다.
     확대되면 레이아웃이 틀어져 보이므로 16px 로 맞춥니다. */
  .xp-input,
  .lookup-row input,
  #colorPicker {
    font-size: 16px;
    min-height: 42px;
  }

  .xp-input.time {
    width: 68px;
  }

  /* 터치 대상 확보 */
  .xp-button,
  .lookup-tabs .tab,
  .go-btn {
    min-height: 44px;
  }

  .actions {
    flex-direction: column;
  }

  .actions .xp-button {
    width: 100%;
  }

  .radio,
  .check {
    padding: 9px 0;
  }

  /* 검색 결과 항목이 좁은 화면에서 넘치지 않도록 */
  .search-item {
    flex-wrap: wrap;
    gap: 6px 8px;
  }

  .search-name {
    flex: 1 1 100%;
  }
}

/* 필드별 오류 안내 (URL 형식·도메인) */
.field-error {
  margin: 5px 0 0;
  padding: 5px 9px;
  font-size: 11.5px;
  line-height: 1.55;
  color: #6d1a1e;
  background: #fdf0f0;
  border: 1px solid #c1272d;
}

.field-error[hidden] {
  display: none;
}

/* =========================================================
   XP 스타일 알림 대화상자
   (기본 alert 대신 사용 — 리더보드와 같은 모양)
   ========================================================= */
.xp-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
}

.xp-modal-overlay[hidden] {
  display: none !important;
}

.xp-modal {
  min-width: 320px;
  max-width: 480px;
  background: var(--xp-face);
  border: 1px solid var(--xp-blue-border);
  border-radius: 8px 8px 0 0;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25),
    0 12px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: xpModalIn 0.12s ease-out;
}

@keyframes xpModalIn {
  from {
    transform: scale(0.94);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.xp-modal .xp-titlebar {
  padding-right: 4px;
}

.xp-modal .xp-btn {
  border: 1px solid rgba(255, 255, 255, 0.75);
  padding: 0;
}

.xp-modal-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 20px 12px;
}

/* 경고 아이콘 (XP 다이얼로그 느낌) */
.xp-modal-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: bold;
  font-style: italic;
  color: #fff;
  background: linear-gradient(180deg, #ffd34d 0%, #f0a000 55%, #d98600 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

.xp-modal-msg {
  margin: 0;
  padding-top: 3px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #000;
  /* 메시지의 줄바꿈(\n)을 그대로 반영 */
  white-space: pre-line;
}

.xp-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 6px 20px 18px;
}

.xp-modal-footer .xp-button {
  min-width: 88px;
}

/* ---------------------------------------------------------
   취소 코드 — 제출 완료 화면에서만 보여 줍니다.
   --------------------------------------------------------- */
.token-box {
  margin: 14px auto 4px;
  max-width: 360px;
  padding: 10px 14px 12px;
  background: #fdfbe5;
  border: 1px solid #e3d9a0;
  text-align: center;
}

.token-label {
  margin: 0 0 4px;
  font-size: 0.72rem;
  color: #6b6b4d;
}

.token-value {
  margin: 0 0 8px;
  font-family: "Consolas", "D2Coding", monospace;
  font-size: 1.05rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  color: #000;
  /* 코드를 드래그해 복사하기 쉽도록 */
  user-select: all;
  word-break: break-all;
}

.token-hint {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.6;
  color: #6b6b4d;
}

/* ---------------------------------------------------------
   제출 취소 (상태 조회 화면)
   --------------------------------------------------------- */
.cancel-box {
  margin-top: 14px;
  padding: 11px 13px 12px;
  border-top: 1px solid #d6d2c2;
}

.cancel-box[hidden] {
  display: none;
}

.cancel-label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.75rem;
  font-weight: bold;
}

.cancel-row {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

.cancel-row .xp-input {
  flex: 1 1 180px;
  min-width: 0;
}

.cancel-row .xp-button {
  flex: 0 0 auto;
}

.cancel-hint {
  margin: 7px 0 0;
  font-size: 0.7rem;
  line-height: 1.6;
  color: #666;
}

/* 취소는 되돌릴 수 없으므로 위험한 동작으로 표시합니다. */
.xp-button.danger {
  background: linear-gradient(180deg, #fff 0%, #ffecec 45%, #f7d2d2 100%);
  border-color: #b08585;
}

.xp-button.danger:hover {
  background: linear-gradient(180deg, #fff 0%, #ffe0e0 45%, #f5c0c0 100%);
}

/* ---------------------------------------------------------
   스트리머 이름 자동 추천
   --------------------------------------------------------- */
.suggest-wrap {
  position: relative;
}

.suggest-list {
  position: absolute;
  z-index: 50;
  top: 100%;
  left: 0;
  right: 0;
  margin: 2px 0 0;
  padding: 2px;
  list-style: none;
  background: #fff;
  border: 1px solid #7f9db9;
  box-shadow: 2px 3px 7px rgba(0, 0, 0, 0.25);
  max-height: 232px;
  overflow-y: auto;
}

.suggest-list[hidden] {
  display: none;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 0.8rem;
}

/* 마우스 hover 와 키보드 선택을 같은 모양으로 */
.suggest-item:hover,
.suggest-item.active {
  background: #316ac5;
  color: #fff;
}

/* 리더보드에서 쓰는 색을 그대로 보여 줍니다. */
.suggest-dot {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 2px;
}

.suggest-name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-tags {
  flex: 0 0 auto;
  font-size: 0.7rem;
  color: #777;
  white-space: nowrap;
}

.suggest-item:hover .suggest-tags,
.suggest-item.active .suggest-tags {
  color: #dbe6f7;
}

/* 선택해도 등록되지 않는 항목임을 미리 알려 줍니다. */
.check-note {
  color: #c1272d;
  font-size: 0.72rem;
}

/* ---------------------------------------------------------
   증빙 미리보기 (치지직 클립)
   --------------------------------------------------------- */
.evidence-preview {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 7px;
  padding: 8px 10px;
  background: #f7f6f0;
  border: 1px solid #c9c4b4;
  font-size: 0.76rem;
  line-height: 1.6;
}

.evidence-preview[hidden] {
  display: none;
}

.evidence-preview.ok {
  border-color: #9dc79a;
  background: #f1f8f0;
}

.evidence-preview.warn {
  border-color: #e3d9a0;
  background: #fdfbe5;
}

.evidence-thumb {
  flex: 0 0 auto;
  /* 16:9 비율 유지. 썸네일이 원본 1280x720 이라 선명합니다. */
  width: 176px;
  height: 99px;
  object-fit: cover;
  border: 1px solid #b9b4a4;
  background: #fff;
}

/* 좁은 화면에서는 썸네일이 자리를 너무 차지하지 않게 줄입니다. */
@media (max-width: 520px) {
  .evidence-thumb {
    width: 120px;
    height: 68px;
  }
}

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

.evidence-info p {
  margin: 0;
}

.evidence-title {
  font-weight: bold;
  color: #222;
  /* 제목이 길어도 한 줄로 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-meta {
  color: #777;
  font-size: 0.72rem;
}

.evidence-verdict {
  margin-top: 3px !important;
  color: #444;
}
