/* gachatd.css — 지켜라 (가챠 TD) v20260516_2
 * 다크 테마 + 시각적 퀄리티 강화
 */

.gt-app {
  max-width: 900px;
  margin: 0 auto;
  padding: 8px;
  position: relative;
}

/* ===== 사이드 광고 (PC 와이드 화면) ===== */
.gt-side-ad { display: none; }
@media (min-width: 1340px) {
  .gt-side-ad {
    display: block;
    position: fixed;
    top: 80px;
    width: 200px;
    height: 600px;
    z-index: 1;
  }
  .gt-side-ad-left  { left: calc(50% - 660px); }
  .gt-side-ad-right { left: calc(50% + 460px); }
}

/* ===== PLAY 화면 — viewport 맞춤 (스크롤 없이) ===== */
#gtPlay.gt-screen.active {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: calc(100vh - 76px);
  height: calc(100dvh - 76px);
  overflow: hidden;
}
.gt-play-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
  min-width: 0;
}
.gt-play-right {
  flex: 0 0 auto;
  min-height: 0;
}
/* PC 가로 2열 */
@media (min-width: 880px) {
  /* setup/leader/result는 가운데 좁게 유지 */
  #gtSetup .gt-setup,
  #gtLeaderPick .gt-leader-pick,
  #gtResult .gt-result,
  #gtSetup .gt-info-card,
  #gtSetup #gtLbPanel {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }
  #gtPlay.gt-screen.active {
    flex-direction: row;
    gap: 12px;
  }
  .gt-play-left { flex: 1; min-width: 0; }
  .gt-play-right {
    flex: 0 0 300px;
    max-width: 300px;
    max-height: 100%;
    overflow-y: auto;
  }
}

/* ============ Screens ============ */
.gt-screen { display: none; }
.gt-screen.active { display: block; }

/* ============ Setup ============ */
.gt-setup {
  background: linear-gradient(160deg, rgba(124,106,239,.12), rgba(255,140,66,.08)), var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  margin-top: 20px;
  position: relative;
  overflow: hidden;
}
.gt-setup::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(124,106,239,.15), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,140,66,.12), transparent 40%);
  pointer-events: none;
}
.gt-setup > * { position: relative; }
.gt-setup-emoji {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(255, 209, 102, .4));
  animation: gt-emoji-bob 2.4s ease-in-out infinite;
}
@keyframes gt-emoji-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.gt-setup-title {
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #ffd166 0%, #ff8c42 50%, #ff5577 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.5px;
}
.gt-setup-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}
.gt-stage-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 20px;
  font-size: 22px;
  opacity: .9;
}
.gt-setup-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  margin-bottom: 12px;
  text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
.gt-setup-input:focus {
  outline: none;
  border-color: #7c6aef;
  box-shadow: 0 0 0 3px rgba(124,106,239,.2);
}
.gt-setup-btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #7c6aef, #5a4fcf);
  color: #fff;
  transition: transform .1s, box-shadow .15s, filter .15s;
  box-shadow: 0 6px 18px rgba(124,106,239,.35);
}
.gt-setup-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.gt-setup-btn:active { transform: translateY(0); }
.gt-setup-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  background: var(--line);
  box-shadow: none;
}
.gt-setup-btn-secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: none;
}
.gt-setup-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 14px;
  text-align: left;
  background: rgba(255,255,255,.03);
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.06);
}

/* ============ Mode Tabs (Setup) ============ */
.gt-mode-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  background: rgba(0,0,0,.25);
  padding: 4px;
  border-radius: 12px;
}
.gt-mode-tab {
  flex: 1;
  padding: 12px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
  text-align: center;
}
.gt-mode-tab:hover { color: var(--text); transform: translateY(-1px); }
.gt-mode-tab.active {
  background: linear-gradient(135deg, #7c6aef, #5a4fcf);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124,106,239,.4);
}
.gt-mode-tab-sub {
  display: block;
  font-size: 10px;
  font-weight: 600;
  opacity: .8;
  margin-top: 2px;
}

/* ============ Boss Progress (HUD — Clear Mode) ============ */
.gt-boss-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(255,77,77,.12), rgba(170,0,68,.06));
  border: 1px solid rgba(255,77,77,.3);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  color: #ff9999;
  margin-bottom: 8px;
}
.gt-boss-progress.hidden { display: none; }
.gt-boss-progress-icon { font-size: 14px; }
.gt-boss-progress-text { color: var(--text); }
.gt-boss-progress-num { color: #ffd166; font-size: 14px; }

/* ============ HUD (컴팩트) ============ */
.gt-hud {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto auto;
  gap: 4px;
  margin-bottom: 0;
  align-items: stretch;
  flex: 0 0 auto;
}
.gt-hud-cell {
  background: linear-gradient(160deg, rgba(255,255,255,.04), rgba(0,0,0,.2));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 6px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.gt-hud-cell.gold { border-color: rgba(255,209,102,.3); }
.gt-hud-cell.lives { border-color: rgba(255,77,77,.3); }
.gt-hud-cell.wave { border-color: rgba(122,207,255,.25); }
.gt-hud-label {
  font-size: 9px;
  color: var(--muted);
  margin-bottom: 1px;
  font-weight: 600;
  letter-spacing: .2px;
}
.gt-hud-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  transition: transform .15s, color .15s;
  line-height: 1.1;
}
.gt-hud-val.bump {
  transform: scale(1.2);
  color: #ffd166;
}
.gt-hud-val.bump-down {
  transform: scale(1.2);
  color: #ff5555;
}
.gt-hud-btn {
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  min-width: 38px;
  transition: background .15s, transform .1s;
}
.gt-hud-btn:hover { background: rgba(255,255,255,.1); }
.gt-hud-btn:active { transform: scale(.95); }
.gt-hud-btn.active {
  background: linear-gradient(135deg, #7c6aef, #5a4fcf);
  color: #fff;
  border-color: transparent;
}

/* ============ Boss HP Bar ============ */
.gt-boss-bar {
  background: linear-gradient(90deg, rgba(80,0,0,.6), rgba(40,0,0,.6));
  border: 1px solid #c44;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
  box-shadow: 0 0 14px rgba(255,77,77,.3);
  animation: gt-boss-pulse 1.5s ease-in-out infinite;
}
@keyframes gt-boss-pulse {
  0%, 100% { box-shadow: 0 0 14px rgba(255,77,77,.3); }
  50% { box-shadow: 0 0 22px rgba(255,77,77,.6); }
}
.gt-boss-bar-label {
  font-size: 12px;
  color: #ff9090;
  font-weight: 800;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gt-boss-bar-hp {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  opacity: .9;
}
.gt-boss-bar-track {
  height: 16px;
  background: rgba(0,0,0,.5);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255,77,77,.3);
}
.gt-boss-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff3333, #ff8c00, #ffd166);
  width: 100%;
  transition: width .15s linear;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.3);
}
/* 방패병 — 방패 HP 바 (HP 위에 추가) */
.gt-boss-shield {
  height: 10px;
  background: rgba(0,0,0,.4);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(100,180,255,.4);
  margin-bottom: 4px;
}
.gt-boss-shield.hidden { display: none; }
.gt-boss-shield-fill {
  height: 100%;
  background: linear-gradient(90deg, #5a90ff, #aaccff, #e0eaff);
  width: 100%;
  transition: width .12s linear;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.25), 0 0 8px rgba(100,180,255,.5);
}
.gt-boss-shield-label {
  font-size: 10px;
  color: #aaccff;
  font-weight: 700;
  margin-bottom: 3px;
  text-align: right;
}

/* ============ Board / Canvas (viewport fit) ============ */
.gt-board-wrap {
  background: #060911;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0,0,0,.6);
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gt-canvas {
  display: block;
  /* JS의 fitCanvas()가 width/height 직접 세팅 */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ============ Controls (컴팩트) ============ */
.gt-controls {
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,.15));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
}

.gt-gacha-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  margin-bottom: 5px;
}
.gt-gacha-btn {
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(135deg, #4d3da0, #2a2150);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s, filter .15s;
  box-shadow: 0 4px 10px rgba(0,0,0,.3);
  position: relative;
  overflow: hidden;
}
.gt-gacha-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
  transition: left .6s;
}
.gt-gacha-btn:hover::after { left: 150%; }
.gt-gacha-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.gt-gacha-btn:active { transform: translateY(0); }
.gt-gacha-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  filter: grayscale(.6);
}
.gt-gacha-btn-label {
  font-size: 14px;
  margin-bottom: 2px;
}
.gt-gacha-btn-cost {
  font-size: 11px;
  opacity: .85;
}
.gt-gacha-btn-10 {
  background: linear-gradient(135deg, #ffaa00, #cc7700);
}
.gt-gacha-btn-wave {
  background: linear-gradient(135deg, #2cb464, #1d7440);
  box-shadow: 0 4px 10px rgba(44,180,100,.3);
}
.gt-gacha-btn-wave[disabled] {
  background: linear-gradient(135deg, #555, #333);
}
/* 자동 웨이브 카운트다운 — 5초 이하 시 펄스 */
.gt-gacha-btn-wave.urgent {
  animation: gt-wave-urgent .6s ease-in-out infinite alternate;
}
@keyframes gt-wave-urgent {
  0% { box-shadow: 0 4px 10px rgba(255,170,0,.3); }
  100% { box-shadow: 0 4px 20px rgba(255,170,0,.8), 0 0 0 3px rgba(255,170,0,.3); }
}

/* ============ Leader Pick Screen ============ */
.gt-leader-pick {
  background: linear-gradient(160deg, rgba(124,106,239,.15), rgba(255,140,66,.1)), var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 18px;
  text-align: center;
  margin-top: 16px;
  position: relative;
  overflow: hidden;
}
.gt-leader-pick::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(124,106,239,.18), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(255,140,66,.14), transparent 45%);
  pointer-events: none;
}
.gt-leader-pick > * { position: relative; }
.gt-leader-pick-title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #ffd166, #ff8c42);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gt-leader-pick-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}
.gt-leader-timer {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.gt-leader-timer-num {
  font-weight: 800;
  color: #ffd166;
  font-size: 14px;
}
.gt-leader-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.gt-leader-card {
  position: relative;
  padding: 14px 10px 12px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,.1);
  background: linear-gradient(160deg, #1d2540, #0f1525);
  color: #fff;
  cursor: pointer;
  text-align: center;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  overflow: hidden;
}
.gt-leader-card::after {
  content: '';
  position: absolute;
  top: -30%; left: -30%;
  width: 60%; height: 60%;
  background: radial-gradient(circle, rgba(255,255,255,.15), transparent 70%);
  pointer-events: none;
}
.gt-leader-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0,0,0,.4);
}
.gt-leader-card.type-archer { background: linear-gradient(160deg, #1c3a55, #0d1f30); border-color: rgba(90,200,250,.4); }
.gt-leader-card.type-archer:hover { border-color: #5ac8fa; box-shadow: 0 8px 24px rgba(90,200,250,.3); }
.gt-leader-card.type-aoe { background: linear-gradient(160deg, #4a2a18, #1f1208); border-color: rgba(255,140,66,.4); }
.gt-leader-card.type-aoe:hover { border-color: #ff8c42; box-shadow: 0 8px 24px rgba(255,140,66,.3); }
.gt-leader-card.type-slow { background: linear-gradient(160deg, #2a2e60, #14172e); border-color: rgba(154,160,255,.4); }
.gt-leader-card.type-slow:hover { border-color: #9aa0ff; box-shadow: 0 8px 24px rgba(154,160,255,.3); }
.gt-leader-card.type-burst { background: linear-gradient(160deg, #4a3a14, #1f1808); border-color: rgba(255,209,102,.4); }
.gt-leader-card.type-burst:hover { border-color: #ffd166; box-shadow: 0 8px 24px rgba(255,209,102,.3); }
.gt-leader-card.type-gold { background: linear-gradient(160deg, #5a3a08, #2a1a00); border-color: rgba(255,170,0,.5); grid-column: span 2; }
.gt-leader-card.type-gold:hover { border-color: #ffaa00; box-shadow: 0 8px 24px rgba(255,170,0,.4); }
.gt-leader-card-emoji {
  font-size: 36px;
  margin-bottom: 4px;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.4));
}
.gt-leader-card-name {
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}
.gt-leader-card-bonus {
  font-size: 11px;
  color: rgba(255,255,255,.85);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 3px;
}
.gt-leader-card-extra {
  font-size: 10px;
  color: rgba(255,255,255,.6);
  line-height: 1.3;
}

/* ============ Info Card (SEO 설명 박스 — 셋업 화면 전용) ============ */
.gt-info-card {
  margin-top: 16px;
  padding: 22px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(10, 16, 28, 0.72);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  color: var(--muted);
  line-height: 1.7;
}
.gt-info-card h2 {
  font-size: 18px;
  margin: 0 0 12px;
  background: linear-gradient(135deg, #ffd166, #ff8c42);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
}
.gt-info-card h3 {
  font-size: 14px;
  color: var(--text);
  margin: 18px 0 8px;
  letter-spacing: 0.5px;
  font-weight: 800;
}
.gt-info-card p,
.gt-info-card ul,
.gt-info-card ol,
.gt-info-card dl {
  font-size: 13px;
  margin: 6px 0;
}
.gt-info-card dl {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 4px 12px;
}
.gt-info-card dt {
  color: var(--muted);
  font-weight: 700;
}
.gt-info-card dd { margin: 0; color: rgba(255,255,255,.85); }
.gt-info-card ul, .gt-info-card ol { padding-left: 20px; }
.gt-info-card li { margin-bottom: 4px; }
.gt-info-card a {
  color: #ffd166;
  text-decoration: none;
  font-weight: 700;
}
.gt-info-card a:hover { text-decoration: underline; }
.gt-info-card .seo-info-tags {
  font-size: 12px;
  color: var(--muted);
  opacity: .8;
  line-height: 1.8;
}
@media (max-width: 480px) {
  .gt-info-card { padding: 18px 14px; margin: 14px 0 0; }
  .gt-info-card dl { grid-template-columns: 80px 1fr; }
}

/* ============ Leaderboard Panel (Setup) ============ */
.gt-lb-panel {
  margin-top: 14px;
  background: linear-gradient(160deg, rgba(255,209,102,.06), rgba(124,106,239,.04)), var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 12px;
}
.gt-lb-title {
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 10px;
  color: var(--text);
  letter-spacing: -0.2px;
}
.gt-lb-tabs-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  background: rgba(0,0,0,.25);
  padding: 4px;
  border-radius: 10px;
}
.gt-lb-tab {
  flex: 1;
  padding: 7px 8px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.gt-lb-tab:hover { color: var(--text); }
.gt-lb-tab.active {
  background: linear-gradient(135deg, #7c6aef, #5a4fcf);
  color: #fff;
  box-shadow: 0 2px 6px rgba(124,106,239,.4);
}
.gt-lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gt-lb-row {
  display: grid;
  grid-template-columns: 28px 28px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
  font-size: 12px;
  transition: background .15s;
}
.gt-lb-row:hover { background: rgba(255,255,255,.06); }
.gt-lb-row:nth-child(1) { background: linear-gradient(90deg, rgba(255,215,0,.15), transparent); border-color: rgba(255,215,0,.3); }
.gt-lb-row:nth-child(2) { background: linear-gradient(90deg, rgba(180,180,200,.15), transparent); border-color: rgba(180,180,200,.25); }
.gt-lb-row:nth-child(3) { background: linear-gradient(90deg, rgba(205,127,50,.12), transparent); border-color: rgba(205,127,50,.25); }
.gt-lb-rank {
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  color: var(--muted);
}
.gt-lb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2a3144 center / cover no-repeat;
  border: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #aab;
}
.gt-lb-avatar-initial {
  background: linear-gradient(135deg, #4a4080, #2d2050);
  color: #fff;
}
.gt-lb-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.gt-lb-nick {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gt-lb-sub {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.gt-lb-score {
  text-align: right;
  font-weight: 900;
  font-size: 13px;
  color: #ffd166;
  white-space: nowrap;
}
.gt-lb-empty {
  text-align: center;
  padding: 16px 0;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}
.gt-lb-note {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
  opacity: .7;
}
.gt-lb-endless-mark {
  background: linear-gradient(135deg, #ff5588, #b04aff);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 2px;
}

/* Result 화면 — 랭크 표시 */
.gt-rank-display {
  margin-top: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(255,209,102,.12), rgba(255,140,66,.08));
  border: 1px solid rgba(255,209,102,.3);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
}
.gt-rank-display.hidden { display: none; }
.gt-rank-display.loading { color: var(--muted); font-weight: 600; }
.gt-rank-display strong {
  color: #ffd166;
  font-size: 16px;
  font-weight: 900;
}
.gt-rank-cta {
  margin-top: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(124,106,239,.15), rgba(90,79,207,.08));
  border: 1px solid rgba(124,106,239,.4);
  border-radius: 10px;
  text-align: center;
}
.gt-rank-cta.hidden { display: none; }
.gt-rank-cta-text {
  font-size: 12px;
  color: var(--text);
  margin-bottom: 8px;
}
.gt-rank-cta-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #7c6aef, #5a4fcf);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: transform .1s, filter .15s;
}
.gt-rank-cta-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }

/* ============ Shards System ============ */
.gt-shards-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  padding: 6px 10px;
  background: linear-gradient(135deg, rgba(124,106,239,.08), rgba(208,74,255,.05));
  border: 1px solid rgba(124,106,239,.25);
  border-radius: 10px;
  font-size: 12px;
}
.gt-shards-icon { font-size: 16px; }
.gt-shards-count {
  font-weight: 900;
  color: #d090ff;
  font-size: 14px;
}
.gt-shards-hint {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .2px;
  flex: 1;
  margin-left: 4px;
}
.gt-shards-btn {
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.05);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.gt-shards-btn:hover { background: rgba(255,255,255,.1); transform: translateY(-1px); }
.gt-shards-btn:active { transform: translateY(0); }
.gt-shards-btn:disabled { opacity: .4; cursor: not-allowed; }
.gt-shards-btn.exchange {
  background: linear-gradient(135deg, #b04aff, #6a1aa0);
  border-color: rgba(208,74,255,.5);
  color: #fff;
}
.gt-shards-btn.exchange:disabled { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.15); color: var(--muted); }

/* ============ Personal Best Banner (Setup) ============ */
.gt-best-banner {
  margin-top: 14px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(255,209,102,.12), rgba(255,140,66,.08));
  border: 1px solid rgba(255,209,102,.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gt-best-banner.hidden { display: none; }
.gt-best-banner-icon { font-size: 22px; }
.gt-best-banner-info { flex: 1; text-align: left; }
.gt-best-banner-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .3px;
}
.gt-best-banner-val {
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(135deg, #ffd166, #ff8c42);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gt-best-banner-sub {
  font-size: 11px;
  color: rgba(255,255,255,.7);
  text-align: right;
}

/* ============ Endless Mode Badge ============ */
.gt-endless-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  background: linear-gradient(135deg, #ff5588, #b04aff);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 6px;
  vertical-align: middle;
  letter-spacing: .5px;
  animation: gt-endless-glow 1.5s ease-in-out infinite;
}
@keyframes gt-endless-glow {
  0%, 100% { box-shadow: 0 0 4px rgba(255,85,136,.4); }
  50% { box-shadow: 0 0 12px rgba(255,85,136,.8); }
}

/* ============ New Personal Best Celebration ============ */
.gt-new-best {
  display: inline-block;
  padding: 4px 10px;
  background: linear-gradient(135deg, #ffd166, #ff8c42);
  color: #2a1a00;
  font-size: 12px;
  font-weight: 900;
  border-radius: 6px;
  margin-left: 8px;
  animation: gt-new-best-shine 1.5s ease-in-out infinite;
}
@keyframes gt-new-best-shine {
  0%, 100% { transform: rotate(-3deg) scale(1); }
  50% { transform: rotate(3deg) scale(1.05); }
}

/* ============ Merge Bar ============ */
.gt-merge-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: linear-gradient(135deg, rgba(255,209,102,.14), rgba(208,74,255,.08));
  border: 1px solid rgba(255,209,102,.35);
  border-radius: 10px;
  animation: gt-merge-pulse 2s ease-in-out infinite;
}
@keyframes gt-merge-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(255,209,102,.25); }
  50% { box-shadow: 0 0 18px rgba(255,209,102,.55); }
}
.gt-merge-bar.hidden { display: none; }
.gt-merge-bar-label {
  width: 100%;
  font-size: 11px;
  font-weight: 800;
  color: #ffd166;
  margin-bottom: 2px;
  letter-spacing: .3px;
}
.gt-merge-chip {
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.18);
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  transition: transform .1s, filter .15s, box-shadow .15s;
  background: linear-gradient(135deg, #4a4080, #2d2050);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.gt-merge-chip:hover { transform: translateY(-2px); filter: brightness(1.2); box-shadow: 0 4px 10px rgba(255,209,102,.3); }
.gt-merge-chip:active { transform: translateY(0); }
.gt-merge-chip.target-rare { background: linear-gradient(135deg, #4a90ff, #1a4080); border-color: #5a9dff; }
.gt-merge-chip.target-epic { background: linear-gradient(135deg, #b04aff, #6a1aa0); border-color: #d090ff; box-shadow: 0 4px 12px rgba(208,74,255,.4); }

/* ============ Merge Animation Overlay ============ */
.gt-merge-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
}
.gt-merge-overlay.show { opacity: 1; }
.gt-merge-overlay-inner {
  position: relative;
  width: 200px;
  height: 200px;
}
.gt-merge-piece {
  position: absolute;
  width: 60px;
  height: 72px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 2px solid rgba(255,255,255,.3);
  background: #1a2030;
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
  transition: all .55s cubic-bezier(.5,.05,.6,.5);
}
.gt-merge-overlay.show .gt-merge-piece {
  left: 70px !important;
  top: 64px !important;
  transform: scale(.4) rotate(360deg);
  opacity: 0;
}
.gt-merge-result {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 90px;
  height: 110px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, #b04aff, #6a1aa0);
  border: 3px solid #d090ff;
  box-shadow: 0 0 30px rgba(208,74,255,.7);
  opacity: 0;
  transition: all .4s cubic-bezier(.34,1.56,.64,1);
  transition-delay: .4s;
}
.gt-merge-result.golden {
  background: linear-gradient(135deg, #ffd700, #ff8a00);
  border-color: #fff8d0;
  box-shadow: 0 0 40px rgba(255,215,0,.9);
}
.gt-merge-overlay.show .gt-merge-result {
  transform: translate(-50%, -50%) scale(1.2);
  opacity: 1;
}
.gt-merge-result-label {
  font-size: 11px;
  color: rgba(255,255,255,.9);
  margin-top: 2px;
  letter-spacing: .5px;
}

/* ============ Inventory (컴팩트) ============ */
.gt-inventory {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 4px;
  min-height: 54px;
  max-height: 54px;
  padding: 4px;
  background: rgba(0,0,0,.3);
  border-radius: 8px;
  border: 1px dashed rgba(255,255,255,.08);
  scrollbar-width: thin;
}
@media (min-width: 880px) {
  /* PC: 인벤토리는 wrap + 더 큰 영역 */
  .gt-inventory {
    flex-wrap: wrap;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 60px;
    max-height: none;
    padding: 6px;
  }
}
.gt-inventory-empty {
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 16px 0;
  align-self: center;
}
.gt-inv-card {
  width: 42px;
  height: 46px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  border: 2px solid transparent;
  background: var(--bg);
  transition: transform .12s, border-color .15s, box-shadow .15s;
  position: relative;
  user-select: none;
  flex: 0 0 auto;
}
@media (min-width: 880px) {
  .gt-inv-card { width: 46px; height: 52px; font-size: 20px; }
}
.gt-inv-card:hover {
  transform: translateY(-3px) scale(1.05);
}
.gt-inv-card.selected {
  border-color: #ffd166;
  box-shadow: 0 0 16px rgba(255, 209, 102, .6), inset 0 0 12px rgba(255,209,102,.15);
  transform: translateY(-3px);
}
.gt-inv-card-name {
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 800;
  letter-spacing: .3px;
}
.gt-inv-card-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ffd166;
  color: #1a1a1a;
  font-size: 10px;
  font-weight: 900;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #2a2030;
  box-shadow: 0 2px 4px rgba(0,0,0,.4);
}
.gt-inv-card.mergeable {
  animation: gt-mergeable-glow 1.4s ease-in-out infinite;
}
@keyframes gt-mergeable-glow {
  0%, 100% { box-shadow: 0 0 6px rgba(255,209,102,.4); }
  50% { box-shadow: 0 0 16px rgba(255,209,102,.7); }
}

/* 희귀도 색상 */
.gt-rar-common {
  background: linear-gradient(135deg, #2a3144, #1a2030);
  border-color: #4a5267;
}
.gt-rar-rare {
  background: linear-gradient(135deg, #1e4a90, #0d2358);
  border-color: #5a9dff;
  box-shadow: 0 0 8px rgba(90,157,255,.2);
}
.gt-rar-rare .gt-inv-card-name { color: #8ab4ff; }
.gt-rar-epic {
  background: linear-gradient(135deg, #7a1aa0, #3a0d50);
  border-color: #d04aff;
  box-shadow: 0 0 10px rgba(208,74,255,.3);
}
.gt-rar-epic .gt-inv-card-name { color: #e090ff; }
.gt-rar-golden {
  background: linear-gradient(135deg, #ffaa00, #ff6a00);
  border-color: #ffd700;
  box-shadow: 0 0 16px rgba(255,215,0,.7);
  animation: gt-golden-shine 1.6s ease-in-out infinite;
}
.gt-rar-golden .gt-inv-card-name { color: #fff8d0; }
@keyframes gt-golden-shine {
  0%, 100% { box-shadow: 0 0 16px rgba(255,215,0,.6); }
  50% { box-shadow: 0 0 24px rgba(255,215,0,.9), 0 0 32px rgba(255,170,0,.4); }
}

/* ============ Pull Animation ============ */
@keyframes gt-pull-pop {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  60% { transform: scale(1.3) rotate(15deg); opacity: 1; }
  80% { transform: scale(.95) rotate(-3deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.gt-inv-card.pop {
  animation: gt-pull-pop .5s cubic-bezier(.34,1.56,.64,1);
}

/* ============ Result ============ */
.gt-result {
  background: linear-gradient(160deg, rgba(124,106,239,.1), rgba(255,140,66,.06)), var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  margin-top: 20px;
  position: relative;
  overflow: hidden;
}
.gt-result.victory::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,209,102,.15), transparent 60%);
  pointer-events: none;
}
.gt-result.defeat::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,77,77,.12), transparent 60%);
  pointer-events: none;
}
.gt-result > * { position: relative; }
.gt-result-emoji {
  font-size: 64px;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.4));
}
.gt-result-title {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}
.gt-result.victory .gt-result-title {
  background: linear-gradient(135deg, #ffd166, #ff8c42);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gt-result.defeat .gt-result-title {
  color: #ff7777;
}
.gt-result-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}
.gt-result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.gt-result-stat {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 12px 6px;
}
.gt-result-stat-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.gt-result-stat-val {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  margin-top: 4px;
}

/* ============ Toast ============ */
.gt-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(20,20,30,.92), rgba(0,0,0,.92));
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, top .25s cubic-bezier(.34,1.56,.64,1);
  white-space: nowrap;
  max-width: 90vw;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.gt-toast.show {
  opacity: 1;
  top: 84px;
}
.gt-toast.golden {
  background: linear-gradient(135deg, #ffd700, #ff8a00);
  color: #2a1a00;
  border-color: #fff8d0;
  box-shadow: 0 8px 24px rgba(255,170,0,.5);
}
.gt-toast.epic {
  background: linear-gradient(135deg, #b04aff, #6a1aa0);
  border-color: #d090ff;
  box-shadow: 0 8px 24px rgba(176,74,255,.4);
}

/* ============ Combo Display ============ */
.gt-combo-display {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  pointer-events: none;
  display: none;
}
.gt-combo-display.show {
  display: block;
  animation: gt-combo-pop .25s cubic-bezier(.34,1.56,.64,1);
}
.gt-combo-num {
  font-size: 32px;
  font-weight: 900;
  background: linear-gradient(135deg, #ffd166, #ff5566);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 16px rgba(255,100,100,.6);
  filter: drop-shadow(0 0 8px rgba(255,170,0,.7));
  letter-spacing: -1px;
  line-height: 1;
}
.gt-combo-label {
  font-size: 11px;
  font-weight: 800;
  color: #ffaa55;
  text-align: right;
  letter-spacing: 2px;
}
@keyframes gt-combo-pop {
  0% { transform: scale(.5) rotate(-8deg); }
  60% { transform: scale(1.15) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ============ Boss Cinematic Overlay ============ */
.gt-boss-cinematic {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,.85) 75%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .35s;
}
.gt-boss-cinematic.show { opacity: 1; }
.gt-boss-cinematic-warn {
  position: absolute;
  top: 18%;
  left: 0; right: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 8px;
  color: #ff5555;
  text-shadow: 0 0 12px rgba(255,77,77,.8);
  animation: gt-cine-warn-pulse .5s linear infinite alternate;
}
@keyframes gt-cine-warn-pulse {
  0% { opacity: .5; }
  100% { opacity: 1; }
}
.gt-boss-cinematic-emoji {
  font-size: 80px;
  filter: drop-shadow(0 6px 24px rgba(255,77,77,.7));
  animation: gt-cine-emoji-grow .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes gt-cine-emoji-grow {
  0% { transform: scale(.2) rotate(-30deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.gt-boss-cinematic-name {
  font-size: 36px;
  font-weight: 900;
  background: linear-gradient(135deg, #ffaaaa, #ff3333, #aa0000);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 20px rgba(255,0,0,.5);
  margin-top: 8px;
  letter-spacing: -1px;
  animation: gt-cine-name-slide .45s cubic-bezier(.5,0,.5,1);
}
@keyframes gt-cine-name-slide {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.gt-boss-cinematic-desc {
  font-size: 13px;
  color: rgba(255,200,200,.85);
  font-weight: 600;
  margin-top: 8px;
  max-width: 280px;
  text-align: center;
  line-height: 1.5;
}
.gt-boss-cinematic-flash {
  position: absolute;
  inset: 0;
  background: rgba(255,0,0,.3);
  opacity: 0;
  animation: gt-cine-flash .6s ease-out;
}
@keyframes gt-cine-flash {
  0% { opacity: 0; }
  10% { opacity: 1; }
  100% { opacity: 0; }
}

/* ============ Tutorial Overlay ============ */
.gt-tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(3px);
  z-index: 1800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.gt-tutorial-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.gt-tutorial-card {
  background: linear-gradient(160deg, rgba(124,106,239,.18), rgba(255,140,66,.1)), var(--card);
  border: 1px solid rgba(255,209,102,.3);
  border-radius: 16px;
  padding: 24px 22px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 12px 36px rgba(0,0,0,.6);
}
.gt-tutorial-emoji {
  font-size: 48px;
  margin-bottom: 6px;
}
.gt-tutorial-title {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffd166, #ff8c42);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gt-tutorial-steps {
  text-align: left;
  font-size: 13px;
  color: rgba(255,255,255,.85);
  line-height: 1.7;
  margin-bottom: 16px;
  background: rgba(0,0,0,.25);
  padding: 12px 14px;
  border-radius: 10px;
}
.gt-tutorial-steps strong {
  color: #ffd166;
  font-weight: 800;
}
.gt-tutorial-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #7c6aef, #5a4fcf);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .1s, filter .15s;
  box-shadow: 0 6px 16px rgba(124,106,239,.4);
}
.gt-tutorial-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }

/* ============ Critical Hit Visual ============ */
.gt-floater-crit {
  /* drawn on canvas; CSS not used for floater, but referenced for future */
}

/* ============ Wave Banner (Canvas 위 overlay) ============ */
.gt-wave-banner {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
  text-align: center;
  opacity: 0;
  transition: opacity .3s;
}
.gt-wave-banner.show {
  opacity: 1;
  animation: gt-banner-pop .6s cubic-bezier(.34,1.56,.64,1);
}
@keyframes gt-banner-pop {
  0% { transform: translate(-50%, -50%) scale(.3); }
  60% { transform: translate(-50%, -50%) scale(1.15); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
.gt-wave-banner-num {
  font-size: 56px;
  font-weight: 900;
  background: linear-gradient(135deg, #ffd166, #ff8c42);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 4px 20px rgba(255,170,0,.5);
  letter-spacing: -1px;
  filter: drop-shadow(0 0 12px rgba(255,170,0,.6));
}
.gt-wave-banner-sub {
  font-size: 14px;
  color: rgba(255,255,255,.85);
  font-weight: 700;
  letter-spacing: 2px;
  margin-top: -4px;
}
.gt-wave-banner.boss .gt-wave-banner-num {
  background: linear-gradient(135deg, #ff5555, #ff0033);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gt-wave-banner.boss .gt-wave-banner-sub {
  color: #ff9090;
  animation: gt-boss-warn 0.4s linear infinite alternate;
}
@keyframes gt-boss-warn {
  0% { opacity: .6; }
  100% { opacity: 1; }
}

/* ============ 강화 시스템 ============ */
.gt-upgrade-bar {
  display: flex;
  margin: 4px 0 6px;
}
.gt-upgrade-btn {
  flex: 1;
  background: linear-gradient(120deg, #4a3a8a, #6a4ab0);
  border: 1px solid rgba(170,140,255,.5);
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform .1s, filter .1s;
}
.gt-upgrade-btn:hover { filter: brightness(1.15); }
.gt-upgrade-btn:active { transform: scale(0.97); }

.gt-upgrade-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 4, 12, 0.85);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.gt-upgrade-modal.hidden { display: none !important; }
.gt-upgrade-card {
  background: linear-gradient(160deg, #1a1a2e, #232347);
  border: 1px solid rgba(170,140,255,.4);
  border-radius: 14px;
  padding: 20px 18px 16px;
  width: min(440px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 12px 50px rgba(0,0,0,.6);
}
.gt-upgrade-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.gt-upgrade-close:hover { background: rgba(255,255,255,.18); }
.gt-upgrade-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  background: linear-gradient(120deg, #ffd966, #ff8c42);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gt-upgrade-gold-row {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,.85);
  margin-bottom: 10px;
}
.gt-upgrade-list { display: flex; flex-direction: column; gap: 6px; }
.gt-up-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
}
.gt-up-emoji { font-size: 22px; flex: 0 0 auto; }
.gt-up-info { flex: 1 1 auto; min-width: 0; }
.gt-up-name {
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}
.gt-up-lv {
  font-size: 11px;
  color: rgba(170,140,255,.9);
  margin-left: 4px;
}
.gt-up-desc {
  font-size: 11px;
  color: rgba(255,255,255,.6);
  margin-top: 2px;
}
.gt-up-buy {
  flex: 0 0 auto;
  background: linear-gradient(120deg, #4a8a3a, #6ab04a);
  border: 1px solid rgba(140,255,170,.4);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  min-width: 92px;
  white-space: nowrap;
}
.gt-up-buy:hover { filter: brightness(1.15); }
.gt-up-buy:disabled {
  background: rgba(120,120,120,.3);
  border-color: rgba(180,180,180,.2);
  color: rgba(255,255,255,.4);
  cursor: not-allowed;
}
.gt-upgrade-hint {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,.5);
  margin-top: 10px;
}

/* ============ Mobile Tweak ============ */
@media (max-width: 420px) {
  .gt-app { padding: 8px 8px 20px; }
  .gt-setup-title { font-size: 26px; }
  .gt-hud-val { font-size: 16px; }
  .gt-hud-cell { padding: 6px; }
  .gt-hud-btn { font-size: 12px; padding: 0 6px; min-width: 32px; }
  .gt-inv-card { width: 44px; height: 54px; font-size: 19px; }
  .gt-gacha-btn-label { font-size: 13px; }
  .gt-wave-banner-num { font-size: 44px; }
}

/* 짧은 뷰포트 컴팩트 */
@media (max-height: 720px){
  .gt-setup{ padding: 14px 18px; }
  .gt-setup-emoji{ font-size: 36px; }
  .gt-setup-title{ font-size: 22px; }
  .gt-setup-sub{ font-size: 12px; margin-bottom: 8px; }
  .gt-stage-preview{ margin: 6px auto; font-size: 16px; }
  .gt-hud-val{ font-size: 15px; }
  .gt-hud-cell{ padding: 5px; }
  .gt-wave-banner-num{ font-size: 40px; }
}
@media (max-height: 560px){
  .gt-setup-emoji{ font-size: 28px; }
  .gt-setup-title{ font-size: 18px; }
  .gt-setup-sub, .gt-stage-preview{ display: none; }
}
