/* 이벤트 응모 페이지 - 와이어프레임 스타일 (모바일 우선, 다크)
   디자인 확정 전 placeholder. 레이아웃/기능 검증용. */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #14161c;
    --panel: #1d212b;
    --panel-2: #262b38;
    --line: #333a49;
    --text: #e7eaf0;
    --muted: #9aa3b2;
    --accent: #ff5a2c;
    --accent-2: #ffb020;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
    background: #0d0f14;
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.wf-banner {
    background: #3a2a00;
    color: #ffce6b;
    font-size: 12px;
    text-align: center;
    padding: 6px 10px;
    border-bottom: 1px dashed #6b5410;
}

.app {
    max-width: 750px;
    margin: 0 auto;
    background: var(--bg);
    min-height: 100vh;
    padding-bottom: 96px;
}

.hidden { display: none !important; }

/* 상단바 */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 10;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.icon-btn {
    width: 34px; height: 34px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

/* 히어로 */
.hero {
    /* padding: 22px 16px; */
    border-bottom: 1px solid var(--line);
    text-align: center;
}
.brands {
    line-height: 0;
    font-size: 0;
}
.brands > img {
    display: block;
    width: 100%;
    height: auto;
}
.brands-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    margin: 0;
    padding: 0;
    line-height: 0;
}
.brands-row img {
    display: block;
    flex: 0 0 auto;
    height: auto;
    align-self: flex-start;
    margin: 0;
    padding: 0;
    border: 0;
}
.brands-mid {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    min-height: 0;
    box-sizing: border-box;
    padding: 0 2px;
    background-color: #414b54;
}
.brands-mid-num {
    font-size: clamp(25px, 7.2vw, 40px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #ff6a28;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.hero-title { font-size: 22px; margin: 12px 0 18px; }
.hero-title b { color: var(--accent-2); }

.steps {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    list-style: none;
    margin-bottom: 18px;
    padding: 0 12px;
}
.steps li {
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    padding: 12px 6px;
    background: rgba(0, 0, 0, .25);
}
.steps li.steps-clickable {
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.steps li.steps-clickable:hover,
.steps li.steps-clickable:focus-visible {
    border-color: var(--accent-2);
    background: rgba(255, 176, 32, .12);
    color: #fff;
    outline: none;
}

.counter-box {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 18px;
}
.counter-label { display: block; font-size: 12px; color: var(--muted); }
.counter-value {
    display: block;
    font-size: 38px;
    font-weight: 800;
    color: var(--accent-2);
    letter-spacing: 1px;
    margin: 4px 0;
}
.counter-suffix { font-size: 13px; color: var(--muted); }

.current-tournament {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 14px;
    text-align: center;
}
.current-tournament .ct-label {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    border-radius: 999px;
    padding: 2px 8px;
}
.current-tournament .ct-date { font-size: 11px; color: var(--muted); width: 100%; }

/* CTA */
.cta-primary {
    width: 100%;
    border: none;
    border-radius: 30px;
    padding: 10px;
    font-size: 1.2em;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(90deg, var(--accent), #ff0000);
    cursor: pointer;
}
.cta-primary:disabled { opacity: .4; cursor: not-allowed; }

/* 카드 공통 */
.card {
    margin: 14px 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
}
.section-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }

/* 내 현황 */
.my-status { display: flex; justify-content: space-between; text-align: center; }
.my-status .stat { flex: 1; }
.my-status .stat + .stat { border-left: 1px solid var(--line); }
.stat-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat-value { font-size: 14px; }
.stat-value b { font-size: 20px; color: var(--accent-2); }

/* 추천 링크 */
.referral-row { display: flex; gap: 8px; }
.referral-row input {
    flex: 1;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    padding: 10px;
    font-size: 12px;
}
.hint { font-size: 11px; color: var(--muted); margin-top: 8px; white-space: pre-line; }

/* TOP3 */
.top3 { list-style: none; }
.top3 li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}
.top3 li:last-child { border-bottom: none; }
.top3 .rank { color: var(--accent-2); font-weight: 700; margin-right: 8px; }
.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 8px 0; }

/* 피드: 화면에 3개 노출, 나머지는 내부 스크롤 (최대 30건) */
.feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(3 * 78px + 2 * 10px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}
.feed::-webkit-scrollbar { width: 6px; }
.feed::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 3px;
}
.feed-item {
    flex-shrink: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
}
.feed-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    font-size: 12px;
    color: var(--muted);
}
.feed-head .nick {
    font-weight: 700;
    color: var(--text);
}
.feed-head .sep {
    color: var(--line);
    user-select: none;
}
.feed-head .time {
    white-space: nowrap;
}
.feed-msg {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text);
    word-break: break-word;
}
.feed-msg-empty {
    color: var(--muted);
}

/* 하단 고정 CTA */
.bottom-cta {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: 750px;
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    z-index: 20;
}
.bottom-counter { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 8px; }
.bottom-counter b { color: var(--accent-2); }

.bottom-upcoming {
    text-align: center;
    padding: 12px 8px 4px;
}
.bottom-upcoming-title {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}
.bottom-upcoming-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-2);
    line-height: 1.4;
    margin-bottom: 4px;
}
.bottom-upcoming-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.bottom-upcoming-hint {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
}

/* 오른쪽 플로트 메뉴 */
.float-side-menu {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}
.float-side-item {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 52px;
    padding: 10px 8px 10px 10px;
    background: rgba(29, 33, 43, .94);
    border: 1px solid var(--line);
    border-right: none;
    border-radius: 14px 0 0 14px;
    color: var(--text);
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    box-shadow: -4px 4px 16px rgba(0, 0, 0, .35);
    transition: background .15s, border-color .15s;
}
.float-side-item:hover,
.float-side-item:focus-visible {
    background: var(--panel-2);
    border-color: var(--accent);
    outline: none;
}
.float-side-item--chat {
    background: rgba(254, 229, 0, .12);
    border-color: rgba(254, 229, 0, .35);
    color: #fff8b0;
}
.float-side-item--chat:hover,
.float-side-item--chat:focus-visible {
    background: rgba(254, 229, 0, .22);
    border-color: #fee500;
}
.float-side-icon {
    font-size: 20px;
    line-height: 1;
}
.float-side-label { letter-spacing: -.2px; }

.foot { text-align: center; color: var(--muted); font-size: 11px; }

/* 모달 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 50;
}
.modal {
    width: 100%;
    max-width: 440px;
    background: var(--bg);
    border-radius: 18px;
    border: 1px solid var(--line);
    max-height: 88vh;
    overflow-y: auto;
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    position: sticky; top: 0; background: var(--bg);
}
.modal-steps {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
}
.modal-steps .dot {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 6px;
}
.modal-steps .dot.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.modal-body { padding: 16px; }
.step-desc { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* 현재 진행 대회 (모달 내부) */
.modal-tournament {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255,90,44,.10);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 14px;
}
.modal-tournament b { color: var(--accent-2); }
.modal-tournament span { font-size: 11px; color: var(--muted); }

/* 입력 행 */
.field-row { display: flex; gap: 8px; margin-bottom: 10px; }
.field-row input {
    flex: 1;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    padding: 12px;
    font-size: 14px;
}
.btn-sm {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: 8px;
    padding: 0 14px;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}

.field-block { margin-bottom: 12px; }
.field-label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.field-label .req { color: var(--accent); }
.field-block textarea {
    width: 100%;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    padding: 12px;
    font-size: 14px;
    resize: vertical;
    min-height: 72px;
    font-family: inherit;
}

/* 사진 기준 안내 (업로드 단계) */
.photo-rules {
    background: rgba(255, 90, 44, .12);
    border: 1px solid rgba(255, 140, 90, .45);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.photo-rules-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-2);
    margin-bottom: 8px;
}
.photo-rules-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
}
.photo-rules-list li { margin-bottom: 6px; }
.photo-rules-list li:last-child { margin-bottom: 0; }
.photo-rules-list b { color: #fff; font-weight: 700; }
.photo-rules-warn { color: #ffb4a0; }
.photo-rules-must {
    list-style: none;
    margin-left: -18px;
    padding: 8px 10px;
    background: rgba(255, 90, 44, .18);
    border: 1px dashed rgba(255, 140, 90, .55);
    border-radius: 8px;
    color: #ffe8dc;
}

.photo-sample {
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--panel-2);
}
.photo-sample-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-2);
    padding: 10px 12px 8px;
}
.photo-sample-img {
    display: block;
    width: 100%;
    height: auto;
}

/* 업로드 */
.upload-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    color: var(--muted);
    cursor: pointer;
    margin-bottom: 16px;
    overflow: hidden;
}
.upload-box img { max-width: 100%; max-height: 280px; display: block; }

/* 완료 */
.done-box { text-align: center; padding: 20px 0; }
.done-emoji { font-size: 44px; }
.ticket-no {
    margin: 14px 0 20px;
    font-size: 15px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
}
.ticket-no b { color: var(--accent-2); font-size: 18px; }

#oneonSignupModal { z-index: 60; background: rgba(0, 0, 0, .78); }
.oneon-signup-modal { max-width: 400px; }
.oneon-signup-body {
    text-align: center;
    padding: 28px 20px 24px;
}
.oneon-signup-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 16px;
}
.oneon-signup-msg {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.65;
    color: var(--text);
    white-space: pre-line;
    margin-bottom: 24px;
}
.oneon-install-btn {
    display: block;
    text-decoration: none;
    margin-bottom: 12px;
}
.oneon-signup-close {
    width: 100%;
    padding: 12px;
    font-size: 14px;
}

/* 라이트박스 */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 60;
}
.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    font-size: 26px;
    line-height: 1;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    border-color: rgba(255, 255, 255, .25);
    color: #fff;
}
.lightbox-nav:hover,
.lightbox-nav:focus-visible {
    background: rgba(0, 0, 0, .65);
    border-color: rgba(255, 255, 255, .45);
    color: #fff;
    outline: none;
}
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    cursor: pointer;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* 토스트 */
.toast {
    position: fixed;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 100;
    border: 1px solid var(--line);
}
