/* ── 확장 위젯 D (v1.12.0) — 꾸미기·레트로 + 재미·미니게임 ── */

/* 레트로 카운터 */
.wg-hitc { height: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; }
.wg-hitc-panel { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.wg-hitc-label { font-size: 10px; letter-spacing: .18em; font-weight: 800; color: var(--muted); }
.wg-hitc-num { display: inline-flex; gap: 2px; padding: 5px 6px; border-radius: 4px; background: #0c0f0d; box-shadow: inset 0 0 0 1px #2a2f2b, inset 0 2px 6px rgba(0,0,0,.8); }
.wg-hitc-num i {
  position: relative; font-style: normal; font-family: 'Courier New', ui-monospace, monospace; font-weight: 700;
  font-size: clamp(16px, 2.4vw, 22px); line-height: 1; padding: 3px 2px; min-width: 1ch; text-align: center;
  font-variant-numeric: tabular-nums;
}
.wg-hitc-seg7 .wg-hitc-num i { color: #4bff7a; text-shadow: 0 0 6px rgba(75,255,122,.7); }
.wg-hitc-seg7 .wg-hitc-num i::before { content: '8'; position: absolute; inset: 3px 2px; color: #4bff7a; opacity: .12; text-shadow: none; }
.wg-hitc-odometer .wg-hitc-num { background: #2b2118; box-shadow: inset 0 0 0 1px #5a4632, inset 0 3px 6px rgba(0,0,0,.6); gap: 3px; }
.wg-hitc-odometer .wg-hitc-num i {
  color: #ffb347; background: linear-gradient(#1a130d, #3a2b1e 45%, #1a130d); border-radius: 3px; padding: 4px 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

/* 블링키 */
.wg-blinkie-wrap { height: 100%; display: flex; align-items: center; justify-content: center; }
.wg-blinkie-band {
  width: 100%; max-width: 300px; aspect-ratio: 150 / 20; display: flex; align-items: center; justify-content: center;
  font-family: 'Courier New', ui-monospace, monospace; font-weight: 700; font-size: clamp(11px, 2.2vw, 15px); letter-spacing: .04em;
  border: 2px solid var(--bk-b); background: var(--bk-bg); color: var(--bk-fg); image-rendering: pixelated;
  animation: wg-blinkie-blink .6s steps(2, end) infinite;
}
.wg-blinkie-band span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 6px; }
.wg-blinkie-pink { --bk-bg: #ffd6ea; --bk-fg: #c2185b; --bk-b: #ff5fa2; }
.wg-blinkie-blue { --bk-bg: #d6ecff; --bk-fg: #0d47a1; --bk-b: #4da3ff; }
.wg-blinkie-green { --bk-bg: #d9ffe0; --bk-fg: #1b5e20; --bk-b: #3ddc84; }
.wg-blinkie-purple { --bk-bg: #e8dcff; --bk-fg: #4a148c; --bk-b: #a970ff; }
.wg-blinkie-yellow { --bk-bg: #fff6c2; --bk-fg: #7a5b00; --bk-b: #ffd23f; }
@keyframes wg-blinkie-blink { 0%, 49% { border-color: var(--bk-b); color: var(--bk-fg); } 50%, 100% { border-color: var(--bk-fg); color: var(--bk-b); } }

/* 88×31 버튼 벽 */
.wg-bwall { height: 100%; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 6px; }
.wg-bwall-btn { display: inline-block; width: 88px; height: 31px; flex-shrink: 0; line-height: 0; }
.wg-bwall-btn img { width: 88px; height: 31px; image-rendering: pixelated; display: block; }
.wg-bwall-txt {
  display: flex; align-items: center; justify-content: center; width: 88px; height: 31px; box-sizing: border-box;
  border: 1px solid; font-family: 'Courier New', ui-monospace, monospace; font-size: 11px; font-weight: 700; color: #222; line-height: 1;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 4px;
}
a.wg-bwall-btn:hover { filter: brightness(1.08); }

/* 유저박스 */
.wg-ubox { display: flex; flex-direction: column; gap: 5px; }
.wg-ubox-row { display: flex; align-items: stretch; border: 1px solid hsl(var(--ub-h), 45%, 72%); background: hsl(var(--ub-h), 70%, 96%); font-size: 12px; line-height: 1.35; min-height: 38px; }
.wg-ubox-ico { flex: 0 0 42px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: hsl(var(--ub-h), 65%, 84%); border-right: 1px solid hsl(var(--ub-h), 45%, 72%); }
.wg-ubox-txt { flex: 1; display: flex; align-items: center; padding: 4px 9px; color: var(--c-text, var(--ink)); }

/* 우표 모음 (톱니 테두리 — 가장자리 구멍만 남기는 마스크) */
.wg-postage { height: 100%; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 12px 14px; }
.wg-postage-stamp {
  width: clamp(72px, 22%, 110px); padding: 7px; background: #fffdf7;
  -webkit-mask: radial-gradient(circle, transparent 3.5px, #000 4px) -6px -6px / 12px 12px repeat, linear-gradient(#000, #000) content-box;
  -webkit-mask-composite: source-over;
  mask: radial-gradient(circle, transparent 3.5px, #000 4px) -6px -6px / 12px 12px repeat, linear-gradient(#000, #000) content-box;
  mask-composite: add;
  filter: drop-shadow(1px 2px 3px rgba(0,0,0,.18));
}
.wg-postage-in { aspect-ratio: 4 / 5; border: 1px solid #d9d2c0; background: #efe9da; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.wg-postage-in img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wg-postage-ph { font-size: 24px; }
.wg-postage-name { margin-top: 4px; font-size: 10px; font-weight: 700; text-align: center; color: #5b5346; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* 미니룸 */
.wg-mr { position: relative; height: 100%; min-height: 150px; border-radius: 12px; overflow: hidden; background: var(--mr-sky); }
.wg-mr-wall { position: absolute; inset: 0 0 auto 0; height: 46%; background: linear-gradient(90deg, var(--mr-wl) 50%, var(--mr-wr) 50%); }
.wg-mr-floor { position: absolute; inset: auto 0 0 0; height: 62%; background: linear-gradient(180deg, var(--mr-f1), var(--mr-f2)); clip-path: polygon(0 22%, 50% 0, 100% 22%, 100% 100%, 0 100%); }
.wg-mr-item { position: absolute; transform: translate(-50%, -50%); font-size: clamp(20px, 3.2vw, 32px); line-height: 1; filter: drop-shadow(0 3px 2px rgba(0,0,0,.18)); }
.wg-mr-me { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wg-mr-minimi { font-size: clamp(30px, 4.6vw, 46px); line-height: 1; animation: wg-mr-float 2.6s ease-in-out infinite; filter: drop-shadow(0 4px 3px rgba(0,0,0,.22)); }
.wg-mr-bubble { position: relative; background: #fff; color: #333; border-radius: 12px; padding: 4px 10px; font-size: 12px; font-weight: 700; max-width: 180px; text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.wg-mr-bubble::after { content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
.wg-mr-room { --mr-sky: #f6e7d8; --mr-wl: #f3d9c4; --mr-wr: #e7c6ab; --mr-f1: #c99a6b; --mr-f2: #a9784c; }
.wg-mr-beach { --mr-sky: #cdeeff; --mr-wl: #bfe7ff; --mr-wr: #9fd8f7; --mr-f1: #ffe9b3; --mr-f2: #f2cf85; }
.wg-mr-space { --mr-sky: #0f1030; --mr-wl: #1a1b4b; --mr-wr: #12123a; --mr-f1: #3b3f78; --mr-f2: #23264f; }
.wg-mr-space .wg-mr-wall { background-image: radial-gradient(#fff 1px, transparent 1.5px), radial-gradient(#fff 1px, transparent 1.5px); background-size: 46px 46px, 29px 29px; background-position: 0 0, 14px 9px; }
.wg-mr-forest { --mr-sky: #dff3d8; --mr-wl: #bfe3b1; --mr-wr: #a3d491; --mr-f1: #7cbf6a; --mr-f2: #558f45; }
.wg-mr-space .wg-mr-bubble { background: #fff; }
@keyframes wg-mr-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* 곡선 글자 */
.wg-tpath { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--c-primary, var(--brand)); }
.wg-tpath svg { width: 100%; height: 100%; max-height: 100%; overflow: visible; }
.wg-tpath text { fill: currentColor; font-family: var(--font-display); font-weight: 800; letter-spacing: .02em; }

/* 이미지 글자 */
.wg-tmask { height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; }
.wg-tmask-text {
  font-family: var(--font-display); font-weight: 900; font-size: clamp(30px, 8vw, 72px); line-height: 1.05; letter-spacing: .01em;
  background-size: cover; background-position: center; -webkit-background-clip: text; background-clip: text; color: transparent;
  word-break: keep-all; overflow-wrap: anywhere; padding: 0 4px;
}
.wg-tmask-grad { background-image: linear-gradient(120deg, var(--c-primary, var(--brand)), var(--c-accent, var(--amber)), #ff6b9d); }

/* 도형 장식 */
.wg-shape-wrap { height: 100%; display: flex; align-items: center; justify-content: center; }
.wg-shape { aspect-ratio: 1; max-height: 100%; background: var(--sh); position: relative; }
.wg-shape-s { width: 45%; } .wg-shape-m { width: 70%; } .wg-shape-l { width: 96%; }
.wg-shape-c-primary { --sh: var(--c-primary, var(--brand)); }
.wg-shape-c-pink { --sh: #ffb3c7; } .wg-shape-c-sky { --sh: #a9d8ff; } .wg-shape-c-mint { --sh: #a8ecd3; }
.wg-shape-c-lemon { --sh: #fff1a8; } .wg-shape-c-lavender { --sh: #d3c4ff; }
.wg-shape-circle { border-radius: 50%; }
.wg-shape-triangle { clip-path: polygon(50% 4%, 96% 92%, 4% 92%); }
.wg-shape-star { clip-path: polygon(50% 2%, 61% 36%, 98% 36%, 68% 58%, 79% 94%, 50% 72%, 21% 94%, 32% 58%, 2% 36%, 39% 36%); }
.wg-shape-blob { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; animation: wg-shape-morph 9s ease-in-out infinite; }
.wg-shape-heart { background: none; }
.wg-shape-heart::before, .wg-shape-heart::after {
  content: ''; position: absolute; top: 14%; width: 50%; height: 78%; background: var(--sh); border-radius: 50% 50% 0 0;
}
.wg-shape-heart::before { left: 50%; transform: translateX(-100%) rotate(-45deg); transform-origin: 100% 100%; }
.wg-shape-heart::after { left: 50%; transform: rotate(45deg); transform-origin: 0 100%; }
@keyframes wg-shape-morph { 0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; } 50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; } }

/* 픽셀 아트 */
.wg-pixel-wrap { height: 100%; display: flex; align-items: center; justify-content: center; }
.wg-pixel { display: grid; grid-template-columns: repeat(16, 1fr); aspect-ratio: 1; max-height: 100%; background: repeating-conic-gradient(var(--paper) 0 25%, transparent 0 50%) 0 0 / 12.5% 12.5%; border-radius: 6px; overflow: hidden; }
.wg-pixel-fit { width: 100%; } .wg-pixel-m { width: 70%; } .wg-pixel-s { width: 45%; }
.wg-pixel i { display: block; aspect-ratio: 1; }

/* 액자 */
.wg-frame { height: 100%; margin: 0; display: flex; flex-direction: column; box-sizing: border-box; border: 12px solid; padding: 0; }
.wg-frame-mat { flex: 1; min-height: 0; padding: 6%; background: #fdfcf8; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), inset 0 3px 10px rgba(0,0,0,.12); display: flex; }
.wg-frame-mat img { width: 100%; height: 100%; min-height: 0; object-fit: cover; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.15), inset 0 0 12px rgba(0,0,0,.2); }
.wg-frame-cap { text-align: center; font-size: 11px; font-style: italic; padding: 5px 6px; background: #fdfcf8; color: #555; border-top: 1px solid rgba(0,0,0,.08); }
.wg-frame-gold { border-color: #d4a83a; box-shadow: inset 0 0 0 2px #f6e2a0, inset 0 0 0 4px #a8801e, 0 6px 16px rgba(0,0,0,.22); }
.wg-frame-wood { border-color: #8b5a2b; box-shadow: inset 0 0 0 2px #b87a45, inset 0 0 0 3px #5e3a17, 0 6px 16px rgba(0,0,0,.22); }
.wg-frame-white { border-color: #f6f6f6; box-shadow: inset 0 0 0 2px #dcdcdc, 0 6px 16px rgba(0,0,0,.14); }
.wg-frame-black { border-color: #1e1e22; box-shadow: inset 0 0 0 2px #444, 0 6px 16px rgba(0,0,0,.3); }

/* 마스킹테이프 */
.wg-tape-wrap { height: 100%; display: flex; align-items: center; justify-content: center; }
.wg-tape {
  width: 100%; height: clamp(22px, 62%, 36px); opacity: .82; background-color: var(--tp);
  clip-path: polygon(0 0, 100% 0, 99.2% 28%, 100% 52%, 99.3% 78%, 100% 100%, 0 100%, .8% 72%, 0 46%, .7% 22%);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.wg-tape-pink { --tp: #ffb6cf; --tp2: #ff8fb6; } .wg-tape-yellow { --tp: #ffe38a; --tp2: #f7c948; } .wg-tape-mint { --tp: #b4ecd7; --tp2: #7fd9b6; }
.wg-tape-sky { --tp: #b9dcff; --tp2: #86c0ff; } .wg-tape-lavender { --tp: #d9c9ff; --tp2: #b79dff; } .wg-tape-kraft { --tp: #d9b98c; --tp2: #bf9a66; }
.wg-tape-stripe { background-image: repeating-linear-gradient(135deg, var(--tp2) 0 6px, transparent 6px 14px); }
.wg-tape-dot { background-image: radial-gradient(var(--tp2) 2.2px, transparent 2.8px); background-size: 12px 12px; }

/* 편지 봉투 */
.wg-env { position: relative; width: 100%; height: 100%; min-height: 120px; cursor: pointer; outline-offset: 4px; border-radius: 8px; --env: #ffd0df; --env2: #f3a9c0; --env3: #e58fac; }
.wg-env-pink { --env: #ffd0df; --env2: #f3a9c0; --env3: #e58fac; }
.wg-env-sky { --env: #cfe6ff; --env2: #a6cdf7; --env3: #85b6ea; }
.wg-env-cream { --env: #fff1c9; --env2: #f5dd9a; --env3: #e9c977; }
.wg-env-mint { --env: #cdf3e3; --env2: #a4e2c8; --env3: #83cfae; }
.wg-env-lavender { --env: #e3d8ff; --env2: #c7b4ff; --env3: #ad95f5; }
.wg-env-body { position: absolute; left: 4%; right: 4%; top: 22%; bottom: 10%; background: var(--env2); border-radius: 6px; box-shadow: 0 6px 16px rgba(0,0,0,.14); }
.wg-env-letter {
  position: absolute; left: 9%; right: 9%; top: 30%; bottom: 14%; background: #fff; border-radius: 4px; padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); font-size: 12px; line-height: 1.5; color: #333; overflow: hidden;
  transition: transform .5s cubic-bezier(.2,.8,.3,1.1) .15s, bottom .5s ease .15s;
}
.wg-env-to { font-weight: 800; margin-bottom: 4px; color: var(--c-primary, var(--brand)); }
.wg-env-pocket { position: absolute; left: 4%; right: 4%; top: 22%; bottom: 10%; border-radius: 6px; background: var(--env); clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%); }
.wg-env-flap {
  position: absolute; left: 4%; right: 4%; top: 22%; height: 46%; background: var(--env3); border-radius: 6px 6px 0 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transition: transform .45s ease, z-index 0s .2s; z-index: 3;
}
.wg-env-seal { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); font-size: 22px; z-index: 4; transition: opacity .3s; pointer-events: none; }
.wg-env-hint { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 11px; color: var(--muted); }
.wg-env.open .wg-env-flap { transform: rotateX(180deg); z-index: 0; }
.wg-env.open .wg-env-letter { transform: translateY(-34%); z-index: 2; overflow: auto; }
.wg-env.open .wg-env-seal { opacity: 0; }
.wg-env.open .wg-env-hint { opacity: 0; }

/* 선물 상자 */
.wg-gift { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; cursor: pointer; border-radius: 8px; outline-offset: 4px; --gb: #e5484d; --gb2: #ffd166; }
.wg-gift-red { --gb: #e5484d; --gb2: #ffd166; } .wg-gift-pink { --gb: #ff7eb6; --gb2: #fff0f6; } .wg-gift-blue { --gb: #4d8dff; --gb2: #ffe08a; }
.wg-gift-green { --gb: #3cb371; --gb2: #ffe08a; } .wg-gift-gold { --gb: #e0b040; --gb2: #fff7d6; }
.wg-gift-stage { position: relative; width: min(100%, 180px); flex: 1; min-height: 90px; display: flex; align-items: flex-end; justify-content: center; }
.wg-gift-box { position: relative; width: 70%; height: 46%; background: var(--gb); border-radius: 4px; box-shadow: inset 0 -8px 0 rgba(0,0,0,.12); z-index: 2; }
.wg-gift-box::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 16%; transform: translateX(-50%); background: var(--gb2); }
.wg-gift-lid { position: absolute; left: 50%; bottom: 44%; width: 80%; height: 16%; transform: translateX(-50%); background: var(--gb); border-radius: 3px; box-shadow: 0 2px 4px rgba(0,0,0,.18); z-index: 3; transform-origin: 10% 100%; }
.wg-gift-lid::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 14%; transform: translateX(-50%); background: var(--gb2); }
.wg-gift-bow { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); font-size: 26px; line-height: 1; }
.wg-gift-content {
  position: absolute; left: 50%; bottom: 40%; width: 92%; transform: translate(-50%, 20%) scale(.6); opacity: 0; z-index: 1;
  text-align: center; font-size: 13px; font-weight: 700; background: var(--c-card, var(--card)); border-radius: 10px; padding: 8px 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,.15); transition: transform .5s cubic-bezier(.2,.8,.3,1.2) .25s, opacity .3s .25s; max-height: 70%; overflow: auto;
}
.wg-gift-content img { max-width: 100%; max-height: 90px; border-radius: 6px; margin-bottom: 4px; }
.wg-gift-confetti { position: absolute; left: 50%; bottom: 55%; width: 0; height: 0; z-index: 4; pointer-events: none; }
.wg-gift-confetti i { position: absolute; width: 7px; height: 10px; border-radius: 2px; opacity: 0; background: hsl(calc(var(--i) * 45), 85%, 62%); }
.wg-gift-hint { font-size: 11px; color: var(--muted); }
.wg-gift.open .wg-gift-lid { animation: wg-gift-pop .6s cubic-bezier(.2,.8,.3,1) forwards; }
.wg-gift.open .wg-gift-content { transform: translate(-50%, -20%) scale(1); opacity: 1; z-index: 5; }
.wg-gift.open .wg-gift-confetti i { animation: wg-gift-confetti .9s ease-out forwards; animation-delay: calc(var(--i) * 40ms); }
@keyframes wg-gift-pop { 0% { transform: translateX(-50%) rotate(0); } 40% { transform: translate(-30%, -140%) rotate(-30deg); } 100% { transform: translate(-10%, -120%) rotate(-38deg); } }
@keyframes wg-gift-confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  100% { opacity: 0; transform: translate(calc((var(--i) - 3.5) * 22px), calc(-60px - var(--i) * 6px)) rotate(calc(var(--i) * 140deg)); }
}

/* 떼어가는 전단지 */
.wg-tear { height: 100%; display: flex; flex-direction: column; }
.wg-tear-paper { flex: 1; min-height: 0; overflow: auto; background: #fffdf5; border: 1px solid #e6dfc8; border-bottom: 1px dashed #c9bf9f; padding: 10px 12px; box-shadow: 0 3px 8px rgba(0,0,0,.08); }
.wg-tear-title { font-weight: 800; font-size: 15px; margin-bottom: 4px; color: #333; }
.wg-tear-body { font-size: 12px; line-height: 1.5; color: #444; }
.wg-tear-tabs { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2px; height: clamp(54px, 26%, 78px); }
.wg-tear-tab {
  border: 1px solid #e6dfc8; border-top: none; background: #fffdf5; cursor: pointer; padding: 4px 0; overflow: hidden; min-width: 0;
  display: flex; align-items: center; justify-content: center; transform-origin: top center; box-shadow: 0 3px 6px rgba(0,0,0,.08);
}
.wg-tear-tab span { writing-mode: vertical-rl; font-size: 10px; font-weight: 700; color: var(--c-primary, var(--brand)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 100%; }
.wg-tear-tab:hover { background: var(--brand-soft); }
.wg-tear-tab.gone { visibility: hidden; }
.wg-tear-tab.tearing { animation: wg-tear-fall .7s ease-in forwards; }
.wg-tear-foot { font-size: 11px; color: var(--muted); text-align: center; margin-top: 6px; }
@keyframes wg-tear-fall { 0% { transform: rotate(0) translateY(0); opacity: 1; } 30% { transform: rotate(-12deg) translateY(4px); } 100% { transform: rotate(25deg) translateY(90px); opacity: 0; } }

/* 이상형 월드컵 */
.wg-wc { height: 100%; display: flex; flex-direction: column; gap: 8px; }
.wg-wc-round { font-size: 12px; color: var(--muted); font-weight: 700; }
.wg-wc-vs { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 8px; }
.wg-wc-card {
  display: flex; flex-direction: column; border: 2px solid var(--line); border-radius: 12px; background: var(--c-card, var(--card)); padding: 0; overflow: hidden;
  cursor: pointer; min-height: 0; transition: transform .15s, border-color .15s;
}
.wg-wc-card:hover { transform: translateY(-2px); border-color: var(--c-primary, var(--brand)); }
.wg-wc-card img { flex: 1; width: 100%; min-height: 0; object-fit: cover; }
.wg-wc-ph { flex: 1; display: flex; align-items: center; justify-content: center; font-size: clamp(28px, 4vw, 44px); font-weight: 900; color: var(--c-primary, var(--brand)); background: var(--brand-soft); min-height: 70px; }
.wg-wc-name { padding: 7px 6px; font-size: 13px; font-weight: 700; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wg-wc-vsmark { align-self: center; font-family: var(--font-display); font-size: 18px; color: var(--c-accent, var(--amber)); }
.wg-wc-winner { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wg-wc-winner .wg-wc-card { width: min(70%, 220px); flex: 1; cursor: default; border-color: var(--c-accent, var(--amber)); }
.wg-wc-card.win { animation: wg-wc-pop .5s cubic-bezier(.2,.8,.3,1.3); }
.wg-wc-crown { font-weight: 800; color: var(--c-accent, var(--amber)); }
.wg-wc-stat-title { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.wg-wc-stat-row { display: grid; grid-template-columns: minmax(0, 1fr) 2fr auto; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 3px; }
.wg-wc-stat-row span:first-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wg-wc-stat-bar { height: 8px; border-radius: 99px; background: var(--paper); overflow: hidden; }
.wg-wc-stat-bar i { display: block; height: 100%; background: var(--c-primary, var(--brand)); border-radius: 99px; }
.wg-wc-again { align-self: center; }
@keyframes wg-wc-pop { 0% { transform: scale(.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* 사다리타기 */
.wg-ladder { height: 100%; display: flex; flex-direction: column; gap: 4px; }
.wg-ladder-row { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; }
.wg-ladder-top, .wg-ladder-bot { font-size: 11px; font-weight: 700; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-radius: 8px; padding: 5px 3px; min-width: 0; }
.wg-ladder-top { border: 1px solid var(--line); background: var(--c-card, var(--card)); cursor: pointer; }
.wg-ladder-top:hover { border-color: var(--c-primary, var(--brand)); background: var(--brand-soft); }
.wg-ladder-bot { background: var(--paper); color: var(--muted); }
.wg-ladder-top.on { background: var(--c-primary, var(--brand)); color: #fff; border-color: var(--c-primary, var(--brand)); }
.wg-ladder-bot.on { background: var(--c-accent, var(--amber)); color: #fff; }
.wg-ladder-stage { flex: 1; min-height: 80px; }
.wg-ladder-cv { display: block; width: 100%; height: 100%; }
.wg-ladder-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.wg-ladder-msg b { color: var(--c-primary, var(--brand)); }

/* 캡슐 뽑기 */
.wg-gacha { height: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.wg-gacha-machine { width: min(100%, 150px); flex: 1; min-height: 110px; display: flex; flex-direction: column; }
.wg-gacha-dome { flex: 1; min-height: 50px; border-radius: 50% 50% 8px 8px / 60% 60% 8px 8px; background: linear-gradient(160deg, rgba(255,255,255,.85), rgba(200,225,255,.55)); border: 3px solid #d9dde8; border-bottom: none; position: relative; overflow: hidden; }
.wg-gacha-dome i { position: absolute; width: 22%; aspect-ratio: 1; border-radius: 50%; bottom: 4%; }
.wg-gacha-dome i:nth-child(1) { left: 6%; background: #ff8fa3; } .wg-gacha-dome i:nth-child(2) { left: 30%; background: #ffd166; }
.wg-gacha-dome i:nth-child(3) { left: 54%; background: #8fd3ff; } .wg-gacha-dome i:nth-child(4) { left: 76%; background: #b5e48c; }
.wg-gacha-dome i:nth-child(5) { left: 18%; bottom: 24%; background: #cdb4ff; } .wg-gacha-dome i:nth-child(6) { left: 44%; bottom: 26%; background: #ffb37a; }
.wg-gacha-body { height: 52px; border-radius: 0 0 12px 12px; background: var(--c-primary, var(--brand)); display: flex; align-items: center; justify-content: space-around; padding: 0 8px; box-shadow: inset 0 -6px 0 rgba(0,0,0,.15); }
.wg-gacha-knob { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.7); background: #fff; color: var(--c-primary, var(--brand)); font-size: 16px; font-weight: 900; cursor: pointer; line-height: 1; }
.wg-gacha-knob:disabled { cursor: default; }
.wg-gacha-knob.spin { animation: wg-gacha-spin .7s ease-in-out; }
.wg-gacha-slot { width: 40px; height: 28px; border-radius: 6px; background: #1c1c28; position: relative; overflow: hidden; }
.wg-gacha-capsule { position: absolute; left: 50%; top: -30px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: linear-gradient(#fff 50%, var(--gc, #9ca3af) 50%); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.wg-gacha-capsule.drop { animation: wg-gacha-drop 1.2s cubic-bezier(.3,.6,.4,1.2) forwards; }
.wg-gacha-ssr { --gc: #f2b705; } .wg-gacha-sr { --gc: #8b5cf6; } .wg-gacha-r { --gc: #3b82f6; } .wg-gacha-n { --gc: #9ca3af; }
.wg-gacha-result { font-size: 14px; min-height: 22px; text-align: center; }
.wg-gacha-wait { color: var(--muted); }
.wg-gacha-badge, .wg-gacha-chip { display: inline-block; border-radius: 99px; padding: 1px 8px; font-size: 11px; font-weight: 800; color: #fff; background: var(--gc, #9ca3af); }
.wg-gacha-badge { font-size: 12px; }
.wg-gacha-name.pop { display: inline-block; animation: wg-gacha-pop .4s cubic-bezier(.2,.8,.3,1.4); }
.wg-gacha-hist { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; font-size: 11px; }
.wg-gacha-hist-label { color: var(--muted); align-self: center; }
@keyframes wg-gacha-spin { to { transform: rotate(360deg); } }
@keyframes wg-gacha-drop { 0% { top: -30px; } 60% { top: 4px; } 80% { top: 0; } 100% { top: 3px; } }
@keyframes wg-gacha-pop { 0% { transform: scale(.5); } 100% { transform: scale(1); } }

/* 취향 테스트 */
.wg-tt { height: 100%; display: flex; flex-direction: column; gap: 8px; }
.wg-tt-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.wg-tt-desc { font-size: 13px; color: var(--muted); }
.wg-tt-prog { font-size: 12px; color: var(--muted); font-weight: 700; }
.wg-tt-bar { height: 5px; border-radius: 99px; background: var(--paper); overflow: hidden; }
.wg-tt-bar i { display: block; height: 100%; background: var(--c-primary, var(--brand)); transition: width .3s; }
.wg-tt-q { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 15px; font-weight: 800; padding: 6px; }
.wg-tt-opts { display: flex; flex-direction: column; gap: 6px; }
.wg-tt-opt { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--c-card, var(--card)); padding: 9px 12px; font-size: 13px; cursor: pointer; }
.wg-tt-opt b { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--c-primary, var(--brand)); font-size: 12px; }
.wg-tt-opt:hover { border-color: var(--c-primary, var(--brand)); background: var(--brand-soft); }
.wg-tt-result { font-size: 15px; font-weight: 800; line-height: 1.5; background: var(--brand-soft); border-radius: 12px; padding: 12px 14px; }
.wg-tt-result.pop { animation: wg-wc-pop .45s cubic-bezier(.2,.8,.3,1.3); }
.wg-tt-count { font-size: 12px; color: var(--muted); }

/* 초성 퀴즈 */
.wg-cho { height: 100%; display: flex; flex-direction: column; gap: 8px; }
.wg-cho-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.wg-cho-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }
.wg-cho-desc b { color: var(--c-primary, var(--brand)); }
.wg-cho-time { font-size: 13px; font-weight: 800; color: var(--danger); font-variant-numeric: tabular-nums; }
.wg-cho-q { flex: 1; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: clamp(26px, 4vw, 40px); letter-spacing: .12em; color: var(--c-primary, var(--brand)); min-height: 44px; }
.wg-cho-hint { font-size: 12px; color: var(--muted); text-align: center; min-height: 16px; }
.wg-cho-form { display: flex; gap: 6px; }
.wg-cho-form input { flex: 1; min-width: 0; }
.wg-cho-form input.wg-cho-wrong { animation: wg-shake .35s; border-color: var(--danger); }
.wg-cho-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.wg-cho-foot b { color: var(--c-primary, var(--brand)); }
.wg-cho-score { font-size: 22px; font-weight: 900; color: var(--c-primary, var(--brand)); }
@keyframes wg-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* 단어 맞추기 (워들) */
.wg-wd { height: 100%; display: flex; flex-direction: column; gap: 8px; border-radius: 8px; outline-offset: 2px; }
.wg-wd-meta { font-size: 12px; color: var(--muted); font-weight: 700; }
.wg-wd-grid { display: flex; flex-direction: column; gap: 4px; align-self: center; width: min(100%, 240px); }
.wg-wd-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.wg-wd-row.shake { animation: wg-shake .35s; }
.wg-wd-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 2px solid var(--line); border-radius: 6px; font-style: normal; font-weight: 800; font-size: clamp(14px, 2.4vw, 20px); text-transform: uppercase; }
.wg-wd-cell.fill { border-color: var(--muted); }
.wg-wd-cell.g, .wg-wd-key.g { background: #6aaa64; border-color: #6aaa64; color: #fff; }
.wg-wd-cell.y, .wg-wd-key.y { background: #c9b458; border-color: #c9b458; color: #fff; }
.wg-wd-cell.x, .wg-wd-key.x { background: #8a8f98; border-color: #8a8f98; color: #fff; }
.wg-wd-msg { text-align: center; font-size: 12px; color: var(--muted); min-height: 16px; }
.wg-wd-msg b { color: var(--c-primary, var(--brand)); }
.wg-wd-kb { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.wg-wd-kbrow { display: flex; justify-content: center; gap: 3px; }
.wg-wd-key { flex: 1; max-width: 32px; min-width: 0; height: 34px; border: none; border-radius: 5px; background: var(--paper); font-weight: 700; font-size: 12px; cursor: pointer; padding: 0; color: var(--c-text, var(--ink)); }
.wg-wd-key.wide { max-width: 48px; flex: 1.6; font-size: 11px; }
.wg-wd-key:hover { filter: brightness(.95); }

/* 두더지 잡기 */
.wg-mole-wrap { height: 100%; display: flex; flex-direction: column; gap: 8px; }
.wg-mole-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wg-mole-meta b { color: var(--c-primary, var(--brand)); }
.wg-mole-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 8px; }
.wg-mole-hole {
  position: relative; border: none; border-radius: 50% / 40%; background: radial-gradient(ellipse at 50% 70%, #5b4030 0 40%, #8b6a4e 41% 60%, var(--brand-soft) 61%);
  overflow: hidden; cursor: pointer; padding: 0; min-height: 44px; touch-action: manipulation;
}
.wg-mole { position: absolute; left: 50%; bottom: 8%; transform: translate(-50%, 110%); font-size: clamp(24px, 3.6vw, 40px); line-height: 1; transition: transform .12s ease-out; pointer-events: none; }
.wg-mole-hole.up .wg-mole { transform: translate(-50%, 0); }
.wg-mole-hole.hit { background: radial-gradient(ellipse at 50% 70%, #ffd166 0 40%, #8b6a4e 41% 60%, var(--brand-soft) 61%); }
.wg-mole-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.wg-mole-foot b { color: var(--c-primary, var(--brand)); }

/* 뱀 게임 */
.wg-snake { height: 100%; display: flex; flex-direction: column; gap: 8px; }
.wg-snake-meta { font-size: 12px; color: var(--muted); }
.wg-snake-meta b { color: var(--c-primary, var(--brand)); }
.wg-snake-stage { position: relative; align-self: center; width: min(100%, 320px); aspect-ratio: 1; border-radius: 10px; overflow: hidden; touch-action: none; outline-offset: 2px; }
.wg-snake-cv { display: block; width: 100%; height: 100%; }
.wg-snake-over { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(20,22,30,.72); color: #fff; text-align: center; font-size: 13px; font-weight: 700; }
.wg-snake-over.show { display: flex; }
.wg-snake-over-in { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; }
.wg-snake-best { font-size: 12px; font-weight: 400; opacity: .85; }
.wg-snake-best b { color: #ffd166; }
.wg-snake-pad { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wg-snake-pad div { display: flex; gap: 4px; }
.wg-snake-pad button { width: 40px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--c-card, var(--card)); cursor: pointer; font-size: 12px; color: var(--c-text, var(--ink)); }
.wg-snake-pad button:hover { border-color: var(--c-primary, var(--brand)); background: var(--brand-soft); }

/* 2048 */
.wg-2048 { height: 100%; display: flex; flex-direction: column; gap: 8px; }
.wg-2048-meta { font-size: 12px; color: var(--muted); }
.wg-2048-meta b { color: var(--c-primary, var(--brand)); }
.wg-2048-board { align-self: center; width: min(100%, 300px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 6px; border-radius: 10px; background: #bbada0; touch-action: none; outline-offset: 2px; }
.wg-2048-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 5px; background: rgba(238,228,218,.35); font-style: normal; font-weight: 800; font-size: clamp(13px, 2.4vw, 22px); color: #776e65; }
.wg-2048-cell.v2 { background: #eee4da; } .wg-2048-cell.v4 { background: #ede0c8; }
.wg-2048-cell.v8 { background: #f2b179; color: #fff; } .wg-2048-cell.v16 { background: #f59563; color: #fff; }
.wg-2048-cell.v32 { background: #f67c5f; color: #fff; } .wg-2048-cell.v64 { background: #f65e3b; color: #fff; }
.wg-2048-cell.v128 { background: #edcf72; color: #fff; font-size: clamp(12px, 2vw, 19px); } .wg-2048-cell.v256 { background: #edcc61; color: #fff; font-size: clamp(12px, 2vw, 19px); }
.wg-2048-cell.v512 { background: #edc850; color: #fff; font-size: clamp(12px, 2vw, 19px); } .wg-2048-cell.v1024 { background: #edc53f; color: #fff; font-size: clamp(11px, 1.8vw, 16px); }
.wg-2048-cell.v2048, .wg-2048-cell.vbig { background: #edc22e; color: #fff; font-size: clamp(11px, 1.8vw, 16px); box-shadow: 0 0 12px rgba(237,194,46,.6); }
.wg-2048-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.wg-2048-msg b { color: var(--c-primary, var(--brand)); }

/* 슬라이드 퍼즐 */
.wg-slide { height: 100%; display: flex; flex-direction: column; gap: 8px; }
.wg-slide-meta { font-size: 12px; color: var(--muted); }
.wg-slide-meta b { color: var(--c-primary, var(--brand)); }
.wg-slide-board { align-self: center; width: min(100%, 300px); display: grid; grid-template-columns: repeat(var(--s), 1fr); gap: 3px; padding: 3px; border-radius: 10px; background: var(--line); }
.wg-slide-tile { aspect-ratio: 1; border: none; border-radius: 5px; background: var(--brand-soft) center / cover no-repeat; cursor: pointer; font-weight: 800; font-size: clamp(14px, 2.6vw, 22px); color: var(--c-primary, var(--brand)); padding: 0; transition: transform .1s; }
.wg-slide-tile:hover { transform: scale(.97); }
.wg-slide-tile.img { color: transparent; }
.wg-slide-blank { aspect-ratio: 1; border-radius: 5px; background: rgba(0,0,0,.06); }
.wg-slide-board.done { box-shadow: 0 0 0 3px var(--c-accent, var(--amber)); }
.wg-slide-board.done .wg-slide-tile { cursor: default; }
.wg-slide-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.wg-slide-msg b { color: var(--c-primary, var(--brand)); }

/* 행맨 */
.wg-hang { height: 100%; display: flex; flex-direction: column; gap: 8px; }
.wg-hang-life { font-size: 11px; letter-spacing: 1px; }
.wg-hang-main { flex: 1; min-height: 0; display: flex; gap: 10px; align-items: center; }
.wg-hang-svg { width: clamp(70px, 28%, 110px); flex-shrink: 0; fill: none; stroke: var(--c-text, var(--ink)); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.wg-hang-svg circle, .wg-hang-svg path:not(:first-child) { stroke: var(--c-primary, var(--brand)); }
.wg-hang-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wg-hang-word { display: flex; flex-wrap: wrap; gap: 4px; }
.wg-hang-slot { width: clamp(24px, 3.6vw, 32px); height: clamp(30px, 4.4vw, 38px); display: inline-flex; align-items: center; justify-content: center; border-bottom: 3px solid var(--line); font-style: normal; font-weight: 800; font-size: clamp(14px, 2.4vw, 20px); color: var(--muted); }
.wg-hang-slot.show { color: var(--c-text, var(--ink)); border-color: var(--c-primary, var(--brand)); }
.wg-hang-slot.miss { color: var(--danger); border-color: var(--danger); }
.wg-hang-hint { font-size: 11px; color: var(--muted); }
.wg-hang-msg { font-size: 12px; text-align: center; min-height: 16px; color: var(--muted); }
.wg-hang-msg b { color: var(--c-primary, var(--brand)); }
.wg-hang-form { display: flex; gap: 6px; }
.wg-hang-form input { flex: 1; min-width: 0; text-align: center; }
.wg-hang-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 3px; }
.wg-hang-key { height: 28px; border: 1px solid var(--line); border-radius: 5px; background: var(--c-card, var(--card)); font-size: 12px; font-weight: 700; cursor: pointer; padding: 0; color: var(--c-text, var(--ink)); }
.wg-hang-key:hover:not(:disabled) { border-color: var(--c-primary, var(--brand)); background: var(--brand-soft); }
.wg-hang-key.ok { background: #6aaa64; border-color: #6aaa64; color: #fff; }
.wg-hang-key.no { background: var(--paper); color: var(--muted); border-color: transparent; }
.wg-hang-new { align-self: center; }

/* 확장 위젯 D 애니메이션 — 모션 최소화 설정 시 전부 비활성 */
@media (prefers-reduced-motion: reduce) {
  .wg-blinkie-band, .wg-mr-minimi, .wg-shape-blob, .wg-gift.open .wg-gift-lid, .wg-gift.open .wg-gift-confetti i,
  .wg-tear-tab.tearing, .wg-wc-card.win, .wg-tt-result.pop, .wg-gacha-knob.spin, .wg-gacha-capsule.drop, .wg-gacha-name.pop,
  .wg-cho-form input.wg-cho-wrong, .wg-wd-row.shake {
    animation: none;
  }
  .wg-gift.open .wg-gift-lid { transform: translate(-10%, -120%) rotate(-38deg); }
  .wg-gacha-capsule.drop { top: 3px; }
  .wg-env-letter, .wg-env-flap, .wg-env-seal, .wg-gift-content, .wg-mole, .wg-wc-card, .wg-tt-bar i, .wg-slide-tile { transition: none; }
}
