/* ===== Thisgun Games Common Styles ===== */
.tg-game-wrap{max-width:640px;margin:0 auto;padding:20px;font-family:'Pretendard',system-ui,-apple-system,sans-serif;box-sizing:border-box}
.tg-game-wrap *,.tg-game-wrap *::before,.tg-game-wrap *::after{box-sizing:border-box}
.tg-game-wrap h2{text-align:center;margin:0 0 8px;font-size:1.6em}
.tg-game-wrap .tg-subtitle{text-align:center;color:#888;margin:0 0 24px;font-size:.95em}
.tg-btn{display:inline-block;padding:12px 28px;border:none;border-radius:8px;font-size:1em;font-weight:600;cursor:pointer;transition:all .2s;color:#fff;text-align:center}
.tg-btn:hover{transform:translateY(-1px);filter:brightness(1.1)}
.tg-btn:active{transform:translateY(0)}
.tg-btn:disabled{opacity:.5;cursor:not-allowed;transform:none}
.tg-btn-primary{background:linear-gradient(135deg,#4f46e5,#7c3aed)}
.tg-btn-success{background:linear-gradient(135deg,#059669,#10b981)}
.tg-btn-danger{background:linear-gradient(135deg,#dc2626,#ef4444)}
.tg-btn-warning{background:linear-gradient(135deg,#d97706,#f59e0b)}
.tg-btn-sm{padding:8px 16px;font-size:.85em}
.tg-card{background:#fff;border-radius:16px;box-shadow:0 4px 24px rgba(0,0,0,.08);padding:24px;margin-bottom:16px}
.tg-best-score{text-align:center;padding:8px 16px;background:#fef3c7;border-radius:8px;font-size:.9em;color:#92400e;margin-bottom:16px}
.tg-result-box{text-align:center;padding:24px;border-radius:12px;background:linear-gradient(135deg,#f0fdf4,#dcfce7);margin:16px 0}
.tg-result-box.lose{background:linear-gradient(135deg,#fef2f2,#fee2e2)}
.tg-result-box h3{margin:0 0 12px;font-size:1.4em}
.tg-result-box p{margin:4px 0;font-size:1em;color:#555}
.tg-hidden{display:none!important}

/* ===== Number Baseball ===== */
.tg-baseball{--accent:#1e3a5f;--gold:#d4a017}
.tg-baseball h2{color:var(--accent)}
.tg-baseball .tg-input-row{display:flex;gap:8px;justify-content:center;align-items:center;margin-bottom:16px}
.tg-baseball .tg-digit-input{width:56px;height:56px;text-align:center;font-size:1.6em;font-weight:700;border:2px solid #cbd5e1;border-radius:12px;outline:none;transition:border-color .2s}
.tg-baseball .tg-digit-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(30,58,95,.15)}
.tg-baseball .tg-btn-check{background:linear-gradient(135deg,var(--accent),#2d5a8e);padding:12px 32px;font-size:1.1em}
.tg-baseball .tg-history-table{width:100%;border-collapse:collapse;margin-top:12px}
.tg-baseball .tg-history-table th{background:var(--accent);color:#fff;padding:10px;font-size:.9em}
.tg-baseball .tg-history-table td{padding:10px;text-align:center;border-bottom:1px solid #e2e8f0;font-size:.95em}
.tg-baseball .tg-history-table tr:hover td{background:#f1f5f9}
.tg-baseball .tg-strike{color:#dc2626;font-weight:700}
.tg-baseball .tg-ball{color:#2563eb;font-weight:700}
.tg-baseball .tg-out{color:#9ca3af}

/* ===== Word Chain ===== */
.tg-wordchain{--accent:#059669;--light:#ecfdf5}
.tg-wordchain h2{color:var(--accent)}
.tg-wordchain .tg-chat-area{height:360px;overflow-y:auto;padding:16px;background:#f8fafc;border-radius:12px;margin-bottom:12px;display:flex;flex-direction:column;gap:8px}
.tg-wordchain .tg-chat-bubble{max-width:75%;padding:10px 16px;border-radius:16px;font-size:1em;line-height:1.4;word-break:keep-all}
.tg-wordchain .tg-chat-computer{align-self:flex-start;background:var(--light);color:#065f46;border-bottom-left-radius:4px}
.tg-wordchain .tg-chat-player{align-self:flex-end;background:var(--accent);color:#fff;border-bottom-right-radius:4px}
.tg-wordchain .tg-chat-system{align-self:center;background:#fef3c7;color:#92400e;font-size:.85em;border-radius:20px;padding:6px 16px}
.tg-wordchain .tg-input-bar{display:flex;gap:8px}
.tg-wordchain .tg-input-bar input{flex:1;padding:12px 16px;border:2px solid #d1d5db;border-radius:12px;font-size:1em;outline:none}
.tg-wordchain .tg-input-bar input:focus{border-color:var(--accent)}
.tg-wordchain .tg-timer-bar{height:6px;background:#e5e7eb;border-radius:3px;margin-bottom:12px;overflow:hidden}
.tg-wordchain .tg-timer-fill{height:100%;background:var(--accent);transition:width .1s linear;border-radius:3px}
.tg-wordchain .tg-timer-fill.danger{background:#ef4444}
.tg-wordchain .tg-score-bar{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;font-size:.9em;color:#555}

/* ===== Reaction Test ===== */
.tg-reaction{--red:#dc2626;--green:#16a34a}
.tg-reaction h2{color:#333}
.tg-reaction .tg-react-zone{width:100%;min-height:300px;border-radius:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;user-select:none;transition:background .15s;padding:24px}
.tg-reaction .tg-react-zone.waiting{background:var(--red)}
.tg-reaction .tg-react-zone.ready{background:var(--green)}
.tg-reaction .tg-react-zone.idle{background:#3b82f6}
.tg-reaction .tg-react-zone.too-early{background:#f59e0b}
.tg-reaction .tg-react-zone .tg-react-text{color:#fff;font-size:1.8em;font-weight:700;text-align:center}
.tg-reaction .tg-react-zone .tg-react-sub{color:rgba(255,255,255,.8);font-size:1em;margin-top:8px;text-align:center}
.tg-reaction .tg-round-counter{text-align:center;margin-bottom:12px;font-size:.9em;color:#666}
.tg-reaction .tg-rounds-list{margin-top:16px}
.tg-reaction .tg-rounds-list .tg-round-item{display:flex;justify-content:space-between;padding:8px 12px;border-bottom:1px solid #e5e7eb;font-size:.95em}
.tg-reaction .tg-rounds-list .tg-round-item:last-child{border-bottom:none}
.tg-reaction .tg-rating{font-size:1.3em;font-weight:700;margin:8px 0}

/* ===== Typing Test ===== */
.tg-typing{--accent:#2563eb;--bg-dark:#1e293b}
.tg-typing h2{color:var(--accent)}
.tg-typing .tg-typing-display{background:var(--bg-dark);border-radius:12px;padding:24px;margin-bottom:16px;font-family:'D2Coding','Consolas',monospace;font-size:1.2em;line-height:1.8;color:#94a3b8;min-height:80px;word-break:keep-all;letter-spacing:.02em}
.tg-typing .tg-typing-display .correct{color:#4ade80}
.tg-typing .tg-typing-display .wrong{color:#f87171;text-decoration:underline}
.tg-typing .tg-typing-display .cursor{border-left:2px solid #fff;animation:tg-blink 1s infinite}
@keyframes tg-blink{0%,100%{opacity:1}50%{opacity:0}}
.tg-typing .tg-typing-input{width:100%;padding:14px 16px;border:2px solid #cbd5e1;border-radius:12px;font-size:1.05em;outline:none;font-family:'D2Coding','Consolas',monospace}
.tg-typing .tg-typing-input:focus{border-color:var(--accent)}
.tg-typing .tg-typing-stats{display:flex;justify-content:space-around;margin:16px 0;flex-wrap:wrap;gap:8px}
.tg-typing .tg-stat-item{text-align:center;padding:12px 16px;background:#f1f5f9;border-radius:10px;min-width:100px}
.tg-typing .tg-stat-item .tg-stat-val{font-size:1.5em;font-weight:700;color:var(--bg-dark)}
.tg-typing .tg-stat-item .tg-stat-label{font-size:.8em;color:#64748b;margin-top:2px}
.tg-typing .tg-progress-bar{height:6px;background:#e2e8f0;border-radius:3px;overflow:hidden;margin-bottom:16px}
.tg-typing .tg-progress-fill{height:100%;background:var(--accent);transition:width .2s}

/* ===== Lotto Generator ===== */
.tg-lotto{--gold:#d4a017;--bg-gold:#fefce8}
.tg-lotto h2{color:#92400e}
.tg-lotto .tg-lotto-balls{display:flex;gap:10px;justify-content:center;align-items:center;flex-wrap:wrap;margin:24px 0;min-height:64px}
.tg-lotto .tg-lotto-ball{width:56px;height:56px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:1.3em;font-weight:700;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.3);box-shadow:0 4px 12px rgba(0,0,0,.15),inset 0 2px 4px rgba(255,255,255,.3);animation:tg-pop-in .4s ease-out both}
.tg-lotto .tg-lotto-ball.bonus{border:3px dashed #999;position:relative}
.tg-lotto .tg-lotto-plus{font-size:1.5em;font-weight:700;color:#9ca3af}
.tg-lotto .tg-ball-y{background:linear-gradient(135deg,#facc15,#eab308)}
.tg-lotto .tg-ball-b{background:linear-gradient(135deg,#60a5fa,#3b82f6)}
.tg-lotto .tg-ball-r{background:linear-gradient(135deg,#f87171,#ef4444)}
.tg-lotto .tg-ball-g2{background:linear-gradient(135deg,#9ca3af,#6b7280)}
.tg-lotto .tg-ball-gn{background:linear-gradient(135deg,#4ade80,#22c55e)}
@keyframes tg-pop-in{0%{transform:scale(0) rotate(-180deg);opacity:0}60%{transform:scale(1.15) rotate(10deg)}100%{transform:scale(1) rotate(0);opacity:1}}
.tg-lotto .tg-mode-select{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px;justify-content:center}
.tg-lotto .tg-mode-btn{padding:8px 16px;border:2px solid #e5e7eb;border-radius:8px;background:#fff;cursor:pointer;font-size:.9em;transition:all .2s}
.tg-lotto .tg-mode-btn.active{border-color:var(--gold);background:var(--bg-gold);color:#92400e;font-weight:600}
.tg-lotto .tg-number-picker{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:12px 0;max-height:200px;overflow-y:auto;padding:8px}
.tg-lotto .tg-pick-num{width:40px;height:40px;border-radius:50%;border:2px solid #d1d5db;background:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:.85em;font-weight:600;transition:all .2s}
.tg-lotto .tg-pick-num.selected{border-color:var(--gold);background:var(--bg-gold);color:#92400e}
.tg-lotto .tg-pick-num:hover{border-color:#999}
.tg-lotto .tg-history-section{margin-top:24px;border-top:1px solid #e5e7eb;padding-top:16px}
.tg-lotto .tg-history-section h4{margin:0 0 12px;color:#555}
.tg-lotto .tg-history-item{display:flex;gap:6px;align-items:center;margin-bottom:8px;flex-wrap:wrap}
.tg-lotto .tg-history-item .tg-mini-ball{width:32px;height:32px;border-radius:50%;font-size:.75em;font-weight:700;color:#fff;display:flex;align-items:center;justify-content:center;text-shadow:0 1px 1px rgba(0,0,0,.2)}
.tg-lotto .tg-prob-text{text-align:center;font-size:.85em;color:#9ca3af;margin-top:12px}
.tg-lotto .tg-set-divider{margin:16px 0;border:none;border-top:1px dashed #d1d5db}

/* ===== Confetti ===== */
.tg-confetti-piece{position:fixed;width:10px;height:10px;top:-10px;z-index:9999;animation:tg-confetti-fall 3s linear forwards}
@keyframes tg-confetti-fall{0%{transform:translateY(0) rotate(0);opacity:1}100%{transform:translateY(100vh) rotate(720deg);opacity:0}}

/* ===== Responsive ===== */
@media(max-width:480px){
.tg-game-wrap{padding:12px}
.tg-game-wrap h2{font-size:1.3em}
.tg-baseball .tg-digit-input{width:48px;height:48px;font-size:1.3em}
.tg-lotto .tg-lotto-ball{width:46px;height:46px;font-size:1.1em}
.tg-lotto .tg-pick-num{width:34px;height:34px;font-size:.8em}
.tg-typing .tg-typing-display{font-size:1em;padding:16px}
.tg-wordchain .tg-chat-area{height:280px}
.tg-reaction .tg-react-zone{min-height:240px}
.tg-reaction .tg-react-zone .tg-react-text{font-size:1.4em}
}
