/* Plinko 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;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

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

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

.controls select {
  width: 130px;
}

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

.controls button {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}

#drop-btn {
  background: var(--accent);
  color: #000;
}

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

#reset-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

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

.message {
  margin-left: auto;
  color: #ffd166;
  font-size: 14px;
}

.footer {
  margin-top: 2em;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85em;
}


.game-area {
  width: 500px;
  max-width: 100%;
  margin: 0 auto;
}

.canvas-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.canvas-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#plinko-canvas {
  display: block;
  margin: auto;
  width: 100%;
  height: auto;
}

.notes {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  margin-top: 5px;
  width: 100%;
  padding: 0 10px;
}

.note {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 16px;
  max-width: 22px;
  aspect-ratio: 30 / 26;
  border-radius: 4px;
  background-color: gray;
  flex-shrink: 1;
  border-bottom: solid 3px yellow;
  text-align: center;
  font-size: 0.6em;
  font-weight: 600;
  color: #000;
}

.note[data-pressed="true"] {
  animation: press 0.5s;
}

@keyframes press {
  0% {
    border-bottom-width: 3px;
  }
  50% {
    border-bottom-width: 0;
  }
  100% {
    border-bottom-width: 3px;
  }
}

/* Multiplier colors matching reference */
.note:nth-child(1),
.note:nth-child(17) {
  background-color: #ff0050;
  border-color: #cc0040;
}

.note:nth-child(2),
.note:nth-child(16) {
  background-color: #ff1744;
  border-color: #cc1236;
}

.note:nth-child(3),
.note:nth-child(15) {
  background-color: #ff5252;
  border-color: #cc4141;
}

.note:nth-child(4),
.note:nth-child(14) {
  background-color: #ff6e40;
  border-color: #cc5833;
}

.note:nth-child(5),
.note:nth-child(13) {
  background-color: #ff6e40;
  border-color: #cc5833;
}

.note:nth-child(6),
.note:nth-child(12) {
  background-color: #ff9100;
  border-color: #cc7400;
}

.note:nth-child(7),
.note:nth-child(11) {
  background-color: #ffa726;
  border-color: #cc851e;
}

.note:nth-child(8),
.note:nth-child(10) {
  background-color: #ffc107;
  border-color: #cc9a06;
}

.note:nth-child(9) {
  background-color: #ffeb3b;
  border-color: #ccbc2f;
}

.message {
  text-align: center;
  color: #ffd166;
  font-size: 14px;
  margin-top: 1em;
  min-height: 20px;
}



/* Mobile Responsiveness */

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

  .controls {
    gap: 8px;
  }

  .controls label {
    font-size: 12px;
    flex-direction: row;
    align-items: center;
		white-space: nowrap;
  }

  .controls input {
    width: 100%;
  }

  .controls button {
    width: 100%;
  }

  .canvas-wrapper {
    width: 100%;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .canvas-container {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    margin: 1em auto 0;
  }

  #plinko-canvas {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
  }

  .notes {
    width: 100%;
    max-width: 100%;
    gap: 2px;
    padding: 0 2px;
    margin: 5px auto 0;
  }

  .note {
    min-width: 15px;
    max-width: 20px;
    font-size: 0.55em;
    border-bottom-width: 3px;
  }
}

@media (max-width: 390px) {
  .notes {
    gap: 0.25px;
  }
}
