* { 
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin:0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:#0d1117;
  color:#c9d1d9;
  overflow-x:hidden;
  touch-action: manipulation;
}
header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 15px 20px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 15px;
}
h1 { 
  margin: 0; 
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 600;
  color: #58a6ff;
  letter-spacing: 0.5px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  transition: color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
h1:hover {
  color: #79c0ff;
}
#topNav {
  display: flex;
  gap: 10px;
  margin-top: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 101;
  margin-left: auto;
}
#topNav button {
  width: auto;
  margin: 0;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.event-timer {
  position:fixed;
  top:80px;
  left:50%;
  transform:translateX(-50%);
  background:rgba(255, 193, 7, 0.2);
  border:2px solid #ffc107;
  padding:16px 32px;
  border-radius:8px;
  font-size:clamp(11px, 2.5vw, 14px);
  color:#ffc107;
  z-index:1000;
  box-shadow:0 4px 16px rgba(0,0,0,0.6);
  text-align:center;
  min-width:280px;
  max-width:90vw;
  white-space: pre-line;
  backdrop-filter:blur(4px);
}
.event-timer-label {
  font-weight:700;
  margin-bottom:6px;
  font-size:clamp(10px, 2.2vw, 13px);
  letter-spacing:1px;
  text-transform:uppercase;
}
.container {
  max-width:1600px;
  margin:0 auto;
  padding:clamp(10px, 3vw, 20px);
}
.grid {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(min(100%, 350px), 1fr));
  gap:clamp(12px, 2vw, 20px);
  margin-bottom:24px;
}
.panel {
  background:#161b22;
  padding:clamp(12px, 3vw, 20px);
  border:1px solid #30363d;
  border-radius:6px;
  margin-bottom:24px;
}
.panel h3 {
  margin:0 0 16px 0;
  color:#58a6ff;
  font-size:clamp(12px, 2.5vw, 14px);
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.5px;
  padding-bottom:12px;
  border-bottom:1px solid #21262d;
}
.stats-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap:clamp(8px, 2vw, 12px);
}
.stat-card {
  background:#0d1117;
  padding:clamp(12px, 3vw, 16px);
  border:1px solid #30363d;
  border-radius:6px;
}
.stat-label {
  font-size:clamp(10px, 2vw, 11px);
  color:#8b949e;
  text-transform:uppercase;
  letter-spacing:0.5px;
  margin-bottom:8px;
}
.stat-value {
  font-size:clamp(18px, 4vw, 24px);
  color:#58a6ff;
  font-weight:600;
}
button {
  background:#21262d;
  border:1px solid #30363d;
  color:#c9d1d9;
  padding:10px 16px;
  cursor:pointer;
  border-radius:6px;
  font-family:inherit;
  font-size:clamp(11px, 2.5vw, 13px);
  transition:all 0.2s;
  width:100%;
  margin-bottom:8px;
  touch-action:manipulation;
  user-select:none;
  -webkit-user-select:none;
}
button:hover:not(:disabled) {
  background:#30363d;
  border-color:#58a6ff;
}
button:active:not(:disabled) {
  transform:scale(0.98);
}
button:disabled {
  opacity:0.4;
  cursor:not-allowed;
}
button.active {
  background:#0366d6;
  border-color:#0073FA;
  color:#fff;
}
button.danger {
  background:#da3633;
  border-color:#f85149;
  color:#fff;
}
button.danger:hover:not(:disabled) {
  background:#f85149;
}
button.primary {
  background:#0366d6;
  border-color:#0366d6;
  color:#fff;
}
button.primary:hover:not(:disabled) {
  background:#1f6feb;
  border-color:#58a6ff;
}
button.small {
  padding:6px 10px;
  font-size:clamp(10px, 2vw, 11px);
  width:auto;
}
.tool-card {
  background:#0d1117;
  padding:14px;
  margin-bottom:12px;
  border:1px solid #30363d;
  border-radius:6px;
}
.tool-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
  gap:8px;
  flex-wrap:wrap;
}
.tool-name {
  color:#58a6ff;
  font-weight:600;
  font-size:clamp(11px, 2.5vw, 13px);
}
.tool-status {
  font-size:clamp(10px, 2vw, 11px);
  padding:2px 8px;
  border-radius:12px;
  background:#21262d;
  color:#8b949e;
  white-space:nowrap;
}
.tool-status.active {
  background:#2ea043;
  color:#fff;
}
.tool-desc {
  font-size:clamp(11px, 2.2vw, 12px);
  color:#8b949e;
  margin-bottom:10px;
  line-height:1.4;
}
.tool-actions {
  display:flex;
  gap:8px;
}
.tool-actions button {
  margin:0;
}
input[type="number"] {
  background:#0d1117;
  border:1px solid #30363d;
  color:#c9d1d9;
  padding:8px 12px;
  border-radius:6px;
  font-family:inherit;
  font-size:clamp(11px, 2.5vw, 13px);
  width:100%;
  touch-action:manipulation;
}
input[type="number"]:focus {
  outline:none;
  border-color:#58a6ff;
}
.sell-tier {
  margin-bottom:16px;
  padding:12px;
  background:#0d1117;
  border:1px solid #30363d;
  border-radius:6px;
}
.sell-tier-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
  gap:8px;
  flex-wrap:wrap;
}
.sell-tier-name {
  font-size:clamp(11px, 2.5vw, 13px);
  font-weight:600;
  color:#c9d1d9;
}
.sell-tier-price {
  font-size:clamp(11px, 2.5vw, 13px);
  color:#58a6ff;
}
.sell-buttons-row {
  display:flex;
  gap:6px;
  margin-bottom:8px;
  align-items:flex-start;
  flex-wrap:nowrap;
}
.sell-scroll-container {
  overflow-x:auto;
  overflow-y:hidden;
  white-space:nowrap;
  flex:1;
  padding:0;
  max-width:100%;
}
.sell-scroll-container::-webkit-scrollbar {
  height:6px;
}
.sell-scroll-container::-webkit-scrollbar-track {
  background:#0d1117;
}
.sell-scroll-container::-webkit-scrollbar-thumb {
  background:#30363d;
  border-radius:3px;
}
.sell-scroll-buttons {
  display:inline-flex;
  gap:6px;
}
.custom-sell-container {
  display:flex;
  gap:6px;
  align-items:center;
  margin-top:8px;
}
.custom-sell-container input {
  flex:1;
  margin-bottom:0;
}
.custom-sell-container button {
  width:auto;
  margin-bottom:0;
}
canvas {
  width:100%;
  background:#0d1117;
  border:1px solid #30363d;
  border-radius:6px;
  cursor:pointer;
  display:block;
  touch-action:manipulation;
}
#pieChart {
  height:clamp(160px, 30vh, 250px);
}
#moneyGraph {
  height:clamp(120px, 20vh, 180px);
}
.achievement {
  padding:10px;
  margin-bottom:8px;
  background:#0d1117;
  border-left:3px solid #30363d;
  border-radius:3px;
  font-size:clamp(11px, 2.2vw, 12px);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.achievement.done {
  border-left-color:#2ea043;
}
.achievement-text {
  color:#c9d1d9;
}
.achievement.done .achievement-text {
  color:#2ea043;
}
.achievement-reward {
  font-size:clamp(10px, 2vw, 11px);
  color:#8b949e;
}
.scrollable {
  max-height:min(400px, 50vh);
  overflow-y:auto;
  padding-right:8px;
}
.scrollable::-webkit-scrollbar {
  width:8px;
}
.scrollable::-webkit-scrollbar-track {
  background:#0d1117;
  border-radius:4px;
}
.scrollable::-webkit-scrollbar-thumb {
  background:#30363d;
  border-radius:4px;
}
.progress-bar {
  background:#0d1117;
  height:24px;
  border-radius:6px;
  overflow:hidden;
  position:relative;
  margin:12px 0;
  border:1px solid #30363d;
}
.progress-fill {
  background:#1f6feb;
  height:100%;
  transition:width 0.3s;
}
.progress-text {
  position:absolute;
  width:100%;
  text-align:center;
  line-height:24px;
  font-size:clamp(11px, 2.2vw, 12px);
  font-weight:600;
  color:#c9d1d9;
}
.tier-badge {
  display:inline-block;
  padding:2px 8px;
  border-radius:3px;
  font-size:clamp(9px, 2vw, 10px);
  font-weight:600;
  margin-left:6px;
}
.tier-t1 { background:#6e7681; color:#fff; }
.tier-t2 { background:#58a6ff; color:#000; }
.tier-t3 { background:#f85149; color:#fff; }
.tier-mobile { background:#ffc107; color:#000; }
.cooldown-bar {
  height:6px;
  background:#30363d;
  border-radius:3px;
  overflow:hidden;
  margin-top:8px;
}
.cooldown-fill {
  height:100%;
  background:#58a6ff;
  transition:width 0.1s linear;
}
.modal-overlay {
  position:fixed;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background:rgba(0,0,0,0.8);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:10000;
  animation:fadeIn 0.2s;
  padding:20px;
  pointer-events:all;
}
.modal {
  background:#161b22;
  border:1px solid #30363d;
  border-radius:6px;
  padding:clamp(16px, 4vw, 24px);
  max-width:600px;
  width:100%;
  box-shadow:0 8px 32px rgba(0,0,0,0.5);
  max-height:80vh;
  overflow-y:auto;
  pointer-events:all;
}
@keyframes fadeIn {
  from { opacity:0; }
  to { opacity:1; }
}
.modal-title {
  font-size:clamp(14px, 3vw, 16px);
  font-weight:600;
  color:#58a6ff;
  margin-bottom:12px;
}
.modal-content {
  font-size:clamp(12px, 2.5vw, 14px);
  color:#c9d1d9;
  margin-bottom:20px;
  line-height:1.6;
}
.modal-content h4 {
  color:#58a6ff;
  font-size:clamp(12px, 2.5vw, 14px);
  margin:16px 0 8px 0;
}
.modal-content ul {
  margin:8px 0;
  padding-left:20px;
}
.modal-content li {
  margin:6px 0;
}
.skill-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap:12px;
}
.graph-container {
  position:relative;
}
.tooltip {
  position:absolute;
  background:#161b22;
  border:1px solid #58a6ff;
  padding:8px 12px;
  border-radius:6px;
  font-size:clamp(11px, 2.2vw, 12px);
  pointer-events:none;
  display:none;
  z-index:100;
  box-shadow:0 4px 12px rgba(0,0,0,0.5);
}
.tooltip-label {
  color:#8b949e;
  font-size:clamp(9px, 2vw, 10px);
  margin-bottom:4px;
}
.tooltip-value {
  color:#58a6ff;
  font-weight:600;
  font-size:clamp(12px, 2.5vw, 14px);
}
.tool-tabs {
  display:flex;
  gap:8px;
  margin-bottom:12px;
  flex-wrap:wrap;
}
.tool-tab {
  padding:6px 12px;
  background:#0d1117;
  border:1px solid #30363d;
  border-radius:6px;
  cursor:pointer;
  font-size:clamp(10px, 2vw, 11px);
  transition:all 0.2s;
  touch-action:manipulation;
  user-select:none;
  -webkit-user-select:none;
}
.tool-tab:hover {
  border-color:#58a6ff;
}
.tool-tab.active {
  background:#1f6feb;
  border-color:#58a6ff;
  color:#fff;
}
.tool-panel {
  display:none;
}
.tool-panel.active {
  display:block;
}
@keyframes spin {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100px); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px currentColor; }
    50% { box-shadow: 0 0 30px currentColor; }
}
@keyframes floatUp {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-40px); opacity: 0; }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
.spinning { animation: spin 0.1s infinite linear; }
.shake { animation: shake 0.3s ease; }
.flash { animation: flash 0.5s ease 2; }
.glow { animation: glow 0.5s ease infinite; }
.pulse { animation: pulse 0.5s ease 2; }
.slots-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.slot-stat-box {
  background: #0d1117;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #30363d;
  font-size: clamp(10px, 1.8vw, 11px);
}
.slot-stat-label {
  color: #8b949e;
  margin-bottom: 4px;
}
.slot-stat-value {
  color: #58a6ff;
  font-weight: 600;
  font-size: clamp(12px, 2.2vw, 14px);
}
.slot-stat-value.free-spins {
  color: #f85149;
}
.crypto-mode-btn.active {
  background: #1f6feb !important;
  border-color: #58a6ff !important;
  color: #fff !important;
}
#offlineTime {
    text-align: center;
    line-height: 1.3;
    margin-bottom: 10px;
}
#topNav button.profile-toggle {
  width: 48px;
  height: 48px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #21262d;
  border: 1px solid #30363d;
  cursor: pointer;
  transition: all 0.2s;
  overflow: visible;
  position: relative;
  z-index: 102;
  pointer-events: auto;
}
#topNav button.profile-toggle * {
  pointer-events: none;
}
#topNav button.profile-toggle:hover {
  background: #30363d;
  border-color: #58a6ff;
}
#topNav button.profile-toggle.active {
  background: #0366d6;
  border-color: #0366d6;
}
#topNav button.profile-toggle img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}
#prestigeCircle {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #f85149;
  color: white;
  font-size: 10px;
  font-weight: bold;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #161b22;
  z-index: 103;
}
.profile-dropdown {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 300px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 999;
  display: none;
  overflow: hidden;
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #21262d;
  background: #0d1117;
}
.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.profile-avatar img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.profile-info {
  flex: 1;
}
.profile-name {
  font-weight: 600;
  color: #c9d1d9;
  font-size: 13px;
  margin-bottom: 2px;
}
.profile-id {
  font-size: 11px;
  color: #8b949e;
}
.dropdown-section {
  padding: 16px;
  border-bottom: 1px solid #21262d;
}
.dropdown-section:last-child {
  border-bottom: none;
}
.dropdown-section h4 {
  margin: 0 0 12px 0;
  color: #58a6ff;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dropdown-section button.compact {
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 6px;
}
.prestige-info {
  font-size: 11px;
  color: #8b949e;
  margin-top: 8px;
  line-height: 1.4;
}
.progress-bar.compact {
  height: 16px;
  margin: 12px 0;
}
.progress-bar.compact .progress-text {
  line-height: 16px;
  font-size: 10px;
}
footer {
  padding: 20px 30px;
  background: #161b22;
  border-top: 1px solid #30363d;
  text-align: center;
}
.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.footer-text {
  font-size: 13px;
  color: #8b949e;
}
.footer-heart {
  color: #f85149;
  display: inline-block;
}
.footer-version {
  font-size: clamp(10px, 2vw, 11px);
  color: #6e7681;
  font-family: monospace;
  letter-spacing: 0.5px;
}
#gameVersion {
  color: #58a6ff;
  font-weight: 600;
}
@media (max-width: 768px) {
  header {
    padding: 12px 16px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  h1 {
    font-size: clamp(13px, 3.5vw, 16px);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
  }
  #topNav {
    align-self: center;
  }
  #topNav button.profile-toggle {
    width: 44px;
    height: 44px;
  }
  #topNav button.profile-toggle img {
    width: 28px;
    height: 28px;
  }
  #prestigeCircle {
    top: -3px;
    right: -3px;
    width: 16px;
    height: 16px;
    font-size: 9px;
  }
  .profile-dropdown {
    width: 280px;
    right: 10px;
    top: 65px;
  }
  .slot-machine-page .reel {
    height: 80px !important;
  }
  .slot-machine-page .symbol {
    width: 50px !important;
    height: 50px !important;
    font-size: 0.8rem !important;
  }
  .slot-machine-page .slot-btn {
    min-width: 120px !important;
    padding: 10px !important;
  }
  .stats-grid {
    grid-template-columns:repeat(auto-fit, minmax(120px, 1fr));
  }
  footer {
    padding: 16px 20px;
  }
  .footer-text {
    font-size: 12px;
  }
  .footer-version {
    font-size: 10px;
  }
}