/* 테닝테닝 카드 놀이 전용 디자인 (pages/play-tening.html) (다른 페이지에 영향 없도록 .tg 안에서만 써요) */
.tg { --ink: #0F141C; --yellow: #FFD400; --orange: #F07D00; --purple: #7A2A9A; --mint: #26B5A6; }
.tg .tg-hero { background: var(--ink); color: #fff; padding: 48px 0 40px; position: relative; overflow: hidden; }
.tg .tg-hero::after { content: "+ + + + + + + + + + + + + + + + + + + +"; position: absolute; left: -10px; right: -10px; bottom: 8px; color: rgba(255,255,255,.08); font: 700 28px/1 sans-serif; letter-spacing: 14px; white-space: nowrap; }
.tg .tg-kicker { margin: 0 0 8px; color: var(--yellow); font-weight: 700; font-size: 15px; }
.tg .tg-title { margin: 0 0 14px; font-family: "Jua", var(--font); font-weight: 400; font-size: clamp(30px, 8vw, 48px); line-height: 1.2; }
.tg .tg-title span { color: var(--yellow); }
.tg .tg-lead { margin: 0 0 24px; color: rgba(255,255,255,.85); font-size: 16px; line-height: 1.7; }

.tg .tg-sec { padding: 56px 0; }
.tg .tg-sec-dark { background: var(--ink); color: #fff; }
.tg .tg-sec-soft { background: var(--color-surface); }
.tg .tg-num { display: inline-block; margin: 0 0 8px; padding: 4px 12px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-weight: 800; font-size: 13px; }
.tg .tg-h2 { margin: 0 0 10px; font-family: "Jua", var(--font); font-weight: 400; font-size: clamp(26px, 6.5vw, 36px); line-height: 1.25; }
.tg .tg-desc { margin: 0 0 22px; font-size: 16px; line-height: 1.7; color: var(--color-text-sub); max-width: 640px; }
.tg .tg-sec-dark .tg-desc { color: rgba(255,255,255,.78); }
.tg .tg-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.tg .tg-link { background: none; border: 0; padding: 10px 6px; color: var(--color-primary-strong); font: inherit; font-size: 15px; text-decoration: underline; cursor: pointer; }
.tg .tg-link-light { color: rgba(255,255,255,.8); }

/* 놀이 1 */
.tg .tg-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tg .tg-chip { border: 2px solid var(--ink); background: #fff; color: var(--ink); border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.tg .tg-chip.is-on { background: var(--ink); color: #fff; }
.tg .tg-table { display: flex; flex-direction: column; align-items: center; padding: 26px 12px; border-radius: 28px; background: linear-gradient(160deg, #2a1745, #12323a); }
.tg .tg-card { position: relative; width: min(260px, 72vw); aspect-ratio: 6 / 11; border: 0; padding: 0; border-radius: 18px; background: var(--ink); color: #fff; cursor: pointer; box-shadow: 0 14px 30px rgba(0,0,0,.35); font: inherit; overflow: hidden; }
@keyframes tgPulse { 50% { opacity: .45; } }
.tg .tg-card.is-open { animation: tgFlip .45s ease; }
@keyframes tgFlip { 0% { transform: rotateY(90deg) scale(.95); } 100% { transform: none; } }
.tg .tg-left { margin: 14px 0 0; color: rgba(255,255,255,.75); font-size: 14px; text-align: center; }


.tg .tg-memo { margin-top: 16px; padding: 16px; border-radius: 18px; background: var(--color-surface); display: grid; gap: 10px; }
.tg .tg-memo label { font-weight: 700; }
.tg .tg-memo small { color: var(--color-text-sub); font-weight: 400; }
.tg .tg-memo textarea { width: 100%; border: 1px solid var(--color-primary); border-radius: 12px; padding: 12px; font: inherit; font-size: 16px; resize: vertical; }
.tg .tg-memo .btn { justify-self: start; }
.tg .tg-diary { margin-top: 22px; border: 2px solid var(--color-line); border-radius: 18px; padding: 4px 16px; }
.tg .tg-diary summary { cursor: pointer; padding: 12px 0; font-weight: 800; }
.tg .tg-diary summary span { display: inline-block; min-width: 26px; padding: 2px 8px; margin-left: 6px; border-radius: 999px; background: var(--yellow); text-align: center; font-size: 13px; }
.tg .tg-diary ol { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.tg .tg-diary li { line-height: 1.5; }
.tg .tg-diary li b { display: block; }
.tg .tg-diary li span { display: block; color: var(--color-text); }
.tg .tg-diary li small { color: var(--color-text-sub); }
.tg .tg-diary .tg-empty { list-style: none; margin-left: -20px; color: var(--color-text-sub); }

/* 놀이 2 */
.tg .tg-game { background: rgba(255,255,255,.04); border-radius: 24px; padding: 16px; }
.tg .tg-players { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tg .tg-player { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.08); border: 2px solid transparent; }
.tg .tg-player.is-turn { border-color: var(--yellow); background: rgba(255,212,0,.12); }
.tg .tg-pname { font-weight: 800; font-size: 15px; }
.tg .tg-pscore { color: var(--yellow); font: 400 22px/1.1 "Jua", sans-serif; }
.tg .tg-boards { display: grid; gap: 12px; margin-top: 16px; }
@media (min-width: 760px) { .tg .tg-boards { grid-template-columns: 1fr 1fr; } }
.tg .tg-board { display: grid; gap: 6px; padding: 10px; border-radius: 16px; background: #fff; opacity: .55; transition: opacity .2s; }
.tg .tg-board.is-turn { opacity: 1; box-shadow: 0 0 0 3px var(--yellow); }
.tg .tg-line { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; padding: 3px; border: 2px solid transparent; border-radius: 8px; background: #EDEDED; cursor: default; }
.tg .tg-line.can { border-color: var(--orange); background: #FFF3E0; cursor: pointer; animation: tgPulse 1.2s ease-in-out infinite; }
.tg .tg-line.ten { background: #FFF8C4; }
.tg .tg-line:disabled { color: inherit; }
.tg .tg-cube { grid-column: span var(--n); height: 26px; border-radius: 5px; background: var(--c); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.tg .tg-hole { height: 26px; border-radius: 4px; background: #fff; border: 1px dashed #c9c9c9; }
.tg .tg-gamebar { display: flex; gap: 14px; align-items: center; margin-top: 16px; }
.tg .tg-mini { position: relative; flex: 0 0 76px; height: 120px; border-radius: 10px; background: #1c2431; display: flex; align-items: center; justify-content: center; font: 400 34px "Jua", sans-serif; color: var(--yellow); overflow: hidden; }
.tg .tg-mini.is-open { animation: tgFlip .4s ease; }
.tg .tg-say { flex: 1; font-size: 16px; line-height: 1.55; }
.tg .tg-say b { color: var(--yellow); font-size: 20px; }
.tg .tg-q { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.1); font-size: 15px; word-break: keep-all; }
.tg .tg-supers { margin-top: 14px; padding: 12px; border-radius: 16px; background: rgba(125,194,66,.18); }
.tg .tg-supers p { margin: 6px 0; font-weight: 800; }
.tg .tg-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.tg .tg-pick button { width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--c); color: #fff; font: 400 22px "Jua", sans-serif; cursor: pointer; }
.tg .tg-pick button:disabled { opacity: .25; cursor: not-allowed; }
.tg .tg-none { color: rgba(255,255,255,.7); font-size: 14px; }
.tg .tg-ask { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 15px; }
.tg .tg-ask input { width: 20px; height: 20px; }
.tg .tg-note { margin: 14px 0 0; font-size: 13px; line-height: 1.6; color: rgba(255,255,255,.6); }

/* 놀이 3 */
.tg .tg-pair { padding: 20px 14px; border-radius: 24px; background: var(--color-surface); text-align: center; }
.tg .tg-pair-q { display: flex; align-items: center; justify-content: center; gap: 8px; }
.tg .tg-pair-card { position: relative; width: 82px; height: 130px; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 14px rgba(0,0,0,.15); background: #fff; }
.tg .tg-pair-blank { display: flex; align-items: center; justify-content: center; background: #fff; border: 3px dashed var(--orange); box-shadow: none; font: 400 40px "Jua", sans-serif; color: var(--orange); }
.tg .tg-plus { font: 400 30px "Jua", sans-serif; color: var(--color-text-sub); }
.tg .tg-pair-ten { font: 400 46px "Jua", sans-serif; color: var(--ink); }
.tg .tg-bar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; max-width: 420px; margin: 20px auto 18px; }
.tg .tg-bar span { aspect-ratio: 1; border-radius: 6px; background: #fff; border: 2px dashed #cfc3b4; }
.tg .tg-bar span.on { background: var(--c); border: 0; }
.tg .tg-bar span.pair { background: var(--c2); border: 0; animation: tgPop .35s ease; }
@keyframes tgPop { 50% { transform: scale(1.25); } }
.tg .tg-pair-opts { display: flex; justify-content: center; gap: 12px; }
.tg .tg-pair-msg { margin: 16px 0 4px; font-weight: 700; font-size: 17px; min-height: 1.5em; }
.tg .tg-stars { margin: 0; min-height: 1.5em; font-size: 20px; letter-spacing: 2px; }

/* 놀이 4 + 인쇄 카드 */
.tg .tg-preview { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }
@media (min-width: 760px) { .tg .tg-preview { grid-template-columns: repeat(3, 1fr); } }

.tg .tg-buy { background: var(--color-surface); }
.tg .tg-buy-inner { display: grid; gap: 20px; align-items: center; }
.tg .tg-buy img { width: 100%; max-width: 360px; height: auto; border-radius: var(--radius-photo); }
@media (min-width: 760px) { .tg .tg-buy-inner { grid-template-columns: 360px 1fr; gap: 36px; } }

.tg .tg-printzone { display: none; }
.tg .btn:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 400px) {
  .tg .tg-cube, .tg .tg-hole { height: 22px; }
  .tg .tg-cube { font-size: 11px; }
  .tg .tg-pair-opts button { width: 74px; }
}

/* 인쇄: 버튼을 누른 때만 인쇄 영역을 보여 줘요 */
@media print {
  body.tg-printing > *:not(main) { display: none !important; }
  body.tg-printing main > *:not(.tg), body.tg-printing .tg > *:not(.tg-printzone) { display: none !important; }
  body.tg-printing .tg .tg-printzone { display: block; }
  .tp-page { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 62mm; gap: 6mm; page-break-after: always; break-after: page; }
  .tp-page:last-child { page-break-after: auto; break-after: auto; }
  .tp-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; border-style: dashed; }
  .tp-diary h1 { font-size: 22px; margin: 0 0 4px; }
  .tp-diary ol { padding-left: 20px; }
  .tp-diary li { margin-bottom: 10px; break-inside: avoid; }
  .tp-diary li b, .tp-diary li span { display: block; }
  @page { size: A4; margin: 12mm; }
}


/* ===== 실제 카드 그림 ===== */
.tg .tg-back { display: inline-block; margin-bottom: 14px; color: rgba(255,255,255,.75); font-size: 14px; text-decoration: none; }
.tg .tg-jump { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: 900px; position: relative; z-index: 1; }
.tg .tg-jump a { display: grid; grid-template-columns: 46px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px; border-radius: 16px; background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.tg .tg-jump a:first-child { grid-column: 1 / -1; background: var(--yellow); color: var(--ink); }
.tg .tg-jump a:hover { background: rgba(255,255,255,.18); }
.tg .tg-jump a:first-child:hover { background: #ffe14d; }
.tg .tg-jump img { grid-row: 1 / 3; width: 46px; height: 66px; object-fit: cover; border-radius: 6px; background: #fff; }
.tg .tg-jump b { font-size: 15px; }
.tg .tg-jump small { font-size: 12px; opacity: .8; }
@media (min-width: 760px) { .tg .tg-jump { grid-template-columns: repeat(5, 1fr); } .tg .tg-jump a:first-child { grid-column: auto; } }

.tg .tg-card { background: #fff; }
.tg .tg-card-backimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tg .tg-card-back-label { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: var(--yellow); font-weight: 700; font-size: 15px; text-shadow: 0 1px 3px #000; animation: tgPulse 1.6s ease-in-out infinite; }
.tg .tg-face { position: absolute; inset: 0; display: flex; flex-direction: column; background: #fff; }
.tg .tg-face img { flex: 1; min-height: 0; width: 100%; object-fit: cover; object-position: center; display: block; }
.tg .tg-face.is-super { background: #6DB33F; } .tg .tg-face.is-devil { background: #E53A28; }
.tg .tg-face-q { background: var(--ink); color: #fff; padding: 14px 12px 16px; min-height: 22%; display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 700; font-size: 16px; line-height: 1.45; word-break: keep-all; }

.tg .tg-mini { background: #fff; }
.tg .tg-mini img, .tg .tg-mini .tg-face img { width: 100%; height: 100%; object-fit: cover; }

/* 오늘의 카드 + 도장판 */
.tg .tg-today { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; padding: 16px; border-radius: 24px; background: #fff; box-shadow: 0 6px 18px rgba(136,106,96,.12); }
.tg .tg-today-card { position: relative; width: 120px; aspect-ratio: 400 / 607; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 14px rgba(0,0,0,.18); transform: rotate(-3deg); }
.tg .tg-today-date { margin: 0 0 6px; color: var(--color-primary-strong); font-weight: 700; font-size: 14px; }
.tg .tg-today-q { margin: 0; font-family: "Jua", var(--font); font-size: 22px; line-height: 1.35; word-break: keep-all; }
.tg .tg-today .tg-row { margin-top: 12px; }
.tg .tg-small { margin: 8px 0 0; font-size: 14px; color: var(--color-text-sub); min-height: 1.4em; }
@media (max-width: 520px) { .tg .tg-today { grid-template-columns: 1fr; justify-items: center; text-align: center; } .tg .tg-today .tg-row { justify-content: center; } }
.tg .tg-stamps-wrap { margin-top: 18px; padding: 14px; border-radius: 20px; border: 2px dashed var(--color-primary); background: #fff; }
.tg .tg-stamps-title { margin: 0 0 10px; font-weight: 800; }
.tg .tg-stamps-title span { color: var(--color-primary-strong); font-weight: 700; }
.tg .tg-stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 420px; }
.tg .tg-stamps span { aspect-ratio: 1; border-radius: 50%; border: 2px dashed #d8c9b8; display: flex; align-items: center; justify-content: center; color: #cbbba9; font-weight: 700; overflow: hidden; }
.tg .tg-stamps span.on { border: 3px solid #E53A28; background: #fff; transform: rotate(-8deg); }
.tg .tg-stamps span.on img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.tg .tg-stamps span.pop { animation: tgStamp .5s ease; }
@keyframes tgStamp { 0% { transform: scale(2.2) rotate(-20deg); opacity: 0; } 70% { transform: scale(.9) rotate(-8deg); opacity: 1; } }

/* 가족 대결 */
.tg .tg-who { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 12px; font-weight: 700; flex-wrap: wrap; }
.tg .tg-who > span { color: var(--yellow); font: 400 20px "Jua", sans-serif; }
.tg .tg-who select { margin-left: 4px; padding: 8px 10px; border-radius: 10px; border: 0; font: inherit; font-size: 15px; }
.tg .tg-supply { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: 13px; color: rgba(255,255,255,.7); }
.tg .tg-supply span { padding: 2px 7px; border-radius: 6px; background: var(--c); color: #fff; font-weight: 700; }
.tg .tg-supply span.out { opacity: .25; }
.tg .tg-pick-wide button { width: auto; padding: 0 12px; font-size: 18px; background: #3a4a5c; }
.tg .tg-rules { margin-top: 12px; font-size: 14px; color: rgba(255,255,255,.8); }
.tg .tg-rules summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.tg .tg-rules ol { margin: 6px 0 0; padding-left: 20px; line-height: 1.7; }
.tg #tg-game.is-win .tg-game { animation: tgWin .8s ease 3; }
@keyframes tgWin { 50% { box-shadow: 0 0 0 6px var(--yellow), 0 0 40px var(--yellow); } }

/* 10 짝꿍 (카드 그림) */
.tg .tg-pair-card img { width: 100%; height: 100%; object-fit: cover; }
.tg .tg-pair-opts button { width: 78px; padding: 0; overflow: hidden; aspect-ratio: 400 / 607; border-width: 4px; }
.tg .tg-pair-opts img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tg .tg-pair-opts button.ok { transform: translateY(-6px); box-shadow: 0 8px 18px rgba(0,0,0,.2); background: #fff; }

/* 인쇄 카드 */
.tp-card { position: relative; border: 2px solid var(--c); border-radius: 14px; padding: 10px 12px 10px; background: #fff; min-height: 150px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; break-inside: avoid; }
.tp-card .tp-n { position: absolute; top: 6px; left: 10px; font: 400 24px/1 "Jua", sans-serif; color: var(--c); }
.tp-card img { height: 64px; width: auto; }
.tp-card p { margin: 0; font-weight: 700; font-size: 14px; line-height: 1.45; word-break: keep-all; color: #222; }
.tp-card small { margin-top: auto; font-size: 10px; color: #999; }
@media print { .tp-card img { height: 22mm; } }
.tg [hidden] { display: none !important; }
