/* =========================================================
   오늘의 영단어 (word.html) — 2026-11-17
   위 막대·버튼·오른쪽 칸 모양은 2048 페이지와 같게 (연보라 위 막대 + 따뜻한 노랑 바탕)
   칸 색: 맞음 --w-ok(초록) / 자리 다름 --w-in(노랑) / 없음 --w-no(회보라)
   ========================================================= */
:root {
    --g-cream: #fbf7ef;
    --g-paper: #f4ecdd;
    --g-ink: #2c2418;
    --g-mute: #8a7d68;
    --g-gold: #c9a27e;
    --w-ok: #2fae7a;
    --w-in: #f0b429;
    --w-no: #9a98b8;
    --w-tile: 58px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: linear-gradient(180deg, #fff3c4 0%, #fde9a6 100%) fixed;
    color: var(--g-ink);
    font-family: "Noto Sans KR", system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* 위 막대 (2048과 같음) */
.g-top { background: linear-gradient(180deg, #e6e5ff, #DAD9FF); border-bottom: 3px solid #b3b1f2; }
.g-top-in {
    max-width: 860px; margin: 0 auto; padding: 14px 16px;
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.g-title { margin: 0; color: #36347a; font-size: 1.5rem; letter-spacing: 0.02em; }
.g-title small { margin-left: 8px; font-size: 0.82rem; font-weight: 600; color: #5a57b5; letter-spacing: 0; }
.g-brand { font-family: "Chewy", cursive; color: #5a57b5; font-size: 1.05rem; white-space: nowrap; }

.g-main {
    max-width: 860px; margin: 0 auto; padding: 18px 16px 10px;
    display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 22px; align-items: start;
}

/* 탭 + 소리 버튼 */
.w-statusrow { display: flex; align-items: center; gap: 10px; max-width: 420px; margin: 0 auto 6px; }
.w-tabs { flex: 1; display: flex; gap: 6px; background: #DAD9FF; border: 1px solid #c3c1f0; border-radius: 12px; padding: 4px; }
.w-tab {
    flex: 1; font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer;
    border: 0; border-radius: 9px; padding: 8px 6px; background: transparent; color: #5a57b5;
    transition: background 0.15s, color 0.15s;
}
.w-tab.on { background: #fff; color: #36347a; box-shadow: 0 2px 6px rgba(54, 52, 122, 0.18); }
.w-sub[hidden] { display: none; }
.w-sub { margin: 4px auto 10px; max-width: 420px; text-align: center; font-size: 0.85rem; color: #5a57b5; min-height: 1.3em; }

.g-mute {
    flex: none; width: 42px; height: 42px; padding: 0;
    display: grid; place-items: center; border-radius: 50%; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: linear-gradient(160deg, rgba(120, 170, 235, 0.55), rgba(40, 80, 150, 0.75));
    box-shadow: 0 4px 12px rgba(30, 50, 100, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: transform 0.12s, filter 0.15s;
}
.g-mute:hover { filter: brightness(1.08); }
.g-mute:active { transform: scale(0.94); }
.g-mute svg { width: 24px; height: 24px; overflow: visible; }
.g-mute .g-spk { fill: #fff; }
.g-mute .g-wave { fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; }
.g-mute .g-slash { fill: none; stroke: #e5402b; stroke-width: 2.6; stroke-linecap: round; opacity: 0; filter: drop-shadow(0 0 1px #fff); }
.g-mute.muted .g-wave { opacity: 0.35; }
.g-mute.muted .g-slash { opacity: 1; }

/* 판: 6줄 × 5칸 */
.w-board-wrap { position: relative; max-width: 420px; margin: 0 auto; }
.w-board { display: grid; grid-template-rows: repeat(6, var(--w-tile)); gap: 7px; justify-content: center; padding: 4px 0 8px; }
.w-row { display: grid; grid-template-columns: repeat(5, var(--w-tile)); gap: 7px; }
.w-row.shake { animation: wShake 0.42s; }
@keyframes wShake {
    0%, 100% { transform: translateX(0); }
    15%, 55% { transform: translateX(-7px); }
    35%, 75% { transform: translateX(7px); }
}
.w-tile {
    position: relative; display: grid; place-items: center;
    width: var(--w-tile); height: var(--w-tile);
    border-radius: 10px; border: 2px solid #d9d0bb; background: #fffdf6;
    font-size: 1.9rem; font-weight: 700; color: #36347a; text-transform: uppercase;
    user-select: none; -webkit-user-select: none;
}
.w-tile.filled { border-color: #8d8ac9; animation: wPop 0.11s ease-out; }
@keyframes wPop { 50% { transform: scale(1.1); } }
.w-tile.ok, .w-tile.in, .w-tile.no { color: #fff; border-color: transparent; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); }
.w-tile.ok { background: var(--w-ok); }
.w-tile.in { background: var(--w-in); }
.w-tile.no { background: var(--w-no); }
.w-tile.flip { animation: wFlip 0.46s ease-in-out; }
@keyframes wFlip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.w-tile.jump { animation: wJump 0.5s ease; }
@keyframes wJump { 30% { transform: translateY(-14px); } 55% { transform: translateY(2px); } 75% { transform: translateY(-4px); } }

/* 짧은 안내 (판 위 가운데) */
.w-toast {
    position: absolute; left: 50%; top: 10px; transform: translate(-50%, -6px);
    background: #36347a; color: #fff; font-size: 0.9rem; font-weight: 700;
    padding: 8px 14px; border-radius: 10px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.18s; z-index: 6; white-space: nowrap;
}
.w-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 결과 창 */
.w-result { position: absolute; inset: -6px 0 0; display: grid; place-items: center; z-index: 5; background: rgba(54, 52, 122, 0.28); border-radius: 14px; animation: wFade 0.3s ease; }
.w-result[hidden] { display: none; }
@keyframes wFade { from { opacity: 0; } to { opacity: 1; } }
.w-result-card {
    position: relative; width: min(92%, 360px);
    background: var(--g-cream); border: 2px solid var(--g-gold); border-radius: 14px;
    padding: 18px 20px 16px; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    animation: wCard 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes wCard { from { transform: scale(0.82); } to { transform: scale(1); } }
.w-result-title { margin: 0; font-size: 1.15rem; font-weight: 700; color: #36347a; }
.w-word { margin: 8px 0 2px; font-size: 2rem; font-weight: 800; letter-spacing: 0.18em; color: var(--w-ok); }
.w-mean { margin: 0 0 8px; font-size: 1.05rem; font-weight: 700; color: var(--g-ink); }
.w-ex { margin: 0; font-size: 0.9rem; font-style: italic; color: #4a3d2c; }
.w-ex-ko { margin: 2px 0 0; font-size: 0.84rem; color: var(--g-mute); }
.w-next { margin: 10px 0 0; font-size: 0.82rem; color: #5a57b5; font-weight: 600; }
.w-next:empty { display: none; }
.w-result-btns { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.w-close { position: absolute; top: 4px; right: 8px; border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--g-mute); cursor: pointer; padding: 4px; }

/* 화면 자판 */
.w-keys { max-width: 460px; margin: 10px auto 0; display: flex; flex-direction: column; gap: 7px; user-select: none; -webkit-user-select: none; }
.w-krow { display: flex; gap: 5px; justify-content: center; }
.w-key {
    flex: 1 1 0; min-width: 0; max-width: 42px; height: 52px;
    font: inherit; font-size: 1rem; font-weight: 700; text-transform: uppercase; cursor: pointer;
    border: 0; border-radius: 8px; background: #DAD9FF; color: #36347a;
    box-shadow: 0 2px 0 #b3b1f2; touch-action: manipulation;
    transition: background 0.2s, color 0.2s, transform 0.08s;
}
.w-key:active { transform: translateY(2px); box-shadow: none; }
.w-key.wide { flex: 1.6 1 0; max-width: 68px; font-size: 0.78rem; }
.w-key.ok { background: var(--w-ok); color: #fff; box-shadow: 0 2px 0 #208a5e; }
.w-key.in { background: var(--w-in); color: #fff; box-shadow: 0 2px 0 #c48e12; }
.w-key.no { background: #c9c8dc; color: #77759a; box-shadow: 0 2px 0 #aeacc7; }
.w-key svg { width: 22px; height: 22px; }

/* 오른쪽 칸 (2048과 같음) */
.g-panel { background: #fff; border: 1px solid #e3d8c4; border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.g-actions { display: flex; gap: 8px; }
.g-btn {
    font: inherit; font-size: 0.92rem; font-weight: 700;
    padding: 10px 14px; border-radius: 10px; cursor: pointer;
    border: 1px solid #d8ccb4; background: var(--g-paper); color: var(--g-ink);
    transition: transform 0.1s, background 0.15s;
}
.g-btn:active:not(:disabled) { transform: translateY(1px); }
.g-btn:disabled { cursor: not-allowed; opacity: 0.5; }
.g-actions .g-btn { flex: 1; padding-left: 6px; padding-right: 6px; }
.g-exit { background: #f1f1ff; border-color: #c3c1f0; color: #36347a; }
.g-exit:hover { background: #e6e5ff; }
.g-primary { background: linear-gradient(180deg, #e6e5ff, #DAD9FF); border-color: #b3b1f2; color: #36347a; }
.g-primary:hover:not(:disabled) { background: linear-gradient(180deg, #efeeff, #cfcdfb); }
.g-record { font-size: 0.82rem; color: #5a4c38; background: var(--g-paper); border-radius: 10px; padding: 10px 12px; line-height: 1.7; }
.g-record b { color: var(--g-ink); }
.w-dist { margin-top: 6px; display: grid; gap: 3px; }
.w-dist div { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; }
.w-dist span { width: 10px; text-align: right; }
.w-dist i { display: block; height: 15px; min-width: 18px; border-radius: 4px; background: #c3c1f0; color: #36347a; font-style: normal; font-size: 0.72rem; font-weight: 700; text-align: right; padding: 0 5px; line-height: 15px; }
.w-dist i.hot { background: var(--w-ok); color: #fff; }
.g-rules { font-size: 0.85rem; color: #4a3d2c; }
.g-rules summary { cursor: pointer; font-weight: 700; color: #36347a; }
.g-rules ul { padding-left: 1.2em; margin: 8px 0 0; line-height: 1.75; }
.w-chip { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; color: #fff; font-weight: 700; font-size: 0.75rem; vertical-align: -4px; margin-right: 2px; }
.w-chip.ok { background: var(--w-ok); } .w-chip.in { background: var(--w-in); } .w-chip.no { background: var(--w-no); }
.g-foot { text-align: center; font-size: 0.78rem; color: var(--g-mute); padding: 18px 16px 26px; }

/* ---------- 폰 ---------- */
@media (max-width: 760px) {
    :root { --w-tile: min(56px, calc((100vw - 60px) / 5)); }
    .g-top-in { padding: 11px 16px; }
    .g-title { font-size: 1.25rem; }
    .g-title small { display: block; margin: 2px 0 0; }
    .g-brand { font-size: 0.92rem; }
    .g-main { grid-template-columns: 1fr; gap: 14px; padding: 10px 8px 6px; }
    .w-board { gap: 6px; } .w-row { gap: 6px; }
    .w-tile { font-size: 1.7rem; }
    .w-keys { gap: 6px; }
    .w-krow { gap: 4px; }
    .w-key { height: 50px; max-width: none; }
    .w-key.wide { max-width: none; }
    .g-panel { padding: 14px; }
    .g-btn { padding: 12px 14px; }
}

/* ---------- 2026-11-17: 큰 [확인] 버튼 (판과 자판 사이) ---------- */
.w-board { padding-bottom: 4px; }
.w-enter {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: calc(var(--w-tile) * 5 + 28px); max-width: 100%; height: 44px; margin: 6px auto 0;
    font: inherit; font-size: 1.05rem; font-weight: 800; letter-spacing: 0.04em; cursor: pointer;
    border: 2px solid #c3c1f0; border-radius: 12px; background: #f1f1ff; color: #8d8ac9;
    touch-action: manipulation; transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.08s;
}
.w-enter-ic { font-size: 1.15rem; }
.w-enter.ready {
    background: linear-gradient(180deg, #6d6ad0, #4c49a8); border-color: #36347a; color: #fff;
    box-shadow: 0 3px 0 #2c2a68, 0 0 0 0 rgba(109, 106, 208, 0.55);
    animation: wReady 1.4s ease-out infinite;
}
.w-enter:active:not(:disabled) { transform: translateY(2px); }
.w-enter.ready:active { box-shadow: 0 1px 0 #2c2a68; }
.w-enter:disabled { opacity: 0.45; cursor: default; animation: none; }
.w-enter.nudge { animation: wNudge 0.45s; }
@keyframes wReady { 0% { box-shadow: 0 3px 0 #2c2a68, 0 0 0 0 rgba(109, 106, 208, 0.55); } 100% { box-shadow: 0 3px 0 #2c2a68, 0 0 0 12px rgba(109, 106, 208, 0); } }
@keyframes wNudge { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.06); } 70% { transform: scale(0.98); } }
/* 자판 안 [확인] 키도 5글자가 차면 진하게 */
.w-key.ready { background: #4c49a8; color: #fff; box-shadow: 0 2px 0 #2c2a68; }
@media (min-width: 761px) {
    :root { --w-tile: 54px; }          /* 확인 버튼이 들어간 만큼 칸을 조금 줄여서 게임 창(높이 약 790) 안에 다 보이게 */
    .w-keys { margin-top: 8px; }
}
@media (max-width: 760px) {
    .w-enter { height: 46px; margin-top: 4px; font-size: 1.1rem; }
    .w-toast { max-width: 94%; white-space: normal; text-align: center; }   /* 폰: 안내 글이 길면 줄바꿈 */
}

/* ---------- 2026-11-17: [💡 힌트] [✓ 확인] [🏳 정답] 한 줄 + 힌트 줄 + 정답 보기 확인 창 ---------- */
.w-actrow {
    display: flex; gap: 6px; align-items: stretch;
    width: calc(var(--w-tile) * 5 + 28px); max-width: 100%; margin: 6px auto 0;
}
.w-actrow .w-enter { flex: 1; width: auto; margin: 0; }
.w-side {
    position: relative; flex: none; width: 66px; height: 44px; padding: 0 4px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
    font: inherit; font-size: 0.72rem; cursor: pointer; line-height: 1.15;
    border-radius: 12px; touch-action: manipulation; transition: transform 0.08s, filter 0.15s, opacity 0.2s;
}
.w-side span { font-size: 1.05rem; line-height: 1; }
.w-side b { font-weight: 800; }
.w-side:active:not(:disabled) { transform: translateY(2px); }
.w-side:hover:not(:disabled) { filter: brightness(1.04); }
.w-side:disabled { opacity: 0.4; cursor: default; }
.w-hintbtn { border: 2px solid #f0c75a; background: #fff6d6; color: #8a5a00; }
.w-givebtn { border: 2px solid #e3c7cf; background: #fdf1f4; color: #9a4058; }
.w-badge {
    position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 9px; background: #ff5e8a; color: #fff; font-style: normal; font-size: 0.68rem; font-weight: 800;
    line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff3c4;
}
.w-badge:empty { display: none; }

.w-hintline {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px;
    max-width: 420px; margin: 4px auto 6px; padding: 3px 10px; min-height: 30px;
    background: #fff6d6; border: 1px dashed #f0c75a; border-radius: 10px;
    font-size: 0.9rem; color: #5a4300;
}
.w-hintline[hidden] { display: none; }
.w-hintline.pop { animation: wHintPop 0.35s ease-out; }
@keyframes wHintPop { 0% { transform: scale(0.94); opacity: 0.4; } 100% { transform: scale(1); opacity: 1; } }
.w-h-k { font-size: 0.78rem; font-weight: 700; color: #a07a1c; }
.w-h-ex { font-style: italic; }
.w-h-sep { width: 1px; height: 16px; background: #ead79a; }
.w-h-pat { display: inline-flex; gap: 3px; }
.w-h-pat i {
    display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 5px;
    border: 1.5px solid #e6d39a; background: #fffdf6; font-style: normal; font-weight: 800; font-size: 0.85rem; color: #36347a;
}
.w-h-pat i.on { background: var(--w-ok); border-color: var(--w-ok); color: #fff; }

.w-ask { position: absolute; inset: -6px 0 0; display: grid; place-items: center; z-index: 7; background: rgba(54, 52, 122, 0.28); border-radius: 14px; animation: wFade 0.2s ease; }
.w-ask[hidden] { display: none; }
.w-ask-card {
    width: min(90%, 320px); background: var(--g-cream); border: 2px solid var(--g-gold); border-radius: 14px;
    padding: 16px 18px 14px; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    animation: wCard 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.w-ask-t { margin: 0; font-size: 1.1rem; font-weight: 800; color: #36347a; }
.w-ask-s { margin: 6px 0 0; font-size: 0.86rem; color: #5a4c38; line-height: 1.5; }

@media (max-width: 760px) {
    .w-actrow { margin-top: 4px; }
    .w-side { height: 46px; width: 62px; }
    .w-hintline { margin: 4px 4px 6px; font-size: 0.86rem; }
}

@media (prefers-reduced-motion: reduce) {
    .w-tile.flip, .w-tile.jump, .w-tile.filled, .w-row.shake, .w-enter.ready, .w-enter.nudge, .w-hintline.pop { animation: none; }
}
