* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --wood-bg: #8B6914;
  --wood-dark: #5C4A1E;
  --wood-light: #A67C2E;
  --gold: #D4A843;
  --gold-dim: rgba(212, 168, 67, 0.4);
  --panel-bg: rgba(0, 0, 0, 0.85);
  --panel-border: rgba(212, 168, 67, 0.4);
  --text-primary: #fff;
  --text-dim: rgba(255,255,255,0.6);
  --offense-color: #e89020;
  --defense-color: #d03030;
  --ally-color: #3080d0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #1a1a2e;
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* Lobby */
.screen { width: 100vw; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
#lobby.screen { gap: 28px; padding: 24px; }

.lobby-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 40px 50px;
  text-align: center;
  min-width: 380px;
}

/* Left history panel */
.lobby-history {
  width: 340px; height: min(85vh, 700px);
  background: linear-gradient(160deg, rgba(20,20,50,0.95), rgba(10,10,30,0.98));
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.lobby-history-header {
  padding: 20px 22px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.lobby-history-title {
  font-size: 15px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  background: linear-gradient(135deg, var(--gold), #fff, var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.lobby-history-count {
  font-size: 22px; font-weight: 900;
  background: linear-gradient(135deg, var(--gold), #e8c060);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.lobby-history-summary {
  display: flex; gap: 8px; padding: 14px 22px 10px; flex-wrap: wrap;
}
.lobby-history-summary .mini-stat {
  flex: 1; min-width: 70px; text-align: center;
  background: rgba(255,255,255,0.04); border-radius: 8px; padding: 8px 6px;
}
.mini-stat-val {
  font-size: 18px; font-weight: 800;
  color: var(--gold);
}
.mini-stat-lbl { font-size: 9px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.lobby-history-scroll {
  flex: 1; overflow-y: auto; padding: 6px 16px 16px;
  scrollbar-width: thin; scrollbar-color: var(--gold-dim) transparent;
}
.history-entry {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
  transition: border-color 0.2s;
}
.history-entry:hover { border-color: var(--gold-dim); }
.history-top {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;
}
.history-date { font-size: 10px; color: var(--text-dim); }
.history-meta { font-size: 10px; color: var(--text-dim); }
.history-winner { font-size: 13px; font-weight: 700; color: var(--gold); }
.history-winner-alien { font-weight: 400; color: var(--text-dim); font-size: 11px; }
.history-aliens {
  display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px;
}
.history-alien-tag {
  font-size: 9px; padding: 2px 7px; border-radius: 8px;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6);
}
.history-alien-tag.winner {
  background: rgba(212, 168, 67, 0.15); color: var(--gold); font-weight: 600;
}


@media (max-width: 800px) {
  #lobby.screen { flex-direction: column; gap: 16px; padding: 12px; }
  .lobby-history { width: 100%; height: 200px; }
  .lobby-right-col { width: 100%; }
  .lobby-card { min-width: auto; width: 100%; }
}
/* Lobby Right Column */
.lobby-right-col {
  display: flex; flex-direction: column; gap: 14px; align-items: center;
}

/* What's New Banner */
.whats-new-banner {
  background: linear-gradient(135deg, rgba(40,30,80,0.9), rgba(20,20,50,0.95));
  border: 1px solid rgba(130,100,255,0.3);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 0;
  text-align: left;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.whats-new-banner::before {
  content: '';
  position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 20% 50%, rgba(130,100,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.whats-new-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.whats-new-tag {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff; font-size: 9px; font-weight: 900; letter-spacing: 1.5px;
  padding: 3px 8px; border-radius: 4px; text-transform: uppercase;
}
.whats-new-title {
  font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.9); letter-spacing: 1px;
}
.whats-new-close {
  margin-left: auto; background: none; border: none; color: rgba(255,255,255,0.4);
  font-size: 18px; cursor: pointer; line-height: 1; padding: 0 2px;
}
.whats-new-close:hover { color: #fff; }
.whats-new-items {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px;
}
.whats-new-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: rgba(255,255,255,0.75); line-height: 1.3;
}
.wn-icon { font-size: 13px; flex-shrink: 0; }
@media (max-width: 500px) {
  .whats-new-items { grid-template-columns: 1fr; }
}

.lobby-title {
  font-size: 32px; font-weight: 900; letter-spacing: 6px;
  background: linear-gradient(135deg, var(--gold), #fff, var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.lobby-subtitle { color: var(--text-dim); font-size: 14px; margin-bottom: 30px; }

/* Top User Bar */
.top-user-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; justify-content: flex-end; align-items: center;
  padding: 8px 20px;
  background: linear-gradient(180deg, rgba(10,10,30,0.92), rgba(10,10,30,0.7));
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
}
.user-login-form {
  display: flex; gap: 6px; align-items: center;
}
.input-sm {
  padding: 6px 10px !important; font-size: 12px !important; width: auto !important; min-width: 0;
}
.btn-sm {
  padding: 6px 12px !important; font-size: 11px !important; border-radius: 6px; white-space: nowrap;
}
.btn-gold {
  background: var(--gold) !important; color: #1a1a2e !important; border: none; font-weight: 700; cursor: pointer;
}
.btn-gold:hover { background: #e6bc55 !important; }
.btn-ghost {
  background: rgba(255,255,255,0.08) !important; color: rgba(255,255,255,0.7) !important;
  border: 1px solid rgba(255,255,255,0.12); cursor: pointer;
}
.btn-ghost:hover { background: rgba(255,255,255,0.15) !important; color: #fff !important; }
.user-logged-in {
  display: flex; align-items: center; gap: 8px;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name {
  font-weight: 700; font-size: 13px; color: rgba(255,255,255,0.9);
  margin-right: auto;
}

/* Bottom Info Bar */
.lobby-bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(10,10,30,0.92), rgba(5,5,20,0.98));
  border-top: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center;
  padding: 0;
}
.bottom-features-row {
  display: flex; justify-content: center; gap: 24px; flex-wrap: wrap;
  padding: 8px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  width: 100%;
}
.bottom-feature {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: rgba(255,255,255,0.45);
}
.bf-icon { font-size: 13px; flex-shrink: 0; }
.bf-cta {
  color: rgba(212,168,67,0.7); font-weight: 600;
}
.live-stats-row {
  display: flex; justify-content: center; gap: 28px;
  padding: 6px 20px; width: 100%;
}
.live-stat {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: rgba(255,255,255,0.6); font-weight: 500;
}
.live-stat span:not(.live-stat-icon) { color: var(--gold); font-weight: 700; }
.live-stat-icon { font-size: 13px; }

@media (max-width: 700px) {
  .bottom-features-row { gap: 10px; padding: 6px 10px; }
  .bottom-feature { font-size: 10px; }
  .live-stats-row { gap: 12px; flex-wrap: wrap; padding: 4px 10px; }
  .live-stat { font-size: 10px; }
}

/* User Profile Overlay */
.user-profile-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 650;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.user-profile-overlay.hidden { display: none !important; }
.user-profile-card {
  background: linear-gradient(160deg, rgba(20,20,50,0.98), rgba(10,10,30,0.99));
  border: 1px solid rgba(130,100,255,0.3); border-radius: 20px;
  padding: 30px 36px; max-width: 560px; width: 100%; max-height: 85vh;
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--gold-dim) transparent;
}
.profile-header {
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
}
.profile-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff; font-weight: 900; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.profile-username { font-size: 22px; font-weight: 800; color: #fff; }
.profile-close {
  margin-left: auto; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; border-radius: 8px; padding: 6px 14px; font-size: 13px;
  cursor: pointer; font-weight: 600;
}
.profile-close:hover { background: rgba(255,255,255,0.2); }
.profile-section {
  margin-bottom: 20px;
}
.profile-section-title {
  font-size: 13px; font-weight: 800; color: var(--gold); letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 10px;
  padding-bottom: 4px; border-bottom: 1px solid rgba(212,168,67,0.2);
}
.profile-stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.profile-stat-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 14px; text-align: center;
}
.profile-stat-val {
  font-size: 24px; font-weight: 900; color: var(--gold); display: block;
}
.profile-stat-label {
  font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase;
  letter-spacing: 1px; margin-top: 4px;
}
.profile-color-picker {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.profile-color-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; transition: all 0.2s; position: relative;
}
.profile-color-btn:hover { transform: scale(1.15); }
.profile-color-btn.selected { border-color: #fff; box-shadow: 0 0 10px rgba(255,255,255,0.3); }
.profile-color-btn.selected::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 900; text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.profile-aliens-list {
  display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto;
}
.profile-alien-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: rgba(255,255,255,0.03); border-radius: 8px;
}
.profile-alien-name { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.85); flex: 1; }
.profile-alien-stat { font-size: 11px; color: rgba(255,255,255,0.5); }
.profile-alien-wins { color: #4ade80; font-weight: 700; }
.profile-no-data { font-size: 12px; color: rgba(255,255,255,0.35); font-style: italic; text-align: center; padding: 16px; }

@media (max-width: 500px) {
  .profile-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .live-stats-bar { gap: 12px; flex-wrap: wrap; padding: 6px 10px; }
  .live-stat { font-size: 10px; }
}

/* Guest create message */
.guest-create-msg {
  font-size: 11px; color: rgba(255,255,255,0.4); text-align: center;
  padding: 8px 0; margin: 0; line-height: 1.5;
}

/* Quiz Button */
.quiz-btn { background: rgba(220,120,40,0.15) !important; border-color: rgba(220,120,40,0.4) !important; }

/* Quiz Overlay */
.quiz-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; max-width: 700px; margin: 0 auto; width: 100%; padding: 30px;
}
.quiz-card {
  background: linear-gradient(160deg, rgba(20,20,50,0.98), rgba(10,10,30,0.99));
  border: 1px solid rgba(220,120,40,0.3); border-radius: 20px;
  padding: 36px 40px; width: 100%; text-align: center; position: relative;
}
.quiz-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.quiz-title {
  font-size: 22px; font-weight: 900; letter-spacing: 3px;
  background: linear-gradient(135deg, #f59e0b, #fff, #f59e0b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.quiz-score {
  font-size: 13px; color: rgba(255,255,255,0.5);
}
.quiz-score strong { color: var(--gold); }
.quiz-close {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; border-radius: 8px; padding: 6px 14px; font-size: 13px;
  cursor: pointer; font-weight: 600;
}
.quiz-close:hover { background: rgba(255,255,255,0.2); }
.quiz-power-text {
  font-size: 15px; color: rgba(255,255,255,0.85); line-height: 1.8;
  text-align: left; margin-bottom: 24px; padding: 18px 20px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; max-height: 200px; overflow-y: auto;
}
.quiz-power-highlight {
  color: #f59e0b; font-weight: 700;
}
.quiz-input-row {
  display: flex; gap: 10px; margin-bottom: 16px;
}
.quiz-input {
  flex: 1; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; padding: 12px 16px; color: #fff; font-size: 15px;
  outline: none; transition: border-color 0.2s;
}
.quiz-input:focus { border-color: #f59e0b; }
.quiz-submit {
  background: linear-gradient(135deg, #f59e0b, #d97706); color: #1a1a2e;
  border: none; border-radius: 10px; padding: 12px 24px; font-size: 14px;
  font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.quiz-submit:hover { transform: translateY(-1px); background: #fbbf24; }
.quiz-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.quiz-result {
  padding: 16px; border-radius: 12px; font-size: 15px; font-weight: 700;
  margin-bottom: 16px; transition: all 0.3s;
}
.quiz-result.correct {
  background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3); color: #4ade80;
}
.quiz-result.wrong {
  background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: #f87171;
}
.quiz-next {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; border-radius: 10px; padding: 10px 28px; font-size: 14px;
  font-weight: 600; cursor: pointer;
}
.quiz-next:hover { background: rgba(255,255,255,0.2); }
.quiz-streak {
  display: flex; gap: 4px; justify-content: center; margin-top: 12px;
}
.quiz-streak-dot {
  width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.15);
}
.quiz-streak-dot.correct { background: #4ade80; }
.quiz-streak-dot.wrong { background: #f87171; }

/* Rulebook Button */
.rulebook-btn { background: rgba(130,100,255,0.15) !important; border-color: rgba(130,100,255,0.4) !important; }

/* Rulebook Overlay */
.rulebook-container {
  display: flex; flex-direction: column; height: 100%;
  max-width: 880px; margin: 0 auto; width: 100%;
}
.rulebook-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 30px 0; flex-shrink: 0;
}
.rulebook-title {
  font-size: 28px; font-weight: 900; letter-spacing: 4px;
  background: linear-gradient(135deg, var(--gold), #fff, var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.rulebook-close {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; border-radius: 8px; padding: 6px 14px; font-size: 13px;
  cursor: pointer; font-weight: 600;
}
.rulebook-close:hover { background: rgba(255,255,255,0.2); }
.rulebook-nav {
  display: flex; gap: 4px; padding: 16px 30px 0; flex-wrap: wrap; flex-shrink: 0;
}
.rulebook-nav-btn {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6); border-radius: 8px; padding: 7px 14px;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.rulebook-nav-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.rulebook-nav-btn.active {
  background: var(--gold); color: #1a1a2e; border-color: var(--gold);
}
.rulebook-body {
  flex: 1; overflow-y: auto; padding: 20px 30px 30px;
  scrollbar-width: thin; scrollbar-color: var(--gold-dim) transparent;
}
.rb-section { margin-bottom: 28px; }
.rb-section-title {
  font-size: 18px; font-weight: 800; color: var(--gold); letter-spacing: 1px;
  margin-bottom: 12px; padding-bottom: 6px;
  border-bottom: 1px solid rgba(212,168,67,0.25);
}
.rb-subsection {
  margin-bottom: 16px;
}
.rb-subtitle {
  font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.9); margin-bottom: 6px;
}
.rb-text {
  font-size: 13px; color: rgba(255,255,255,0.75); line-height: 1.7;
  margin-bottom: 8px;
}
.rb-list {
  list-style: none; padding: 0; margin: 0 0 8px;
}
.rb-list li {
  font-size: 13px; color: rgba(255,255,255,0.75); line-height: 1.7;
  padding-left: 18px; position: relative;
}
.rb-list li::before {
  content: '▸'; position: absolute; left: 0; color: var(--gold); font-size: 12px;
}
.rb-table {
  width: 100%; border-collapse: collapse; margin: 8px 0 12px;
  font-size: 12px;
}
.rb-table th {
  background: rgba(212,168,67,0.15); color: var(--gold); font-weight: 700;
  padding: 8px 12px; text-align: left; border: 1px solid rgba(255,255,255,0.08);
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
}
.rb-table td {
  padding: 7px 12px; border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.75);
}
.rb-table tr:nth-child(even) { background: rgba(255,255,255,0.02); }
.rb-highlight {
  background: rgba(212,168,67,0.08); border-left: 3px solid var(--gold);
  padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 8px 0;
  font-size: 12px; color: rgba(255,255,255,0.8); line-height: 1.6;
}
.rb-card-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700; margin-right: 4px;
}
.rb-card-attack { background: rgba(220,60,60,0.25); color: #ff6b6b; }
.rb-card-negotiate { background: rgba(60,160,60,0.25); color: #6bff6b; }
.rb-card-reinforcement { background: rgba(160,80,220,0.25); color: #c47bff; }
.rb-card-morph { background: rgba(60,140,220,0.25); color: #6bb8ff; }
.rb-card-artifact { background: rgba(220,180,40,0.25); color: #ffd644; }
.rb-phase-flow {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0;
}
.rb-phase-chip {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px; padding: 5px 10px; font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.8);
}
.rb-phase-arrow {
  color: var(--gold-dim); font-size: 13px;
}
.rb-icon-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px; margin: 10px 0;
}
.rb-icon-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start;
}
.rb-icon-card-icon {
  font-size: 22px; flex-shrink: 0; margin-top: 2px;
}
.rb-icon-card-text {
  font-size: 12px; color: rgba(255,255,255,0.75); line-height: 1.5;
}
.rb-icon-card-title {
  font-weight: 700; color: rgba(255,255,255,0.9); display: block; margin-bottom: 3px;
}
.stats-empty {
  text-align: center; color: var(--text-dim); padding: 40px 0; font-size: 13px;
}
.lobby-form { display: flex; flex-direction: column; gap: 12px; }
.lobby-buttons { display: flex; flex-direction: column; gap: 10px; }
.join-row { display: flex; gap: 8px; }

.input-field {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; padding: 10px 14px; color: #fff; font-size: 14px; width: 100%;
  outline: none; transition: border-color 0.2s;
}
.input-field:focus { border-color: var(--gold); }
.input-code { width: 140px; text-transform: uppercase; letter-spacing: 3px; text-align: center; font-weight: 700; }
.input-small { width: 60px; }

.btn {
  padding: 10px 20px; border: none; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-primary { background: var(--gold); color: #1a1a2e; }
.btn-primary:hover { background: #e6bc55; transform: translateY(-1px); }
.btn-secondary { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.btn-secondary:hover { background: rgba(255,255,255,0.2); }
.btn-small { padding: 4px 10px; border: none; border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer; background: rgba(255,255,255,0.12); color: #fff; }
.btn-small:hover { background: rgba(255,255,255,0.25); }

.waiting-room { margin-top: 20px; }
.room-code-label { color: var(--text-dim); font-size: 12px; }
.room-code { font-size: 36px; font-weight: 900; letter-spacing: 8px; color: var(--gold); margin: 4px 0 8px; }
.btn-copy-link {
  display: inline-block; margin-bottom: 14px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px; padding: 4px 14px;
  color: var(--text-dim); font-size: 11px; cursor: pointer;
  transition: all 0.2s;
}
.btn-copy-link:hover { color: var(--gold); border-color: var(--gold); }
.player-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.player-list-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: rgba(255,255,255,0.05); border-radius: 6px;
}
.player-color-dot { width: 12px; height: 12px; border-radius: 50%; }

/* Color picker in waiting room */
.color-picker-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; justify-content: center;
}
.color-picker-label {
  font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px;
}
.color-pick {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--pick-color);
  border: 3px solid transparent;
  cursor: pointer; transition: all 0.2s;
  position: relative;
  outline: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15);
}
.color-pick:hover:not(:disabled) {
  transform: scale(1.15);
  border-color: rgba(255,255,255,0.4);
}
.color-pick.selected {
  border-color: #fff;
  box-shadow: 0 0 0 3px var(--pick-color), 0 0 12px var(--pick-color);
  transform: scale(1.1);
}
.color-pick.taken {
  opacity: 0.2;
  cursor: not-allowed;
}
.color-pick.taken::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    45deg, transparent, transparent 4px, rgba(0,0,0,0.5) 4px, rgba(0,0,0,0.5) 6px
  );
  border-radius: 50%;
}

.lobby-footer { margin-top: 16px; }
.link-btn { background: none; border: none; color: var(--text-dim); font-size: 12px; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--gold); }

/* Game Table - realistic wood grain */
.game-table {
  width: 100vw; flex: 1 1 auto; min-height: auto;
  background-color: #8B6914;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent, transparent 2px,
      rgba(92,74,30,0.15) 2px, rgba(92,74,30,0.15) 4px
    ),
    repeating-linear-gradient(
      87deg,
      transparent, transparent 8px,
      rgba(120,90,20,0.08) 8px, rgba(120,90,20,0.08) 12px
    ),
    repeating-linear-gradient(
      92deg,
      transparent, transparent 20px,
      rgba(60,45,10,0.06) 20px, rgba(60,45,10,0.06) 22px
    ),
    linear-gradient(180deg, #7a5c12 0%, #9a7520 20%, #8B6914 50%, #9a7520 80%, #7a5c12 100%);
  background-size: 100% 100%;
  display: flex; flex-direction: column; position: relative; overflow: visible;
}

#game.screen {
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  min-height: 100vh;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Opponents (2-player linear layout) */
.opponents-area {
  display: flex; justify-content: center; gap: 16px;
  padding: 10px 20px;
}
.opponents-area.hidden { display: none; }
.opponent-zone {
  background: rgba(0,0,0,0.35); border-radius: 10px; padding: 8px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 110px; backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
}

/* Multi-player table layout (3+ players) */
.game-middle-row {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.multi-layout .game-middle-row {
  flex-direction: row;
  align-items: stretch;
}
.center-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

/* Top opponents row */
.top-opponents {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 6px 12px;
}
.top-opponents.hidden { display: none; }

/* Side opponents */
.side-opponent {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  min-width: 140px;
  max-width: 180px;
}
.side-opponent.hidden { display: none; }

.side-player-zone {
  background: rgba(0,0,0,0.4);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255,255,255,0.1);
}
.side-player-name { font-size: 11px; font-weight: 700; }
.side-role { font-size: 9px; font-weight: 600; }

.multi-layout .opponents-area { display: none; }
.multi-layout .player-area { justify-content: center; }
.opponent-name { font-size: 11px; font-weight: 700; color: #fff; }
.opponent-role { font-size: 9px; font-weight: 600; margin-top: -2px; }
.planets-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.planets-extra { font-size: 10px; color: var(--gold); font-weight: 700; margin-left: 2px; }
.planet {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center;
  gap: 2px; padding: 4px;
  border: 2px solid; position: relative;
}
.ship-dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.planet-large {
  width: 44px; height: 44px; padding: 5px; gap: 3px;
}
.planet-large .ship-dot {
  width: 8px; height: 8px;
}

/* Center */
.center-area {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
}
.decks-row { display: flex; gap: 40px; }
.deck-pile {
  position: relative; width: 60px; height: 80px; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
}
.deck-card {
  width: 50px; height: 70px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.25);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.7);
}

/* Cosmic deck back (regular deck - left card in second image) */
.deck-card-cosmic {
  background:
    radial-gradient(circle at 50% 30%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.4) 18%, transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(255,230,140,0.6) 0%, transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(255,210,90,0.4) 0%, transparent 55%),
    linear-gradient(135deg, #f6e7b0 0%, #f0c878 35%, #c08a40 70%, #5b3c20 100%);
}
.deck-card-cosmic::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 0 12px rgba(255,255,255,0.25);
}

/* Reward deck back (right card in second image) */
.deck-card-reward {
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,0.9) 0%, rgba(200,220,255,0.3) 20%, transparent 45%),
    radial-gradient(circle at 15% 85%, rgba(120,160,255,0.5) 0%, transparent 55%),
    radial-gradient(circle at 85% 85%, rgba(160,120,255,0.5) 0%, transparent 55%),
    linear-gradient(145deg, #283064 0%, #3a4c9c 40%, #5e4fb4 70%, #1a1438 100%);
}
.deck-card-reward::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 5px;
  border: 1px solid rgba(220,230,255,0.7);
  box-shadow: 0 0 14px rgba(150,180,255,0.4);
}

/* Destiny back (left stack back from first image) */
.deck-card-destiny {
  background:
    radial-gradient(circle at 50% 50%, #05070c 0%, #070b16 40%, #05060b 75%, #000 100%),
    repeating-radial-gradient(circle at 50% 50%, rgba(80,120,140,0.8) 0, rgba(80,120,140,0.8) 1px, transparent 1px, transparent 4px),
    radial-gradient(circle at 50% 50%, rgba(0,255,255,0.1) 0%, transparent 60%);
}
.deck-card-destiny::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 55%);
  box-shadow: 0 0 14px rgba(0,255,255,0.35);
}
.deck-card-destiny::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px dashed rgba(120,200,255,0.8);
  box-shadow: 0 0 10px rgba(0,255,255,0.4);
}

.deck-card-discard {
  background: linear-gradient(135deg, #3a2010, #1a0f08);
  border-color: rgba(200,150,80,0.4) !important;
}
.deck-card-discard::after {
  content: '♻';
  position: absolute;
  inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: rgba(200,150,80,0.5);
}

.deck-card-reward {
  background:
    radial-gradient(circle at 50% 35%, rgba(255,230,80,0.9) 0%, rgba(255,200,40,0.4) 25%, transparent 50%),
    radial-gradient(circle at 30% 70%, rgba(180,120,0,0.5) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(200,150,20,0.4) 0%, transparent 50%),
    linear-gradient(135deg, #5a4000 0%, #806010 35%, #a07820 60%, #604000 100%);
  border-color: rgba(234,179,8,0.6) !important;
}
.deck-card-reward::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(234,179,8,0.4);
  border-radius: 4px;
  background: radial-gradient(circle at 50% 40%, rgba(255,230,80,0.3) 0%, transparent 60%);
}
.deck-card-reward::after {
  content: '★';
  position: absolute;
  inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: rgba(234,179,8,0.8);
  text-shadow: 0 0 8px rgba(234,179,8,0.5);
}

.deck-card-destiny-discard {
  background: linear-gradient(135deg, #0a1520, #05080d);
  border-color: rgba(0,200,200,0.3) !important;
}
.deck-card-destiny-discard::after {
  content: '♻';
  position: absolute;
  inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: rgba(0,200,200,0.4);
}

.destiny-discard-panel { border-color: rgba(0,200,200,0.25) !important; }
.destiny-discard-panel .discard-header { border-color: rgba(0,200,200,0.15) !important; }

.destiny-card-item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.1);
}
.destiny-card-item.color-card { border-color: rgba(255,255,255,0.2); }
.destiny-card-item .color-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3); flex-shrink: 0;
}
.destiny-card-item.special-card {
  background: rgba(255,100,0,0.15); border-color: rgba(255,100,0,0.3); color: #ff9040;
}
.destiny-card-item.wild-card {
  background: rgba(200,100,255,0.15); border-color: rgba(200,100,255,0.3); color: #d080ff;
}

.deck-label { font-size: 8px; color: var(--text-dim); margin-top: 2px; }
.deck-count { font-size: 9px; color: var(--text-dim); }
.deck-pile.clickable { cursor: pointer; }
.deck-pile.clickable:hover .deck-card { border-color: #0f0; box-shadow: 0 0 8px rgba(0,255,0,0.3); }

/* Discard pile overlay */
.discard-overlay {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center;
}
.discard-overlay.hidden { display: none; }
.discard-panel {
  background: linear-gradient(135deg, #1a1028, #0d0818);
  border: 1px solid var(--gold-dim); border-radius: 12px;
  width: 340px; max-height: 70vh; display: flex; flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.discard-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 13px; font-weight: 700; color: var(--gold);
}
.discard-body {
  padding: 10px; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center;
}
.discard-card {
  width: 56px; height: 36px; border-radius: 5px; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px solid rgba(255,255,255,0.15); color: #fff;
}
.discard-atk { background: linear-gradient(135deg, #6b1515, #8b2020); }
.discard-neg { background: linear-gradient(135deg, #154a15, #208030); }
.discard-other { background: linear-gradient(135deg, #2a2a5a, #404080); }
.deck-pile.pulsing .deck-card {
  animation: pulse 1.5s infinite;
  border-color: #0f0;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 4px rgba(0,255,0,0.3); } 50% { box-shadow: 0 0 16px rgba(0,255,0,0.6); } }

.gate-warp-row { display: flex; gap: 40px; align-items: center; }

/* Hyperspace Gate as a thick arrow that can rotate toward target */
.hyperspace-gate {
  width: 100px; height: 30px;
  background: linear-gradient(90deg, #553018 0%, #d0a040 35%, #f5d068 55%, #8a4a20 100%);
  border-radius: 15px;
  border: 2px solid rgba(255,230,170,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative;
  color: #2b1206;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,0.7);
  transition: transform 0.6s ease-out, box-shadow 0.25s ease-out;
}
.hyperspace-gate::after {
  content: '';
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
  border-left: 20px solid #f5d068;
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.6));
}
.hyperspace-gate-label {
  position: relative; z-index: 1;
  display: flex; gap: 2px; align-items: center;
}
.gate-ship-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2b1206; border: 1px solid rgba(0,0,0,0.3);
  display: inline-block;
}
.gate-target {
  position: absolute;
  bottom: -14px; left: 10px;
  font-size: 9px; font-weight: 600;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 0 3px rgba(0,0,0,0.8);
  white-space: nowrap;
}

.hyperspace-gate.choosing-target {
  box-shadow: 0 0 14px rgba(255,230,130,0.9);
  animation: gatePulse 1.1s infinite;
}

@keyframes gatePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Ship fly animation */
@keyframes shipFlyToGate {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--fly-x, 0px), var(--fly-y, -40px)) scale(0.6); opacity: 0; }
}
.ship-flying {
  animation: shipFlyToGate 0.5s ease-in forwards;
  position: absolute; z-index: 10;
}

/* Gate moves toward target planet */
.hyperspace-gate.gate-launched {
  transition: transform 0.8s ease-in-out;
}

/* Warp: circular, vortex/galaxy center, numbered track, colored markers per player */
.warp {
  width: 200px; height: 200px; border-radius: 50%;
  position: relative;
  overflow: visible;
  flex-shrink: 0;
}
.warp-vortex {
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.5) 8%, transparent 25%),
    radial-gradient(circle at 50% 50%, rgba(255,240,180,0.9) 0%, rgba(255,200,80,0.6) 20%, rgba(255,150,40,0.4) 40%, rgba(180,80,20,0.3) 60%, rgba(80,40,60,0.2) 80%, transparent 100%),
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,220,100,0.15) 0deg 10deg, transparent 10deg 20deg);
  box-shadow: inset 0 0 30px rgba(255,200,80,0.4), 0 0 20px rgba(255,180,60,0.3);
  border: 2px solid rgba(255,220,140,0.6);
}
.warp-track {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}
.warp-slot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(180deg, #5a5a6a 0%, #2a2a38 100%);
  border: 1px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1px;
  position: absolute;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.3);
  pointer-events: auto;
  padding: 2px;
}
.warp-slot-num {
  font-size: 8px;
  font-weight: 800;
  color: rgba(200,180,255,0.95);
  z-index: 2;
  text-shadow: 0 0 2px rgba(0,0,0,0.9), 0 1px 0 rgba(0,0,0,0.5);
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
}
.score-slot {
  background: linear-gradient(180deg, #3a3a5a 0%, #1a1a28 100%);
}
.score-marker {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.6);
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(255,255,255,0.3);
}
.warp-ships-inner {
  position: absolute; inset: 30px; border-radius: 50%;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 3px; padding: 6px; pointer-events: auto;
  z-index: 3;
}
.warp-inner-ship {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  flex-shrink: 0;
  box-shadow: 0 0 3px rgba(0,0,0,0.5);
}
.warp-inner-overflow {
  font-size: 8px; font-weight: 700;
}

/* Encounter */
.encounter-area {
  display: flex; justify-content: center; align-items: center; gap: 12px;
  padding: 6px 12px; min-height: 40px; flex-wrap: wrap;
  position: relative;
  transition: all 0.3s ease;
}
.encounter-area.encounter-planning-mode {
  position: fixed; left: 10px; top: 50%; transform: translateY(-50%);
  z-index: 200; width: 170px;
  background: rgba(10,10,30,0.95); border: 1px solid rgba(212,168,67,0.35);
  border-radius: 12px; padding: 10px 8px; gap: 6px;
  flex-direction: column; align-items: stretch;
  box-shadow: 0 4px 24px rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
}
.encounter-planning-mode .planning-mode-header {
  text-align: center; font-size: 10px; font-weight: 700;
  color: var(--gold); letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 2px;
}
.encounter-planning-mode .encounter-sides-row,
.encounter-planning-mode:not(:has(.encounter-sides-row)) {
  flex-direction: column; gap: 6px;
}
.encounter-planning-mode .encounter-side {
  min-width: unset; width: 100%; padding: 6px 8px;
  flex-direction: row; gap: 8px; align-items: center; justify-content: flex-start;
}
.encounter-planning-mode .encounter-vs { font-size: 10px; align-self: center; }
.encounter-planning-mode .encounter-label { font-size: 9px; white-space: nowrap; }
.encounter-planning-mode .enc-card { width: 38px; height: 52px; font-size: 8px; flex-shrink: 0; }
.encounter-planning-mode .enc-card .enc-card-value { font-size: 11px; }
.encounter-planning-mode .enc-math { display: none; }
.encounter-planning-mode .encounter-ships { display: none; }
.encounter-planning-mode .encounter-reinforce { display: none; }
.encounter-area:has(.enc-tally-bar) {
  flex-direction: column; align-items: stretch; gap: 10px;
}
.encounter-sides-row {
  display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: nowrap;
}
.enc-tally-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 14px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(40,30,60,0.9), rgba(25,20,45,0.95));
  border: 1px solid rgba(212,168,67,0.35);
  font-size: 13px; font-weight: 600;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.enc-tally-bar .enc-tally-off { color: var(--offense-color, #e06060); }
.enc-tally-bar .enc-tally-off strong { font-size: 16px; color: #ff8888; }
.enc-tally-bar .enc-tally-def { color: var(--defense-color, #60a0e0); }
.enc-tally-bar .enc-tally-def strong { font-size: 16px; color: #88bbff; }
.enc-tally-bar .enc-tally-vs { color: var(--gold); opacity: 0.8; font-weight: 800; }
.enc-tally-bar .enc-tally-lead {
  margin-left: 8px; padding: 4px 10px; border-radius: 6px;
  background: rgba(212,168,67,0.2); color: var(--gold);
  font-weight: 800; font-size: 12px;
}
.encounter-side {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(0,0,0,0.35); min-width: 80px;
}
.encounter-label { font-size: 11px; font-weight: 700; }
.encounter-ships { display: flex; gap: 3px; min-height: 10px; }
.encounter-vs { font-size: 14px; font-weight: 900; color: var(--gold); align-self: center; }
.encounter-reinforce { font-size: 10px; color: #50ff70; font-weight: 700; }
.enc-math {
  font-size: 11px; color: rgba(255,255,255,0.8); margin-top: 6px;
  background: rgba(0,0,0,0.4); padding: 4px 8px; border-radius: 6px;
  white-space: nowrap; text-align: center;
}
.enc-math-card { color: #ff9; font-weight: 700; }
.enc-math-ships { color: #8cf; }
.enc-math-allies { color: #c8f; }
.enc-math-reinf { color: #5f5; font-weight: 700; }
.enc-total { color: #ffd700; font-size: 15px; }
.enc-total-win { color: #50ff70; text-shadow: 0 0 8px rgba(80,255,112,0.5); }
.enc-total-lose { color: #ff6060; }
.planning-status { font-size: 11px; color: #80c0ff; margin-right: 8px; }
.encounter-result {
  position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%);
  font-size: 13px; font-weight: 900; white-space: nowrap;
}

/* Encounter cards */
.enc-card {
  width: 48px; height: 68px; border-radius: 6px; border: 2px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  font-weight: 800; cursor: pointer; position: relative;
  transition: transform 0.3s;
}
.enc-card:hover { transform: scale(1.06); }
.enc-card-empty { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.3); border-style: dashed; }
.enc-card-facedown {
  background: repeating-linear-gradient(135deg, #2a2a4a, #2a2a4a 4px, #1a1a2e 4px, #1a1a2e 8px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.enc-card-back { font-size: 9px; color: rgba(255,255,255,0.5); text-align: center; font-weight: 600; }
.enc-card-revealed { box-shadow: 0 0 10px rgba(255,255,255,0.2); }
.enc-card-attack { background: linear-gradient(135deg, #8b2020, #c03030); color: #fff; }
.enc-card-negotiate { background: linear-gradient(135deg, #205a20, #30a040); color: #fff; }
.enc-card-other { background: linear-gradient(135deg, #3a3a6a, #5050a0); color: #fff; }
.enc-card-value { font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.enc-card-private {
  opacity: 0.85;
  border-style: dashed;
}
.enc-card-private-label {
  font-size: 6px; font-weight: 400; color: rgba(255,255,255,0.5);
  position: absolute; bottom: 2px; text-align: center; line-height: 1;
}

@keyframes flipIn {
  0% { transform: rotateY(90deg) scale(0.8); opacity: 0; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}
.flip-in { animation: flipIn 0.4s ease-out; }

/* Deal (Negotiate) UI */
.deal-panel {
  width: 100%; display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 8px; margin-top: 4px;
  background: rgba(0,80,0,0.2); border: 1px solid rgba(80,255,80,0.2);
  border-radius: 8px;
}
.deal-title { font-size: 14px; font-weight: 800; color: var(--gold); }
.deal-timer {
  font-size: 20px; font-weight: 900; color: #ff5050;
  font-variant-numeric: tabular-nums;
}
.deal-buttons { display: flex; gap: 8px; }
.deal-btn {
  padding: 6px 14px; border-radius: 6px; border: none;
  font-weight: 700; font-size: 12px; cursor: pointer;
}
.deal-accept { background: linear-gradient(180deg, #40a040, #206020); color: #fff; }
.deal-accept:hover { background: linear-gradient(180deg, #50c050, #308030); }
.deal-blow { background: linear-gradient(180deg, #a04040, #602020); color: #fff; }
.deal-blow:hover { background: linear-gradient(180deg, #c05050, #803030); }
.deal-status { font-size: 10px; color: rgba(255,255,255,0.6); }
.deal-terms-form { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.deal-terms-row {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  font-size: 13px; color: #e0e0e0;
}
.deal-terms-row label { min-width: 100px; text-align: right; }
.deal-input {
  width: 50px; padding: 4px 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.3); color: #fff; text-align: center; font-size: 14px; font-weight: 700;
}

/* ===== Server Update Overlay ===== */
.update-overlay {
  position: fixed; inset: 0; z-index: 999999;
  background: rgba(5,5,20,0.92); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
}
.update-overlay.hidden { display: none; }
.update-content {
  text-align: center; max-width: 420px; padding: 40px 32px;
  background: linear-gradient(135deg, rgba(20,20,50,0.9), rgba(10,10,30,0.95));
  border: 1px solid rgba(100,140,255,0.25); border-radius: 16px;
  box-shadow: 0 0 40px rgba(60,100,255,0.15);
}
.update-icon { font-size: 48px; margin-bottom: 12px; animation: updatePulse 1.5s ease-in-out infinite; }
@keyframes updatePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.update-title {
  font-size: 22px; font-weight: 800; color: #fff;
  letter-spacing: 1px; margin-bottom: 8px;
}
.update-message { font-size: 14px; color: rgba(255,255,255,0.7); margin-bottom: 16px; }
.update-progress-bar {
  width: 100%; height: 6px; border-radius: 3px;
  background: rgba(255,255,255,0.1); overflow: hidden; margin-bottom: 16px;
}
.update-progress-fill {
  height: 100%; width: 0%; border-radius: 3px;
  background: linear-gradient(90deg, #4a80ff, #60d0ff);
  transition: width 0.5s ease;
}
.update-changes {
  text-align: right; direction: rtl; font-size: 12px;
  color: rgba(255,255,255,0.55); line-height: 1.8;
  max-height: 120px; overflow-y: auto; margin-bottom: 12px;
}
.update-changes .change-item {
  padding: 2px 0; display: flex; align-items: center; gap: 6px; justify-content: flex-start;
}
.update-changes .change-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #60d0ff; flex-shrink: 0;
}
.update-changes .change-dot.done { background: #50ff70; }
.update-status { font-size: 11px; color: rgba(255,255,255,0.4); }

/* ===== Mobile layout tweaks ===== */
@media (max-width: 900px) {
  .game-table {
    padding: 8px 6px 4px;
  }
  .decks-row {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
  }
  .deck-card {
    width: 38px;
    height: 56px;
  }
  .gate-warp-row {
    gap: 16px;
    justify-content: center;
  }
  .hyperspace-gate {
    transform: scale(0.85) !important;
  }
  .warp {
    width: 80px;
    height: 80px;
  }
  .opponents-area,
  .player-area {
    margin: 0 6px;
  }
  .side-opponent {
    min-width: 110px;
    max-width: 140px;
    padding: 4px;
  }
  .side-player-zone { padding: 5px 6px; }
  .side-player-zone .planet { width: 24px; height: 24px; font-size: 9px; }
  .player-hand {
    padding: 6px 6px 8px;
  }
  .hand-card {
    width: 54px;
    height: 76px;
  }
  .phase-bar-container {
    padding: 4px 4px 8px;
  }
  .phase-segment {
    font-size: 9px;
    padding: 4px 4px;
  }
}

/* Player area */
.player-area {
  background: rgba(0,0,0,0.35); border-radius: 10px 10px 0 0;
  padding: 10px 16px; margin: 0 20px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.08);
  border-bottom: none;
}
.player-name { font-size: 13px; font-weight: 700; color: #fff; }
.alien-card-mini {
  width: 80px; height: 50px; border-radius: 6px;
  background: linear-gradient(135deg, #2a1a40, #15102a);
  border: 1px solid var(--gold-dim);
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 10px; color: var(--text-dim); cursor: pointer;
  overflow: hidden; position: relative;
}
.alien-card-mini.revealed { background: linear-gradient(135deg, #302050, #201040); color: var(--gold); }
.alien-card-mini.my-alien {
  color: var(--gold);
  border-color: var(--gold-dim);
}
.my-alien-img {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--gold-dim);
  flex-shrink: 0;
}
.my-alien-name {
  font-size: 9px; font-weight: 600; color: var(--gold);
  text-align: center; line-height: 1.2;
  max-width: 44px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}

.alien-and-tokens {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.player-tokens-row {
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 120px;
}
.token-pill {
  font-size: 9px; padding: 2px 6px; border-radius: 4px;
  background: rgba(212, 168, 67, 0.25); color: var(--gold); border: 1px solid var(--gold-dim);
}

/* Angler fish modal - must appear on top */
#anglerFishModal.modal-overlay {
  z-index: 99999 !important;
}
#anglerFishModal.modal-overlay.hidden { display: none !important; }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.modal-overlay.hidden { display: none; }
.modal-content {
  background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 20px; min-width: 320px; max-width: 90vw;
}
.modal-content.angler-fish h3 { margin-bottom: 8px; color: var(--gold); }
.modal-content.angler-fish p { font-size: 12px; color: var(--text-dim); margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.modal-actions .primary { background: var(--gold); color: #1a1a2e; }

/* Hand */
.player-hand {
  display: flex; justify-content: center; padding: 8px 20px 28px;
  background: rgba(30,20,10,0.7);
  border-top: 1px solid rgba(255,255,255,0.05);
  position: relative;
  overflow: visible;
}
.hand-card {
  width: 64px; height: 90px; border-radius: 7px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; border: 2px solid rgba(255,255,255,0.3);
  transition: transform 0.15s, box-shadow 0.15s; position: relative;
  margin-left: -10px; overflow: visible;
}
.hand-card:first-child { margin-left: 0; }
.hand-card:hover { transform: translateY(-8px); box-shadow: 0 4px 12px rgba(0,0,0,0.5); z-index: 10; }
.hand-card.attack { background: linear-gradient(180deg, #c03030 0%, #801818 100%); color: #fff; }
.hand-card.negotiate { background: linear-gradient(180deg, #40a040 0%, #206020 100%); color: #fff; }
.hand-card.morph { background: linear-gradient(180deg, #a040a0 0%, #602060 100%); color: #fff; }
.hand-card.reinforcement { background: linear-gradient(180deg, #9040c0 0%, #602080 100%); color: #fff; }
.hand-card.artifact { background: linear-gradient(180deg, #3060d0 0%, #204080 100%); color: #fff; }
.hand-card.flare { background: linear-gradient(180deg, #e0c020 0%, #b09010 100%); color: #1a1a2e; }
.hand-card.hidden { background: linear-gradient(180deg, #2a1a40, #15102a); color: var(--text-dim); }
.card-value { font-size: 22px; font-weight: 900; }
.card-type-label { font-size: 8px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90%; text-align: center; }

/* Card Selection & Play */
.hand-card.card-selected {
  transform: translateY(-14px);
  box-shadow: 0 0 16px 4px rgba(255,215,0,0.7), 0 4px 12px rgba(0,0,0,0.5);
  border-color: #ffd700;
  z-index: 20;
}
.card-play-actions {
  position: absolute;
  top: -52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  pointer-events: auto;
}
.card-play-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10,8,4,0.92);
  border: 1px solid rgba(255,215,0,0.5);
  border-radius: 8px;
  padding: 6px 14px;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}
.card-play-label {
  color: #ffd700;
  font-size: 12px;
  font-weight: 600;
}
.card-play-btn {
  background: linear-gradient(180deg, #40a040, #206020);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 5px 16px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.card-play-btn:hover { background: linear-gradient(180deg, #50c050, #308030); }
.card-cancel-btn {
  background: rgba(255,255,255,0.1);
  color: #ccc;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
}
.card-cancel-btn:hover { background: rgba(255,255,255,0.2); }

/* Play button overlay on selected card */
.card-play-overlay-btn {
  position: absolute; bottom: -26px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(180deg, #40c040, #208020); color: #fff;
  border: 1px solid #50e050; border-radius: 6px;
  padding: 4px 14px; font-size: 12px; font-weight: 800;
  cursor: pointer; white-space: nowrap; z-index: 30;
  box-shadow: 0 2px 10px rgba(64,192,64,0.5);
  animation: fadeSlideUp 0.15s ease-out;
  letter-spacing: 0.5px;
}
.card-play-overlay-btn:hover { background: linear-gradient(180deg, #50e050, #30a030); box-shadow: 0 2px 14px rgba(64,192,64,0.7); }
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Leave game button */
.btn-leave-game {
  margin-left: auto;
  background: rgba(200,40,40,0.15); border: 1px solid rgba(200,40,40,0.3);
  border-radius: 4px; padding: 2px 10px;
  color: rgba(255,80,80,0.6); font-size: 10px; cursor: pointer;
  transition: all 0.2s;
}
.btn-leave-game:hover { background: rgba(200,40,40,0.3); color: #ff5050; border-color: rgba(200,40,40,0.6); }

/* Chat */
.chat-toggle-btn {
  position: fixed; bottom: 16px; left: 16px; z-index: 900;
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(180deg, #3060d0, #1a3060);
  border: 2px solid rgba(100,160,255,0.4);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  transition: transform 0.15s, box-shadow 0.15s;
}
.chat-toggle-btn:hover { transform: scale(1.1); box-shadow: 0 4px 20px rgba(50,100,220,0.5); }
.chat-icon { font-size: 20px; line-height: 1; }
.chat-badge {
  position: absolute; top: -4px; right: -4px;
  background: #e03030; color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid #1a1a2e;
}

.chat-panel {
  position: fixed; bottom: 68px; left: 16px; z-index: 900;
  width: 300px; max-height: 400px;
  background: rgba(10,10,30,0.95); border: 1px solid rgba(100,160,255,0.25);
  border-radius: 12px; display: flex; flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
}
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 13px; font-weight: 700; color: var(--gold);
}
.chat-close-btn {
  background: none; border: none; color: rgba(255,255,255,0.4);
  font-size: 18px; cursor: pointer; padding: 0 4px;
}
.chat-close-btn:hover { color: #fff; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 8px 12px;
  min-height: 120px; max-height: 280px;
  display: flex; flex-direction: column; gap: 4px;
}
.chat-msg {
  font-size: 12px; line-height: 1.4; word-break: break-word;
}
.chat-time { color: rgba(255,255,255,0.25); font-size: 10px; margin-right: 2px; }
.chat-name { font-weight: 700; margin-right: 4px; }
.chat-text { color: rgba(255,255,255,0.85); }
.chat-input-row {
  display: flex; gap: 6px; padding: 8px 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.chat-input {
  flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; padding: 6px 10px; color: #fff; font-size: 12px;
  outline: none;
}
.chat-input:focus { border-color: rgba(100,160,255,0.5); }
.chat-send-btn {
  background: linear-gradient(180deg, #3060d0, #1a3060);
  border: 1px solid rgba(100,160,255,0.3); border-radius: 6px;
  color: #fff; font-size: 11px; font-weight: 600; padding: 6px 12px;
  cursor: pointer; transition: background 0.15s;
}
.chat-send-btn:hover { background: linear-gradient(180deg, #4080e0, #2040a0); }

@media (max-width: 600px) {
  .chat-panel { width: calc(100vw - 32px); left: 16px; bottom: 64px; max-height: 50vh; }
  .chat-toggle-btn { width: 38px; height: 38px; bottom: 12px; left: 12px; }
  .chat-icon { font-size: 17px; }
  .encounter-area.encounter-planning-mode {
    left: 4px; width: 130px; padding: 6px;
    top: auto; bottom: 110px; transform: none;
  }
}

.card-info-inline {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3);
  color: var(--gold); font-weight: 800; font-size: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1;
}
.card-info-inline:hover { background: rgba(255,255,255,0.2); }

.card-info-btn {
  position: absolute; top: 2px; right: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.3);
  color: var(--gold); font-size: 8px; font-weight: 800; font-style: italic;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 5; opacity: 0; transition: opacity 0.15s;
  line-height: 1;
}
.hand-card:hover .card-info-btn { opacity: 1; }

/* Card Detail Popup */
.card-detail-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
}
.card-detail-overlay.hidden { display: none; }
.card-detail-popup {
  width: 280px; border-radius: 12px; padding: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.card-detail-popup.cd-attack { background: linear-gradient(135deg, #5a1515, #2a0a0a); border-color: #c03030; }
.card-detail-popup.cd-negotiate { background: linear-gradient(135deg, #154a15, #0a2a0a); border-color: #30a040; }
.card-detail-popup.cd-artifact { background: linear-gradient(135deg, #3a2a10, #1a1008); border-color: #c89030; }
.card-detail-popup.cd-flare { background: linear-gradient(135deg, #2a1a40, #120a20); border-color: #9060c0; }
.card-detail-popup.cd-other { background: linear-gradient(135deg, #2a2a4a, #10101a); border-color: #6060a0; }
.cd-name { font-size: 16px; font-weight: 800; color: #fff; margin-bottom: 2px; }
.cd-type { font-size: 10px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.cd-desc { font-size: 13px; color: rgba(255,255,255,0.85); line-height: 1.5; margin-bottom: 14px; }

/* Flare detail sections */
.flare-section { margin-bottom: 12px; padding: 8px 10px; background: rgba(255,255,255,0.06); border-radius: 6px; border-left: 3px solid #9060c0; }
.flare-heading { font-size: 12px; font-weight: 800; color: #d0a0ff; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.flare-who { font-size: 10px; font-weight: 600; color: #ffc040; background: rgba(255,192,64,0.15); padding: 1px 6px; border-radius: 3px; }
.flare-when { font-size: 10px; font-weight: 600; color: #60c0ff; background: rgba(96,192,255,0.15); padding: 1px 6px; border-radius: 3px; }
.flare-text { font-size: 12px; color: rgba(255,255,255,0.8); line-height: 1.4; }

/* Card Toast */
/* Global card play visual (card-shaped popup) */
.gcn-card-visual {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 90px;
  height: 130px;
  border-radius: 8px;
  border: 3px solid var(--gold-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px;
  z-index: 9000;
  pointer-events: none;
  box-shadow: 0 4px 24px rgba(0,0,0,0.7), 0 0 30px rgba(255,200,60,0.2);
  text-align: center;
}
.gcn-card-visual.hidden { display: none; }
.gcn-slide { animation: gcnSlide 4s ease-out forwards; }
@keyframes gcnSlide {
  0% { opacity: 0; transform: translateY(-50%) translateX(60px); }
  8% { opacity: 1; transform: translateY(-50%) translateX(0); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-50%) translateX(0); }
}
.gcn-bg-encounter { background: linear-gradient(160deg, #2a2a30, #141418); }
.gcn-bg-attack { background: linear-gradient(160deg, #5a1010, #2a0808); }
.gcn-bg-negotiate { background: linear-gradient(160deg, #0a3a1a, #082210); }
.gcn-bg-artifact { background: linear-gradient(160deg, #3a2a08, #221a04); }
.gcn-bg-flare { background: linear-gradient(160deg, #2a1040, #180826); }
.gcn-bg-reinforcement { background: linear-gradient(160deg, #0a1a3a, #081028); }
.gcn-bg-other { background: linear-gradient(160deg, #222, #111); }
.gcn-top-label { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; }
.gcn-card-name { font-size: 11px; font-weight: 800; color: #ffe0a0; word-break: break-word; line-height: 1.2; }
.gcn-card-val { font-size: 20px; font-weight: 900; color: #fff; }
.gcn-bottom-label { font-size: 8px; text-transform: uppercase; color: rgba(255,255,255,0.5); letter-spacing: 1px; }
.gcn-card-back-visual { font-size: 36px; font-weight: 900; color: rgba(255,255,255,0.3); }

/* Appeal waiting overlay */
.appeal-wait-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.appeal-wait-overlay.hidden { display: none; }
.appeal-wait-box {
  background: rgba(20,14,6,0.96);
  border: 2px solid var(--gold-dim);
  border-radius: 12px;
  padding: 28px 36px;
  text-align: center;
  max-width: 320px;
}
.appeal-wait-icon { font-size: 36px; margin-bottom: 10px; }
.appeal-wait-title { font-size: 18px; font-weight: 800; color: #ffc040; margin-bottom: 8px; }
.appeal-wait-detail { font-size: 13px; color: #ccc; line-height: 1.5; }
.appeal-wait-spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(255,200,60,0.2);
  border-top-color: #ffc040;
  border-radius: 50%;
  margin: 14px auto 0;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Appeal header */
.appeal-header {
  background: rgba(200,60,20,0.3);
  color: #ff8040;
  font-weight: 800;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px 6px 0 0;
  border-bottom: 1px solid rgba(200,60,20,0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Admin undo section */
.admin-undo-section {
  margin-bottom: 8px;
  padding: 8px;
  background: rgba(60,30,10,0.4);
  border-radius: 6px;
  border: 1px solid rgba(255,100,40,0.3);
}
.admin-undo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.undo-label { font-size: 11px; color: #ddd; }
.admin-undo-btn {
  background: linear-gradient(180deg, #c04040, #802020);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 4px 14px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
}
.admin-undo-btn:hover { background: linear-gradient(180deg, #e05050, #a03030); }

.card-toast {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastSlideIn 0.3s ease-out;
  pointer-events: auto;
}
@keyframes toastSlideIn {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.card-toast-success {
  background: rgba(30,100,30,0.92);
  color: #80ff80;
  border: 1px solid rgba(80,200,80,0.5);
}
.card-toast-error {
  background: rgba(120,30,20,0.92);
  color: #ff9080;
  border: 1px solid rgba(200,80,60,0.5);
}
.card-toast-info {
  background: rgba(30,60,120,0.92);
  color: #80c0ff;
  border: 1px solid rgba(80,140,220,0.5);
}
.toast-appeal-btn {
  background: rgba(255,180,40,0.2);
  color: #ffc040;
  border: 1px solid rgba(255,180,40,0.5);
  border-radius: 5px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.toast-appeal-btn:hover { background: rgba(255,180,40,0.35); }

/* Admin Appeal Notifications */
.appeal-notifications {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}
.appeal-card {
  background: rgba(40,20,8,0.95);
  border: 1px solid rgba(255,180,40,0.6);
  border-radius: 8px;
  padding: 10px 14px;
  backdrop-filter: blur(6px);
  animation: toastSlideIn 0.3s ease-out;
}
.appeal-info {
  color: #ffe0a0;
  font-size: 12px;
  margin-bottom: 8px;
  line-height: 1.4;
}
.appeal-info em { color: #ffd700; }
.appeal-phase { color: #aaa; font-size: 10px; margin-left: 4px; }
.appeal-actions {
  display: flex;
  gap: 8px;
}
.appeal-approve {
  background: linear-gradient(180deg, #40a040, #206020);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 4px 14px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
}
.appeal-approve:hover { background: linear-gradient(180deg, #50c050, #308030); }
.appeal-deny {
  background: linear-gradient(180deg, #a04040, #602020);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 4px 14px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
}
.appeal-deny:hover { background: linear-gradient(180deg, #c05050, #803030); }

/* Phase Bar */
.phase-bar-container {
  background: #2a1a10; padding: 8px 20px 38px; border-top: 1px solid #4a3520;
  flex-shrink: 0;
}
.phase-bar {
  display: flex; height: 40px; border-radius: 8px; overflow: hidden;
  background: #3a2a18; border: 1px solid #5a4a30;
}
.phase-segment {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: var(--text-dim);
  cursor: pointer; position: relative; transition: background 0.2s;
}
.phase-segment.active {
  background: linear-gradient(180deg, #e8a030, #c07818);
  color: #fff;
}
.phase-segment.held-by-me { background: rgba(255,255,0,0.12); }
.phase-segment .hold-icon {
  position: absolute; top: 2px; right: 4px; font-size: 8px; color: #ff0;
}
.phase-info-row {
  display: flex; gap: 8px; align-items: center; height: 26px; margin-top: 4px;
}
.role-indicator {
  font-size: 11px; font-weight: 700; padding: 2px 12px; border-radius: 12px;
  display: inline-flex; align-items: center; gap: 4px;
}
.role-indicator .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.role-indicator.offense { background: rgba(232,144,32,0.15); color: var(--offense-color); }
.role-indicator.offense .dot { background: var(--offense-color); }
.role-indicator.defense { background: rgba(208,48,48,0.15); color: var(--defense-color); }
.role-indicator.defense .dot { background: var(--defense-color); }
.role-indicator.ally { background: rgba(48,128,208,0.15); color: var(--ally-color); }
.role-indicator.ally .dot { background: var(--ally-color); }
.role-indicator.other { background: rgba(128,128,128,0.15); color: #888; }
.role-indicator.other .dot { background: #888; }
.destiny-indicator {
  font-size: 10px; font-weight: 600; padding: 2px 10px; border-radius: 12px;
}
.hold-info {
  font-size: 10px; color: #ff0; padding: 2px 8px; border-radius: 12px;
  background: rgba(255,255,0,0.1); display: inline-flex; align-items: center; gap: 4px;
}
.action-bar {
  display: flex; align-items: center; justify-content: space-between; margin-top: 4px; min-height: 30px;
}
.block-reason { font-size: 11px; color: rgba(232,144,32,0.7); }
.action-buttons { display: flex; gap: 8px; }
.action-btn {
  padding: 5px 14px; border: none; border-radius: 8px; font-size: 12px;
  font-weight: 600; cursor: pointer; background: var(--gold); color: #1a1a2e;
  transition: all 0.15s;
}
.action-btn:hover { background: #e6bc55; transform: translateY(-1px); }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Regroup retrieve UI */
.regroup-retrieve-panel { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.regroup-label { font-size: 12px; color: #ffe0a0; font-weight: 700; text-align: center; }
.regroup-planets { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.regroup-planet-btn { font-size: 11px !important; padding: 4px 10px !important; background: linear-gradient(180deg, #3a6a3a, #204020) !important; color: #80ff80 !important; border: 1px solid rgba(80,200,80,0.4) !important; }
.regroup-planet-btn:hover { background: linear-gradient(180deg, #4a8a4a, #306030) !important; }
.regroup-skip-btn { font-size: 10px !important; padding: 3px 10px !important; background: rgba(100,100,100,0.4) !important; color: #aaa !important; border: 1px solid rgba(150,150,150,0.3) !important; }
.release-hold-btn {
  padding: 3px 10px; border: 1px solid rgba(255,255,0,0.5); border-radius: 12px;
  background: rgba(255,255,0,0.15); color: #ff0; font-size: 10px; font-weight: 700;
  cursor: pointer;
}

/* Coordinator Choice */
.coordinator-choices {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 16px;
}
.coordinator-choice-card {
  background: linear-gradient(135deg, rgba(30,30,60,0.95), rgba(20,20,50,0.95));
  border: 2px solid rgba(255,215,0,0.3); border-radius: 14px; padding: 20px 24px;
  cursor: pointer; transition: all 0.2s; text-align: center; min-width: 120px;
}
.coordinator-choice-card:hover {
  border-color: var(--gold); transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(255,215,0,0.3);
}
.coordinator-choice-label {
  margin-top: 8px; font-size: 14px; font-weight: 700; color: #fff;
}

/* Saboteur tokens on planets */
.planet { position: relative; }
.saboteur-token {
  position: absolute; bottom: 2px; right: 2px; font-size: 12px; line-height: 1;
  width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(0,0,0,0.5);
}
.saboteur-token-trap { color: #ff6b6b; }
.saboteur-token-decoy { color: #69db7c; }
.saboteur-token-token { color: #ffd43b; }

/* Saboteur placement overlay */
.saboteur-placement .saboteur-pool { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.saboteur-token-btn { font-size: 12px !important; padding: 6px 12px !important; }
.saboteur-token-btn.selected { border-color: var(--gold); box-shadow: 0 0 10px var(--gold-dim); }
.saboteur-trap { border-color: #ff6b6b; color: #ff6b6b; }
.saboteur-decoy { border-color: #69db7c; color: #69db7c; }
.saboteur-planets-label { font-size: 12px; color: var(--text-dim); margin-top: 12px; margin-bottom: 6px; }
.saboteur-planets { display: flex; flex-wrap: wrap; gap: 6px; }
.saboteur-planet-slot { font-size: 11px !important; padding: 4px 10px !important; }

/* Saboteur relocate overlay */
.saboteur-relocate .saboteur-slots { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.saboteur-slot-btn { font-size: 11px !important; padding: 4px 10px !important; }
.saboteur-slot-btn.selected { border-color: var(--gold); background: rgba(212,168,67,0.2); }
.saboteur-moves-summary { font-size: 11px; color: var(--text-dim); margin: 8px 0; }
.saboteur-relocate-actions { display: flex; gap: 8px; margin-top: 12px; }

/* Overlay */
.overlay-container {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.overlay-panel {
  background: var(--panel-bg); border: 1px solid var(--panel-border);
  border-radius: 16px; padding: 30px; text-align: center; max-width: 600px;
}
.overlay-title { font-size: 22px; font-weight: 900; letter-spacing: 3px; margin-bottom: 12px; }
.overlay-subtitle { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.overlay-players { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.overlay-player-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; background: none; border: none; padding: 8px;
}
.overlay-player-circle {
  width: 56px; height: 56px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
  color: #fff; transition: all 0.15s;
}
.overlay-player-circle.selected { border-color: #fff; border-width: 3px; }
.overlay-player-circle:hover { border-color: #fff; }
.overlay-player-name { font-size: 12px; color: var(--text-dim); }
.overlay-player-info { font-size: 9px; color: rgba(255,255,255,0.4); }
.overlay-btn {
  margin-top: 16px; padding: 10px 30px; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  background: var(--offense-color); color: #fff;
}
.overlay-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.overlay-btn.green { background: #40a040; }
.overlay-btn.red { background: #d03030; }
.overlay-btn.gray { background: #555; }
.overlay-alliance-btns { display: flex; gap: 12px; justify-content: center; margin-top: 12px; }

/* Planet selection */
.planet-select-grid { display: flex; gap: 14px; justify-content: center; }
.planet-select-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; background: none; border: none;
}
.planet-select-circle {
  width: 50px; height: 50px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  color: #fff; border: 2px solid;
}
.planet-select-label { font-size: 10px; color: var(--text-dim); }

/* Ship selection */
.ship-counter { font-size: 16px; font-weight: 700; color: var(--offense-color); margin: 8px 0; }
.colony-select-grid { display: flex; gap: 10px; justify-content: center; }
.colony-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; background: none; border: none;
}
.colony-circle {
  width: 44px; height: 44px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  color: #fff; border: 2px solid; transition: opacity 0.15s;
}
.colony-btn.disabled .colony-circle { opacity: 0.3; cursor: not-allowed; }
.colony-label { font-size: 9px; color: var(--text-dim); }

/* Admin Panel */
.admin-panel {
  position: fixed; top: 10px; right: 10px; z-index: 200;
  background: rgba(0,0,0,0.9); border: 1px solid #555;
  border-radius: 10px; min-width: 260px; font-size: 12px;
}
.admin-header {
  padding: 8px 12px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid #444; color: #ff4444; font-weight: 700;
}
.admin-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.admin-log {
  max-height: 100px; overflow-y: auto; font-size: 10px; color: #aaa;
  border: 1px solid #333; border-radius: 4px; padding: 4px;
}
.admin-log-entry { padding: 2px 0; border-bottom: 1px solid #222; }
.admin-log-entry .timestamp { color: #666; }
.admin-controls { display: flex; flex-direction: column; gap: 6px; }
.admin-row { display: flex; gap: 4px; align-items: center; }
.admin-log-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(255,60,60,0.9); color: #fff; padding: 8px 20px;
  border-radius: 20px; font-size: 12px; z-index: 300;
}

/* Alien Selection */
.alien-selection-screen {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #0a0818 0%, #1a1030 50%, #0a0818 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 500; padding: 20px;
}
.alien-sel-title {
  font-size: 28px; font-weight: 900; letter-spacing: 5px;
  background: linear-gradient(90deg, #d4a844, #fff, #d4a844);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}
.flare-choice-card {
  width: 150px; padding: 14px; text-align: center; cursor: pointer;
  background: linear-gradient(180deg, rgba(60,30,90,0.6), rgba(20,10,40,0.8));
  border: 1.5px solid rgba(128,0,255,0.3); border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.flare-choice-card:hover {
  transform: translateY(-4px); box-shadow: 0 8px 25px rgba(128,0,255,0.4);
  border-color: rgba(128,0,255,0.6);
}
.alien-choose-btn {
  margin-top: 16px; padding: 12px 40px; font-size: 16px; font-weight: 700;
  background: linear-gradient(90deg, #d4a844, #b88830); color: white;
  border: none; border-radius: 10px; cursor: pointer;
  transition: background 0.2s;
}
.alien-choose-btn:hover { background: linear-gradient(90deg, #e0b850, #c89840); }

/* Card dealing animation */
@keyframes dealCard {
  0% {
    opacity: 0;
    transform: translateY(-200px) scale(0.5) rotate(-15deg);
  }
  60% {
    opacity: 1;
    transform: translateY(10px) scale(1.05) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}
.hand-card.dealing {
  animation: dealCard 0.4s ease-out backwards;
}
.dealing-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.7); display: flex; align-items: center;
  justify-content: center; z-index: 400;
}
.dealing-text {
  font-size: 28px; font-weight: 900; letter-spacing: 5px; color: var(--gold);
  animation: dealPulse 1s ease-in-out infinite;
}
@keyframes dealPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Catalog Side Buttons */
.catalog-buttons {
  position: fixed; top: 50%; right: 0; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 6px; z-index: 50;
}
.catalog-btn {
  background: rgba(0,0,0,0.7); color: var(--gold); border: 1px solid var(--gold-dim);
  border-right: none; border-radius: 8px 0 0 8px;
  padding: 10px 10px 10px 12px; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; writing-mode: horizontal-tb;
  backdrop-filter: blur(4px);
}
.catalog-btn:hover {
  background: rgba(0,0,0,0.9); padding-right: 16px; color: #fff;
}

/* Project Admin Overlay (lobby) */
.project-admin-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.9); z-index: 700;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.project-admin-overlay.hidden { display: none !important; }
.project-admin-card {
  background: var(--panel-bg); border: 1px solid var(--panel-border);
  border-radius: 16px; padding: 24px; max-width: 900px; width: 100%;
  max-height: 92vh; overflow: hidden; display: flex; flex-direction: column;
}
.project-admin-section {
  flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0;
}
.project-admin-section h3 { margin-bottom: 8px; color: var(--gold); font-size: 18px; }
.project-admin-hint { color: var(--text-dim); font-size: 12px; margin-bottom: 16px; }
.project-admin-actions { display: flex; gap: 10px; margin-top: 16px; flex-shrink: 0; }
.admin-tab-content { flex: 1; overflow-y: auto; min-height: 0; }
.project-admin-editor-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.project-admin-rules-list {
  flex: 1; overflow-y: auto; margin: 12px 0; max-height: 50vh;
  display: flex; flex-direction: column; gap: 8px;
}
.project-admin-rules-list::-webkit-scrollbar { width: 6px; }
.project-admin-rules-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.card-rule-row {
  display: grid; grid-template-columns: 1fr auto minmax(180px, 2fr); gap: 10px; align-items: start;
  padding: 10px 12px; background: rgba(255,255,255,0.05); border-radius: 8px;
  font-size: 13px;
}
.card-rule-header { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; }
.card-rule-row .card-rule-name { font-weight: 600; color: #fff; flex: 1; }
.effect-toggle-btn {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08); color: #aaa; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
  line-height: 1; padding: 0; flex-shrink: 0;
}
.effect-toggle-btn:hover { background: rgba(255,255,255,0.18); color: #fff; border-color: var(--gold); }
.rule-auto-tag { font-size: 9px; font-weight: 700; color: #50c0ff; background: rgba(50,150,255,0.15); padding: 1px 5px; border-radius: 3px; margin-left: 4px; vertical-align: middle; }
.card-rule-roles-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.card-rule-roles-checks .role-check { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-dim); cursor: pointer; white-space: nowrap; }
.card-rule-roles-checks input { accent-color: #7c4dff; }
.card-rule-phases { display: flex; flex-wrap: wrap; gap: 4px; }
.card-rule-phases label { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-dim); cursor: pointer; }
.card-rule-phases input { accent-color: var(--gold); }

.card-rule-effects {
  grid-column: 1 / -1; margin-top: 6px; padding: 8px 10px;
  background: rgba(0,0,0,0.3); border-radius: 6px; border: 1px solid rgba(255,255,255,0.08);
}
.effect-pills-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 24px; }
.effect-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  background: linear-gradient(135deg, rgba(124,77,255,0.25), rgba(80,192,255,0.18));
  border: 1px solid rgba(124,77,255,0.4); border-radius: 12px;
  font-size: 11px; color: #d0c0ff; font-weight: 600; cursor: default;
}
.effect-remove {
  cursor: pointer; color: rgba(255,100,100,0.6); font-size: 14px; margin-left: 2px; line-height: 1;
}
.effect-remove:hover { color: #ff5050; }
.effect-add-row { display: flex; gap: 6px; align-items: center; }
.effect-add-select {
  padding: 4px 8px; border-radius: 6px; background: rgba(255,255,255,0.1);
  color: #ccc; border: 1px solid rgba(255,255,255,0.15); font-size: 11px; flex: 1; max-width: 200px;
}
.effect-param-input {
  padding: 4px 8px; border-radius: 6px; background: rgba(255,255,255,0.08);
  color: #ccc; border: 1px solid rgba(255,255,255,0.12); font-size: 11px;
}
.effect-desc-text {
  margin-top: 8px; font-size: 11px; color: rgba(255,255,255,0.45);
  line-height: 1.5; font-style: italic; border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 6px;
}

/* Test Panel */
.test-panel {
  position: fixed; bottom: 10px; left: 10px; z-index: 500;
  background: rgba(0,0,0,0.92); border: 1px solid var(--gold-dim);
  border-radius: 10px; width: 320px; font-size: 12px;
  backdrop-filter: blur(8px);
}
.test-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.1);
  color: var(--gold); font-weight: 700; font-size: 13px;
}
.test-panel-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; }
.test-panel-body::-webkit-scrollbar { width: 4px; }
.test-panel-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.test-section { display: flex; flex-direction: column; gap: 4px; }
.test-label { color: var(--text-dim); font-size: 11px; font-weight: 600; }
.test-alien-row { display: flex; gap: 4px; }
.test-alien-row select { flex: 1; font-size: 11px; padding: 4px 6px; }
.test-add-card-row { display: flex; gap: 4px; flex-wrap: wrap; }
.test-add-card-row select, .test-add-card-row input { font-size: 11px; padding: 4px 6px; }
.test-current-hand { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; min-height: 24px; }
.test-hand-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; background: rgba(255,255,255,0.1); border-radius: 4px;
  font-size: 11px; color: #fff;
}
.test-hand-tag .remove-tag { cursor: pointer; color: #f66; font-weight: 700; }
.test-quick-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.btn-compact { padding: 5px 12px; font-size: 11px; }

/* Game Log Panel */
.game-log-panel {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  background: rgba(0,0,0,0.88); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; width: 260px; font-size: 12px;
  backdrop-filter: blur(6px);
}
.game-log-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; cursor: pointer; color: var(--gold); font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  user-select: none;
}
.game-log-header .toggle-icon { font-size: 16px; }
.game-log-body {
  max-height: 200px; overflow-y: auto; padding: 6px 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.game-log-body::-webkit-scrollbar { width: 4px; }
.game-log-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.game-log-entry { color: rgba(255,255,255,0.7); font-size: 11px; line-height: 1.4; }
.game-log-entry.admin-entry { color: var(--gold); }
.game-log-entry.phase-entry { color: #5080ff; font-weight: 600; }
.game-log-entry.turn-entry { color: #50ff70; font-weight: 700; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 4px; margin-top: 4px; }

/* Catalog Overlay */
.catalog-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.92); z-index: 600;
  display: flex; flex-direction: column; overflow: hidden;
}
.catalog-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.catalog-title {
  font-size: 22px; font-weight: 900; letter-spacing: 3px; color: var(--gold);
}
.catalog-close {
  background: none; border: 1px solid rgba(255,255,255,0.3); border-radius: 8px;
  color: #fff; font-size: 14px; padding: 6px 16px; cursor: pointer;
  font-weight: 600; transition: all 0.15s;
}
.catalog-close:hover { background: rgba(255,255,255,0.1); }
.catalog-search {
  padding: 0 24px; margin: 12px 0; flex-shrink: 0;
  display: flex; gap: 10px; align-items: center;
}
.catalog-search-input {
  flex: 1; max-width: 400px; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
  padding: 8px 14px; color: #fff; font-size: 14px; outline: none;
}
.catalog-search-input:focus { border-color: var(--gold); }
.catalog-filter-btn {
  padding: 6px 12px; border-radius: 6px; font-size: 11px; font-weight: 700;
  cursor: pointer; border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6);
  transition: all 0.15s;
}
.catalog-filter-btn.active {
  background: var(--gold); color: #1a1a2e; border-color: var(--gold);
}
.catalog-filter-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.catalog-filter-btn.active:hover { background: #e6bc55; }
.catalog-count {
  font-size: 12px; color: rgba(255,255,255,0.4); margin-left: auto;
}
.catalog-grid {
  flex: 1; overflow-y: auto; padding: 16px 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px; align-content: start;
}
.catalog-grid::-webkit-scrollbar { width: 6px; }
.catalog-grid::-webkit-scrollbar-track { background: transparent; }
.catalog-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* Alien card in catalog */
.catalog-alien-card {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 12px; cursor: pointer;
  display: flex; gap: 12px; transition: all 0.15s; align-items: flex-start;
}
.catalog-alien-card:hover {
  background: rgba(255,255,255,0.1); border-color: var(--gold-dim);
  transform: translateY(-2px);
}
.catalog-alien-img {
  width: 60px; height: 60px; border-radius: 8px; object-fit: cover;
  border: 1px solid rgba(255,255,255,0.15); flex-shrink: 0;
}
.catalog-alien-info { flex: 1; min-width: 0; }
.catalog-alien-name {
  font-size: 14px; font-weight: 800; color: #fff; margin-bottom: 2px;
}
.catalog-alien-summary {
  font-size: 11px; color: rgba(255,255,255,0.5); margin-bottom: 4px;
}
.catalog-alien-meta {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.catalog-tag {
  font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.catalog-tag.green { background: rgba(40,180,60,0.2); color: #50ff70; }
.catalog-tag.yellow { background: rgba(200,180,40,0.2); color: #fff050; }
.catalog-tag.red { background: rgba(200,40,40,0.2); color: #ff5050; }
.catalog-tag.expansion { background: rgba(100,100,200,0.15); color: rgba(150,150,255,0.8); }
.catalog-tag.role { background: rgba(200,150,50,0.15); color: var(--gold); }

/* Alien detail modal */
.catalog-detail {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.85); z-index: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 30px;
}
.catalog-detail-card {
  background: linear-gradient(145deg, #1a1030, #0d0818);
  border: 1px solid var(--gold-dim); border-radius: 16px;
  max-width: 500px; width: 100%; max-height: 85vh; overflow-y: auto;
  padding: 24px;
}
.catalog-detail-card::-webkit-scrollbar { width: 4px; }
.catalog-detail-card::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.detail-header {
  display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px;
}
.detail-img {
  width: 90px; height: 90px; border-radius: 10px; object-fit: cover;
  border: 2px solid var(--gold-dim);
}
.detail-title-area { flex: 1; }
.detail-name { font-size: 22px; font-weight: 900; color: var(--gold); }
.detail-summary { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.detail-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.detail-section {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.08);
}
.detail-section-title {
  font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  color: var(--gold); margin-bottom: 6px;
}
.detail-power-text {
  font-size: 13px; color: rgba(255,255,255,0.85); line-height: 1.5;
}
.detail-history {
  font-size: 11px; color: rgba(255,255,255,0.35); line-height: 1.5; font-style: italic;
}
.detail-phase-bar {
  display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap;
}
.detail-phase-pip {
  font-size: 9px; padding: 3px 8px; border-radius: 4px; font-weight: 700;
  text-transform: uppercase;
}
.detail-phase-pip.active { background: rgba(232,160,48,0.3); color: #e8a030; }
.detail-phase-pip.inactive { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.2); }

/* Flare card in catalog */
.catalog-flare-card {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 14px; cursor: pointer;
  transition: all 0.15s;
}
.catalog-flare-card:hover {
  background: rgba(255,255,255,0.1); border-color: rgba(200,180,40,0.4);
  transform: translateY(-2px);
}
.flare-card-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.flare-card-img {
  width: 40px; height: 40px; border-radius: 6px; object-fit: cover;
  border: 1px solid rgba(255,255,255,0.15);
}
.flare-card-name { font-size: 14px; font-weight: 800; color: #fff; }
.flare-card-section {
  padding: 8px 10px; border-radius: 6px; margin-bottom: 6px;
}
.flare-card-section.wild {
  background: rgba(100,80,200,0.12); border-left: 3px solid #8060d0;
}
.flare-card-section.super {
  background: rgba(200,160,40,0.12); border-left: 3px solid var(--gold);
}
.flare-section-label {
  font-size: 9px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 4px;
}
.flare-section-label.wild-label { color: #8060d0; }
.flare-section-label.super-label { color: var(--gold); }
.flare-section-text {
  font-size: 11px; color: rgba(255,255,255,0.75); line-height: 1.4;
}
.flare-section-meta {
  margin-top: 4px; display: flex; gap: 4px; flex-wrap: wrap;
}
.flare-meta-tag {
  font-size: 8px; font-weight: 700; padding: 2px 5px; border-radius: 3px;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.4);
}
.detail-close-btn {
  margin-top: 16px; width: 100%; padding: 10px; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; background: rgba(255,255,255,0.05); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.detail-close-btn:hover { background: rgba(255,255,255,0.15); }

/* Admin Login */
.admin-login-error {
  color: #ff5050; font-size: 12px; margin-top: 6px; padding: 4px 8px;
  background: rgba(255,50,50,0.1); border-radius: 4px;
}
.admin-login-error.hidden { display: none; }
.admin-logged-in { color: #50ff70 !important; border-color: #50ff70 !important; }
.admin-user-label { font-size: 11px; color: #50ff70; font-weight: 600; margin-right: 4px; }

/* Admin Tabs */
.admin-tabs { display: flex; gap: 4px; }
.admin-tab {
  padding: 6px 14px; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px 8px 0 0;
  background: rgba(255,255,255,0.04); color: var(--text-dim); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; border-bottom: none;
}
.admin-tab.active { background: rgba(124,77,255,0.2); color: #d0c0ff; border-color: rgba(124,77,255,0.4); }
.admin-tab:hover { background: rgba(255,255,255,0.1); color: #fff; }
.admin-tab-content.hidden { display: none; }
.admin-header-right { display: flex; align-items: center; gap: 6px; }
.project-admin-editor-header { flex-wrap: wrap; }

/* Mandatory toggle */
.mandatory-toggle {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-dim);
  cursor: pointer; white-space: nowrap;
}
.mandatory-toggle input { accent-color: #ff7043; }

/* Main Admin Floating Button */
.main-admin-floating-btn {
  position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 600;
  padding: 6px 16px; border: 2px solid #ff7043; border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,112,67,0.4), rgba(255,160,0,0.25));
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  cursor: pointer; transition: all 0.2s; box-shadow: 0 2px 12px rgba(255,112,67,0.35);
}
.main-admin-floating-btn:hover {
  background: linear-gradient(135deg, rgba(255,112,67,0.6), rgba(255,160,0,0.4));
  box-shadow: 0 4px 20px rgba(255,112,67,0.5); transform: translateX(-50%) translateY(-2px);
}
.main-admin-floating-btn.hidden { display: none; }

/* Main Admin In-Game Overlay */
.main-admin-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.92); z-index: 800;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.main-admin-overlay.hidden { display: none !important; }
.main-admin-card {
  background: var(--panel-bg); border: 2px solid #ff7043;
  border-radius: 16px; padding: 24px; max-width: 620px; width: 100%;
  max-height: 90vh; overflow: hidden; display: flex; flex-direction: column;
}
.main-admin-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; flex-wrap: wrap; gap: 8px;
}

/* Main Admin log entries */
.game-log-body .main-admin-log-entry {
  background: rgba(255,112,67,0.12); border-left: 3px solid #ff7043;
  padding: 3px 8px; border-radius: 4px; margin: 2px 0;
}

/* Power Prompt UI */
#powerPromptContainer {
  position: fixed; bottom: 200px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 12px; z-index: 600; max-width: 90vw;
  flex-wrap: wrap; justify-content: center;
}
.power-prompt-card {
  background: linear-gradient(135deg, rgba(30,30,60,0.97), rgba(20,20,50,0.97));
  border: 2px solid #7c4dff; border-radius: 14px; padding: 16px 20px;
  min-width: 280px; max-width: 380px; box-shadow: 0 8px 32px rgba(124,77,255,0.4);
  animation: powerPromptAppear 0.4s ease-out;
}
@keyframes powerPromptAppear {
  from { transform: translateY(30px) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.power-prompt-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.power-prompt-alien {
  font-weight: 700; font-size: 16px; color: #b388ff;
  text-transform: uppercase; letter-spacing: 1px;
}
.power-prompt-mandatory {
  background: #ff5252; color: #fff; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
}
.power-prompt-optional {
  background: #448aff; color: #fff; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
}
.power-prompt-desc {
  color: rgba(255,255,255,0.8); font-size: 13px; margin-bottom: 12px; line-height: 1.4;
}
.power-prompt-buttons {
  display: flex; gap: 8px; justify-content: center;
}
.power-prompt-choices {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; justify-content: center;
}
.power-btn {
  padding: 8px 18px; border: none; border-radius: 8px; cursor: pointer;
  font-weight: 600; font-size: 13px; transition: all 0.2s;
}
.power-btn-yes {
  background: linear-gradient(135deg, #7c4dff, #536dfe); color: #fff;
}
.power-btn-yes:hover { box-shadow: 0 4px 16px rgba(124,77,255,0.5); transform: translateY(-1px); }
.power-btn-no {
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.2);
}
.power-btn-no:hover { background: rgba(255,82,82,0.3); color: #ff5252; }
.power-btn-choice {
  background: rgba(255,255,255,0.08); color: #b388ff; border: 1px solid rgba(124,77,255,0.4);
}
.power-btn-choice:hover { background: rgba(124,77,255,0.3); }
.power-prompt-input label {
  display: block; color: rgba(255,255,255,0.6); font-size: 12px; margin-bottom: 6px;
}
.power-prompt-input select, .power-prompt-input input[type="range"] {
  width: 100%; margin-bottom: 8px; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2); color: #fff; border-radius: 6px; padding: 6px;
}

/* Power Announcement */
#powerAnnouncementNotif {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  z-index: 650; transition: opacity 0.5s;
}
.power-announce-inner {
  background: linear-gradient(135deg, rgba(124,77,255,0.9), rgba(83,109,254,0.9));
  border-radius: 12px; padding: 12px 24px; display: flex; flex-direction: column;
  align-items: center; gap: 4px; box-shadow: 0 6px 24px rgba(124,77,255,0.5);
  animation: powerAnnounce 0.4s ease-out;
}
@keyframes powerAnnounce {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.power-announce-inner strong { color: #fff; font-size: 16px; }
.power-announce-inner span { color: rgba(255,255,255,0.85); font-size: 13px; }
.power-announce-inner small { color: rgba(255,255,255,0.6); font-size: 11px; }

/* Alien Token Display */
#alienTokenDisplay {
  display: flex; gap: 8px; justify-content: center; padding: 4px 0; flex-wrap: wrap;
}
.alien-token-badge {
  background: rgba(124,77,255,0.15); border: 1px solid rgba(124,77,255,0.4);
  border-radius: 20px; padding: 4px 12px; display: flex; gap: 6px; align-items: center;
}
.token-type { color: #b388ff; font-size: 11px; text-transform: uppercase; font-weight: 600; }
.token-count { color: #fff; font-size: 14px; font-weight: 700; }

/* Game Setup Log Entry */
.game-log-body .game-setup-log {
  background: rgba(124,77,255,0.12); border-left: 3px solid #7c4dff;
  padding: 3px 8px; border-radius: 4px; margin: 2px 0;
}

/* Admin Editor Badges */
.game-setup-badge {
  background: #7c4dff; color: #fff; font-size: 9px; padding: 2px 6px;
  border-radius: 8px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  margin-left: 6px; vertical-align: middle;
}
.trigger-badge {
  background: rgba(124,77,255,0.15); color: #b388ff; font-size: 10px; padding: 2px 8px;
  border-radius: 8px; display: inline-block; margin: 4px 0;
}
.rule-auto-tag {
  background: rgba(76,175,80,0.2); color: #66bb6a; font-size: 9px; padding: 2px 6px;
  border-radius: 8px; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase; margin-left: 6px;
}
.effect-trigger-timing { margin: 4px 0; }

/* ===== Alien Power Button & Indicators ===== */

.player-alien-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.power-use-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 2px solid rgba(124,77,255,0.3);
  border-radius: 10px;
  background: rgba(30,30,60,0.7);
  color: rgba(255,255,255,0.35);
  font-weight: 700;
  font-size: 12px;
  cursor: default;
  transition: all 0.3s ease;
  white-space: nowrap;
  user-select: none;
}

.power-use-btn.active {
  border-color: #7c4dff;
  background: linear-gradient(135deg, rgba(124,77,255,0.25), rgba(83,109,254,0.2));
  color: #e0d0ff;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(124,77,255,0.3);
}

.power-use-btn.active:hover {
  background: linear-gradient(135deg, rgba(124,77,255,0.5), rgba(83,109,254,0.4));
  box-shadow: 0 0 20px rgba(124,77,255,0.5);
  transform: translateY(-1px);
}

.power-use-btn.active.pulse {
  animation: powerBtnPulse 1.5s ease-in-out infinite;
}

@keyframes powerBtnPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(124,77,255,0.3); }
  50% { box-shadow: 0 0 24px rgba(124,77,255,0.7), 0 0 40px rgba(124,77,255,0.2); }
}

.power-use-btn.disabled {
  opacity: 0.5;
}

.power-btn-icon {
  font-size: 14px;
}

.power-status-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.power-status-badge.mandatory.active {
  background: linear-gradient(135deg, rgba(255,152,0,0.3), rgba(255,87,34,0.2));
  border: 1px solid rgba(255,152,0,0.5);
  color: #ffcc80;
  animation: mandatoryGlow 2s ease-in-out infinite;
}

.power-status-badge.mandatory.inactive {
  background: rgba(60,60,80,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.35);
}

@keyframes mandatoryGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(255,152,0,0.2); }
  50% { box-shadow: 0 0 16px rgba(255,152,0,0.5); }
}

.power-status-icon {
  font-size: 13px;
}

/* Opponent power indicators */
.opp-power-indicator {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 6px;
  margin-top: 2px;
  font-weight: 600;
}

.opp-power-indicator.mandatory-active {
  color: #ffcc80;
  background: rgba(255,152,0,0.25);
  border: 1px solid rgba(255,152,0,0.4);
  animation: oppPowerGlow 2s ease-in-out infinite;
}

.opp-power-indicator.optional-ready {
  color: #b388ff;
  background: rgba(124,77,255,0.2);
  border: 1px solid rgba(124,77,255,0.4);
  animation: oppPowerGlow 2s ease-in-out infinite;
}

.opp-power-indicator.dormant {
  color: rgba(255,255,255,0.2);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
}

@keyframes oppPowerGlow {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Enhanced Power Announcement */
.power-announce-big {
  flex-direction: row !important;
  gap: 12px !important;
  padding: 14px 28px !important;
  min-width: 320px;
  position: relative;
  overflow: hidden;
}

.power-announce-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  object-fit: cover;
  flex-shrink: 0;
}

.power-announce-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.power-announce-alien-name {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #fff !important;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.power-announce-effect {
  font-size: 12px !important;
  color: rgba(255,255,255,0.7) !important;
}

.power-announce-flash {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 3px 10px;
  border-radius: 0 12px 0 8px;
}

/* ===== AI Agent Chat Panel ===== */

.agent-section {
  border-top: 1px solid rgba(124,77,255,0.3);
  margin-top: 10px;
  padding-top: 6px;
}

.agent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 700;
  color: #b388ff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.agent-header:hover {
  color: #d1c4e9;
}

.agent-status-dot {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.agent-status-ok {
  background: rgba(76,175,80,0.2);
  color: #66bb6a;
}

.agent-status-error {
  background: rgba(244,67,54,0.2);
  color: #ef5350;
}

.agent-status-busy {
  background: rgba(255,193,7,0.2);
  color: #ffca28;
  animation: agentPulse 1s ease-in-out infinite;
}

@keyframes agentPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.agent-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}

.agent-config-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.agent-config-row.agent-connected {
  opacity: 0.5;
  pointer-events: none;
}

.agent-key-input {
  flex: 1;
  min-width: 0;
  font-size: 11px !important;
}

.agent-connect-btn {
  background: linear-gradient(135deg, #7c4dff, #536dfe) !important;
  color: #fff !important;
  white-space: nowrap;
}

.agent-chat-area {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  min-height: 60px;
}

.agent-msg {
  display: flex;
}

.agent-msg-user {
  justify-content: flex-end;
}

.agent-msg-assistant, .agent-msg-error {
  justify-content: flex-start;
}

.agent-msg-bubble {
  max-width: 90%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.4;
  word-wrap: break-word;
}

.agent-user-bubble {
  background: linear-gradient(135deg, #7c4dff, #536dfe);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.agent-ai-bubble {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
  border-bottom-left-radius: 4px;
}

.agent-error-bubble {
  background: rgba(244,67,54,0.2);
  color: #ef5350;
  border-bottom-left-radius: 4px;
}

.agent-ai-text {
  margin-bottom: 6px;
}

.agent-action-card {
  background: rgba(124,77,255,0.1);
  border: 1px solid rgba(124,77,255,0.3);
  border-radius: 8px;
  padding: 8px;
  margin-top: 6px;
  transition: all 0.3s;
}

.agent-action-card.agent-action-executed {
  border-color: rgba(76,175,80,0.5);
  background: rgba(76,175,80,0.08);
}

.agent-action-card.agent-action-rejected {
  border-color: rgba(244,67,54,0.3);
  background: rgba(244,67,54,0.05);
  opacity: 0.6;
}

.agent-action-header {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}

.agent-action-type {
  background: rgba(124,77,255,0.3);
  color: #b388ff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.agent-action-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.8);
}

.agent-code-preview {
  background: rgba(0,0,0,0.4);
  color: #a5d6a7;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-family: 'SF Mono', 'Menlo', monospace;
  overflow-x: auto;
  margin: 4px 0;
  white-space: pre-wrap;
  max-height: 100px;
}

.agent-cmd-preview {
  display: block;
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  font-family: monospace;
  margin: 2px 0;
}

.agent-action-btns {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.agent-exec-btn {
  background: linear-gradient(135deg, #43a047, #2e7d32) !important;
  color: #fff !important;
  border: none;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.agent-exec-btn:hover {
  box-shadow: 0 2px 8px rgba(67,160,71,0.4);
  transform: translateY(-1px);
}

.agent-reject-btn {
  background: rgba(255,255,255,0.08) !important;
  color: rgba(255,255,255,0.6) !important;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.agent-reject-btn:hover {
  background: rgba(244,67,54,0.2) !important;
  color: #ef5350 !important;
}

.agent-action-result {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}

.agent-result-ok {
  color: #66bb6a;
  background: rgba(76,175,80,0.15);
}

.agent-result-err {
  color: #ef5350;
  background: rgba(244,67,54,0.15);
}

.agent-result-rejected {
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.05);
}

.agent-input-row {
  display: flex;
  gap: 4px;
}

.agent-prompt-input {
  flex: 1;
  min-width: 0;
  font-size: 12px !important;
}

.agent-send-btn {
  background: linear-gradient(135deg, #7c4dff, #536dfe) !important;
  color: #fff !important;
  white-space: nowrap;
}

.agent-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.agent-rate-info {
  font-size: 9px;
  color: rgba(255,255,255,0.3);
}

/* Test Results */
.test-run-controls {
  padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.02);
}
.test-run-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.test-alien-input {
  flex: 1; min-width: 160px; padding: 6px 10px; border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15); background: rgba(0,0,0,0.3);
  color: #fff; font-size: 12px;
}
.test-alien-input::placeholder { color: rgba(255,255,255,0.3); }
.test-player-select {
  padding: 6px 8px; border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15); background: rgba(0,0,0,0.3);
  color: #fff; font-size: 12px;
}
.test-run-btn { padding: 6px 16px; font-size: 12px; white-space: nowrap; }
.test-run-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.test-bot-status { padding: 8px 16px; }
.test-bot-running {
  color: #70b0ff; font-size: 12px; padding: 4px 0;
  animation: testPulse 1.5s ease-in-out infinite;
}
@keyframes testPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.test-bot-log {
  max-height: 120px; overflow-y: auto; font-family: monospace; font-size: 10px;
  color: rgba(255,255,255,0.5); background: rgba(0,0,0,0.2); padding: 6px 8px;
  border-radius: 4px; margin-top: 4px; white-space: pre-wrap; word-break: break-all;
}
.test-bot-done { color: #40d060; font-size: 12px; padding: 4px 0; }
.test-bot-error { color: #ff6060; font-size: 12px; padding: 4px 0; }
.test-results-container { padding: 0; display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.test-results-loading { padding: 30px; text-align: center; color: var(--text-dim); font-size: 14px; }
.test-summary-bar {
  display: flex; gap: 12px; align-items: center; padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08); flex-wrap: wrap;
}
.test-run-time { font-size: 13px; color: var(--text-dim); margin-right: auto; }
.test-stat { font-size: 14px; font-weight: 700; padding: 4px 12px; border-radius: 5px; }
.test-stat.pass { background: rgba(40,180,60,0.15); color: #40d060; }
.test-stat.fail { background: rgba(255,60,60,0.15); color: #ff6060; }
.test-stat.warn { background: rgba(255,180,40,0.15); color: #ffb028; }
.test-filter-bar {
  display: flex; gap: 6px; padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.test-filter-btn {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-dim); border-radius: 5px; padding: 5px 14px;
  font-size: 13px; cursor: pointer;
}
.test-filter-btn.active { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.3); }
.test-results-list {
  padding: 10px 16px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  flex: 1; min-height: 0;
}
.test-result-card {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; overflow: hidden; flex-shrink: 0;
}
.test-result-card.fail { border-color: rgba(255,60,60,0.3); }
.test-result-card.pass { border-color: rgba(40,180,60,0.2); }
.test-result-card.warn { border-color: rgba(255,180,40,0.2); }
.test-result-header {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  cursor: pointer; font-size: 15px; min-height: 44px;
}
.test-result-header:hover { background: rgba(255,255,255,0.04); }
.test-result-icon { font-size: 16px; font-weight: 800; width: 22px; text-align: center; }
.test-result-icon.pass { color: #40d060; }
.test-result-icon.fail { color: #ff6060; }
.test-result-icon.warn { color: #ffb028; }
.test-result-name { font-weight: 600; color: #fff; flex: 1; font-size: 15px; }
.test-result-verdict { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; padding: 3px 10px; border-radius: 4px; }
.test-result-verdict.pass { background: rgba(40,180,60,0.2); color: #40d060; }
.test-result-verdict.fail { background: rgba(255,60,60,0.2); color: #ff6060; }
.test-result-verdict.warn { background: rgba(255,180,40,0.2); color: #ffb028; }
.test-result-phase { font-size: 12px; color: var(--text-dim); }
.test-result-mandatory { font-size: 11px; color: var(--text-dim); opacity: 0.6; }
.test-result-detail { display: none; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 13px; }
.test-result-card.expanded .test-result-detail { display: block; }
.test-detail-row { margin-bottom: 8px; color: rgba(255,255,255,0.75); font-size: 14px; }
.test-detail-row .pass { color: #40d060; font-weight: 600; }
.test-detail-row .fail { color: #ff6060; font-weight: 600; }
.test-detail-row .warn { color: #ffb028; font-weight: 600; }
.test-detail-meta {
  display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06); margin-bottom: 8px; font-size: 13px;
}
.test-detail-section { margin-top: 10px; }
.test-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: rgba(255,255,255,0.45); margin-bottom: 6px;
}
.test-effect-desc {
  background: rgba(100,140,255,0.08); border-left: 3px solid #70b0ff;
  padding: 8px 12px; font-size: 14px; color: rgba(255,255,255,0.85);
  border-radius: 0 4px 4px 0; line-height: 1.6;
}
.test-diff-row {
  font-family: monospace; font-size: 13px; padding: 5px 8px; color: rgba(255,255,255,0.7);
  display: flex; gap: 8px; align-items: baseline;
  background: rgba(255,255,255,0.02); border-radius: 4px; margin-bottom: 3px;
}
.test-diff-field { color: #70b0ff; font-weight: 600; min-width: 140px; }
.test-diff-before { color: #ff8080; }
.test-diff-arrow { color: rgba(255,255,255,0.3); }
.test-diff-after { color: #80ff80; }
.test-diff-none { color: var(--text-dim); font-style: italic; font-size: 12px; padding: 4px 0; }
.test-log-entry {
  font-family: monospace; font-size: 12px; padding: 3px 8px;
  color: rgba(255,255,255,0.6); border-left: 2px solid rgba(255,255,255,0.1);
  margin-bottom: 2px;
}

/* Ace Target Option */
.ace-target-section {
  margin-top: 16px; padding-top: 14px;
  border-top: 2px solid rgba(255,215,0,0.3);
}
.ace-target-title {
  font-size: 14px; font-weight: 700; color: var(--gold);
  text-align: center; margin-bottom: 4px;
}
.ace-target-hint {
  font-size: 11px; color: var(--text-dim); text-align: center; margin-bottom: 10px;
}
.ace-attack-btn {
  border: 2px solid rgba(255,215,0,0.5) !important;
  background: rgba(255,215,0,0.06) !important;
}
.ace-attack-btn:hover {
  background: rgba(255,215,0,0.15) !important;
  box-shadow: 0 0 12px rgba(255,215,0,0.3);
}
.ace-ship-label {
  font-size: 9px; color: var(--gold); font-weight: 600; margin-top: 2px;
}
.has-ace-colony { position: relative; }
.ace-indicator {
  position: absolute; top: -6px; right: -6px;
  font-size: 9px; background: rgba(255,215,0,0.2);
  border: 1px solid rgba(255,215,0,0.5); border-radius: 4px;
  padding: 1px 5px; color: var(--gold); font-weight: 700;
}

/* Verified Aliens */
.verified-tick {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  background: rgba(40,180,60,0.85); color: #fff; font-size: 11px; font-weight: 800;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 6px rgba(40,180,60,0.5);
}
.catalog-alien-card { position: relative; }
.alien-verified { border-color: rgba(40,180,60,0.4) !important; }
.catalog-tag.verified-tag {
  background: rgba(40,180,60,0.25); color: #40d060; border: 1px solid rgba(40,180,60,0.4);
}
.verified-filter { color: #40d060 !important; }
.verified-filter.active { background: rgba(40,180,60,0.2) !important; border-color: rgba(40,180,60,0.5) !important; }
.detail-verify-section { text-align: center; }
.detail-verify-btn {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7); padding: 8px 24px; border-radius: 6px;
  font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.detail-verify-btn:hover { background: rgba(40,180,60,0.15); border-color: rgba(40,180,60,0.4); color: #40d060; }
.detail-verify-btn.verified {
  background: rgba(40,180,60,0.2); border-color: rgba(40,180,60,0.5);
  color: #40d060; font-weight: 700;
}
.detail-verified-label {
  display: inline-block; padding: 6px 16px; border-radius: 6px;
  background: rgba(40,180,60,0.12); color: #40d060;
  font-size: 12px; font-weight: 600;
}

/* Chat Report Button */
.chat-report-btn {
  background: rgba(255,180,40,0.15); border: 1px solid rgba(255,180,40,0.4);
  color: #ffb028; border-radius: 6px; padding: 4px 8px;
  font-size: 14px; cursor: pointer; transition: all 0.2s;
  flex-shrink: 0;
}
.chat-report-btn:hover { background: rgba(255,180,40,0.3); }

/* Reports & Improve */
.report-btn { background: rgba(100,140,220,0.15) !important; border-color: rgba(100,140,220,0.4) !important; }
.report-form {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.report-input {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px; padding: 8px 12px; color: #fff; font-size: 13px;
}
.report-textarea {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px; padding: 8px 12px; color: #fff; font-size: 13px;
  resize: vertical; min-height: 60px; font-family: inherit;
}
.report-input::placeholder, .report-textarea::placeholder { color: rgba(255,255,255,0.3); }
.report-submit-btn {
  align-self: flex-end; padding: 6px 20px !important; font-size: 12px !important;
  background: rgba(60,160,60,0.25) !important; border-color: rgba(60,160,60,0.5) !important;
  color: #50e050 !important;
}
.report-count {
  padding: 8px 16px; font-size: 11px; color: var(--text-dim);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.report-list { padding: 8px 12px; overflow-y: auto; max-height: calc(100vh - 280px); display: flex; flex-direction: column; gap: 8px; }
.report-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 10px 14px; transition: border-color 0.2s;
}
.report-card.urgent { border-color: rgba(255,80,80,0.5); background: rgba(255,60,60,0.06); }
.report-card.resolved { opacity: 0.55; }
.report-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.report-author { font-weight: 700; font-size: 13px; color: var(--gold); }
.report-time { font-size: 10px; color: var(--text-dim); margin-left: auto; }
.report-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 1px; padding: 2px 8px;
  border-radius: 4px; text-transform: uppercase;
}
.report-badge.new-report { background: rgba(100,160,255,0.2); color: #70b0ff; }
.report-badge.urgent { background: rgba(255,60,60,0.25); color: #ff6b6b; }
.report-badge.resolved { background: rgba(60,200,60,0.2); color: #50c050; }
.report-text { font-size: 13px; color: rgba(255,255,255,0.85); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.report-admin-note {
  margin-top: 8px; padding: 6px 10px; background: rgba(212,168,67,0.08);
  border-left: 3px solid var(--gold-dim); border-radius: 4px;
  font-size: 12px; color: rgba(255,255,255,0.7);
}
.report-note-label { color: var(--gold); font-weight: 700; font-size: 11px; }
.report-admin-row {
  display: flex; gap: 6px; margin-top: 8px; align-items: center;
}
.report-status-sel {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px; color: #fff; padding: 4px 6px; font-size: 11px;
}
.report-note-input {
  flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px; color: #fff; padding: 4px 8px; font-size: 11px;
}
.report-note-save {
  background: rgba(60,160,60,0.25); border: 1px solid rgba(60,160,60,0.4);
  color: #50e050; border-radius: 4px; padding: 4px 10px; font-size: 10px;
  cursor: pointer; font-weight: 600;
}
.report-note-save:hover { background: rgba(60,160,60,0.4); }
.report-empty { text-align: center; color: var(--text-dim); padding: 30px; font-size: 14px; }
.report-tabs {
  display: flex; gap: 4px; padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.report-tab-btn {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-dim); border-radius: 6px; padding: 8px 16px;
  font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.report-tab-btn.active {
  background: rgba(124,77,255,0.15); color: #d0c0ff;
  border-color: rgba(124,77,255,0.4);
}
.report-tab-btn:hover { background: rgba(255,255,255,0.08); }
.report-tab-count { font-size: 11px; opacity: 0.6; }
.report-alien-link { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.report-alien-tag {
  font-size: 10px; background: rgba(100,140,255,0.15); color: #70b0ff;
  padding: 2px 8px; border-radius: 3px; cursor: pointer; font-weight: 600;
}
.report-alien-tag:hover { background: rgba(100,140,255,0.3); }
.report-badge.admin-only {
  font-size: 9px; background: rgba(180,80,255,0.2); color: #c080ff;
  padding: 1px 6px; border-radius: 3px;
}

/* Bandit Spin Overlay */
.bandit-spin-overlay { max-width: 520px; }
.bandit-title { font-size: 22px; font-weight: 900; letter-spacing: 3px; color: var(--gold); margin-bottom: 4px; }
.bandit-player-name { font-size: 14px; color: var(--text-dim); margin-bottom: 8px; }
.bandit-outcome { font-size: 16px; font-weight: 700; letter-spacing: 2px; padding: 4px 16px; border-radius: 6px; display: inline-block; margin-bottom: 16px; }
.bandit-outcome.all_different { background: rgba(200,60,60,0.25); color: #ff6b6b; border: 1px solid rgba(200,60,60,0.4); }
.bandit-outcome.two_match { background: rgba(60,160,200,0.25); color: #5bc0eb; border: 1px solid rgba(60,160,200,0.4); }
.bandit-outcome.all_same { background: rgba(80,200,80,0.25); color: #50e050; border: 1px solid rgba(80,200,80,0.4); }
.bandit-cards-row { display: flex; gap: 14px; justify-content: center; margin-bottom: 16px; perspective: 600px; }
.bandit-card {
  width: 90px; height: 130px; border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; cursor: default;
  border: 2px solid rgba(255,255,255,0.2); position: relative;
  animation: banditCardReveal 0.5s ease both;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.bandit-card.attack { background: linear-gradient(180deg, #c03030, #801818); color: #fff; }
.bandit-card.negotiate { background: linear-gradient(180deg, #40a040, #206020); color: #fff; }
.bandit-card.reinforcement { background: linear-gradient(180deg, #9040c0, #602080); color: #fff; }
.bandit-card.artifact { background: linear-gradient(180deg, #3060d0, #204080); color: #fff; }
.bandit-card.flare { background: linear-gradient(180deg, #e0c020, #b09010); color: #1a1a2e; }
.bandit-card.morph { background: linear-gradient(180deg, #a040a0, #602060); color: #fff; }
@keyframes banditCardReveal {
  0% { transform: rotateY(90deg) scale(0.6); opacity: 0; }
  60% { transform: rotateY(-5deg) scale(1.05); opacity: 1; }
  100% { transform: rotateY(0) scale(1); opacity: 1; }
}
.bandit-card-value { font-size: 28px; font-weight: 900; line-height: 1; }
.bandit-card-type { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; }
.bandit-card-name { font-size: 9px; opacity: 0.7; text-align: center; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 80px; }
.bandit-selectable { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.bandit-selectable:hover { transform: translateY(-6px); box-shadow: 0 6px 20px rgba(212,168,67,0.4); }
.bandit-selected, .bandit-selectable:active { border-color: var(--gold) !important; box-shadow: 0 0 16px var(--gold-dim); transform: translateY(-8px); }
.bandit-instructions { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; line-height: 1.5; }
.bandit-hand-pick { margin-top: 8px; }
.bandit-hand-label { font-size: 12px; color: var(--gold); margin-bottom: 8px; font-weight: 600; }
.bandit-hand-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-height: 180px; overflow-y: auto; }
.bandit-discard-btn {
  background: rgba(200,60,60,0.2); border: 1px solid rgba(200,60,60,0.4); color: #ff8888;
  padding: 6px 12px; border-radius: 6px; font-size: 11px; cursor: pointer; transition: all 0.15s;
}
.bandit-discard-btn:hover { background: rgba(200,60,60,0.4); color: #fff; }
.bandit-skip-btn { background: rgba(100,100,100,0.3) !important; border-color: rgba(150,150,150,0.3) !important; margin-top: 8px; }
.bandit-confirm-btn { background: rgba(60,160,60,0.3) !important; border-color: rgba(60,160,60,0.5) !important; color: #50e050 !important; margin-top: 8px; }
@media (max-width: 600px) {
  .bandit-spin-overlay { max-width: 95vw; padding: 16px; }
  .bandit-card { width: 70px; height: 100px; }
  .bandit-card-value { font-size: 22px; }
  .bandit-title { font-size: 16px; }
}

/* Expansion panel (waiting room) */
.expansion-panel { margin: 12px 0; padding: 10px 14px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; }
.expansion-title { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.7); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.expansion-option { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; font-size: 13px; color: rgba(255,255,255,0.8); }
.expansion-option input[type="checkbox"] { accent-color: #a78bfa; width: 16px; height: 16px; }
.exp-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.exp-badge.reward { background: rgba(234,179,8,0.2); color: #eab308; border: 1px solid rgba(234,179,8,0.3); }
.exp-badge.hazard { background: rgba(239,68,68,0.2); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.exp-badge.twopower { background: rgba(167,139,250,0.2); color: #a78bfa; border: 1px solid rgba(167,139,250,0.3); }
.exp-desc { font-size: 11px; color: rgba(255,255,255,0.4); }
.expansion-view { margin: 8px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.expansion-view .exp-badge { font-size: 10px; }
