/* 토닷 놀이터 : 미니게임 바로가기 위젯 (한 줄짜리 작은 띠) */
.tdmg, .tdmg * { box-sizing: border-box; }
/* 카드가 많아도 칸(col) 너비를 밀어내지 않게 : 들어간 자리 너비만 씀 */
.tdmg { --tdmg-pv: 4; --tdmg-gap: 8px; display: flex; align-items: center; gap: 14px; width: 100%; min-width: 0; max-width: 100%; margin: 0 0 16px; padding: 12px 14px;
    border: 1px solid #e6ebe8; border-radius: 16px; background: #fff; box-shadow: 0 1px 4px rgba(16, 40, 28, .04); font-family: inherit; color: #1f2a24; }

/* 왼쪽 이름표 */
.tdmg-head { flex: none; display: flex; align-items: center; gap: 8px; }
.tdmg-hicon { flex: none; width: 34px; height: 34px; padding: 6px; border-radius: 10px; background: #e9f7ef; color: #13a457; animation: tdmgWiggle 4s ease-in-out infinite; }
.tdmg-hicon svg { display: block; width: 100%; height: 100%; }
.tdmg-htxt { display: flex; flex-direction: column; gap: 1px; }
.tdmg-title { margin: 0; padding: 0; border: 0; font-size: 15px; font-weight: 800; line-height: 1.25; color: #1f2a24; white-space: nowrap; }
.tdmg-en { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; line-height: 1.2; color: #13a457; white-space: nowrap; }

/* 가운데 카드 줄 */
.tdmg-view { flex: 1 1 0; width: 0; min-width: 0; overflow: hidden; padding: 4px 0 6px; margin: -4px 0 -6px; }
.tdmg-track { display: flex; gap: var(--tdmg-gap); margin: 0; padding: 0; list-style: none; transition: transform .55s cubic-bezier(.22, .61, .36, 1); will-change: transform; }
.tdmg-item { flex: 0 0 calc((100% - (var(--tdmg-pv) - 1) * var(--tdmg-gap)) / var(--tdmg-pv)); min-width: 0; margin: 0; padding: 0; list-style: none; }
.tdmg-card { display: flex; align-items: center; gap: 9px; height: 54px; padding: 0 10px 0 8px; border-radius: 12px; background: var(--bg);
    color: #1f2a24; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.tdmg-card:hover, .tdmg-card:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(16, 40, 28, .09); color: #1f2a24; text-decoration: none; outline: none; }
.tdmg-card:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.tdmg-ic { flex: none; width: 38px; height: 38px; border-radius: 10px; background: #fff; box-shadow: 0 2px 6px rgba(16, 40, 28, .07); display: flex; align-items: center; justify-content: center; }
.tdmg-ic svg { width: 27px; height: 27px; }
.tdmg-card:hover .tdmg-ic { animation: tdmgWobble .5s ease-in-out; }
.tdmg-txt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tdmg-line { display: flex; align-items: center; gap: 5px; min-width: 0; }
.tdmg-name { min-width: 0; font-size: 13.5px; font-weight: 800; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdmg-card:hover .tdmg-name { color: var(--c); }
.tdmg-badge { flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 0 5px; border-radius: 999px; background: var(--c); color: #fff; font-size: 9px; font-weight: 800; line-height: 1.6; }
.tdmg-dot { width: 4px; height: 4px; border-radius: 50%; background: #fff; animation: tdmgBlink 1.2s ease-in-out infinite; }
.tdmg-desc { font-size: 11px; line-height: 1.3; color: #66746c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 오른쪽 ‹ › */
.tdmg-nav { flex: none; display: flex; gap: 4px; }
.tdmg-nav button { width: 26px; height: 26px; padding: 0; border: 1px solid #e1e7e3; border-radius: 8px; background: #fff; color: #33413a; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s, border-color .15s; }
.tdmg-nav button:hover { border-color: #13a457; background: #13a457; color: #fff; }
.tdmg-nav svg { width: 13px; height: 13px; }

@keyframes tdmgBlink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes tdmgWiggle { 0%, 86%, 100% { transform: rotate(0); } 90% { transform: rotate(-12deg); } 95% { transform: rotate(10deg); } }
@keyframes tdmgWobble { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-10deg) scale(1.08); } 65% { transform: rotate(8deg) scale(1.08); } }

/* 태블릿 · 모바일 */
@media (max-width: 1199px) { .tdmg { --tdmg-pv: 3; } }
@media (max-width: 767px) {
    .tdmg { --tdmg-pv: 2; flex-wrap: wrap; gap: 10px; padding: 10px 12px 12px; border-radius: 14px; }
    .tdmg-hicon { width: 30px; height: 30px; padding: 5px; }
    .tdmg-htxt { flex-direction: row; align-items: baseline; gap: 6px; }
    .tdmg-nav { margin-left: auto; }
    .tdmg-view { order: 3; flex: 0 0 100%; width: 0; min-width: 100%; }
    .tdmg-card { height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
    .tdmg-track { transition: none; }
    .tdmg-hicon, .tdmg-dot { animation: none; }
}
