/* ============================================================
   이벤트 위젯/배지 전용 스타일 (free-community 복사 CSS와 분리)
   - list.skin / view.skin 에서 style.css(+list.css) 와 함께 로드
   ============================================================ */

/* ---------- 목록 배지 ---------- */
.ev-list-badge {
    display: inline-block;
    font-size: 11px;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 4px;
    margin-right: 4px;
    vertical-align: middle;
    font-weight: 700;
}
.ev-list-badge--type      { background: #eef2ff; color: #4f46e5; }
.ev-list-badge--open      { background: #ecfdf5; color: #059669; }
.ev-list-badge--before    { background: #fffbeb; color: #b45309; }
.ev-list-badge--closed    { background: #f3f4f6; color: #6b7280; }
.ev-list-badge--settled   { background: #fef2f2; color: #dc2626; }

/* ---------- 위젯 컨테이너 ---------- */
.ev-widget {
    margin: 22px 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.ev-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
}
.ev-badge {
    background: rgba(255,255,255,.22);
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 700;
}
.ev-match { font-weight: 700; font-size: 16px; }
.ev-status-badge {
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(255,255,255,.22);
}
.ev-status-badge--settled { background: #fca5a5; color: #7f1d1d; }

.ev-body { padding: 16px; }
.ev-loading { color: #9ca3af; text-align: center; padding: 14px 0; }
.ev-hint { margin-top: 12px; color: #6b7280; font-size: 13px; }
.ev-hint--done { color: #059669; font-weight: 700; }
.ev-foot { margin-top: 12px; color: #4b5563; font-size: 13px; }

/* ---------- 결과맞히기 옵션 게이지 ---------- */
.ev-options { display: flex; flex-direction: column; gap: 10px; }
.ev-opt {
    position: relative;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #f9fafb;
    min-height: 46px;
}
.ev-opt__bar {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: #e0e7ff;
    transition: width .5s ease;
    z-index: 1;
}
.ev-opt__fg {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 14px;
}
.ev-opt__label { font-weight: 700; color: #111827; }
.ev-opt__meta { font-size: 13px; color: #4b5563; white-space: nowrap; }
.ev-opt.is-clickable { cursor: pointer; }
.ev-opt.is-clickable:hover { border-color: #4f46e5; background: #eef2ff; }
.ev-opt.is-mine { border-color: #4f46e5; }
.ev-opt.is-mine .ev-opt__bar { background: #c7d2fe; }
.ev-opt.is-mine .ev-opt__label { color: #4338ca; }
.ev-opt.is-answer { border-color: #dc2626; }
.ev-opt.is-answer .ev-opt__bar { background: #fecaca; }
.ev-tag-answer { background: #dc2626; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; margin-left: 4px; }

/* ---------- 스코어맞히기 ---------- */
.ev-score-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-score-side { font-weight: 700; color: #374151; }
.ev-score-colon { font-weight: 700; font-size: 18px; }
.ev-score-in {
    width: 64px; height: 40px;
    text-align: center; font-size: 18px; font-weight: 700;
    border: 1.5px solid #d1d5db; border-radius: 8px;
}
.ev-myscore { font-size: 15px; padding: 10px 12px; background: #eef2ff; border-radius: 8px; color: #4338ca; }
.ev-myscore.is-win { background: #fef2f2; color: #b91c1c; }
.ev-score-result { font-size: 15px; margin-bottom: 10px; padding: 10px 12px; background: #fff7ed; border-radius: 8px; color: #9a3412; }
.ev-rank { margin-top: 14px; }
.ev-rank__title { font-size: 13px; font-weight: 700; color: #6b7280; margin-bottom: 6px; }
.ev-rank__list { list-style: none; margin: 0; padding: 0; }
.ev-rank__list li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; }
.ev-rank__list li:nth-child(odd) { background: #f9fafb; }
.ev-rank__no { font-weight: 700; color: #4f46e5; width: 34px; }
.ev-rank__score { font-weight: 700; font-size: 15px; }
.ev-rank__cnt { margin-left: auto; color: #6b7280; font-size: 13px; }

/* ---------- 선착순 ---------- */
.ev-fc-head { font-size: 15px; color: #374151; margin-bottom: 10px; }
.ev-fc-remain { font-weight: 700; color: #059669; }
.ev-fc-remain.is-urgent { color: #dc2626; }
.ev-fc-gauge {
    height: 16px; border-radius: 10px; background: #f3f4f6; overflow: hidden; margin-bottom: 14px;
}
.ev-fc-gauge__fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width .5s ease;
    border-radius: 10px;
}
.ev-fc-gauge__fill.is-urgent { background: linear-gradient(90deg, #f97316, #dc2626); animation: ev-pulse 1.2s infinite; }
@keyframes ev-pulse { 0%,100% { opacity: 1; } 50% { opacity: .65; } }
.ev-fc-mine { text-align: center; font-size: 16px; padding: 13px; background: #ecfdf5; border-radius: 10px; color: #047857; font-weight: 700; }

/* ---------- 버튼 ---------- */
.ev-btn {
    display: inline-block;
    border: 0; cursor: pointer;
    background: #4f46e5; color: #fff;
    font-weight: 700; font-size: 14px;
    padding: 11px 18px; border-radius: 9px;
    text-align: center; text-decoration: none;
}
.ev-btn:hover { background: #4338ca; color: #fff; }
.ev-btn:disabled { background: #d1d5db; cursor: not-allowed; }
.ev-btn--block { display: block; width: 100%; padding: 14px; font-size: 15px; }
.ev-btn--join { background: linear-gradient(135deg, #f97316, #dc2626); }
.ev-btn--join:hover { background: linear-gradient(135deg, #ea580c, #b91c1c); }
.ev-btn--ghost { background: #fff; color: #4f46e5; border: 1.5px solid #4f46e5; }
.ev-btn--ghost:hover { background: #eef2ff; color: #4338ca; }

/* ---------- 관리자 결과처리 ---------- */
.ev-admin {
    border-top: 1px dashed #e5e7eb;
    background: #fafafa;
    padding: 14px 16px;
}
.ev-admin__title { font-size: 13px; font-weight: 700; color: #dc2626; margin-bottom: 10px; }
.ev-admin__opts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.ev-admin__opt { font-weight: 600; }
.ev-admin__score { margin-bottom: 10px; font-weight: 600; }
.ev-admin__score .ev-score-in { width: 56px; height: 34px; font-size: 15px; }
.ev-admin__pay { font-size: 13px; color: #6b7280; margin-bottom: 10px; }
.ev-btn--settle { background: #dc2626; }
.ev-btn--settle:hover { background: #b91c1c; }

/* ---------- 토스트 ---------- */
.ev-toast {
    position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
    background: rgba(17,24,39,.94); color: #fff;
    padding: 12px 20px; border-radius: 10px; font-size: 14px; font-weight: 600;
    opacity: 0; transition: all .3s ease; z-index: 9999; pointer-events: none;
}
.ev-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 작성폼 ---------- */
.ev-form-grid { width: 100%; }
.ev-opt-label { max-width: 320px; }

/* ============================================================
   결과맞히기 베팅형 보강 (게이지/퍼센트/내 선택/카운트다운/소수안내)
   ============================================================ */
.ev-options--bet { gap: 12px; }
.ev-options--bet .ev-opt { min-height: 58px; border-width: 2px; }
.ev-options--bet .ev-opt__bar { background: linear-gradient(90deg, #dbe3ff, #c7d2fe); }
.ev-options--bet .ev-opt.is-mine { box-shadow: 0 0 0 2px rgba(79,70,229,.18); }
.ev-options--bet .ev-opt.is-mine .ev-opt__bar { background: linear-gradient(90deg, #c7d2fe, #a5b4fc); }
.ev-options--bet .ev-opt.is-answer .ev-opt__bar { background: linear-gradient(90deg, #fecaca, #fca5a5); }

.ev-opt__main { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ev-opt__mine {
    display: inline-flex; align-items: center; gap: 3px;
    background: #4f46e5; color: #fff; font-size: 11px; font-weight: 700;
    padding: 2px 7px; border-radius: 999px;
}
.ev-opt__mine i { font-size: 11px; }

.ev-opt__stat {
    display: flex; flex-direction: column; align-items: flex-end;
    line-height: 1.1; white-space: nowrap;
}
.ev-opt__pct { font-size: 18px; font-weight: 800; color: #1f2937; }
.ev-opt.is-mine .ev-opt__pct { color: #4338ca; }
.ev-opt.is-answer .ev-opt__pct { color: #b91c1c; }
.ev-opt__cnt { font-size: 12px; color: #6b7280; margin-top: 2px; }

/* 참여자 적을 때 안내 */
.ev-lowcount {
    margin-top: 12px; padding: 12px 14px; border-radius: 10px;
    background: #f5f3ff; color: #5b21b6; font-size: 13px; font-weight: 600;
    display: flex; align-items: center; gap: 7px;
}
.ev-lowcount i { color: #7c3aed; }

/* 헤더 마감 카운트다운 */
.ev-countdown {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
    padding: 3px 9px; border-radius: 6px;
    background: rgba(255,255,255,.22); color: #fff;
}
.ev-countdown i { font-size: 11px; }
.ev-countdown.is-urgent { background: #fca5a5; color: #7f1d1d; animation: ev-pulse 1.2s infinite; }
.ev-countdown.is-ended { background: rgba(255,255,255,.15); color: #f3f4f6; }

/* ============================================================
   참여형 이벤트 전용 상세 페이지 (히어로/메타/본문)
   ============================================================ */
#bo_v.ev-page { border-top: 0 !important; background: #fff; overflow: hidden; border-radius: 12px; }

/* 페이지 헤더 (유형 칩 + 제목) */
.ev-phead { padding: 20px 22px 14px; }
.ev-phead__chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: #eef2ff; color: #4338ca;
    font-size: 12px; font-weight: 800; letter-spacing: .02em;
    padding: 4px 11px; border-radius: 999px; margin-bottom: 10px;
}
.ev-phead__title {
    margin: 0; color: #111827;
    font-size: 1.55rem; font-weight: 800; line-height: 1.32;
    word-break: keep-all;
}

/* 썸네일 + 위젯 스테이지 (데스크탑: 썸네일 좌측 / 모바일: 위) */
.ev-stage { margin: 0 20px 22px; }
.ev-stage.has-thumb { display: flex; gap: 16px; align-items: flex-start; }
.ev-stage__thumb { flex: 0 0 38%; max-width: 340px; }
.ev-stage__thumb img {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
    border-radius: 12px; border: 1px solid #e5e7eb; display: block;
}
.ev-stage__main { flex: 1 1 auto; min-width: 0; }
.ev-stage .ev-widget { margin: 0; }

/* 메타 스트립 */
.ev-page-meta {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
    padding: 12px 20px; border-bottom: 1px solid #eef0f3;
    background: #fafbfc;
}
.ev-page-meta__info { display: flex; align-items: center; gap: 14px; color: #94a3b8; font-size: 13px; }
.ev-page-meta__info i { margin-right: 3px; }
.ev-page-meta__btns { display: flex; align-items: center; gap: 6px; }
.ev-pbtn {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 13px; color: #475569; text-decoration: none;
    padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff;
}
.ev-pbtn:hover { background: #f1f5f9; color: #1e293b; text-decoration: none; }
.ev-pbtn--danger:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* 본문 */
.ev-page-content { padding: 18px 24px; color: #1f2937; font-size: 1rem; line-height: 1.7; word-break: break-word; }

/* 작성폼 썸네일 미리보기 */
.ev-thumb-preview { display: flex; align-items: center; gap: 12px; }
.ev-thumb-preview img { width: 160px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid #e5e7eb; }
.ev-thumb-del { font-size: 13px; color: #6b7280; margin: 0; cursor: pointer; }

@media (max-width: 680px) {
    .ev-stage.has-thumb { flex-direction: column; }
    .ev-stage__thumb { flex: none; max-width: none; width: 100%; }
    .ev-stage__thumb img { aspect-ratio: 16 / 9; }
}
@media (max-width: 575px) {
    .ev-phead { padding: 16px 16px 12px; }
    .ev-phead__title { font-size: 1.3rem; }
    .ev-page-content { padding: 16px; }
    .ev-stage { margin: 0 14px 18px; }
}
