/* Crash Game Styling */
:root {
  --card-bg: rgba(255, 255, 255, 0.05);
  --accent: #c6ff00;
}

html {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background-color: #14151f;
  color: #fff;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.container {
  width: 100%;
  max-width: 650px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1em;
}

.header h1 {
  font-size: 1.8em;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-link {
  color: #fff;
  text-decoration: none;
  font-size: 1em;
  line-height: 1;
  transition: all 0.2s;
  opacity: 0.7;
  display: flex;
  align-items: center;
}

.back-link:hover {
  opacity: 1;
  color: var(--accent);
  transform: translateX(-2px);
}

.balance-display {
  font-size: 1.2em;
  font-weight: 600;
  color: #00ff00;
}

button {
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.8;
}

button:hover {
  opacity: 1;
}

button:active {
  opacity: 0.8;
}

.controls {
  background: var(--card-bg);
  padding: 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 10px;
}

.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.controls-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  white-space: nowrap;
}

.controls input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  width: 100px;
  font-family: inherit;
}

.controls input:focus {
  outline: none;
  border-color: var(--accent);
}

#start-game {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
}

#start-game:hover {
  background: #00ff00;
  transform: translateY(-1px);
}

#cash-out {
  background: #ffa726;
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
}

#cash-out:hover:not(:disabled) {
  background: #ff9800;
  transform: translateY(-1px);
}

#cash-out:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
  opacity: 0.5;
}

#reset {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
}

#reset:hover {
  background: rgba(255, 255, 255, 0.15);
}

.message {
  color: #ffd166;
  font-size: 14px;
  text-align: right;
  min-height: 20px;
  flex: 1;
}

.game-area {
  margin-bottom: 10px;
}

.canvas-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game {
  width: 100%;
  max-width: 500px;
  height: 400px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  display: block;
}

.multiplier-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 60px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(198, 255, 0, 0.5);
  pointer-events: none;
}

.last-crashes {
  background: var(--card-bg);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.last-crashes-label {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}

.crashes-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.crashes-list p {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.3);
}

footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  margin-top: 10px;
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.4em;
  }

  .balance-display {
    font-size: 1em;
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  .controls-row:first-child {
    gap: 8px;
  }

  .controls label {
    width: 100%;
  }

  .controls button {
    width: 100%;
  }

  .message {
    width: 100%;
    text-align: center;
  }

  .multiplier-display {
    font-size: 40px;
  }

  #game {
    height: 300px;
  }
}