* { box-sizing: border-box; font-family: system-ui, -apple-system, sans-serif; }
body { margin: 0; background: #1a1410; color: #f5ebe0; display: flex; justify-content: center; padding: 24px 16px; }
.hidden { display: none !important; }
.card { background: #261d17; border: 1px solid #4a3728; border-radius: 16px; padding: 20px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); }
.auth-box { width: 100%; max-width: 400px; }
h1, h2 { margin: 0 0 8px; color: #ffd166; }
.subtitle { color: #bfa894; font-size: 14px; margin-bottom: 16px; }
input { width: 100%; padding: 11px 12px; margin-bottom: 10px; border-radius: 10px; border: 1px solid #4a3728; background: #17110d; color: #f5ebe0; font-size: 14px; }
.btn { padding: 11px 14px; border-radius: 10px; border: none; background: #d97706; color: #fffbeb; font-weight: 600; cursor: pointer; font-size: 14px; }
.btn:disabled { background: #2e241d; color: #6e5b4d; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-ghost { background: transparent; border: 1px solid #4a3728; color: #d6c3b3; }
.btn-mine { padding: 16px; font-size: 16px; }
.btn-raid { margin-top: 10px; background: #3f6212; }
.btn-corn { background: #4d7c0f; color: #ecfccb; }
.btn-equipped { background: #1f2937; color: #86efac; border: 1px solid #374151; }
.btn-attack { background: #dc2626; color: #fff; font-size: 15px; padding: 13px; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab-btn { flex: 1; padding: 9px; border-radius: 10px; border: 1px solid #4a3728; background: #1c1510; color: #bfa894; cursor: pointer; }
.tab-btn.active { background: #b45309; color: #fff; border-color: #d97706; }
.error { color: #f87171; font-size: 13px; margin-bottom: 10px; min-height: 18px; }
.shell { width: 100%; max-width: 900px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.header-title { color: #ffd166; font-size: 18px; }
.header-user { color: #9c8572; font-size: 13px; margin-left: 8px; }
.nav-group { display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px; }
@media (max-width: 740px) { .grid { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat-box { background: #1c1510; border: 1px solid #38291e; border-radius: 12px; padding: 12px; }
.stat-label { font-size: 12px; color: #b59d88; }
.stat-value { font-size: 20px; font-weight: 700; margin-top: 4px; color: #fbbf24; }
.stat-value.corn { color: #fde047; }
.stat-value.sm { font-size: 16px; }
.stat-value.xs { font-size: 14px; }
.roach-stage { background: radial-gradient(circle, #38281d 0%, #1c1510 100%); border: 1px solid #4a3728; border-radius: 14px; padding: 16px; text-align: center; margin-bottom: 14px; }
.roach-avatar { font-size: 54px; transition: transform 0.08s ease; user-select: none; }
.roach-rank { margin-top: 6px; color: #f4a261; font-weight: 600; }
.equipped-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge { background: #2e2219; border: 1px solid #6b4e38; border-radius: 999px; padding: 3px 10px; font-size: 12px; color: #fde68a; }
.upgrade { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #1c1510; border: 1px solid #3a2a1e; border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.upgrade-title { font-weight: 600; }
.upgrade-count { color: #fbbf24; }
.upgrade-desc { font-size: 12px; color: #b59d88; }
.log-box { margin-top: 12px; background: #17110d; border: 1px solid #33251a; border-radius: 10px; padding: 10px 12px; height: 220px; overflow-y: auto; }
.log-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #8c7563; margin-bottom: 6px; }
.log-item { font-size: 12px; color: #d6c3b3; padding: 3px 0; border-bottom: 1px solid #241a13; }
.log-time { color: #8c7563; margin-right: 6px; }
.profile-card { max-width: 540px; margin: 0 auto; }
.field-label { font-size: 13px; color: #bfa894; display: block; margin-bottom: 6px; }
.rename-row { display: flex; gap: 8px; margin-bottom: 16px; }
.rename-row input { margin: 0; }
.top-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.top-table th, .top-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #38291e; font-size: 14px; }
.top-me { background: rgba(217, 119, 6, 0.14); }
.event-banner { border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.event-danger { background: #450a0a; border: 2px solid #ef4444; color: #fecaca; }
.event-bonus { background: #14532d; border: 2px solid #22c55e; color: #bbf7d0; }
.sub-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.sub-tab { flex: 1; min-width: 90px; padding: 8px 10px; border-radius: 10px; border: 1px solid #4a3728; background: #1c1510; color: #bfa894; font-weight: 600; font-size: 13px; cursor: pointer; }
.sub-tab.active { background: #d97706; color: #fffbeb; border-color: #f59e0b; }
.boss-card { background: #1c1510; border: 1px solid #572727; border-radius: 14px; padding: 16px; text-align: center; }
.boss-icon { font-size: 56px; margin: 6px 0; }
.hp-bar { width: 100%; height: 14px; background: #0f0b08; border-radius: 999px; overflow: hidden; border: 1px solid #4a3728; margin: 10px 0; }
.hp-fill { height: 100%; background: linear-gradient(90deg, #dc2626, #f97316); transition: width 0.15s ease; }
.hp-fill.player { background: linear-gradient(90deg, #16a34a, #4ade80); }
.stash-box { background: #1c1510; border: 1px dashed #6b4e38; border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.stash-actions { display: flex; gap: 8px; margin-top: 8px; }
.buff-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.buff-pill { background: #1e3a8a; border: 1px solid #3b82f6; color: #dbeafe; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.skin-gold { filter: drop-shadow(0 0 14px #facc15) sepia(1) saturate(4) hue-rotate(10deg); }
.skin-cyber { filter: drop-shadow(0 0 14px #38bdf8) hue-rotate(175deg) saturate(2); }
.skin-ghost { opacity: 0.72; filter: drop-shadow(0 0 14px #e2e8f0) grayscale(0.8); }
.skin-king { filter: drop-shadow(0 0 16px #f97316) saturate(1.5); transform: scale(1.12); }
.skins-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.skin-card { background: #1c1510; border: 1px solid #3a2a1e; border-radius: 10px; padding: 10px; text-align: center; }
.skin-card.active-skin { border-color: #fbbf24; background: #2b2017; }
.ach-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.ach-item { display: flex; justify-content: space-between; align-items: center; background: #1c1510; border: 1px solid #38291e; border-radius: 10px; padding: 10px 12px; opacity: 0.55; }
.ach-item.unlocked { opacity: 1; border-color: #65a30d; background: #1e2614; }
.kitchen-canvas { width: 100%; height: 180px; display: block; border-radius: 12px; border: 1px solid #4a3728; background: #17110d; margin: 10px 0 12px; cursor: pointer; }
.prestige-box { background: linear-gradient(135deg, #2e1f11, #1c1510); border: 1px solid #d97706; border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.quest-card { background: #1c1510; border: 1px solid #3a2a1e; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.quest-bar { height: 6px; background: #120d0a; border-radius: 999px; overflow: hidden; margin: 6px 0; }
.quest-fill { height: 100%; background: #f59e0b; }
.top-table th, .top-table td { vertical-align: middle; }
.col-num { white-space: nowrap; text-align: right; }
.top-table th:first-child, .top-table td:first-child { text-align: center; width: 42px; }
.top-table th:nth-child(n+3) { text-align: right; }

.mat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.mat-box { background: #1c1510; border: 1px solid #3a2a1e; border-radius: 10px; padding: 8px 4px; text-align: center; }
.mat-val { font-size: 15px; font-weight: 700; color: #fde68a; }
.mat-name { font-size: 11px; color: #bfa894; }
.craft-card { background: #1c1510; border: 1px solid #4a3728; border-radius: 12px; padding: 11px; margin-bottom: 10px; }
.craft-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.craft-reqs { font-size: 12px; color: #fcd34d; margin: 6px 0 8px; }

.trap-banner {
  background: linear-gradient(135deg, #3b0d0c, #1c1510);
  border: 2px dashed #f59e0b;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  margin-bottom: 12px;
}
.trap-art { font-size: 42px; margin-bottom: 4px; }
.leg-card {
  background: linear-gradient(135deg, #291d0e, #18120c);
  border: 1px solid #d97706;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.leg-title { color: #fbbf24; font-weight: 700; font-size: 15px; }
.leg-tag {
  display: inline-block;
  background: #78350f;
  color: #fef3c7;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  text-transform: uppercase;
}

.skin-gigolo {
  filter: drop-shadow(0 0 16px #f43f5e) hue-rotate(305deg) saturate(2.4);
  transform: scale(1.15);
}
.club-banner {
  background: linear-gradient(135deg, #3b0724, #1e1018);
  border: 1px solid #e11d48;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  margin-bottom: 12px;
}
.vip-card {
  background: #1f1219;
  border: 1px solid #881337;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.vip-timer {
  display: inline-block;
  background: #881337;
  color: #ffe4e6;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

.race-track { background: #140f0c; border: 1px solid #4a3728; border-radius: 12px; padding: 10px; margin-bottom: 12px; }
.race-lane { position: relative; height: 32px; border-bottom: 1px dashed #33251a; display: flex; align-items: center; }
.race-lane:last-child { border-bottom: none; }
.race-runner { position: absolute; left: 4px; font-size: 20px; transition: left 0.1s linear; }
.race-finish { position: absolute; right: 8px; font-size: 14px; opacity: 0.7; }
.bet-row { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.mut-card { background: #161f1d; border: 1px solid #0d9488; border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.raid-card { background: #1f1616; border: 1px solid #7f1d1d; border-radius: 12px; padding: 11px; margin-bottom: 9px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.roulette-wheel {
  background: #120c09;
  border: 2px solid #d97706;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  margin-bottom: 12px;
}
.roulette-result {
  font-size: 28px;
  font-weight: 800;
  padding: 10px;
  border-radius: 10px;
  margin: 6px 0;
  background: #1e1610;
}
.sector-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.btn-red { background: #b91c1c; color: #fff; }
.btn-black { background: #1f2937; color: #f3f4f6; border: 1px solid #4b5563; }
.btn-green { background: #15803d; color: #fff; }
.sector-active { outline: 3px solid #fbbf24; transform: scale(1.03); }

.chat-box {
  background: #140f0c;
  border: 1px solid #3a2a1e;
  border-radius: 12px;
  padding: 10px 12px;
  height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-msg {
  font-size: 13px;
  line-height: 1.35;
  padding-bottom: 5px;
  border-bottom: 1px solid #221912;
  word-break: break-word;
}
.chat-msg:last-child { border-bottom: none; }
.chat-time { color: #8c7563; font-size: 11px; margin-right: 6px; }
.chat-author { color: #fbbf24; font-weight: 700; margin-right: 6px; }

.roulette-viewport {
  position: relative;
  width: 100%;
  height: 68px;
  overflow: hidden;
  background: #0f0a08;
  border: 2px solid #d97706;
  border-radius: 12px;
  margin-bottom: 10px;
}
.roulette-pointer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: #fbbf24;
  box-shadow: 0 0 10px #fbbf24;
  transform: translateX(-50%);
  z-index: 5;
}
.roulette-strip {
  display: flex;
  align-items: center;
  height: 100%;
  will-change: transform;
}
.r-tile {
  flex: 0 0 64px;
  height: 54px;
  margin: 0 2px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
}
.r-tile.red { background: #b91c1c; border: 1px solid #f87171; }
.r-tile.black { background: #1f2937; border: 1px solid #6b7280; }
.r-tile.green { background: #15803d; border: 1px solid #4ade80; }
.roulette-outcome {
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  margin-bottom: 10px;
}
.outcome-win { background: #14532d; border: 1px solid #22c55e; color: #bbf7d0; }
.outcome-loss { background: #450a0a; border: 1px solid #ef4444; color: #fecaca; }
.outcome-idle { background: #1c1510; border: 1px solid #3a2a1e; color: #d6c3b3; }

.grid > .card { min-width: 0; }
.roulette-viewport { max-width: 100%; box-sizing: border-box; }

.slot-machine {
  background: linear-gradient(180deg, #291a12, #140d09);
  border: 2px solid #f59e0b;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
}
.slot-reels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.slot-reel {
  background: #0d0907;
  border: 2px solid #4a3728;
  border-radius: 12px;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.85);
}
.slot-reel.reel-win {
  border-color: #4ade80;
  box-shadow: 0 0 14px rgba(74, 222, 128, 0.45);
}
.slot-paytable {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: #fde68a;
  background: #1c1510;
  padding: 6px;
  border-radius: 8px;
}

.skin-season {
  filter: drop-shadow(0 0 18px #a855f7) hue-rotate(255deg) saturate(2.5);
  transform: scale(1.16);
}
.lot-card {
  background: #1b1511;
  border: 1px solid #57412e;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.bp-tier {
  background: #1a1412;
  border: 1px solid #3f2e21;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
}
.bp-tier.bp-unlocked { border-color: #eab308; background: #241c13; }
.bp-row { display: grid; grid-template-columns: 42px 1fr 1fr; gap: 8px; align-items: center; }

.skin-mythic {
  filter: drop-shadow(0 0 22px #f43f5e) drop-shadow(0 0 10px #fde047) saturate(2.8);
  transform: scale(1.22);
}
.backpack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 6px;
  margin-top: 10px;
  max-height: 210px;
  overflow-y: auto;
}
.bp-item-pill {
  background: #1c1510;
  border: 1px solid #57412e;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
}

.sb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 6, 4, 0.86);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}
.sb-modal-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #2e150c, #170d08);
  border: 2px solid #f59e0b;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.35);
  text-align: center;
}
.sb-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}