/* Shared styles for the casino site */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600&display=swap');

:root {
  --accent: #0ff;
  --bg-start: #1a1a1a;
  --bg-end: #000;
  --muted: #777;
}

body {
  font-family: 'Orbitron', system-ui, sans-serif;
  margin: 40px auto;
  max-width: 760px;
  padding: 0 16px;
  color: #eee;
  background: radial-gradient(circle at top, var(--bg-start), var(--bg-end));
}

.hidden {
  display: none;
}

h1, h2, h3 {
  text-shadow: 0 0 6px var(--accent);
}

button {
  padding: 8px 16px;
  cursor: pointer;
  background: #111;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
  text-shadow: 0 0 4px rgba(0, 255, 255, 0.5);
  transition: background 0.2s, box-shadow 0.2s, text-shadow 0.2s;
}

button:hover {
  background: #222;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.6);
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.8);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  text-shadow: none;
}

button.loading {
  position: relative;
  color: transparent;
}

button.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  margin-left: -8px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

input {
  background: #000;
  border: 1px solid #444;
  color: #eee;
  padding: 4px 6px;
  border-radius: 4px;
}

pre {
  background: #111;
  color: var(--accent);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #333;
  overflow: auto;
}

.alert {
  position: fixed;
  top: 16px;
  right: max(16px, calc((100vw - 760px) / 2 + 16px));
  z-index: 1000;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: #111;
  color: var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: min(320px, calc(100vw - 32px));
}

.alert.error {
  border-color: #f33;
  color: #f66;
}

.alert.success {
  border-color: #3f3;
  color: #9f9;
}

.alert.hidden {
  display: none;
}

.mono {
  font-family: 'Fira Code', 'SFMono-Regular', ui-monospace, Menlo, Monaco, Consolas, monospace;
}

.small {
  font-size: 0.9rem;
}

code {
  background: #111;
  padding: 2px 4px;
  border-radius: 4px;
}

.row {
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

section {
  margin-bottom: 24px;
}

input.guess {
  width: 60px;
}

input.stake {
  width: 80px;
}

.muted {
  color: var(--muted);
}

.balance {
  color: var(--accent);
}

#coin-container {
  width: 100px;
  height: 100px;
  perspective: 1000px;
  margin: 20px auto;
  border: 2px solid var(--accent);
  border-radius: 50%;
}

#coin-container.win {
  border-color: #0f0;
}

#coin-container.lose {
  border-color: #f00;
}

#coin {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s;
}


#coin.flipping-to-heads {
  animation: flip-to-heads 1s forwards;
}

#coin.flipping-to-tails {
  animation: flip-to-tails 1s forwards;
}

#coin div {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 50%;
}

.heads {
  background-color: #ffd700;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-size="40">H</text></svg>');
}

.tails {
  background-color: #c0c0c0;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-size="40">T</text></svg>');
  transform: rotateY(180deg);
}

@keyframes flip-to-heads {
  from {
    transform: rotateY(0);
  }
  to {
    transform: rotateY(1800deg);
  }
}

@keyframes flip-to-tails {
  from {
    transform: rotateY(0);
  }
  to {
    transform: rotateY(1980deg);
  }
}

.numbers-container {
  position: relative;
  width: 100%;
  height: 50px;
  margin-top: 20px;
  overflow: hidden;
}

.numbers {
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}

.number {
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: #333;
  color: #fff;
  border-radius: 5px;
}

.number.active {
  background-color: var(--accent);
  color: #000;
}

.number.win {
  background-color: #0f0;
  color: #000;
}

.number.lose {
  background-color: #f00;
  color: #000;
}

#coin.looping {
  animation: flip-loop 0.5s infinite linear;
}

@keyframes flip-loop {
  from {
    transform: rotateY(0);
  }
  to {
    transform: rotateY(360deg);
  }
}
#race-track {
  position: relative;
  width: 100%;
  border: 2px solid var(--accent);
  margin-top: 20px;
}

.lane {
  position: relative;
  height: 30px;
  border-bottom: 1px solid #333;
  cursor: pointer;
}

.lane:last-child {
  border-bottom: none;
}

.lane.selected {
  background: rgba(255, 255, 0, 0.2);
}

.lane.bet {
  background: rgba(0, 0, 255, 0.2);
}

.lane.win {
  background: rgba(0, 255, 0, 0.2);
}

.horse {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
}

#pachinko-board {
  position: relative;
  width: 100%;
  height: 200px;
  border: 2px solid var(--accent);
  margin-top: 20px;
}

  #pachinko-ball {
    position: absolute;
    top: 0;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    transform: translateX(-50%);
    z-index: 1;
  }

#pachinko-board .peg {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  z-index: 0;
}

#pachinko-board .slots {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
}

#pachinko-board .slot {
  flex: 1;
  text-align: center;
  border-top: 1px solid var(--accent);
  padding-top: 4px;
}

#pachinko-board .slot.win {
  background: rgba(0, 255, 0, 0.2);
}
