* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background: radial-gradient(circle at center, #1b2f15 0%, #0a1308 100%);
  color: #fff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
}

#game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 900px;
  max-width: 98vw;
}

/* Clean Flexbox Top Navigation Bar */
.top-nav-bar {
  width: 100%;
  background: linear-gradient(to bottom, #3e2723, #2a160c);
  border: 3px solid #5d4037;
  border-bottom: 2px solid #231209;
  border-radius: 10px 10px 0 0;
  padding: 6px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  z-index: 10;
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  background: #2a160c;
  color: #ffeb3b;
  border: 2px solid #e09f3e;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.nav-btn:hover {
  background: #422817;
  border-color: #ffd54f;
  transform: translateY(-1px);
}

.nav-btn:active {
  transform: translateY(1px);
}

/* User Profile Badge */
.profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #8d6e63;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  color: #c8e6c9;
}

.profile-badge span {
  font-weight: bold;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-mini {
  background: #4caf50;
  color: #fff;
  border: 1px solid #2e7d32;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-mini:hover {
  background: #66bb6a;
}

/* Main Game Canvas Container */
#game-container {
  position: relative;
  width: 100%;
  height: 600px;
  max-height: calc(95vh - 54px);
  aspect-ratio: 900 / 600;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(76, 175, 80, 0.3);
  border-radius: 0 0 10px 10px;
  overflow: hidden;
  border: 3px solid #5d4037;
  border-top: none;
  background-color: #388e3c;
}

canvas#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
  touch-action: none;
}

/* Overlays & Modals */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.overlay.hidden {
  display: none;
  opacity: 0;
}

.banner-card {
  background: linear-gradient(135deg, #422817 0%, #2a160c 100%);
  border: 4px solid #e09f3e;
  border-radius: 16px;
  padding: 26px 40px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.9);
  max-width: 480px;
  animation: popIn 0.3s ease-out;
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.banner-card h1 {
  font-size: 34px;
  margin-bottom: 10px;
  color: #ffeb3b;
  text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
  letter-spacing: 1px;
}

.banner-card p {
  font-size: 16px;
  color: #e0e0e0;
  margin-bottom: 20px;
  line-height: 1.4;
}

.btn {
  background: linear-gradient(to bottom, #8bc34a, #4caf50);
  color: #fff;
  border: 2px solid #2e7d32;
  border-radius: 8px;
  padding: 10px 26px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 0 #1b5e20, 0 8px 15px rgba(0,0,0,0.4);
  transition: transform 0.1s, box-shadow 0.1s;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

.btn:hover {
  background: linear-gradient(to bottom, #9ccc65, #66bb6a);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #1b5e20, 0 3px 5px rgba(0,0,0,0.4);
}

.btn-secondary {
  background: linear-gradient(to bottom, #6d4c41, #4e342e);
  border-color: #3e2723;
  box-shadow: 0 4px 0 #27140b, 0 8px 15px rgba(0,0,0,0.4);
  color: #ffeb3b;
}

.btn-secondary:hover {
  background: linear-gradient(to bottom, #795548, #5d4037);
}

.btn-secondary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #27140b;
}

.footer-info {
  margin-top: 14px;
  font-size: 13px;
  color: #81c784;
  opacity: 0.8;
  letter-spacing: 0.5px;
}

/* Mode Selectors */
.mode-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.mode-btn {
  background: #2a160c;
  color: #ffeb3b;
  border: 2px solid #8d6e63;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn:hover, .mode-btn.active {
  background: #422817;
  border-color: #ffeb3b;
  box-shadow: 0 0 10px rgba(255, 235, 59, 0.4);
}

.btn-shop {
  background: linear-gradient(to bottom, #ff9800, #f57c00);
  border-color: #e65100;
  box-shadow: 0 4px 0 #bf360c, 0 8px 15px rgba(0,0,0,0.4);
}

.btn-shop:hover {
  background: linear-gradient(to bottom, #ffa726, #fb8c00);
}

/* Shop Modal Styles */
.shop-card {
  max-width: 520px;
  width: 90%;
}

.shop-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.shop-item {
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid #8d6e63;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.shop-item-info h3 {
  font-size: 15px;
  color: #ffeb3b;
  margin-bottom: 4px;
}

.shop-item-info p {
  font-size: 12px;
  color: #ccc;
  margin-bottom: 0;
  line-height: 1.2;
}

.btn-buy {
  background: #4caf50;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-buy:hover:not(:disabled) {
  background: #66bb6a;
}

.btn-buy:disabled {
  background: #555;
  color: #888;
  cursor: not-allowed;
}

/* Auth Modal Styles */
.auth-card {
  max-width: 420px;
  width: 90%;
}

.auth-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #8d6e63;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
  border-color: #ffeb3b;
  box-shadow: 0 0 8px rgba(255, 235, 59, 0.4);
}

.auth-error {
  font-size: 13px;
  color: #ff8a80;
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid #e57373;
  border-radius: 4px;
  padding: 6px 10px;
  text-align: left;
}

.auth-error.hidden {
  display: none;
}

.btn-auth-submit {
  background: linear-gradient(to bottom, #8bc34a, #4caf50);
}

/* Workshop / Garden Lab Styles */
.btn-workshop {
  background: linear-gradient(to bottom, #00897b, #004d40);
  border: 2px solid #64ffda;
  color: #fff;
}

.btn-workshop:hover {
  background: linear-gradient(to bottom, #00bfa5, #00695c);
}

.workshop-card {
  max-width: 820px;
  width: 94%;
  max-height: 550px;
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
  overflow: hidden;
  box-sizing: border-box;
}

.workshop-header {
  flex-shrink: 0;
  text-align: center;
}

.materials-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #00897b;
  border-radius: 8px;
  padding: 6px 14px;
  margin-bottom: 10px;
}

.mat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: bold;
  color: #e0f2f1;
}

.mat-item span:nth-child(2) {
  color: #a7ffeb;
}

.mat-item.mat-coins span:nth-child(2) {
  color: #ffd54f;
}

.workshop-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ws-tab {
  background: rgba(0, 0, 0, 0.35);
  color: #b0bec5;
  border: 2px solid #546e7a;
  border-radius: 6px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.ws-tab.active {
  background: #00897b;
  color: #fff;
  border-color: #64ffda;
  box-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
}

.ws-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  min-height: 250px;
  max-height: 310px;
}

.ws-content.hidden {
  display: none;
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 10px;
}

.upgrade-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #00897b;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: transform 0.15s, border-color 0.15s;
}

.upgrade-card:hover {
  border-color: #64ffda;
  background: rgba(0, 0, 0, 0.55);
}

.upgrade-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.upgrade-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
}

.upgrade-level-badge {
  font-size: 11px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 10px;
  background: #37474f;
  color: #eceff1;
}

.upgrade-level-badge.maxed {
  background: linear-gradient(135deg, #ffd700, #ff8f00);
  color: #212121;
}

.upgrade-desc {
  font-size: 12px;
  color: #cfd8dc;
  line-height: 1.3;
}

.upgrade-stats-next {
  font-size: 11px;
  color: #80cbc4;
  background: rgba(0, 77, 64, 0.35);
  border-left: 3px solid #26a69a;
  padding: 4px 8px;
  border-radius: 0 4px 4px 0;
}

.upgrade-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.cost-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: #e0f2f1;
}

.cost-badge {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 2px 6px;
}

.cost-badge.insufficient {
  color: #ff8a80;
  border: 1px solid rgba(244, 67, 54, 0.4);
}

.btn-upgrade-action {
  background: #00897b;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-upgrade-action:hover:not(:disabled) {
  background: #26a69a;
}

.btn-upgrade-action:disabled {
  background: #455a64;
  color: #90a4ae;
  cursor: not-allowed;
}

/* Zen Garden Styles */
.btn-zengarden {
  background: linear-gradient(to bottom, #558b2f, #33691e);
  border: 2px solid #aed581;
  color: #fff;
}
.btn-zengarden:hover {
  background: linear-gradient(to bottom, #689f38, #558b2f);
}

.zengarden-card {
  max-width: 820px;
  width: 94%;
  max-height: 550px;
  display: flex;
  flex-direction: column;
  padding: 12px 18px;
  overflow: hidden;
  box-sizing: border-box;
}

.zen-tools-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.btn-zen-tool {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #7cb342;
  border-radius: 6px;
  color: #f1f8e9;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-zen-tool:hover {
  background: rgba(124, 179, 66, 0.3);
  border-color: #aed581;
}

.btn-zen-tool.active {
  background: #558b2f;
  border-color: #dcedc8;
  box-shadow: 0 0 8px rgba(174, 213, 129, 0.5);
}

.zen-canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #1b3b22;
  border: 2px solid #558b2f;
  border-radius: 8px;
  overflow: hidden;
}

#zenCanvas {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: pointer;
}

/* Almanac Styles */
.btn-almanac {
  background: linear-gradient(to bottom, #ef6c00, #e65100);
  border: 2px solid #ffb74d;
  color: #fff;
}
.btn-almanac:hover {
  background: linear-gradient(to bottom, #f57c00, #ef6c00);
}

.almanac-card {
  max-width: 820px;
  width: 94%;
  max-height: 550px;
  display: flex;
  flex-direction: column;
  padding: 12px 18px;
  overflow: hidden;
  box-sizing: border-box;
}

.almanac-header {
  text-align: center;
  margin-bottom: 8px;
}

.almanac-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.almanac-tab {
  background: rgba(0, 0, 0, 0.4);
  color: #cfd8dc;
  border: 2px solid #78909c;
  border-radius: 6px;
  padding: 5px 18px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.almanac-tab.active {
  background: #ef6c00;
  color: #fff;
  border-color: #ffb74d;
  box-shadow: 0 0 10px rgba(255, 183, 77, 0.4);
}

.almanac-body {
  display: flex;
  gap: 12px;
  height: 380px;
  overflow: hidden;
}

.almanac-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  overflow-y: auto;
  padding-right: 6px;
}

.almanac-slot {
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid #546e7a;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.almanac-slot:hover {
  border-color: #ffb74d;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.almanac-slot.selected {
  border-color: #ffeb3b;
  background: rgba(255, 235, 59, 0.2);
  box-shadow: 0 0 8px rgba(255, 235, 59, 0.4);
}

.almanac-slot-icon {
  font-size: 26px;
  margin-bottom: 4px;
}

.almanac-slot-name {
  font-size: 10px;
  font-weight: bold;
  color: #eceff1;
  text-align: center;
  line-height: 1.1;
}

.almanac-detail-card {
  width: 320px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #8d6e63;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.almanac-detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.almanac-detail-icon {
  font-size: 34px;
}

.almanac-detail-name {
  font-size: 17px;
  font-weight: bold;
  color: #ffd54f;
}

.almanac-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #cfd8dc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 0;
}

.almanac-stat-row strong {
  color: #fff;
}

.almanac-desc-text {
  font-size: 12px;
  color: #e0e0e0;
  line-height: 1.3;
}

.almanac-lore-quote {
  font-size: 11px;
  font-style: italic;
  color: #a7ffeb;
  background: rgba(0, 77, 64, 0.3);
  border-left: 3px solid #00bfa5;
  padding: 6px 8px;
  border-radius: 0 4px 4px 0;
  line-height: 1.25;
}

/* Achievements & Roguelike Styles */
.btn-achievements {
  background: linear-gradient(to bottom, #fbc02d, #f57f17);
  border: 2px solid #fff59d;
  color: #212121;
}
.btn-achievements:hover {
  background: linear-gradient(to bottom, #fff176, #fbc02d);
}

.achievements-card {
  max-width: 820px;
  width: 94%;
  max-height: 550px;
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  overflow: hidden;
  box-sizing: border-box;
}

.achievements-header {
  text-align: center;
  margin-bottom: 8px;
}

.achievements-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding-right: 6px;
}

.ach-item {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #795548;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: border-color 0.15s, background 0.15s;
}

.ach-item.completed {
  border-color: #ffd54f;
  background: rgba(255, 213, 79, 0.1);
}

.ach-icon {
  font-size: 30px;
  flex-shrink: 0;
}

.ach-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ach-title {
  font-size: 13px;
  font-weight: bold;
  color: #fff;
}

.ach-desc {
  font-size: 11px;
  color: #cfd8dc;
  line-height: 1.2;
}

.ach-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 2px;
}

.ach-progress-bar {
  height: 100%;
  background: linear-gradient(to right, #4caf50, #8bc34a);
  border-radius: 3px;
  transition: width 0.3s;
}

.btn-claim-ach {
  background: #ffb300;
  color: #212121;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-claim-ach:hover {
  background: #ffd54f;
}

.btn-claim-ach:disabled {
  background: #424242;
  color: #9e9e9e;
  cursor: default;
}

/* Achievement Toast Notification */
.achievement-toast {
  position: fixed;
  top: 20px;
  right: -350px;
  width: 300px;
  background: linear-gradient(135deg, #37474f 0%, #212121 100%);
  border: 2px solid #ffd54f;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 12px rgba(255, 213, 79, 0.4);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  transition: right 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  pointer-events: none;
}

.achievement-toast.visible {
  right: 20px;
}

.ach-toast-icon {
  font-size: 32px;
}

.ach-toast-subtitle {
  font-size: 10px;
  font-weight: bold;
  color: #ffd54f;
  letter-spacing: 0.5px;
}

.ach-toast-title {
  font-size: 13px;
  font-weight: bold;
  color: #fff;
}

/* Roguelike Draft Card Styles */
.draft-card {
  max-width: 780px;
  width: 92%;
  text-align: center;
  padding: 20px 24px;
}

.draft-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.draft-option-card {
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #00897b;
  border-radius: 10px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.draft-option-card:hover {
  transform: translateY(-4px);
  border-color: #64ffda;
  box-shadow: 0 6px 18px rgba(100, 255, 218, 0.35);
  background: rgba(0, 0, 0, 0.65);
}

.draft-option-icon {
  font-size: 44px;
}

.draft-option-title {
  font-size: 15px;
  font-weight: bold;
  color: #ffd54f;
}

.draft-option-desc {
  font-size: 12px;
  color: #cfd8dc;
  line-height: 1.3;
}

.draft-badge-type {
  font-size: 10px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #80cbc4;
}

/* Tree of Wisdom & Cheats Styling */
.btn-tree {
  background: linear-gradient(to bottom, #43a047, #2e7d32);
  color: #fff;
}
.btn-tree:hover {
  background: linear-gradient(to bottom, #4caf50, #388e3c);
}

.btn-leaderboard {
  background: linear-gradient(to bottom, #f57f17, #e65100);
  color: #fff;
}
.btn-leaderboard:hover {
  background: linear-gradient(to bottom, #fbc02d, #f57f17);
}

.tree-card {
  max-width: 680px;
  width: 92%;
  padding: 18px 24px;
}

.tree-display-box {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #4caf50;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}

.tree-visual-wrapper {
  font-size: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  filter: drop-shadow(0 0 12px rgba(129, 199, 132, 0.6));
}

.tree-wisdom-bubble {
  flex: 1;
  text-align: left;
}

.tree-wisdom-title {
  font-size: 16px;
  font-weight: bold;
  color: #a5d6a7;
  margin-bottom: 4px;
}

.tree-wisdom-quote {
  font-size: 13px;
  color: #fff;
  line-height: 1.4;
  font-style: italic;
}

.tree-cheats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tree-cheat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #757575;
  border-radius: 6px;
  padding: 6px 12px;
}

.tree-cheat-name {
  font-size: 13px;
  font-weight: bold;
  color: #ffd54f;
}

.tree-cheat-btn {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  font-weight: bold;
}

.tree-cheat-btn.active {
  background: #4caf50;
  color: #fff;
}

.tree-cheat-btn.inactive {
  background: #616161;
  color: #e0e0e0;
}

/* Leaderboards Styling */
.leaderboard-card {
  max-width: 720px;
  width: 92%;
  padding: 18px 24px;
}

.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.lb-tab {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #b78103;
  color: #ffe082;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.lb-tab:hover {
  background: rgba(255, 213, 79, 0.2);
  border-color: #ffd54f;
}

.lb-tab.active {
  background: #f57f17;
  color: #fff;
  border-color: #fff59d;
}

.leaderboard-table-wrapper {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #795548;
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.lb-table th {
  background: rgba(62, 39, 35, 0.8);
  color: #ffd54f;
  padding: 8px 12px;
  font-weight: bold;
}

.lb-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
}

.lb-table tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.lb-rank-badge {
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
}

.lb-rank-1 { color: #ffd700; font-size: 15px; }
.lb-rank-2 { color: #c0c0c0; font-size: 14px; }
.lb-rank-3 { color: #cd7f32; font-size: 14px; }

/* ==========================================================================
   VISUAL SKINS & THEMES ENGINE (v2.1)
   ========================================================================== */

/* 1. Cyberpunk Neon Theme */
body.theme-cyberpunk {
  background: radial-gradient(circle at center, #0f051d 0%, #030008 100%);
  color: #00e5ff;
}
body.theme-cyberpunk .top-nav-bar {
  background: linear-gradient(to bottom, #1f0b35, #0d001a);
  border-color: #00e5ff;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4), inset 0 0 10px rgba(233, 30, 99, 0.25);
}
body.theme-cyberpunk .nav-btn {
  background: #0e021c;
  border-color: #e91e63;
  color: #00e5ff;
  box-shadow: 0 0 8px rgba(233, 30, 99, 0.35);
  text-shadow: 0 0 4px rgba(0, 229, 255, 0.8);
}
body.theme-cyberpunk .nav-btn:hover {
  background: #1d0537;
  border-color: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
}
body.theme-cyberpunk #gameCanvas {
  border: 3px solid #00e5ff;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.4), 0 0 40px rgba(233, 30, 99, 0.2);
}
body.theme-cyberpunk .banner-card {
  background: linear-gradient(135deg, #18092b, #090014);
  border-color: #00e5ff;
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.35);
}

/* 2. Retro 8-bit Arcade Theme */
body.theme-retro8bit {
  background: #050505;
  font-family: 'Courier New', Courier, monospace;
}
body.theme-retro8bit .top-nav-bar {
  background: #111;
  border: 3px solid #10b981;
  border-radius: 0;
  box-shadow: 0 4px 0 #047857;
}
body.theme-retro8bit .nav-btn {
  border-radius: 0;
  border: 2px solid #10b981;
  background: #000;
  color: #34d399;
  box-shadow: none;
}
body.theme-retro8bit .nav-btn:hover {
  background: #10b981;
  color: #000;
}
body.theme-retro8bit #gameCanvas {
  border: 4px solid #10b981;
  border-radius: 0;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}
body.theme-retro8bit .banner-card {
  border-radius: 0;
  border: 4px solid #10b981;
  background: #0a0a0a;
}

/* 3. Winter Frost Theme */
body.theme-winter {
  background: radial-gradient(circle at center, #1a237e 0%, #0d1326 100%);
  color: #e0f7fa;
}
body.theme-winter .top-nav-bar {
  background: linear-gradient(to bottom, #1e3c72, #2a5298);
  border-color: #80deea;
  box-shadow: 0 0 15px rgba(128, 222, 234, 0.35);
}
body.theme-winter .nav-btn {
  background: #152b52;
  border-color: #b2ebf2;
  color: #e0f7fa;
}
body.theme-winter .nav-btn:hover {
  background: #25467f;
  border-color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}
body.theme-winter #gameCanvas {
  border: 3px solid #80deea;
  box-shadow: 0 0 25px rgba(128, 222, 234, 0.4);
}
body.theme-winter .banner-card {
  background: linear-gradient(135deg, #132442, #0b1528);
  border-color: #80deea;
  box-shadow: 0 0 25px rgba(128, 222, 234, 0.3);
}

/* Boss Rush Button Accent */
#btn-mode-bossrush.active {
  border-color: #ff1744 !important;
  background: linear-gradient(135deg, #d50000, #b71c1c) !important;
  box-shadow: 0 0 12px rgba(255, 23, 68, 0.6) !important;
}
