/* ============================================================
 *  WOW — Word of War (글자의 전쟁) 전용 스타일
 *  모든 선택자는 wow- 프리픽스를 사용한다. (다른 게임과 충돌 방지)
 * ============================================================ */

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

.wow-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Jua', 'Nanum Gothic', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #3E2723;
    background: linear-gradient(180deg, #8FD3F4 0%, #A8E0F0 45%, #C6E7B8 100%);
    background-attachment: fixed;
    -webkit-text-size-adjust: 100%;
}

.wow-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 12px 16px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── 헤더 ─────────────────────────────────────────────────── */
.wow-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: #FFF8E7;
    border: 3px solid #3E2723;
    border-radius: 18px;
    box-shadow: 0 4px 0 #3E2723;
}
.wow-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.wow-logo-mark {
    font-size: 22px; line-height: 1;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: #FFB020;
    border: 3px solid #3E2723;
    border-radius: 12px;
}
.wow-logo-text { font-size: 20px; letter-spacing: .02em; }
.wow-logo-sub { font-size: 11px; color: #8D6E63; margin-top: -2px; }

.wow-score-box { text-align: right; line-height: 1.25; }
.wow-score-label { font-size: 11px; color: #8D6E63; }
.wow-score-value { font-size: 22px; color: #E8590C; }
.wow-round-value { font-size: 11px; color: #8D6E63; }

/* ── 공통 카드 ───────────────────────────────────────────── */
.wow-card {
    background: #FFFFFF;
    border: 3px solid #3E2723;
    border-radius: 18px;
    box-shadow: 0 4px 0 #3E2723;
    padding: 14px;
}

/* ── 인트로(글자수 선택) ─────────────────────────────────── */
.wow-intro-title { font-size: 19px; text-align: center; margin: 2px 0 4px; }
.wow-intro-desc  { font-size: 13px; color: #6D4C41; text-align: center; line-height: 1.6; margin: 0 0 12px; }

.wow-len-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.wow-len-btn {
    font-family: inherit;
    cursor: pointer;
    padding: 14px 8px;
    background: #FFF1CC;
    border: 3px solid #3E2723;
    border-radius: 16px;
    box-shadow: 0 4px 0 #3E2723;
    transition: transform .08s, box-shadow .08s;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.wow-len-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #3E2723; }
.wow-len-num  { font-size: 26px; color: #E8590C; line-height: 1; }
.wow-len-cap  { font-size: 12px; color: #6D4C41; }
.wow-len-mult { font-size: 11px; color: #8D6E63; }

.wow-rule-list { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.wow-rule-list li { font-size: 12.5px; color: #5D4037; line-height: 1.5; display: flex; align-items: flex-start; gap: 7px; }
.wow-chip {
    flex: 0 0 auto;
    width: 20px; height: 20px; border-radius: 6px;
    border: 2px solid #3E2723;
    display: inline-block;
}
.wow-chip-green { background: #5FBF5F; }
.wow-chip-blue  { background: #4A9FE0; }
.wow-chip-red   { background: #E85D5D; }
.wow-chip-gray  { background: #E8E2D8; }

/* ── 자모 현황판 (보드 위쪽에 배치) ───────────────────────── */
.wow-keystat { padding: 10px 12px; }
.wow-keystat-title { font-size: 11px; color: #8D6E63; margin-bottom: 7px; text-align: center; }
.wow-keystat-rows { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.wow-keystat-row  { display: flex; gap: 3px; justify-content: center; flex-wrap: nowrap; }
.wow-key {
    flex: 0 0 auto;
    min-width: 0;
    width: 26px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    background: #FFFFFF;
    border: 2px solid #C7B9A8;
    border-radius: 7px;
    color: #3E2723;
    transition: background .15s, color .15s, border-color .15s, opacity .15s;
}
.wow-key.is-correct { background: #5FBF5F; border-color: #3E2723; color: #fff; }
.wow-key.is-present { background: #4A9FE0; border-color: #3E2723; color: #fff; }
.wow-key.is-absent  { opacity: .3; background: #EFEAE2; border-color: #DCD3C6; }
.wow-key.is-used    { opacity: .32; }

/* ── 힌트 ─────────────────────────────────────────────────── */
.wow-hint { background: #FFF8E7; display: flex; gap: 10px; align-items: flex-start; }
.wow-hint-icon {
    flex: 0 0 auto;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    background: #FFB020;
    border: 3px solid #3E2723;
    border-radius: 11px;
}
.wow-hint-body { flex: 1 1 auto; min-width: 0; }
.wow-hint-cat {
    display: inline-block;
    font-size: 10.5px; color: #fff; background: #8D6E63;
    padding: 1px 8px; border-radius: 99px; margin-bottom: 4px;
}
.wow-hint-text { font-size: 14px; line-height: 1.55; color: #3E2723; word-break: keep-all; }

/* ── 보드 ─────────────────────────────────────────────────── */
.wow-board-area { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.wow-board { display: flex; flex-direction: column; gap: 6px; width: 100%; align-items: center; }
.wow-row { display: flex; gap: 6px; justify-content: center; width: 100%; }

.wow-cell {
    --size: 52px;
    width: var(--size);
    height: var(--size);
    flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    font-size: calc(var(--size) * .48);
    background: #F7F2E8;
    border: 3px solid #C7B9A8;
    border-radius: 12px;
    color: #3E2723;
    transition: transform .1s, border-color .12s;
}
.wow-row.is-active .wow-cell { border-color: #8D6E63; background: #FFFDF7; }
.wow-cell.is-filled { border-color: #3E2723; transform: scale(1.03); }
.wow-cell.is-caret  { border-color: #FFB020; box-shadow: 0 0 0 3px rgba(255,176,32,.28); }

.wow-cell.mark-green { background: #5FBF5F; border-color: #3E2723; color: #fff; }
.wow-cell.mark-blue  { background: #4A9FE0; border-color: #3E2723; color: #fff; }
.wow-cell.mark-red   { background: #E85D5D; border-color: #3E2723; color: #fff; }
.wow-cell.mark-gray  { background: #E8E2D8; border-color: #B5A795; color: #6D4C41; }

.wow-row.is-shake { animation: wow-shake .38s; }
@keyframes wow-shake {
    0%,100% { transform: translateX(0); }
    20% { transform: translateX(-7px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.wow-cell.is-pop { animation: wow-pop .3s; }
@keyframes wow-pop {
    0% { transform: scale(1); }
    45% { transform: scale(1.16); }
    100% { transform: scale(1); }
}

/* ── 입력 영역 ───────────────────────────────────────────── */
.wow-input-area { display: flex; gap: 8px; align-items: stretch; }
.wow-input {
    flex: 1 1 auto;
    min-width: 0;
    font-family: inherit;
    font-size: 17px;
    text-align: center;
    letter-spacing: .12em;
    padding: 12px 10px;
    background: #FFFFFF;
    border: 3px solid #3E2723;
    border-radius: 14px;
    box-shadow: 0 3px 0 #3E2723;
    color: #3E2723;
    outline: none;
}
.wow-input::placeholder { color: #C7B9A8; letter-spacing: normal; font-size: 14px; }
.wow-input:focus { border-color: #E8590C; box-shadow: 0 3px 0 #E8590C; }

.wow-btn {
    font-family: inherit;
    cursor: pointer;
    font-size: 15px;
    padding: 12px 18px;
    background: #FFB020;
    border: 3px solid #3E2723;
    border-radius: 14px;
    box-shadow: 0 3px 0 #3E2723;
    color: #3E2723;
    white-space: nowrap;
    transition: transform .08s, box-shadow .08s, opacity .15s;
}
.wow-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #3E2723; }
.wow-btn:disabled { opacity: .45; cursor: default; }
.wow-btn-sub  { background: #FFF1CC; }
.wow-btn-ghost{ background: #FFFFFF; }
.wow-btn-wide { width: 100%; }

.wow-meta-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; color: #6D4C41; padding: 0 2px;
}
.wow-tries-left strong { color: #E8590C; font-size: 14px; }

.wow-toast {
    position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(14px);
    background: #3E2723; color: #FFF8E7;
    font-size: 13px; padding: 10px 18px; border-radius: 99px;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
    z-index: 60; max-width: 90vw; text-align: center; line-height: 1.45;
}
.wow-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 모달 ─────────────────────────────────────────────────── */
.wow-modal-back {
    position: fixed; inset: 0;
    background: rgba(62,39,35,.55);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; z-index: 50;
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.wow-modal-back.is-show { opacity: 1; pointer-events: auto; }
.wow-modal {
    width: 100%; max-width: 360px;
    background: #FFF8E7;
    border: 3px solid #3E2723;
    border-radius: 22px;
    box-shadow: 0 6px 0 #3E2723;
    padding: 20px 18px 18px;
    text-align: center;
    transform: translateY(10px); transition: transform .2s;
}
.wow-modal-back.is-show .wow-modal { transform: translateY(0); }
.wow-modal-emoji { font-size: 40px; line-height: 1; margin-bottom: 6px; }
.wow-modal-title { font-size: 21px; margin-bottom: 6px; }
.wow-modal-answer {
    display: inline-block;
    font-size: 20px; color: #E8590C;
    background: #FFFFFF; border: 3px solid #3E2723; border-radius: 12px;
    padding: 7px 16px; margin: 6px 0 4px;
}
.wow-modal-desc { font-size: 13px; color: #6D4C41; line-height: 1.6; margin: 8px 0 14px; }
.wow-modal-gain { font-size: 14px; color: #2E7D32; }
.wow-modal-actions { display: flex; flex-direction: column; gap: 8px; }
.wow-modal-actions .wow-btn { width: 100%; }

.wow-nick-input {
    width: 100%; font-family: inherit; font-size: 16px; text-align: center;
    padding: 11px 10px; margin-bottom: 10px;
    background: #FFFFFF; border: 3px solid #3E2723; border-radius: 12px;
    color: #3E2723; outline: none;
}
.wow-nick-input:focus { border-color: #E8590C; }

/* ── 랭킹 ─────────────────────────────────────────────────── */
.wow-rank-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.wow-rank-tab {
    flex: 1 1 0; font-family: inherit; cursor: pointer;
    font-size: 14px; padding: 9px 4px;
    background: #FFF1CC; border: 3px solid #3E2723; border-radius: 12px;
    box-shadow: 0 3px 0 #3E2723; color: #3E2723;
}
.wow-rank-tab.is-on { background: #FFB020; }
.wow-rank-tab:active { transform: translateY(2px); box-shadow: 0 1px 0 #3E2723; }

.wow-rank-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wow-rank-table th {
    font-size: 11.5px; color: #8D6E63; font-weight: normal;
    padding: 7px 4px; border-bottom: 2px solid #E0D6C8;
}
.wow-rank-table td { padding: 9px 4px; border-bottom: 1px solid #F0EAE0; text-align: center; }
.wow-rank-table .wow-rank-nick { text-align: left; }
.wow-rank-no { width: 38px; color: #8D6E63; }
.wow-rank-score { color: #E8590C; font-size: 15px; }
.wow-rank-row-1 .wow-rank-no,
.wow-rank-row-2 .wow-rank-no,
.wow-rank-row-3 .wow-rank-no { font-size: 15px; }
.wow-rank-row-1 { background: #FFF6D8; }
.wow-rank-row-2 { background: #F4F4F4; }
.wow-rank-row-3 { background: #FBEFE4; }
.wow-rank-empty { text-align: center; color: #8D6E63; font-size: 13px; padding: 26px 0; }
.wow-rank-time { font-size: 11px; color: #A1887F; }

.wow-foot { text-align: center; font-size: 11.5px; color: #5D4037; opacity: .8; padding: 4px 0 0; }
.wow-foot a { color: #5D4037; }

.wow-hide { display: none !important; }

/* ── 좁은 화면 대응 ───────────────────────────────────────── */
@media (max-width: 400px) {
    .wow-wrap { padding: 10px 12px 24px; }
    .wow-key { width: 23px; height: 26px; font-size: 12px; }
    .wow-logo-text { font-size: 18px; }
}
@media (max-width: 340px) {
    .wow-key { width: 20px; height: 24px; font-size: 11px; border-radius: 6px; }
}

/* ── 도움말(색깔 규칙) ────────────────────────────────────── */
.wow-header-right { display: flex; align-items: center; gap: 10px; }

.wow-help-btn {
    flex: 0 0 auto;
    font-family: inherit; cursor: pointer;
    width: 32px; height: 32px;
    font-size: 17px; line-height: 1;
    background: #FFFFFF;
    border: 3px solid #3E2723;
    border-radius: 50%;
    box-shadow: 0 3px 0 #3E2723;
    color: #3E2723;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    transition: transform .08s, box-shadow .08s;
}
.wow-help-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #3E2723; }

.wow-chip-faint { background: #E8E2D8; opacity: .4; }

.wow-help-sec {
    font-size: 12px; color: #8D6E63;
    padding-bottom: 5px; margin-bottom: 8px;
    border-bottom: 2px solid #EFE7DA;
}

.wow-help-ex {
    margin-top: 16px; padding: 12px;
    background: #FFFFFF;
    border: 2px dashed #D7CBBA;
    border-radius: 14px;
}
.wow-help-ex-title { font-size: 12px; color: #8D6E63; margin-bottom: 9px; }
.wow-help-ex-row {
    display: flex; align-items: center; gap: 5px;
    margin-bottom: 9px;
}
.wow-help-ex-row:last-child { margin-bottom: 0; }
.wow-help-cell {
    flex: 0 0 auto;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; border-radius: 8px; border: 2px solid #C7B9A8;
}
.wow-help-cell.mark-green { background: #5FBF5F; border-color: #3E2723; color: #fff; }
.wow-help-cell.mark-blue  { background: #4A9FE0; border-color: #3E2723; color: #fff; }
.wow-help-cell.mark-red   { background: #E85D5D; border-color: #3E2723; color: #fff; }
.wow-help-cell.mark-gray  { background: #E8E2D8; border-color: #B5A795; color: #6D4C41; }

.wow-help-ex-desc {
    flex: 1 1 auto; min-width: 0;
    font-size: 11.5px; color: #5D4037; line-height: 1.45;
    margin-left: 5px; word-break: keep-all;
}

/* ── PC / 태블릿: 전체적으로 크게 ─────────────────────────── */
@media (min-width: 768px) {
    .wow-wrap { max-width: 680px; padding: 22px 20px 40px; gap: 16px; }

    .wow-header { padding: 14px 20px; border-radius: 22px; }
    .wow-logo-mark { width: 48px; height: 48px; font-size: 28px; border-radius: 15px; }
    .wow-logo-text { font-size: 27px; }
    .wow-logo-sub  { font-size: 13px; }
    .wow-score-label { font-size: 13px; }
    .wow-score-value { font-size: 30px; }
    .wow-round-value { font-size: 13px; }

    .wow-card { padding: 20px; border-radius: 22px; }

    .wow-intro-title { font-size: 25px; }
    .wow-intro-desc  { font-size: 15px; margin-bottom: 18px; }
    .wow-len-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
    .wow-len-btn { padding: 18px 8px; }
    .wow-len-num { font-size: 29px; }
    .wow-len-cap { font-size: 13px; }
    .wow-len-mult { font-size: 12px; }
    .wow-rule-list li { font-size: 14.5px; }
    .wow-chip { width: 23px; height: 23px; }

    .wow-keystat-title { font-size: 13px; margin-bottom: 10px; }
    .wow-keystat-rows { gap: 6px; }
    .wow-keystat-row { gap: 5px; }
    .wow-key { width: 40px; height: 42px; font-size: 19px; border-radius: 10px; }

    .wow-hint-icon { width: 44px; height: 44px; font-size: 23px; border-radius: 14px; }
    .wow-hint-cat  { font-size: 12px; padding: 2px 11px; }
    .wow-hint-text { font-size: 18px; line-height: 1.6; }

    .wow-meta-row { font-size: 14.5px; }
    .wow-tries-left strong { font-size: 17px; }

    .wow-row { gap: 8px; }
    .wow-cell { border-radius: 15px; border-width: 4px; }

    .wow-input { font-size: 22px; padding: 16px 12px; border-radius: 16px; }
    .wow-input::placeholder { font-size: 17px; }
    .wow-btn { font-size: 18px; padding: 16px 26px; border-radius: 16px; }

    .wow-modal { max-width: 420px; padding: 26px 24px 22px; }
    .wow-modal-emoji { font-size: 50px; }
    .wow-modal-title { font-size: 26px; }
    .wow-modal-answer { font-size: 25px; padding: 9px 20px; }
    .wow-modal-desc { font-size: 15px; }
    .wow-modal-gain { font-size: 16px; }
    .wow-nick-input { font-size: 18px; padding: 13px 12px; }

    .wow-rank-tab { font-size: 16px; padding: 11px 6px; }
    .wow-rank-table { font-size: 15px; }
    .wow-rank-table th { font-size: 13px; }
    .wow-rank-score { font-size: 17px; }
    .wow-foot { font-size: 13px; }

    .wow-help-btn { width: 40px; height: 40px; font-size: 21px; }
    .wow-help-sec { font-size: 14px; }
    .wow-help-cell { width: 36px; height: 36px; font-size: 18px; }
    .wow-help-ex-desc { font-size: 13px; }
    .wow-help-ex-title { font-size: 13px; }
}
