:root {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --container-bg: #2c2c2c;
    --button-bg: #4CAF50;
    --button-hover-bg: #45a049;
    --upgrade-bg: #333;
    --border-color: #444;
    --danger-color: #f44336;
    --disabled-bg: #555;
    --disabled-color: #888;
    --success-color: #8BC34A;
    --critical-color: #FFC107;
    --target-color: #f44336;
    --stat-level-color: #2196F3;
    --stat-multiplier-color: #FF9800;
    --stat-value-color: #9C27B0;
    --tooltip-bg: #444;
    --tooltip-text-color: #f0f0f0;
  }
  
  body {
    font-family: 'Press Start 2P', cursive;
    background-color: var(--bg-color);
    color: var(--text-color);
    text-align: center;
    padding: 20px;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    cursor: url('hand-32.png'), auto;
  }
  
  #game-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--container-bg);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5), inset 0 0 10px #000;
    border: 3px solid var(--border-color);
    position: relative;
  }
  
  h1, h2, h3 {
      text-transform: uppercase;
      letter-spacing: 2px;
      text-shadow: 2px 2px #000;
  }
  
  #click-button {
    padding: 20px 40px;
    font-size: 36px;
    border: none;
    border-radius: 10px;
    background-color: var(--button-bg);
    color: white;
    margin: 20px 0;
    transition: all 0.1s ease;
    box-shadow: 0 5px #999;
    position: relative;
    overflow: hidden;
    cursor: url('hand-32.png'), auto;
  }
  
  #click-button:active {
      transform: translateY(4px);
      box-shadow: 0 1px #666;
      cursor: url('fist-32.png'), auto;
  }

  .critical-hit {
    animation: flash-yellow 0.2s ease-out;
  }

  @keyframes flash-yellow {
    0% { background-color: var(--button-bg); }
    50% { background-color: var(--critical-color); }
    100% { background-color: var(--button-bg); }
  }

  .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
  }

  @keyframes ripple-animation {
    to {
      transform: scale(4);
      opacity: 0;
    }
  }

  .floating-text {
    position: absolute;
    color: var(--text-color);
    font-size: 20px;
    font-weight: bold;
    text-shadow: 2px 2px #000;
    animation: float-up-animation 1s ease-out forwards;
    pointer-events: none;
  }

  @keyframes float-up-animation {
    to {
        transform: translateY(-50px);
        opacity: 0;
    }
  }
  
  #stats {
    display: flex;
    justify-content: space-around;
    background: var(--upgrade-bg);
    padding: 10px;
    border-radius: 5px;
    border-bottom: 3px solid var(--border-color);
  }

  .stat-item {
      display: flex;
      flex-direction: column;
  }

  .stat-label {
      font-size: 12px;
      color: #aaa;
      margin-bottom: 8px;
  }

  .stat-value {
      font-size: 24px;
      font-weight: bold;
      text-shadow: 2px 2px #000;
  }

  #secondary-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 14px;
    color: #ccc;
    margin-top: 15px;
  }

  #milestone-progress-container {
    width: 200px;
    height: 10px;
    background-color: var(--disabled-bg);
    border-radius: 5px;
    overflow: hidden;
  }

  #milestone-progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--success-color);
    transition: width 0.5s ease-in-out;
  }

  #income-display {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    margin: 30px 0;
    background: #111;
    border-radius: 8px;
  }

  #income-display > div {
    display: flex;
    flex-direction: column;
  }

  #income-display .label {
    font-s ze: 12px;
    color: #aaa;
    margin-bottom: 8px;
  }

  #income-display .value {
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px #000;
  }
  
  #upgrades {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
  }
  
  .upgrade-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--upgrade-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    position: relative;
  }
  
  button {
    font-family: 'Press Start 2P', cursive;
    background-color: var(--button-bg);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 3px #666;
    transition: all 0.1s ease;
  }
  
  button:hover {
      background-color: var(--button-hover-bg);
  }
  
  button:active {
      transform: translateY(2px);
      box-shadow: 0 1px #666;
  }

  button:disabled {
    background-color: var(--disabled-bg) !important;
    color: var(--disabled-color) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: translateY(0) !important;
  }

  #reset-button {
      background-color: var(--danger-color);
      margin-top: 30px;
  }
  
  #upgrades button {
    width: 100%;
    min-height: 50px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
  }

  .upgrade-success {
    animation: flash-success 0.3s ease-out;
  }

  @keyframes flash-success {
    0% { background-color: var(--button-bg); }
    50% { background-color: var(--success-color); }
    100% { background-color: var(--button-bg); }
  }

  .upgrade-stats {
    font-size: 12px;
    color: #ccc;
    text-align: center;
    line-height: 1.8;
  }

  .stat-level, .stat-multiplier {
    font-weight: bold;
  }

  .stat-level { color: var(--stat-level-color); }
  .stat-multiplier { color: var(--stat-multiplier-color); }
  .stat-value-main { color: var(--text-color); }
  .stat-value-next { color: var(--success-color); }
  .stat-cost { color: var(--danger-color); }
  
  .info-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 16px;
    cursor: help;
    z-index: 1;
  }

  .tooltip {
    position: absolute;
    background-color: var(--tooltip-bg);
    color: var(--tooltip-text-color);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-size: 12px;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    text-align: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 2;
  }

  .info-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
  }

  input[type="text"], input[type="number"] {
      padding: 10px;
      border-radius: 5px;
      border: 2px solid var(--border-color);
      background: var(--upgrade-bg);
      color: var(--text-color);
      font-family: 'Press Start 2P', cursive;
  }
  
  select {
    padding: 10px;
    border-radius: 5px;
    border: 2px solid var(--border-color);
    background: var(--upgrade-bg);
    color: var(--text-color);
    font-family: 'Press Start 2P', cursive;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1.5em;
    padding-right: 2.5em;
    margin-bottom: 20px;
  }

  #player-list {
      margin: 20px 0;
  }

  #highscore-container {
      max-width: 800px;
      margin: 30px auto;
  }

  #highscore-time-filter {
    margin-bottom: 20px;
  }

  #highscore-table {
      width: 100%;
      border-collapse: collapse;
  }

  #highscore-table th, #highscore-table td {
      border: 2px solid var(--border-color);
      padding: 8px;
  }

  #highscore-table th {
      background-color: var(--upgrade-bg);
  }

  #patch-notes {
    margin-top: 30px;
    font-size: 12px;
    color: #aaa;
  }
  
  #patch-notes h3 {
    font-size: 14px;
    color: #ccc;
  }
  
  #patch-notes ul {
    list-style-type: none;
    padding: 0;
  }
  
  #patch-notes li {
    margin-bottom: 5px;
  }

  .coin-target {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255,223,0,1) 0%, rgba(255,165,0,1) 35%, rgba(255,69,0,1) 100%);
    border-radius: 50%;
    cursor: pointer;
    animation: grow-and-shrink ease-in-out forwards, pulse 0.5s infinite alternate;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 25px rgba(255, 165, 0, 0.6);
  }

  @keyframes grow-and-shrink {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0); opacity: 0; }
  }

  @keyframes pulse {
    from { box-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 25px rgba(255, 165, 0, 0.6); }
    to { box-shadow: 0 0 25px rgba(255, 215, 0, 1), 0 0 40px rgba(255, 165, 0, 0.8); }
  }

  .diamond-powerup {
    position: absolute;
    font-size: 30px;
    animation: fall linear;
  }

  @keyframes fall {
      to {
          transform: translateY(100vh);
      }
  }

  .explosion {
    animation: explode 0.5s forwards;
  }

  @keyframes explode {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(3); opacity: 0; }
  }

  .powerup-highlight {
      border: 2px solid #00f;
  }

  ::-webkit-scrollbar {
    width: 12px;
  }
  
  ::-webkit-scrollbar-track {
    background: var(--container-bg); 
  }
   
  ::-webkit-scrollbar-thumb {
    background: var(--button-bg); 
    border-radius: 6px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: var(--button-hover-bg); 
  }
