@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Inter:wght@400;600;700&display=swap');
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: #0D0405; color: #F5E6D0;
  display: flex; justify-content: center; align-items: center;
  min-height: 100vh; overflow: hidden;
}
#game {
  width: 540px; height: 1020px;
  background: url('../images/playing_bg.png') center/cover no-repeat;
  display: flex; flex-direction: column;
  overflow: hidden; position: relative;
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(120,50,40,0.2), 0 0 80px rgba(80,30,20,0.1), inset 0 0 80px rgba(0,0,0,0.15);
  transform-origin: center center;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; flex-shrink: 0;
  background: linear-gradient(180deg, rgba(40,8,6,0.9), rgba(25,5,4,0.85));
  border-bottom: 1px solid rgba(218,165,32,0.15);
  backdrop-filter: blur(10px);
}
.topbar .title { font-family: 'Cinzel', serif; font-size: 18px; font-weight: 700; letter-spacing: 1.5px; color: #F0D890; text-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.topbar .info { font-size: 10px; color: #A89870; display: flex; gap: 12px; font-weight: 600; }
.topbar .audio-btns { display: flex; gap: 6px; }
.audio-btn {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(218,165,32,0.12);
  border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 12px;
  color: #9A7F60; transition: all 0.2s;
}
.audio-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(218,165,32,0.2); }
.audio-btn.active { color: #F0D890; border-color: rgba(218,165,32,0.35); background: rgba(218,165,32,0.12); }
.settings-dropdown {
  position: absolute; top: 38px; right: 100px; z-index: 200;
  background: rgba(15,6,4,0.97); border: 1px solid rgba(218,165,32,0.3);
  border-radius: 10px; padding: 10px; min-width: 180px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.6);
  animation: ctpFadeIn 0.15s ease-out;
}
.sd-title { font-size: 11px; font-weight: 700; color: #DAA520; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sd-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px; cursor: pointer; border-radius: 6px; }
.sd-row:hover { background: rgba(255,255,255,0.05); }
.sd-label { font-size: 12px; color: #E8C882; }
.sd-toggle { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: rgba(255,255,255,0.06); color: #9A8A6A; }
.sd-toggle.on { background: rgba(74,222,128,0.15); color: #4ADE80; }
.btn {
  border: none; border-radius: 10px; padding: 10px 16px;
  cursor: pointer; font-size: 12px; font-weight: 700; color: #F5E6D0;
  transition: all 0.2s ease; letter-spacing: 0.2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.btn:hover { opacity: 0.95; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.35); }
.btn:active { transform: translateY(0); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.btn-green { background: linear-gradient(180deg, #8B2020, #5A0F0F); border: 1px solid rgba(180,50,50,0.25); }
.btn-blue { background: linear-gradient(180deg, #8A6F18, #5A4810); border: 1px solid rgba(180,140,30,0.25); }
.btn-orange { background: linear-gradient(180deg, #9B4F2A, #6B3A1B); border: 1px solid rgba(180,90,50,0.25); }
.btn-purple { background: linear-gradient(180deg, #6B1A1A, #3A0A0A); border: 1px solid rgba(140,30,30,0.25); }
.btn-gray { background: rgba(50,22,18,0.75); border: 1px solid rgba(255,255,255,0.06); }
.score-strip {
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 12px; flex-shrink: 0; flex-wrap: wrap; gap: 6px;
  background: linear-gradient(180deg, rgba(35,8,6,0.3), rgba(25,6,4,0.2));
}
.score-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 18px;
  background: rgba(35,10,8,0.55); border: 1px solid rgba(218,165,32,0.14);
  font-size: 11px; color: #B8986A; backdrop-filter: blur(6px);
  transition: all 0.2s;
}
.score-pill.active { background: rgba(218,165,32,0.12); border-color: rgba(218,165,32,0.35); box-shadow: 0 0 10px rgba(218,165,32,0.08); }
.score-pill .s-name { font-weight: 700; color: #F5E6D0; font-size: 12px; }
.score-pill .s-pts { font-weight: 700; color: #F0D890; font-size: 17px; text-shadow: 0 0 4px rgba(240,216,144,0.2); }
.score-pill .s-info { font-size: 9px; color: #7F6A4A; font-weight: 600; }
.score-pill .s-ring { font-size: 9px; color: #E85050; }
.lobby-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 280px; padding: 12px 16px; margin: 4px 0; border-radius: 12px;
  background: rgba(35,10,8,0.45); border: 1px solid rgba(218,165,32,0.12);
  cursor: pointer; transition: all 0.2s ease; user-select: none;
}
.lobby-toggle:hover { border-color: rgba(218,165,32,0.25); background: rgba(35,10,8,0.5); }
.lobby-toggle.active { background: rgba(218,165,32,0.10); border-color: rgba(218,165,32,0.3); }
.lobby-toggle .lt-label { font-size: 13px; font-weight: 600; color: #F5E6D0; }
.lobby-toggle .lt-desc { font-size: 10px; color: #7F6A4A; margin-top: 2px; }
.lobby-toggle .lt-switch {
  width: 40px; min-width: 40px; height: 22px; border-radius: 11px; position: relative;
  background: rgba(255,255,255,0.15); transition: background 0.2s ease; flex-shrink: 0;
  margin-left: 12px; border: 1px solid rgba(255,255,255,0.08);
}
.lobby-toggle.active .lt-switch { background: rgba(218,165,32,0.45); border-color: rgba(218,165,32,0.25); }
.lobby-toggle .lt-knob {
  width: 18px; height: 18px; border-radius: 50%; background: #F5E6D0;
  position: absolute; top: 2px; left: 2px; transition: left 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.lobby-toggle.active .lt-knob { left: 18px; }
.turn-timer-wrap {
  width: 100%; height: 6px; background: rgba(0,0,0,0.35);
  flex-shrink: 0; position: relative; overflow: hidden;
}
.turn-timer-bar {
  height: 100%; width: 100%; border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #FFD700, #E8A849);
  box-shadow: 0 0 8px rgba(255,215,0,0.3);
}
.turn-timer-bar.running {
  animation: timer-countdown 20s linear forwards;
}
@keyframes timer-countdown {
  0%   { width: 100%; background: linear-gradient(90deg, #FFD700, #E8A849); box-shadow: 0 0 8px rgba(255,215,0,0.3); }
  50%  { width: 50%;  background: linear-gradient(90deg, #E87B30, #C04040); box-shadow: 0 0 10px rgba(224,60,60,0.4); }
  75%  { width: 25%;  background: linear-gradient(90deg, #C04040, #901010); box-shadow: 0 0 12px rgba(200,30,30,0.6); }
  100% { width: 0%;   background: linear-gradient(90deg, #901010, #600808); box-shadow: 0 0 12px rgba(200,30,30,0.6); }
}
.tower-zone {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 4px 8px; position: relative; min-height: 0;
  overflow: hidden;
}
.tower-zone.opponent { justify-content: flex-start; padding-top: 2px; }
.tower-zone.player { justify-content: flex-end; padding-bottom: 2px; }
#game.players-2 .tower-zone.opponent .tower-box {
  transform: scale(1.25); transform-origin: top center;
}
#game.players-2 .tower-zone.player .tower-box {
  transform: scale(1.25); transform-origin: bottom center;
}
#game.players-3 .towers-row .tower-zone.opponent .tower-box {
  transform: scale(1.1); transform-origin: top center;
}
#game.players-3 .tower-zone.player .tower-box {
  transform: scale(1.25); transform-origin: bottom center;
}
#game.players-4 .towers-row .tower-zone.opponent .tower-box {
  transform: scale(1.1); transform-origin: top center;
}
#game.players-4 .towers-row .tower-zone.player .tower-box {
  transform: scale(1.1); transform-origin: bottom center;
}
.tower-box {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0;
  padding: 7px 9px; border-radius: 10px;
  background: rgba(25,8,6,0.4); border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.3s ease; backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02), 0 1px 2px rgba(0,0,0,0.2);
}
.tower-box.opponent-tower {
  background: rgba(40,20,30,0.45); border-color: rgba(180,100,100,0.08);
}
.tower-box.opponent-tower .tower-label {
  color: #A08080;
}
.tower-box.opponent-tower .slot {
  border-color: rgba(180,100,100,0.12);
  background: rgba(180,100,100,0.03);
}
.tower-box.target {
  background: rgba(218,165,32,0.08); border: 1px solid rgba(218,165,32,0.4);
  box-shadow: 0 0 12px rgba(218,165,32,0.12), inset 0 1px 0 rgba(255,255,255,0.02);
}
.tower-label {
  font-size: 10px; font-weight: 700; color: #A89870; margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.tower-label .pts { color: #F0D890; text-shadow: 0 0 3px rgba(240,216,144,0.15); }
.tower-row {
  display: flex; gap: 3px; margin-bottom: 2px; align-items: center;
  justify-content: center; padding: 3px 5px; border-radius: 6px;
}
.tower-row.highlighted { background: rgba(218,165,32,0.10); box-shadow: 0 0 6px rgba(218,165,32,0.08); }
.tower-row .row-stat { display: none; }
.tower-empty { color: #4F3F2A; font-size: 10px; font-style: italic; }
.towers-row {
  display: flex; justify-content: center; gap: 6px;
  flex: 1; min-height: 0; align-items: center;
}
.towers-row .tower-zone { flex: 1; padding: 2px 4px; }
.bottom-area {
  display: flex; flex: 1; min-height: 0;
}
.bottom-area .tower-zone { flex: 1; }
.side-tower {
  flex: 0 0 140px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2px; min-height: 0;
}
.side-tower .tower-box { transform: scale(0.85); transform-origin: center center; }
.center-strip {
  flex-shrink: 0; padding: 8px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: linear-gradient(180deg, rgba(30,8,6,0.25), rgba(25,6,4,0.2));
  border-top: 1px solid rgba(218,165,32,0.08);
  border-bottom: 1px solid rgba(218,165,32,0.08);
  position: relative; z-index: 2;
}
.message {
  text-align: center; font-size: 12px; color: #D4A892;
  min-height: 18px; line-height: 1.4; font-weight: 600;
}
.controls { display: flex; gap: 8px; }
.slot {
  width: 46px; height: 66px; border-radius: 8px;
  border: 1px dashed rgba(218,165,32,0.15);
  display: flex; align-items: center; justify-content: center;
  color: rgba(218,165,32,0.18); font-size: 14px;
  background: rgba(218,165,32,0.03); transition: all 0.2s ease;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.12);
}
.slot.clickable {
  cursor: pointer; background: rgba(218,165,32,0.05);
  border-color: rgba(218,165,32,0.35);
  animation: slotPulse 2s ease-in-out infinite;
}
@keyframes slotPulse {
  0%, 100% { border-color: rgba(218,165,32,0.25); }
  50% { border-color: rgba(218,165,32,0.45); }
}
.slot.clickable:hover { background: rgba(218,165,32,0.12); border-color: rgba(218,165,32,0.4); }
.card {
  border-radius: 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -ms-user-select: none; touch-action: manipulation;
  transition: all 0.2s ease; position: relative;
  overflow: hidden;
}
.card * { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.card-full {
  width: 64px; height: 90px; padding: 3px;
  border: 1px solid rgba(160,120,50,0.55);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.08);
  cursor: pointer;
}
.card-small {
  width: 46px; height: 66px; padding: 2px;
  border: 1px solid rgba(160,120,50,0.45);
  box-shadow: 0 1px 3px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
  cursor: default;
}
.card.selected {
  border-color: #F0D890;
  box-shadow: 0 0 14px rgba(240,216,144,0.5), 0 3px 10px rgba(0,0,0,0.35);
  transform: translateY(-7px) scale(1.02);
}
.card.dimmed { opacity: 0.3; cursor: default; filter: grayscale(0.25); }
.card.glowing {
  box-shadow: 0 0 12px rgba(218,165,32,0.4), 0 2px 6px rgba(0,0,0,0.35);
  border-color: #D4A45A;
  animation: cardPulse 1.5s ease-in-out infinite;
}
@keyframes cardPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(218,165,32,0.35), 0 2px 6px rgba(0,0,0,0.35); }
  50% { box-shadow: 0 0 16px rgba(218,165,32,0.55), 0 2px 6px rgba(0,0,0,0.35); }
}
.card.special-card { border-color: rgba(218,165,32,0.6); }
.card .str-badge {
  background: linear-gradient(180deg, #DD2828, #AA1818); color: #FFD700; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  z-index: 2; border: 1px solid rgba(255,80,80,0.3); position: relative;
}
.card-full .str-badge { width: 18px; height: 18px; font-size: 11px; }
.card-small .str-badge { width: 14px; height: 14px; font-size: 9px; }
.card .card-img {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 6px; z-index: 0;
}
.card-full .card-img { border-radius: 6px; }
.card-small .card-img { border-radius: 6px; }
.card .card-name {
  color: #F5E6D0; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.7);
  line-height: 1; z-index: 2; position: relative;
}
.card-full .card-name { font-size: 7px; letter-spacing: 0.3px; }
.card-small .card-name { font-size: 5px; }
.card .wt-badge {
  background: linear-gradient(180deg, #6B4420, #4A2E14); color: #FFD700; border-radius: 4px;
  padding: 0 4px; font-weight: 700; z-index: 2; position: relative;
  border: 1px solid rgba(139,105,20,0.3);
}
.card-full .wt-badge { font-size: 10px; }
.card-small .wt-badge { font-size: 8px; }
.card .special-header { color: #FFD700; font-weight: 700; text-align: center; letter-spacing: 1px; z-index: 2; position: relative; text-shadow: 0 1px 4px rgba(0,0,0,0.9); }
.card-full .special-header { font-size: 7px; margin-top: 2px; }
.card-small .special-header { font-size: 5px; }
.card .special-name { color: #E8D0B0; text-align: center; line-height: 1; font-weight: 600; z-index: 2; position: relative; text-shadow: 0 1px 4px rgba(0,0,0,0.9); }
.card-full .special-name { font-size: 6px; padding: 0 2px; }
.card-small .special-name { font-size: 4px; }
.card-tooltip {
  position: absolute; z-index: 200;
  background: linear-gradient(135deg, rgba(25,10,6,0.96), rgba(15,6,3,0.96));
  border: 1px solid rgba(218,165,32,0.4);
  border-radius: 10px; padding: 11px 14px; max-width: 190px;
  pointer-events: none; opacity: 0; transition: opacity 0.15s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,0.5), 0 0 10px rgba(218,165,32,0.08);
  backdrop-filter: blur(10px);
}
.card-tooltip.visible { opacity: 1; }
.card-tooltip .tt-name { color: #F0D890; font-weight: 700; font-size: 12px; margin-bottom: 4px; letter-spacing: 0.2px; }
.card-tooltip .tt-desc { color: #D0B090; font-size: 11px; line-height: 1.5; }
.card-tap-preview {
  position: absolute; z-index: 90;
  left: 50%; bottom: 160px;
  transform: translateX(-50%);
  width: 150px;
  display: flex; flex-direction: column; align-items: center;
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.7), 0 0 15px rgba(218,165,32,0.15);
  border: 2px solid rgba(218,165,32,0.35);
  background: rgba(15,6,4,0.95);
  animation: ctpFadeIn 0.2s ease-out;
  cursor: default;
}
@keyframes ctpFadeIn {
  0% { opacity: 0; transform: translateX(-50%) scale(0.92); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}
.ctp-img {
  width: 100%; height: 200px; object-fit: cover; display: block;
}
.ctp-info {
  width: 100%; padding: 8px 10px; text-align: center;
  background: linear-gradient(180deg, rgba(20,8,5,0.95), rgba(12,4,2,0.98));
}
.ctp-name { font-size: 13px; font-weight: 700; color: #F0D890; letter-spacing: 0.2px; }
.ctp-stats { display: flex; gap: 10px; justify-content: center; margin-top: 3px; }
.ctp-str { font-size: 11px; font-weight: 700; color: #FF6B6B; }
.ctp-wt { font-size: 11px; font-weight: 700; color: #C8A050; }
.ctp-desc { font-size: 10px; color: #D0B090; line-height: 1.4; margin: 4px 0 6px; }
.ctp-play-btn { padding: 5px 18px !important; font-size: 12px !important; margin-top: 4px; }
.stat-boosted { color: #4ADE80 !important; }
.stat-weakened { color: #F87171 !important; }
.stat-swapped { color: #A78BFA !important; }
.ctp-mod-label { font-size: 9px; color: #A89070; font-style: italic; margin-top: 2px; }
.hand-area {
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(25,8,6,0.3), rgba(25,6,4,0.2));
  padding: 8px 12px 10px; border-top: 1px solid rgba(218,165,32,0.06);
}
.hand-header {
  font-size: 10px; color: #7F6A4A; margin-bottom: 5px;
  display: flex; justify-content: space-between; align-items: center; font-weight: 600;
}
.hand-header .hint { color: #D4A45A; font-size: 9px; font-weight: 600; }
.hand-cards {
  display: flex; gap: 7px; justify-content: center; flex-wrap: wrap;
  min-height: 96px; align-items: center;
}
.hand-empty { color: #4F3F2A; font-style: italic; font-size: 11px; }
.steal-picker {
  position: absolute; inset: 0; z-index: 50;
  background: radial-gradient(ellipse at center, rgba(35,10,8,0.94), rgba(12,3,2,0.96));
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(10px);
}
.steal-picker .title { font-size: 14px; margin-bottom: 16px; color: #F0D890; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.steal-picker .cards { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.drag-ghost {
  position: fixed; z-index: 200; pointer-events: none;
  opacity: 0.90; transform: scale(1.15) rotate(-2deg);
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.6)) drop-shadow(0 0 6px rgba(218,165,32,0.2));
  transition: none;
}
.slot.drop-hover {
  background: rgba(218,165,32,0.20) !important;
  border-color: #D4A45A !important;
  box-shadow: 0 0 12px rgba(218,165,32,0.28), inset 0 0 6px rgba(218,165,32,0.08);
  animation: slotPulse 1s ease-in-out infinite;
}
.card.dragging { opacity: 0.25; }
.overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(55,10,8,0.92), rgba(10,3,2,0.96));
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; z-index: 100;
  backdrop-filter: blur(12px);
}
.overlay .icon { font-size: 60px; margin-bottom: 12px; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5)); }
.overlay .title { font-family: 'Cinzel', serif; font-size: 32px; font-weight: 700; color: #F0D890; margin-bottom: 10px; text-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 20px rgba(240,216,144,0.08); letter-spacing: 1px; }
.overlay .subtitle { font-size: 15px; color: #D0B090; margin-bottom: 8px; }
.overlay .detail { font-size: 12px; color: #7F6A4A; margin-bottom: 20px; }
.game-summary { gap: 6px; padding: 20px; }
.gs-table { width: 80%; max-width: 320px; margin: 4px 0; }
.gs-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; border-radius: 8px; margin-bottom: 3px; background: rgba(255,255,255,0.03); }
.gs-row.gs-winner { background: rgba(218,165,32,0.12); border: 1px solid rgba(218,165,32,0.2); }
.gs-name { font-size: 13px; font-weight: 600; color: #E8D0B0; }
.gs-winner .gs-name { color: #F0D890; }
.gs-score { font-size: 13px; font-weight: 700; color: #DAA520; }
.gs-towers { font-size: 11px; color: #A89870; margin-left: 8px; }
.gs-stats { display: flex; gap: 14px; margin: 4px 0; flex-wrap: wrap; justify-content: center; }
.gs-stat { font-size: 11px; color: #9A8A6A; background: rgba(255,255,255,0.04); padding: 3px 10px; border-radius: 12px; }
.gs-buttons { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 6px; }
.gs-achievements { width: 100%; margin: 8px 0 2px; padding: 8px 12px; background: rgba(218,165,32,0.06); border: 1px solid rgba(218,165,32,0.15); border-radius: 10px; }
.gs-ach-title { font-size: 11px; font-weight: 600; color: #DAA520; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; text-align: center; }
.gs-ach-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.gs-ach-row + .gs-ach-row { border-top: 1px solid rgba(255,255,255,0.04); }
.gs-ach-icon { font-size: 20px; flex-shrink: 0; }
.gs-ach-info { display: flex; flex-direction: column; }
.gs-ach-name { font-size: 12px; font-weight: 600; color: #F0D890; }
.gs-ach-desc { font-size: 10px; color: #9A8A6A; }
.mode-select {
  position: absolute; inset: 0; z-index: 110;
  background: radial-gradient(ellipse at center, rgba(50,10,8,0.95), rgba(10,3,2,0.98));
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 28px; gap: 16px;
  backdrop-filter: blur(10px);
}
.mode-select .ms-title { font-family: 'Cinzel', serif; font-size: 36px; font-weight: 700; color: #F0D890; text-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 20px rgba(240,216,144,0.1); margin-bottom: 6px; letter-spacing: 1.5px; }
.mode-select .ms-sub { font-size: 13px; color: #9A8070; margin-bottom: 12px; font-weight: 500; }
.mode-btn {
  width: 82%; max-width: 290px; padding: 18px 20px; border-radius: 12px;
  border: 1px solid rgba(218,165,32,0.25); cursor: pointer;
  text-align: center; transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
}
.mode-btn:hover { border-color: rgba(218,165,32,0.4); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.3); }
.mode-btn:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.mode-btn .mb-name { font-size: 19px; font-weight: 700; color: #F0D890; margin-bottom: 6px; }
.mode-btn .mb-desc { font-size: 11px; color: #A89870; line-height: 1.5; }
.mode-btn.classic { background: linear-gradient(135deg, rgba(100,20,18,0.5), rgba(70,10,8,0.5)); }
.mode-btn.preschool { background: linear-gradient(135deg, rgba(20,70,50,0.5), rgba(10,50,30,0.5)); }
.event-modal {
  position: absolute; inset: 0; z-index: 90;
  background: radial-gradient(ellipse at center, rgba(28,8,6,0.90), rgba(6,2,1,0.95));
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 24px; gap: 14px;
  backdrop-filter: blur(12px);
}
.event-modal .em-icon { font-size: 44px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
.event-modal .em-title { font-size: 20px; font-weight: 700; color: #F0D890; text-align: center; text-shadow: 0 2px 6px rgba(0,0,0,0.3); letter-spacing: 0.3px; }
.event-modal .em-desc { font-size: 12px; color: #D0B090; text-align: center; line-height: 1.6; max-width: 260px; }
.event-modal .em-card-img { width: 84px; height: 118px; border-radius: 10px; border: 1px solid rgba(218,165,32,0.4); object-fit: cover; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.event-modal .btn { margin-top: 8px; }
.tower-box.ring-locked {
  border: 1px solid rgba(220,60,60,0.6); background: rgba(220,60,60,0.05);
  position: relative;
  box-shadow: inset 0 0 10px rgba(220,60,60,0.06), 0 0 8px rgba(220,60,60,0.1);
}
.tower-box.ring-locked::after {
  content: "\u{1F512} Ringmastered!";
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  font-size: 9px; color: #E85050; font-weight: 700; white-space: nowrap;
  font-family: 'Inter', sans-serif; letter-spacing: 0.4px;
  background: rgba(25,4,3,0.85); padding: 2px 8px; border-radius: 6px;
  border: 1px solid rgba(220,60,60,0.3);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.mem-board {
  flex: 1; display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 5px; padding: 10px 8px;
  min-height: 0;
}
.mem-cell {
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border: 1px solid rgba(218,165,32,0.12);
  background: rgba(35,12,8,0.4);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.mem-cell.face-down:active { transform: scale(0.95); }
.mem-cell .mem-back {
  width: 100%; height: 100%; object-fit: cover; border-radius: 6px;
}
.mem-cell.face-up {
  border-color: rgba(218,165,32,0.45);
  box-shadow: 0 0 10px rgba(218,165,32,0.25), 0 2px 8px rgba(0,0,0,0.3);
}
.mem-cell.face-up .mem-front { display: flex; }
.mem-cell.face-up .mem-back { display: none; }
.mem-cell .mem-front {
  display: none; flex-direction: column; align-items: center;
  justify-content: center; width: 100%; height: 100%;
  border-radius: 6px; padding: 3px;
  background: linear-gradient(135deg, rgba(50,15,10,0.35), rgba(35,10,8,0.5));
}
.mem-cell .mem-front img {
  width: 80%; max-height: 55%; object-fit: contain; border-radius: 4px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}
.mem-cell .mem-front .mem-name {
  font-family: 'Inter', sans-serif;
  font-size: 7px; font-weight: 700; color: #F5E6D0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6); text-align: center; line-height: 1.1;
  margin-top: 2px; letter-spacing: 0.3px;
}
.mem-cell.matched {
  opacity: 0; pointer-events: none; transition: opacity 0.5s ease-out;
}
.mem-cell.empty {
  background: transparent; border-color: transparent; pointer-events: none;
  box-shadow: none;
}
.mem-score-strip {
  display: flex; justify-content: space-around; align-items: center;
  padding: 9px 12px; flex-shrink: 0;
  background: linear-gradient(180deg, rgba(30,8,6,0.35), rgba(25,6,4,0.25));
  border-bottom: 1px solid rgba(218,165,32,0.08);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.mem-score-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 14px;
  background: rgba(35,10,8,0.45); border: 1px solid rgba(218,165,32,0.12);
  font-size: 12px; color: #B8986A;
  font-family: 'Inter', sans-serif;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.mem-score-pill.active {
  background: rgba(100,40,15,0.35); border-color: rgba(218,165,32,0.3);
  box-shadow: 0 0 8px rgba(218,165,32,0.08);
}
.mem-score-pill .ms-name { font-weight: 700; color: #F5E6D0; font-size: 13px; }
.mem-score-pill .ms-pts { font-weight: 700; color: #F0D890; font-size: 18px; text-shadow: 0 0 4px rgba(240,216,144,0.15); }
.mem-turn-msg {
  text-align: center; font-size: 12px; color: #D4A892;
  padding: 7px; flex-shrink: 0;
  font-family: 'Inter', sans-serif;
  background: rgba(25,6,4,0.3);
  border-bottom: 1px solid rgba(218,165,32,0.08);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.mp-screen {
  position: absolute; inset: 0; z-index: 110;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px; gap: 18px;
  background: radial-gradient(ellipse at center, rgba(50,10,8,0.95), rgba(10,3,2,0.98));
  backdrop-filter: blur(10px);
}
.mp-screen .mp-title {
  font-family: 'Cinzel', serif; font-size: 26px; font-weight: 700; color: #F0D890;
  text-shadow: 0 2px 6px rgba(0,0,0,0.3);
  letter-spacing: 1.2px;
}
.mp-screen .mp-sub {
  font-family: 'Inter', sans-serif;
  font-size: 13px; color: #A89870; text-align: center;
  line-height: 1.5;
}
.mp-room-code {
  font-family: 'Cinzel', serif; font-size: 38px; font-weight: 700;
  letter-spacing: 8px; color: #F0D890;
  background: rgba(35,10,8,0.55); border: 1px solid rgba(218,165,32,0.3);
  border-radius: 12px; padding: 14px 28px;
  text-align: center; user-select: all;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  text-shadow: 0 0 8px rgba(240,216,144,0.2);
}
.mp-input {
  font-family: 'Cinzel', serif; font-size: 24px; font-weight: 700;
  letter-spacing: 5px; color: #F0D890;
  background: rgba(35,10,8,0.55); border: 1px solid rgba(218,165,32,0.25);
  border-radius: 10px; padding: 12px 18px;
  text-align: center; width: 210px;
  outline: none;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.mp-input::placeholder { color: rgba(168,152,112,0.3); letter-spacing: 2px; font-size: 15px; font-family: 'Inter', sans-serif; }
.mp-input:focus { border-color: rgba(218,165,32,0.45); box-shadow: 0 0 12px rgba(218,165,32,0.12), 0 2px 8px rgba(0,0,0,0.2); }
.mp-status {
  font-family: 'Inter', sans-serif;
  font-size: 12px; color: #D4A892; text-align: center;
  padding: 8px 14px; border-radius: 8px;
  background: rgba(25,6,4,0.35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(218,165,32,0.06);
  transition: color 0.3s ease;
}
.mp-status.error { color: #E85050; text-shadow: 0 0 4px rgba(232,80,80,0.15); }
.mp-status.connected { color: #6BCF6B; text-shadow: 0 0 4px rgba(107,207,107,0.15); }
.mp-waiting {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 13px; color: #C4A882;
}
.mp-spinner {
  width: 18px; height: 18px; border: 2px solid rgba(218,165,32,0.25);
  border-top-color: #FFD700; border-radius: 50%;
  animation: spin 0.8s linear infinite;
  filter: drop-shadow(0 0 4px rgba(255,215,0,0.2));
}
@keyframes spin { to { transform: rotate(360deg); } }
.mp-conn-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 10px; font-size: 10px; color: #7BFF7B;
  font-family: 'Inter', sans-serif; font-weight: 500;
}
.mp-conn-dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 4px; flex-shrink: 0;
  animation: connPulse 2s ease-in-out infinite;
}
@keyframes connPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(100,255,100,0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 3px rgba(100,255,100,0.2); }
}
@keyframes towerWobble {
  0% { transform: translateX(0) rotate(0); }
  12% { transform: translateX(-5px) rotate(-1.2deg); }
  24% { transform: translateX(5px) rotate(1.2deg); }
  36% { transform: translateX(-7px) rotate(-1.8deg); }
  48% { transform: translateX(7px) rotate(1.8deg); }
  60% { transform: translateX(-4px) rotate(-0.8deg); }
  72% { transform: translateX(3px) rotate(0.5deg); }
  84% { transform: translateX(-1px) rotate(0); opacity: 0.6; }
  92% { transform: translateY(12px) rotate(2deg); opacity: 0.3; }
  100% { transform: translateY(40px) rotate(4deg); opacity: 0; }
}
.tower-box.collapsing {
  animation: towerWobble 1s ease-in-out forwards;
  pointer-events: none;
}
.mp-disconnect-banner {
  position: absolute; top: 40px; left: 50%; transform: translateX(-50%);
  z-index: 150; padding: 8px 18px; border-radius: 10px;
  background: rgba(180,40,30,0.9); border: 1px solid rgba(255,80,60,0.5);
  color: #FFD0C0; font-family: 'Inter', sans-serif; font-size: 12px;
  font-weight: 600; text-align: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  animation: fadeInDown 0.3s ease-out;
}
@keyframes fadeInDown {
  0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.mp-opponent-hand {
  display: flex; gap: 5px; justify-content: center; padding: 5px 10px;
  flex-shrink: 0;
}
.mp-card-back {
  width: 48px; height: 64px; border-radius: 7px;
  background: url('../images/cardback.png') center/cover no-repeat;
  border: 1.5px solid rgba(218,165,32,0.25);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35), 0 0 4px rgba(218,165,32,0.08);
  transition: transform 0.2s;
}
.mp-card-back:hover { transform: translateY(-1px); }
.chat-toggle {
  position: absolute; bottom: 8px; right: 8px; z-index: 200;
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(180deg, rgba(40,8,6,0.90), rgba(25,5,4,0.85));
  border: 1px solid rgba(218,165,32,0.25);
  color: #F0D890; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}
.chat-toggle:hover { border-color: rgba(218,165,32,0.4); transform: scale(1.05); }
.chat-toggle .chat-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; border-radius: 9px;
  background: #B03020; color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  animation: chatBadgePop 0.3s ease-out;
}
@keyframes chatBadgePop {
  0% { transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.chat-panel {
  position: absolute; bottom: 52px; right: 8px; z-index: 200;
  width: 260px; max-height: 320px;
  background: rgba(20,5,4,0.92);
  border: 1px solid rgba(218,165,32,0.15);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; flex-direction: column;
  animation: chatSlideUp 0.2s ease-out;
  overflow: hidden;
}
@keyframes chatSlideUp {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
.chat-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px;
  background: linear-gradient(180deg, rgba(35,8,6,0.9), rgba(25,6,4,0.85));
  border-bottom: 1px solid rgba(218,165,32,0.1);
}
.chat-header-title { font-family: 'Cinzel', serif; font-size: 12px; color: #F0D890; font-weight: 700; letter-spacing: 0.8px; }
.chat-close {
  background: none; border: none; color: #7F6A4A; font-size: 16px;
  cursor: pointer; padding: 0 2px; transition: color 0.2s;
}
.chat-close:hover { color: #D4A45A; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 4px;
  min-height: 120px; max-height: 220px;
  scrollbar-width: thin; scrollbar-color: rgba(218,165,32,0.15) transparent;
}
.chat-msg {
  font-size: 11px; line-height: 1.4; word-wrap: break-word;
  padding: 5px 9px; border-radius: 8px;
  max-width: 90%;
}
.chat-msg.me {
  align-self: flex-end;
  background: rgba(218,165,32,0.12);
  color: #F5E6D0;
  border-bottom-right-radius: 2px;
}
.chat-msg.other {
  align-self: flex-start;
  background: rgba(255,255,255,0.05);
  color: #B8986A;
  border-bottom-left-radius: 2px;
}
.chat-msg .chat-sender { font-weight: 700; font-size: 10px; color: #F0D890; display: block; margin-bottom: 1px; }
.chat-msg.system {
  align-self: center; text-align: center;
  color: #7F6A4A; font-size: 10px; font-style: italic;
  background: none; padding: 2px 0;
}
.chat-input-row {
  display: flex; gap: 6px; padding: 8px 10px;
  border-top: 1px solid rgba(218,165,32,0.08);
  background: rgba(15,3,2,0.5);
}
.chat-input {
  flex: 1; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(218,165,32,0.12); border-radius: 8px;
  padding: 6px 10px; color: #F5E6D0; font-size: 12px;
  font-family: 'Inter', sans-serif; outline: none;
  transition: border-color 0.2s ease;
}
.chat-input::placeholder { color: #5A3F2A; }
.chat-input:focus { border-color: rgba(218,165,32,0.35); }
.chat-send {
  background: linear-gradient(180deg, #7B1A1A, #4A0A0A);
  border: 1px solid rgba(180,50,50,0.2);
  border-radius: 8px; padding: 6px 12px;
  color: #F5E6D0; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all 0.2s ease;
}
.chat-send:hover { opacity: 0.95; }
.card-preview-overlay {
  position: absolute; inset: 0; z-index: 250;
  background: rgba(5,2,1,0.85);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: previewFadeIn 0.15s ease-out;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.card-preview-overlay * { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
@keyframes previewFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
.card-preview-large {
  width: 220px; min-height: 308px; border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px;
  border: 1px solid rgba(218,165,32,0.55);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 16px rgba(218,165,32,0.12);
  position: relative; overflow: visible;
  aspect-ratio: 5 / 7;
}
.card-preview-large .cp-str {
  background: linear-gradient(180deg, #DD2828, #AA1818); color: #FFD700;
  width: 42px; height: 42px; border-radius: 50%; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,80,80,0.4);
  box-shadow: 0 3px 8px rgba(0,0,0,0.5);
}
.card-preview-large .cp-img {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  border-radius: 14px; object-fit: contain; z-index: 0;
}
.card-preview-large .cp-name {
  font-size: 16px; font-weight: 700; color: #F5E6D0; letter-spacing: 0.4px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 10px rgba(0,0,0,0.6);
  z-index: 2; position: relative;
}
.card-preview-large .cp-wt {
  background: linear-gradient(180deg, #5B3810, #3A1E0A); color: #F0D890;
  padding: 4px 16px; border-radius: 8px; font-size: 18px; font-weight: 700;
  border: 1px solid rgba(139,105,20,0.3);
}
.card-preview-large .cp-special-header {
  font-size: 11px; font-weight: 700; color: #F0D890; letter-spacing: 1.8px;
  z-index: 2; position: relative; text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.card-preview-large .cp-desc {
  font-size: 12px; color: #D0B090; text-align: center; line-height: 1.5;
  padding: 0 8px; z-index: 2; position: relative; text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.card-preview-label {
  font-size: 10px; color: #7F6A4A; font-weight: 600; letter-spacing: 0.4px;
}
.card-preview-stats {
  display: flex; gap: 24px; align-items: center; z-index: 2; position: relative;
}
.card-preview-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.card-preview-stat .stat-val { font-size: 20px; font-weight: 700; color: #F0D890; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.card-preview-stat .stat-lbl { font-size: 9px; color: #A89870; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.turn-banner {
  position: absolute; top: 50%; left: 50%; z-index: 180;
  transform: translate(-50%, -50%);
  padding: 16px 44px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(40,8,8,0.93), rgba(25,6,4,0.93));
  border: 1px solid rgba(218,165,32,0.35);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(218,165,32,0.1);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  animation: bannerSlideIn 0.3s ease-out, bannerFadeOut 0.4s ease-in 1.1s forwards;
}
@keyframes bannerSlideIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes bannerFadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
.turn-banner .tb-name {
  font-family: 'Cinzel', serif; font-size: 24px; font-weight: 700;
  color: #F0D890; text-align: center;
  text-shadow: 0 2px 6px rgba(0,0,0,0.3);
  letter-spacing: 0.8px;
}
.turn-banner .tb-sub {
  font-size: 11px; color: #A89870; text-align: center; margin-top: 4px;
  font-weight: 500;
}
.match-history {
  margin-top: 8px; padding: 8px 14px; border-radius: 10px;
  background: rgba(30,10,8,0.5); border: 1px solid rgba(218,165,32,0.15);
  max-width: 280px; text-align: center;
}
.match-history .mh-title {
  font-size: 11px; color: #FFD700; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 4px;
}
.match-history .mh-row {
  font-size: 11px; color: #C4A882; line-height: 1.6;
}
.match-history .mh-row .mh-wins { color: #FFD700; font-weight: 700; }
.achievements-screen {
  position: absolute; inset: 0; z-index: 110;
  background: radial-gradient(ellipse at center, rgba(50,10,8,0.95), rgba(10,3,2,0.98));
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 16px; gap: 8px;
  overflow-y: auto;
  backdrop-filter: blur(10px);
}
.achievements-screen .ach-title {
  font-family: 'Cinzel', serif; font-size: 26px; font-weight: 700;
  color: #F0D890; letter-spacing: 1.5px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.achievements-screen .ach-sub {
  font-size: 11px; color: #7F6A4A; margin-bottom: 6px; font-weight: 500;
}
.ach-card {
  width: 92%; max-width: 320px; padding: 11px 14px;
  border-radius: 10px; display: flex; align-items: center; gap: 11px;
  border: 1px solid rgba(218,165,32,0.1);
  transition: all 0.2s ease;
}
.ach-card.locked {
  background: rgba(15,5,4,0.4); opacity: 0.55;
}
.ach-card.unlocked {
  background: rgba(218,165,32,0.08); border-color: rgba(218,165,32,0.3);
  opacity: 1;
  box-shadow: 0 0 8px rgba(218,165,32,0.08);
}
.ach-card .ach-icon { font-size: 28px; flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
.ach-card.locked .ach-icon { filter: grayscale(0.7) drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
.ach-card .ach-info { flex: 1; }
.ach-card .ach-name { font-size: 12px; font-weight: 700; color: #F0D890; margin-bottom: 2px; }
.ach-card.locked .ach-name { color: #7F6A4A; }
.ach-card .ach-desc { font-size: 10px; color: #B8986A; line-height: 1.4; }
.ach-card.locked .ach-desc { color: #4F3F2A; }
.ach-card .ach-check { font-size: 18px; flex-shrink: 0; }
.ach-toast {
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%);
  z-index: 220; padding: 11px 18px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(40,10,8,0.94), rgba(22,5,3,0.94));
  border: 1px solid rgba(218,165,32,0.3);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 12px rgba(218,165,32,0.08);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.3s ease-out, bannerFadeOut 0.5s ease-in 2.5s forwards;
  pointer-events: none;
}
.ach-toast .at-icon { font-size: 24px; }
.ach-toast .at-text { font-size: 11px; color: #D4A892; font-weight: 600; }
.ach-toast .at-name { font-size: 13px; color: #F0D890; font-weight: 700; display: block; }
@keyframes toastIn {
  0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes fadeInOut {
  0% { opacity: 0; }
  15% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; }
}
.match-history {
  margin-top: 8px; padding: 8px 14px; border-radius: 10px;
  background: rgba(25,6,4,0.35); border: 1px solid rgba(218,165,32,0.1);
  max-width: 280px; text-align: center;
}
.match-history .mh-title {
  font-size: 11px; color: #F0D890; font-weight: 700; letter-spacing: 0.4px; margin-bottom: 4px;
}
.match-history .mh-row {
  font-size: 11px; color: #B8986A; line-height: 1.6;
}
.match-history .mh-row .mh-wins { color: #F0D890; font-weight: 700; }
.log-toggle {
  position: absolute; bottom: 8px; left: 8px; z-index: 200;
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(180deg, rgba(40,8,6,0.90), rgba(25,5,4,0.85));
  border: 1px solid rgba(218,165,32,0.25);
  color: #F0D890; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}
.log-toggle:hover { border-color: rgba(218,165,32,0.4); transform: scale(1.05); }
.log-panel {
  position: absolute; bottom: 52px; left: 8px; z-index: 200;
  width: 280px; max-height: 320px;
  background: rgba(20,5,4,0.92);
  border: 1px solid rgba(218,165,32,0.15);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; flex-direction: column;
  animation: chatSlideUp 0.2s ease-out;
  overflow: hidden;
}
.log-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px;
  background: linear-gradient(180deg, rgba(35,8,6,0.9), rgba(25,6,4,0.85));
  border-bottom: 1px solid rgba(218,165,32,0.1);
}
.log-header-title { font-family: 'Cinzel', serif; font-size: 12px; color: #F0D890; font-weight: 700; letter-spacing: 0.8px; }
.log-close {
  background: none; border: none; color: #7F6A4A; font-size: 16px;
  cursor: pointer; padding: 0 2px; transition: color 0.2s;
}
.log-close:hover { color: #D4A45A; }
.log-messages {
  flex: 1; overflow-y: auto; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px;
  min-height: 120px; max-height: 270px;
  scrollbar-width: thin; scrollbar-color: rgba(218,165,32,0.15) transparent;
}
.log-entry {
  font-size: 10px; line-height: 1.4; color: #B8986A;
  padding: 3px 0;
  border-bottom: 1px solid rgba(218,165,32,0.04);
}
.log-entry:last-child { border-bottom: none; }
.auth-form {
  width: 82%; max-width: 290px;
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px 22px; border-radius: 12px;
  background: rgba(35,10,8,0.55);
  border: 1px solid rgba(218,165,32,0.2);
  backdrop-filter: blur(6px);
}
.auth-label {
  font-size: 11px; color: #A89870; font-weight: 700; letter-spacing: 0.4px; margin-bottom: -3px;
}
.auth-input {
  width: 100%; padding: 10px 14px; border-radius: 8px;
  border: 1px solid rgba(218,165,32,0.2);
  background: rgba(0,0,0,0.25); color: #F5E6D0;
  font-family: 'Inter', sans-serif; font-size: 15px;
  outline: none; transition: border-color 0.2s ease;
}
.auth-input::placeholder { color: rgba(168,152,112,0.35); }
.auth-input:focus { border-color: rgba(218,165,32,0.4); background: rgba(0,0,0,0.3); }
.auth-error {
  font-size: 11px; color: #E85050; min-height: 14px; font-weight: 600; text-align: center;
}
.auth-btn {
  width: 100%; padding: 10px 14px !important; font-size: 13px !important;
  text-align: center; margin-top: 2px;
  border-radius: 10px !important;
}
.auth-btn-secondary {
  background: rgba(255,255,255,0.06) !important; border: 1px solid rgba(218,165,32,0.15) !important;
}
.auth-btn-secondary:hover { background: rgba(255,255,255,0.09) !important; }
.auth-guest {
  font-size: 12px; color: #7F6A4A; cursor: pointer; margin-top: 8px;
  text-decoration: underline; transition: color 0.2s ease;
}
.auth-guest:hover { color: #A89870; }
.pwa-install-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 10px; padding: 10px 20px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, rgba(218,165,32,0.15), rgba(218,165,32,0.08));
  border: 1px solid rgba(218,165,32,0.25); color: #F0D890;
  font-size: 13px; font-weight: 600; transition: all 0.2s ease;
  position: relative;
}
.pwa-install-banner:hover { background: rgba(218,165,32,0.2); border-color: rgba(218,165,32,0.4); }
.pwa-install-banner.pwa-ios { cursor: default; font-weight: 400; font-size: 12px; }
.pwa-install-banner.pwa-ios strong { font-weight: 700; color: #FFE4A0; }
.pwa-icon { font-size: 18px; }
.pwa-dismiss { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: 0.5; padding: 4px 6px; cursor: pointer; }
.pwa-dismiss:hover { opacity: 1; }
.mp-conn-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.70); z-index: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; backdrop-filter: blur(8px);
}
.mp-conn-overlay .conn-icon { font-size: 36px; animation: connPulse 1.5s infinite ease-in-out; }
@keyframes connPulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
.mp-conn-overlay .conn-msg { font-size: 14px; color: #F5E6D0; font-weight: 600; text-align: center; }
.mp-conn-overlay .conn-sub { font-size: 11px; color: #A89870; text-align: center; }
.mp-conn-overlay .conn-bar { width: 160px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.08); overflow: hidden; }
.mp-conn-overlay .conn-bar-fill { height: 100%; border-radius: 2px; background: #D4A45A; transition: width 0.3s ease; }
.mp-conn-dot.connected { background: #45BA45; box-shadow: 0 0 4px rgba(69,186,69,0.5); }
.mp-conn-dot.reconnecting { background: #E89030; animation: connPulse 1s infinite ease-in-out; }
.mp-conn-dot.disconnected { background: #D84040; }
.user-badge {
  font-size: 9px; color: #A89870; opacity: 0.85; cursor: pointer;
  display: flex; align-items: center; gap: 3px;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.user-badge:hover { color: #F0D890; opacity: 1; }
.profile-screen { gap: 10px !important; padding: 18px 14px !important; }
.profile-header { text-align: center; margin-bottom: 4px; }
.profile-header .ms-title { font-size: 28px !important; margin-bottom: 4px; color: #F0D890 !important; }
.profile-summary { display: flex; gap: 10px; justify-content: center; width: 92%; max-width: 320px; margin-bottom: 4px; }
.profile-stat-box { flex: 1; text-align: center; padding: 11px 8px; border-radius: 10px; background: rgba(35,10,8,0.45); border: 1px solid rgba(218,165,32,0.12); }
.profile-stat-num { font-size: 23px; font-weight: 800; color: #F0D890; display: block; }
.profile-stat-label { font-size: 9px; color: #A89870; text-transform: uppercase; letter-spacing: 0.6px; }
.stat-card {
  width: 92%; max-width: 320px; padding: 15px 16px;
  border-radius: 10px; background: rgba(35,10,8,0.4);
  border: 1px solid rgba(218,165,32,0.12);
}
.stat-card-title {
  font-size: 13px; font-weight: 700; color: #F0D890; margin-bottom: 10px;
  letter-spacing: 0.4px;
}
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; font-size: 11px; color: #A89870;
  border-bottom: 1px solid rgba(218,165,32,0.05);
}
.stat-row:last-child { border-bottom: none; }
.stat-val { color: #F5E6D0; font-weight: 700; }
.win-rate-bar { width: 100%; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.06); margin-top: 4px; overflow: hidden; }
.win-rate-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #D4A45A, #F0D890); transition: width 0.5s ease; }
.ach-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 92%; max-width: 320px; }
.ach-cell { text-align: center; padding: 8px 4px; border-radius: 10px; background: rgba(30,8,6,0.35); border: 1px solid rgba(218,165,32,0.08); transition: transform 0.15s ease; }
.ach-cell.unlocked { background: rgba(140,100,20,0.15); border-color: rgba(218,165,32,0.25); }
.ach-cell.locked { opacity: 0.4; filter: grayscale(0.5); }
.ach-cell .ach-icon { font-size: 22px; display: block; margin-bottom: 2px; }
.ach-cell .ach-name { font-size: 8px; color: #A89870; line-height: 1.2; display: block; }
.ach-cell.unlocked .ach-name { color: #F5E6D0; }
.ach-tooltip { position: fixed; z-index: 999; padding: 9px 12px; border-radius: 8px; background: rgba(15,4,2,0.95); border: 1px solid rgba(218,165,32,0.25); color: #F5E6D0; font-size: 11px; max-width: 200px; pointer-events: none; backdrop-filter: blur(10px); }
.ach-tooltip .att-name { font-weight: 700; color: #F0D890; display: block; margin-bottom: 2px; }
.stat-mode-tabs { display: flex; gap: 4px; width: 92%; max-width: 320px; flex-wrap: wrap; justify-content: center; margin-bottom: 4px; }
.stat-mode-tab { padding: 5px 10px; border-radius: 8px; font-size: 10px; cursor: pointer; background: rgba(255,255,255,0.04); color: #A89870; border: 1px solid rgba(218,165,32,0.08); transition: all 0.15s ease; }
.stat-mode-tab.active { background: rgba(140,100,20,0.15); color: #F0D890; border-color: rgba(218,165,32,0.25); }
.stat-mode-tab:hover { background: rgba(255,255,255,0.06); }
.lb-table { width: 92%; max-width: 340px; display: flex; flex-direction: column; gap: 0; border-radius: 10px; overflow: hidden; border: 1px solid rgba(218,165,32,0.15); background: rgba(20,8,4,0.4); }
.lb-row { display: flex; align-items: center; padding: 9px 12px; border-bottom: 1px solid rgba(218,165,32,0.06); }
.lb-row:last-child { border-bottom: none; }
.lb-header { background: rgba(140,100,20,0.12); font-size: 10px; color: #A89870; text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 12px; }
.lb-me { background: rgba(218,165,32,0.08); }
.lb-rank { width: 32px; text-align: center; font-size: 14px; flex-shrink: 0; }
.lb-header .lb-rank { font-size: 10px; }
.lb-name { flex: 1; font-size: 13px; color: #F5E6D0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-highlight { color: #F0D890; font-weight: 700; }
.lb-rating { width: 55px; text-align: right; font-size: 13px; color: #F0D890; font-weight: 600; flex-shrink: 0; }
.lb-record { width: 48px; text-align: right; font-size: 11px; color: #A89870; flex-shrink: 0; }
.lb-my-rating { text-align: center; font-size: 12px; color: #B8986A; margin-top: 10px; }
.lb-my-rating strong { color: #F0D890; font-size: 16px; }
.tut-overlay {
  position: absolute; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.35);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 100px;
  animation: tutFadeIn 0.3s ease;
}
.tut-overlay.tut-bottom {
  align-items: flex-end; padding-top: 0; padding-bottom: 120px;
  background: rgba(0,0,0,0.25);
}
.tut-overlay.tut-passthrough {
  pointer-events: none;
}
.tut-overlay.tut-passthrough .tut-bubble {
  pointer-events: auto;
}
@keyframes tutFadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }
.tut-bubble {
  background: linear-gradient(160deg, rgba(40,10,8,0.95), rgba(25,6,4,0.95));
  border: 1px solid rgba(218,165,32,0.35);
  border-radius: 14px; padding: 22px 24px; max-width: 88%; width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(218,165,32,0.08);
  text-align: center;
  backdrop-filter: blur(12px);
}
.tut-counter {
  font-size: 9px; color: #6F5F3F; text-transform: uppercase; letter-spacing: 1.2px;
  margin-bottom: 8px; font-weight: 600;
}
.tut-msg {
  font-size: 14px; line-height: 1.6; color: #F5E6D0; margin-bottom: 16px;
}
.tut-btn {
  display: inline-block; padding: 10px 28px; border-radius: 10px; border: 1px solid rgba(218,165,32,0.3);
  background: linear-gradient(180deg, rgba(140,100,20,0.2), rgba(100,70,10,0.15));
  color: #F0D890; font-size: 13px; font-weight: 700; cursor: pointer;
  letter-spacing: 0.4px; transition: all 0.2s ease;
}
.tut-btn:active { transform: scale(0.96); background: rgba(140,100,20,0.3); }
.tut-hint {
  font-size: 13px; color: #D4A892; font-weight: 600;
  animation: tutPulse 1.5s ease-in-out infinite;
}
@keyframes tutPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.tut-skip {
  margin-top: 14px; font-size: 11px; color: #6F5F3F; cursor: pointer;
  text-decoration: underline; transition: color 0.2s ease;
}
.tut-skip:hover { color: #A89870; }
.tut-highlight {
  position: relative; z-index: 501; pointer-events: auto;
  box-shadow: 0 0 0 3px rgba(218,165,32,0.4), 0 0 20px rgba(218,165,32,0.2) !important;
  border-radius: 8px;
}
.vfx-screen-flash {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 9998; pointer-events: none; opacity: 0;
  transition: opacity 0.08s ease-in;
}
.vfx-screen-flash.active { opacity: 1; }
@keyframes cardSnap {
  0% { transform: scale(1); }
  40% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.tower-box.card-snap {
  animation: cardSnap 0.3s ease-out;
}
.card-slide-in {
  animation: cardSlideIn 0.25s ease-out;
}
@keyframes cardSlideIn {
  0% { opacity: 0; transform: translateY(-12px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes scorePop {
  0% { transform: scale(1); }
  30% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.score-pill .s-pts.score-pop {
  animation: scorePop 0.4s ease-out;
}
.score-float {
  position: fixed; z-index: 9999; pointer-events: none;
  font-family: 'Inter', sans-serif; font-weight: 800; font-size: 16px;
  transform: translate(-50%, 0); opacity: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  transition: all 0.9s ease-out;
}
.score-float.positive { color: #66DD66; }
.score-float.negative { color: #E85050; }
.score-float.animate {
  transform: translate(-50%, -35px); opacity: 0;
}
.ai-speech-bubble {
  position: absolute; top: 35px; left: 50%; transform: translateX(-50%) translateY(-8px);
  z-index: 180; display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 14px;
  background: rgba(30,10,5,0.92); border: 1px solid rgba(218,165,32,0.25);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 8px rgba(218,165,32,0.08);
  opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 80%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ai-speech-bubble.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.ai-sb-icon { font-size: 18px; flex-shrink: 0; }
.ai-sb-text {
  font-family: 'Inter', sans-serif; font-size: 12px; color: #F0D890;
  font-style: italic; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis;
}
.hover-ghost-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 36px; height: 48px; border-radius: 5px;
  background: rgba(218,165,32,0.12); border: 1.5px dashed rgba(218,165,32,0.4);
  font-size: 6px; color: rgba(218,165,32,0.6); text-align: center;
  opacity: 0.7; animation: ghostPulse 1s ease-in-out infinite;
  overflow: hidden;
}
.hover-ghost-card .hg-img {
  width: 26px; height: 26px; object-fit: contain; opacity: 0.4;
}
@keyframes ghostPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}
.hover-info {
  position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%);
  font-family: 'Inter', sans-serif; font-size: 8px; font-weight: 700;
  padding: 1px 6px; border-radius: 4px; white-space: nowrap;
  z-index: 10;
}
.hover-info.safe { background: rgba(60,140,60,0.25); color: #80DD80; border: 1px solid rgba(60,140,60,0.3); }
.hover-info.danger { background: rgba(200,50,40,0.25); color: #FF8080; border: 1px solid rgba(200,50,40,0.3); }
.row-stats {
  display: flex; gap: 4px; margin-left: 3px; align-items: center;
  font-family: 'Inter', sans-serif;
}
.row-stats .rs-str {
  font-size: 8px; color: #6A9A6A; font-weight: 700;
  background: rgba(60,140,60,0.1); padding: 0 3px; border-radius: 3px;
}
.row-stats .rs-wt {
  font-size: 8px; color: #C89040; font-weight: 700;
  background: rgba(200,144,64,0.1); padding: 0 3px; border-radius: 3px;
}
.row-stats .rs-danger {
  font-size: 8px; color: #E85050; font-weight: 700;
}
.ai-thinking-dots {
  display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle;
}
.ai-thinking-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #C89040; opacity: 0.3;
  animation: aiDotPulse 1.4s ease-in-out infinite;
}
.ai-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiDotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}
.discard-viewer-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.discard-viewer {
  background: rgba(30,12,10,0.95); border: 1px solid rgba(218,165,32,0.3);
  border-radius: 14px; padding: 16px; max-width: 340px; width: 90%;
  max-height: 70vh; display: flex; flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.discard-viewer-title {
  font-size: 14px; font-weight: 700; color: #D4A060;
  text-align: center; margin-bottom: 10px; letter-spacing: 0.5px;
}
.discard-viewer-list {
  overflow-y: auto; display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center; padding: 4px;
}
.discard-viewer-empty {
  color: #6A5A4A; font-style: italic; font-size: 12px;
  text-align: center; padding: 20px 0;
}
.discard-viewer-close {
  margin-top: 10px; text-align: center;
}
.info .disc-count {
  cursor: pointer; border-bottom: 1px dotted rgba(218,165,32,0.3);
  transition: color 0.2s;
}
.info .disc-count:hover { color: #F0D890; }
.card-boosted { box-shadow: 0 0 8px rgba(60,200,60,0.4), inset 0 0 6px rgba(60,200,60,0.1) !important; }
.card-weakened { box-shadow: 0 0 8px rgba(200,60,60,0.4), inset 0 0 6px rgba(200,60,60,0.1) !important; }
.card-swapped { box-shadow: 0 0 8px rgba(180,120,255,0.4), inset 0 0 6px rgba(180,120,255,0.1) !important; }
.str-badge.boosted { color: #60DD60 !important; text-shadow: 0 0 4px rgba(60,200,60,0.4); }
.str-badge.weakened { color: #E85050 !important; text-shadow: 0 0 4px rgba(200,60,60,0.4); }
.wt-badge.swapped { color: #B080FF !important; text-shadow: 0 0 4px rgba(180,120,255,0.4); }
.card-pending {
  animation: cardPendingPulse 1.2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(255,200,60,0.6), 0 0 20px rgba(255,200,60,0.3) !important;
  border: 2px solid rgba(255,200,60,0.7) !important;
}
@keyframes cardPendingPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255,200,60,0.5), 0 0 16px rgba(255,200,60,0.2); }
  50% { box-shadow: 0 0 14px rgba(255,200,60,0.8), 0 0 28px rgba(255,200,60,0.4); }
}
.btn-confirm-play {
  background: linear-gradient(180deg, #2A8A3A, #1A5A25);
  border: 1px solid rgba(60,200,80,0.3);
  color: #E0FFE0;
  font-weight: 700;
}
.draft-screen {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 8px; height: 100%; box-sizing: border-box;
  background: radial-gradient(ellipse at 50% 30%, rgba(100,30,130,0.2) 0%, rgba(40,15,60,0.1) 60%, transparent 100%);
}
.draft-header { text-align: center; margin-bottom: 4px; flex-shrink: 0; }
.draft-title {
  font-family: 'Cinzel', serif; font-size: 22px; font-weight: 700;
  color: #D080E8; text-shadow: 0 2px 12px rgba(200,112,216,0.4), 0 0 30px rgba(160,60,200,0.15);
  letter-spacing: 3px;
}
.draft-subtitle { font-size: 11px; color: #B8A880; margin-top: 2px; letter-spacing: 1px; }
.draft-counters {
  display: flex; gap: 10px; justify-content: center; margin: 6px 0; flex-shrink: 0;
}
.draft-counter {
  text-align: center; padding: 6px 14px;
  background: rgba(255,255,255,0.04); border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.3s; min-width: 70px;
}
.draft-counter.clickable { cursor: pointer; }
.draft-counter.clickable:hover { border-color: rgba(218,165,32,0.5); background: rgba(218,165,32,0.08); }
.draft-counter.active {
  border-color: rgba(200,112,216,0.6);
  background: rgba(200,112,216,0.14);
  box-shadow: 0 0 14px rgba(200,112,216,0.25), inset 0 0 12px rgba(200,112,216,0.06);
}
.draft-counter.pool { border-color: rgba(218,165,32,0.2); }
.dc-label { font-size: 10px; color: #A89870; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.dc-count { font-size: 18px; font-weight: 700; color: #F5E6D0; margin-top: 1px; }
.draft-message {
  font-size: 13px; color: #DAA520; text-align: center;
  margin: 4px 0 6px; min-height: 18px; font-weight: 600; flex-shrink: 0;
  text-shadow: 0 1px 6px rgba(218,165,32,0.15);
}
.draft-grid-wrap {
  display: grid;
  grid-template-columns: 30px repeat(4, 1fr);
  gap: 3px;
  justify-content: center;
  flex: 1; min-height: 0;
  width: 100%; max-width: 480px;
  align-content: center;
}
.draft-col-btns { display: contents; }
.draft-grid-row { display: contents; }
.draft-pick-btn {
  font-size: 15px; cursor: pointer; border: 1px solid rgba(200,112,216,0.2); border-radius: 8px;
  color: #C870D8; background: rgba(200,112,216,0.1);
  transition: all 0.2s; display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.draft-pick-btn.row { min-height: 0; }
.draft-pick-btn.col { height: 26px; }
.draft-pick-btn:hover:not(.disabled) {
  background: rgba(200,112,216,0.35); color: #E8C0FF;
  box-shadow: 0 0 16px rgba(200,112,216,0.35);
  border-color: rgba(200,112,216,0.5);
  transform: scale(1.05);
}
.draft-pick-btn.disabled {
  opacity: 0.15; cursor: default; pointer-events: none; border-color: transparent;
}
.draft-pick-btn.ai-pick {
  background: rgba(180,80,220,0.5) !important;
  color: #F0D0FF !important;
  box-shadow: 0 0 16px rgba(180,80,220,0.5);
  animation: aiPickPulse 0.6s ease-in-out;
}
@keyframes aiPickPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.draft-corner {  }
.draft-cell {
  aspect-ratio: 46 / 66; width: 100%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.035); border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.4s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  position: relative; overflow: hidden;
}
.draft-cell .card-small {
  margin: 0; width: 100% !important; height: 100% !important;
  border-radius: 8px;
}
.draft-cell.empty {
  background: rgba(0,0,0,0.12); border-color: rgba(255,255,255,0.03);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.2);
}
.draft-cell .card-small { margin: 0; }
.draft-cell.ai-highlighted {
  border-color: rgba(180,80,220,0.7);
  box-shadow: 0 0 18px rgba(180,80,220,0.4), inset 0 0 8px rgba(180,80,220,0.1);
  background: rgba(180,80,220,0.12);
  animation: aiCellGlow 0.8s ease-in-out infinite alternate;
}
@keyframes aiCellGlow {
  0% { box-shadow: 0 0 14px rgba(180,80,220,0.3); }
  100% { box-shadow: 0 0 22px rgba(180,80,220,0.5), inset 0 0 8px rgba(180,80,220,0.12); }
}
.draft-cell.discarding {
  opacity: 0.3;
  border-color: rgba(255,60,60,0.3);
  animation: discardFade 1.2s ease-out;
  transform: scale(0.95);
}
@keyframes discardFade {
  0% { opacity: 1; border-color: rgba(255,255,255,0.08); transform: scale(1); }
  40% { opacity: 0.5; border-color: rgba(255,60,60,0.4); }
  100% { opacity: 0.3; border-color: rgba(255,60,60,0.3); transform: scale(0.95); }
}
.draft-bottom-bar {
  flex-shrink: 0; margin-top: 6px;
}
.draft-popup-overlay {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: draftPopFadeIn 0.2s ease;
}
@keyframes draftPopFadeIn { from { opacity: 0; } to { opacity: 1; } }
.draft-popup {
  background: linear-gradient(160deg, rgba(50,20,60,0.95), rgba(30,10,20,0.95));
  border: 1px solid rgba(200,112,216,0.3); border-radius: 14px;
  padding: 16px 18px; max-width: 360px; width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 30px rgba(200,112,216,0.15);
  max-height: 80%; overflow-y: auto;
}
.draft-popup-title {
  font-family: 'Cinzel', serif; font-size: 16px; font-weight: 700;
  color: #D080E8; text-align: center; margin-bottom: 10px;
  letter-spacing: 1px;
}
.draft-inline-log {
  margin-top: 10px; width: 100%;
  background: rgba(0,0,0,0.25); border-radius: 8px;
  padding: 8px 12px; font-size: 10px;
  border: 1px solid rgba(255,255,255,0.04);
}
.draft-log-line {
  color: #8A9A70; padding: 2px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 11px;
}
.draft-log-line.ai { color: #B088C8; }
.draft-breakdown {
  width: 100%;
  background: rgba(0,0,0,0.25); border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.04);
}
.draft-breakdown-stats {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  font-size: 11px; color: #A89870; margin-bottom: 6px; font-weight: 600;
}
.draft-breakdown-bars {
  display: flex; flex-direction: column; gap: 2px;
}
.draft-bar-row {
  display: flex; align-items: center; gap: 6px;
}
.draft-bar-label {
  font-size: 10px; color: #B8986A; width: 70px; text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.draft-bar-outer {
  flex: 1; height: 8px; background: rgba(255,255,255,0.06);
  border-radius: 4px; overflow: hidden;
}
.draft-bar-inner {
  height: 100%; border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 2px;
}
.draft-bar-count {
  font-size: 10px; color: #F5E6D0; width: 16px; text-align: center; font-weight: 700;
}
.draft-review-grid {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 5px;
  margin: 12px 0; max-width: 480px;
  padding: 10px;
  background: rgba(0,0,0,0.15); border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.04);
}
.draft-review-grid .card-small { margin: 0; }
.draft-log-section { margin-top: 12px; width: 100%; max-width: 380px; }
.draft-log-toggle {
  font-size: 12px; color: #A89870; cursor: pointer; padding: 6px 0;
  font-weight: 600; transition: color 0.2s;
}
.draft-log-toggle:hover { color: #DAA520; }
.draft-log-content {
  background: rgba(0,0,0,0.25); border-radius: 8px;
  padding: 8px 12px; margin-top: 4px;
  max-height: 200px; overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.04);
}
.draft-log-entry {
  font-size: 11px; color: #8A9A70; padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.draft-log-entry.ai { color: #B088C8; }
@media (max-width: 420px) {
  .draft-grid-wrap { grid-template-columns: 26px repeat(4, 1fr); }
  .draft-review-grid .card-small { transform: scale(0.85); }
  .draft-title { font-size: 20px; }
  .draft-counters { gap: 6px; }
  .draft-counter { padding: 5px 10px; min-width: 55px; }
  .dc-count { font-size: 16px; }
}