﻿:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --text: #e8e8e8;
  --muted: #9aa0aa;
  --accent: #f5a623;
  --ok: #4caf7d;
  --err: #e05c5c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

h1 { font-size: 20px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 10px; color: var(--accent); }

.wallet {
  font-size: 12px;
  color: var(--muted);
  max-width: 45vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.center { text-align: center; }

.score { font-size: 18px; margin-bottom: 12px; }

#tap {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: none;
  background-image: url("tap.png");
  background-size: cover;
  background-position: center;
  background-color: transparent;
  cursor: pointer;
  transition: transform 0.05s;
}
#tap:active { transform: scale(0.92); }

@keyframes shockFlash {
  0% { box-shadow: 0 0 0 0 rgba(255, 210, 60, 0.9), 0 0 30px 6px rgba(120, 200, 255, 0.8); }
  100% { box-shadow: 0 0 0 18px rgba(255, 210, 60, 0), 0 0 0 0 rgba(120, 200, 255, 0); }
}
#tap.shock { animation: shockFlash 0.45s ease-out; }

.bolt {
  position: fixed;
  z-index: 998;
  font-size: 22px;
  pointer-events: none;
  animation: boltFly 0.55s ease-out forwards;
  filter: drop-shadow(0 0 6px rgba(255, 230, 90, 0.9));
}
@keyframes boltFly {
  0% { opacity: 1; transform: translate(0, 0) scale(0.7) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.4) rotate(var(--rot)); }
}

.balance {
  font-size: 26px;
  font-weight: bold;
  color: var(--ok);
}

.balrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #10131a;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.balrow span { color: var(--muted); }
.balrow b { color: var(--ok); font-size: 15px; }

.addr {
  word-break: break-all;
  background: #10131a;
  border-radius: 8px;
  padding: 10px;
  font-family: monospace;
  font-size: 12px;
  margin-bottom: 10px;
}

input {
  width: 100%;
  background: #10131a;
  color: var(--text);
  border: 1px solid #2a2f3a;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 14px;
}
input:focus { outline: none; border-color: var(--accent); }

button {
  width: 100%;
  background: #2a2f3a;
  color: var(--text);
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 6px;
}
button.primary { background: var(--accent); color: #111; font-weight: bold; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.muted { color: var(--muted); font-size: 12px; margin: 6px 0; }

.status { text-align: center; font-size: 13px; min-height: 20px; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

.hint { text-align: center; color: var(--muted); font-size: 12px; }

.lang-btn {
  width: 48px !important;
  height: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: var(--accent);
  color: #111;
  font-weight: bold;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
}

.last-result { text-align: center; font-weight: bold; min-height: 20px; margin: 8px 0 0; }
.last-result.win { color: var(--ok); }
.last-result.lose { color: var(--err); }

.float-txt {
  position: fixed;
  z-index: 999;
  font-size: 20px;
  font-weight: bold;
  pointer-events: none;
  animation: floatUp 1s ease-out forwards;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.float-txt.win { color: var(--ok); }
.float-txt.lose { color: var(--err); }

@keyframes floatUp {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-45px); }
}



.coin-game {
  position: relative;
  width: 100%;
  height: 260px;
  background: #10131a;
  border-radius: 10px;
  margin: 10px 0;
  overflow: hidden;
  touch-action: none;
}
#coinField {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 40px;
}
.coin {
  position: absolute;
  font-size: 22px;
  user-select: none;
}
#coinBull {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 34px;
  transition: left 0.08s linear;
  user-select: none;
}


.shock-meter {
  position: relative;
  width: 100%;
  height: 44px;
  background: #10131a;
  border-radius: 10px;
  margin: 12px 0 6px;
  overflow: hidden;
}
#shockZones {
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
}
#shockNeedle {
  position: absolute;
  top: 0; bottom: 0;
  width: 4px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  left: 50%;
}
.shock-zone {
  position: absolute;
  top: 0; bottom: 0;
}
.shock-zone.perfect { background: rgba(76,217,100,0.9); }
.shock-zone.great { background: rgba(76,217,100,0.45); }
.shock-zone.good { background: rgba(255,204,0,0.35); }


.float-txt.shock-fly {
  animation: shockFly 0.52s ease-out forwards;
  color: var(--accent);
}
@keyframes shockFly {
  0% { opacity: 1; transform: translate(0,0) scale(0.8); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.5); }
}
.shock-flash {
  position: fixed;
  inset: 0;
  z-index: 998;
  pointer-events: none;
  background: radial-gradient(circle at 50% 55%, rgba(120,200,255,0.4), transparent 65%);
  animation: shockFlash 0.26s ease-out forwards;
}
@keyframes shockFlash { from { opacity: 1; } to { opacity: 0; } }
.shock-btn {
  animation: shockBtn 0.4s ease;
}
@keyframes shockBtn {
  0% { transform: scale(1); }
  25% { transform: scale(1.15) rotate(-4deg); }
  50% { transform: scale(1.05) rotate(3deg); }
  75% { transform: scale(1.1) rotate(-2deg); }
  100% { transform: scale(1); }
}


.coin-popup {
  position: absolute;
  z-index: 5;
  font-size: 18px;
  font-weight: bold;
  pointer-events: none;
  animation: popUp 0.9s ease-out forwards;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.coin-popup.win { color: var(--ok); }
.coin-popup.lose { color: var(--err); }
@keyframes popUp {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-32px); }
}


.dice3d {
  position: relative;
  width: 92px;
  height: 92px;
  margin: 18px auto;
  perspective: 420px;
}
.dice-cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(0deg) rotateY(0deg);
  transition: transform 1.6s cubic-bezier(0.18, 0.8, 0.24, 1);
}
.dice-side {
  position: absolute;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10%;
  padding: 16%;
  box-sizing: border-box;
  background: #fff;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px #d8d8d8;
}
.pip {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: transparent;
}
.pip.on { background: #111; }
.dice-side.front { transform: translateZ(46px); }
.dice-side.back { transform: rotateY(180deg) translateZ(46px); }
.dice-side.right { transform: rotateY(90deg) translateZ(46px); }
.dice-side.left { transform: rotateY(-90deg) translateZ(46px); }
.dice-side.top { transform: rotateX(90deg) translateZ(46px); }
.dice-side.bottom { transform: rotateX(-90deg) translateZ(46px); }


.bet-btn {
  width: 58px;
  height: 42px;
  margin: 0;
  padding: 0;
  background: #2a2f3a;
  color: var(--text);
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}
.bet-btn:active { background: var(--accent); color: #111; }
.bet-btn.win { background: var(--ok); color: #111; }
.bet-btn.lose { background: var(--err); color: #fff; }
.bet-amt {
  width: 52px;
  height: 36px;
  margin: 0;
  padding: 0;
  background: #2a2f3a;
  color: var(--text);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}
.bet-amt.active { background: var(--accent); color: #111; }


.bet-btn.picked { background: var(--accent); color: #111; box-shadow: 0 0 8px rgba(255,204,0,0.5); }

