:root {
  --bg: #05070d;
  --bg-soft: #0c1324;
  --panel: rgba(10, 16, 33, 0.78);
  --panel-border: rgba(102, 128, 196, 0.28);
  --text: #e8f0ff;
  --muted: #8f9dbe;
  --cyan: #1de7ff;
  --cyan-strong: #00c7ff;
  --blue: #1985ff;
  --emerald: #2cffbf;
  --danger: #ff4d71;
  --danger-soft: #ff6d8a;
  --amber: #ffd165;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1400px 780px at -10% -40%, rgba(40, 93, 205, 0.32), transparent 56%),
    radial-gradient(1300px 720px at 120% -20%, rgba(20, 193, 255, 0.18), transparent 54%),
    radial-gradient(1100px 640px at 50% 130%, rgba(34, 255, 168, 0.08), transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: "SF Pro Display", "Segoe UI", "Noto Sans", sans-serif;
}

body {
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(48px);
  opacity: 0.5;
}

.ambient-a {
  width: 260px;
  height: 260px;
  top: -60px;
  left: -80px;
  background: rgba(24, 124, 255, 0.3);
}

.ambient-b {
  width: 220px;
  height: 220px;
  right: -70px;
  top: 30%;
  background: rgba(0, 255, 191, 0.18);
}

.app {
  max-width: 920px;
  margin: 0 auto;
  padding: 14px 12px 26px;
  display: grid;
  gap: 12px;
}

.reveal {
  animation: reveal 0.45s ease both;
}

.hero {
  padding: 4px 2px 2px;
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.hero h1 {
  margin: 2px 0 5px;
  font-size: 30px;
  letter-spacing: 0.4px;
}

.sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.panel {
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(15, 25, 48, 0.78), rgba(8, 13, 24, 0.94));
  border-radius: 18px;
  padding: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 15px 34px rgba(2, 6, 14, 0.52);
}

.label {
  margin: 0 0 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.55px;
  font-size: 11px;
  font-weight: 700;
}

.value {
  margin: 0;
  font-weight: 700;
}

.strong {
  font-size: 18px;
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.vip-pill {
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 101, 0.4);
  background: linear-gradient(120deg, rgba(255, 209, 101, 0.16), rgba(0, 199, 255, 0.08));
  color: var(--amber);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.4px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.ico {
  display: inline-block;
  width: 1em;
  height: 1em;
  object-fit: contain;
  flex-shrink: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(122, 143, 196, 0.32);
  background: rgba(14, 21, 40, 0.88);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.ico-chip {
  width: 14px;
  height: 14px;
}

.bet-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.bet-dot.red {
  background: radial-gradient(circle at 30% 30%, #ff9ab1, #ff4f75 68%);
}

.bet-dot.black {
  background: radial-gradient(circle at 35% 35%, #6a7598, #2f3b55 68%);
}

.chip:hover {
  transform: translateY(-1px);
}

.chip.active {
  border-color: rgba(29, 231, 255, 0.78);
  box-shadow: 0 0 0 1px rgba(29, 231, 255, 0.42), 0 8px 18px rgba(7, 166, 201, 0.22);
}

.stake-row {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(102, 128, 196, 0.3);
  background: var(--bg-soft);
  color: var(--text);
  padding: 10px 11px;
  font-size: 14px;
  outline: none;
}

input:focus {
  border-color: rgba(29, 231, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(29, 231, 255, 0.32);
}

.ghost {
  border-radius: 12px;
  border: 1px solid rgba(102, 128, 196, 0.35);
  background: rgba(13, 20, 37, 0.85);
  color: var(--text);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
}

.ghost.accent {
  color: var(--amber);
  border-color: rgba(255, 209, 101, 0.45);
}

.ghost.small {
  height: 32px;
  padding: 0 10px;
}

.ring-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  border: 1px solid rgba(102, 128, 196, 0.24);
  background: rgba(11, 17, 31, 0.86);
  border-radius: 14px;
  padding: 10px;
}

.metric-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.metric-value {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.crash-panel {
  padding: 12px;
  overflow: hidden;
}

.crash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.crash-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 24, 43, 0.86);
  border: 1px solid rgba(69, 98, 161, 0.34);
  border-radius: 16px;
  min-height: 40px;
  padding: 0 12px;
  color: #d2defc;
  font-weight: 700;
}

.crash-pill-online {
  color: #3ede92;
}

.pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
}

.ico-pill {
  width: 15px;
  height: 15px;
}

.crash-pill-wallet {
  color: #f0f6ff;
  margin-left: auto;
}

.pill-add {
  margin-left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 0;
  background: #f6fbff;
  color: #263046;
  font-size: 17px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ico-plus {
  width: 14px;
  height: 14px;
}

.crash-stage {
  position: relative;
  min-height: 300px;
  border-radius: 20px;
  border: 1px solid rgba(70, 99, 158, 0.32);
  background: linear-gradient(180deg, #020814 0%, #050912 62%, #060a12 100%);
  overflow: hidden;
  --progress-pct: 0;
  --rocket-x: 3%;
  --rocket-y: 78%;
  --ship-shift: 0px;
  --ship-tilt: 0deg;
}

#crashStars,
.crash-noise,
.crash-vignette {
  position: absolute;
  inset: 0;
}

.crash-noise {
  background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px),
    radial-gradient(circle at 82% 76%, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px);
  background-size: 120px 120px, 145px 145px;
  mix-blend-mode: screen;
  opacity: 0.16;
  animation: noiseShift 6s steps(8) infinite;
}

.crash-vignette {
  background: radial-gradient(circle at 50% 40%, rgba(0, 0, 0, 0) 0%, rgba(0, 3, 8, 0.5) 62%, rgba(0, 0, 0, 0.9) 100%);
  pointer-events: none;
}

.crash-center {
  position: relative;
  z-index: 3;
  padding-top: 46px;
  text-align: center;
}

.crash-ship {
  margin: 8px auto 2px;
  width: 124px;
  height: 84px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 12px rgba(255, 161, 73, 0.5));
  transform: translateX(var(--ship-shift)) rotate(var(--ship-tilt));
  transition: transform 0.22s linear;
  animation: shipHover 2.2s ease-in-out infinite;
}

.ico-ship {
  width: 118px;
  height: 80px;
}

.phase {
  margin: 0;
  color: rgba(201, 214, 244, 0.76);
  font-size: 12px;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.crash-multiplier {
  margin: 2px 0 2px;
  font-size: 78px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 1px;
  color: #ff5478;
  text-shadow: 0 0 12px rgba(255, 67, 104, 0.7), 0 0 26px rgba(255, 67, 104, 0.38);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.crash-multiplier span {
  font-size: 36px;
  opacity: 0.75;
}

.potential {
  margin: 0;
  color: #cad8ff;
  font-weight: 600;
  font-size: 13px;
}

.rocket-track {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 30px;
  height: 82px;
  z-index: 3;
}

.rocket-path {
  position: absolute;
  left: 0;
  right: 0;
  top: 15px;
  bottom: 8px;
  border-top: 2px solid rgba(56, 191, 255, 0.16);
  border-right: 2px solid rgba(56, 191, 255, 0.16);
  border-radius: 100% 100% 0 0;
  transform: skewX(-13deg) rotate(-5deg);
}

.rocket-trail {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--progress-pct) * 1%);
  height: 72px;
  background: linear-gradient(90deg, rgba(29, 231, 255, 0.02), rgba(77, 175, 255, 0.18) 35%, rgba(255, 98, 125, 0.26) 72%, rgba(255, 98, 125, 0));
  border-radius: 16px;
  transform: skewX(-22deg);
  filter: blur(1px);
  transition: width 0.2s linear;
}

.rocket-marker {
  position: absolute;
  left: calc(var(--rocket-x) - 12px);
  top: calc(var(--rocket-y) - 16px);
  filter: drop-shadow(0 0 8px rgba(255, 78, 108, 0.7));
  transition: left 0.24s linear, top 0.24s linear, transform 0.24s ease;
  animation: rocketBob 0.85s ease-in-out infinite;
  width: 24px;
  height: 24px;
}

.ico-rocket {
  width: 24px;
  height: 24px;
}

.progress-bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 8px;
  height: 8px;
  background: rgba(28, 36, 58, 0.86);
  border-radius: 999px;
  overflow: hidden;
  z-index: 3;
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #1de7ff, #2cffbf);
  box-shadow: 0 0 18px rgba(29, 231, 255, 0.7);
  border-radius: 999px;
  transition: width 0.2s linear;
}

.crash-stage.state-running .crash-multiplier {
  color: #ff4267;
  animation: dangerPulse 0.66s ease-in-out infinite;
}

.crash-stage.state-running .crash-ship {
  filter: drop-shadow(0 0 18px rgba(255, 170, 95, 0.8));
}

.crash-stage.state-cashed .crash-multiplier {
  color: #2cffbf;
  text-shadow: 0 0 12px rgba(44, 255, 191, 0.65), 0 0 24px rgba(44, 255, 191, 0.36);
}

.crash-stage.state-crashed .crash-multiplier {
  color: #ff6f8f;
  text-shadow: 0 0 10px rgba(255, 111, 143, 0.48);
}

.crash-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.round-state {
  border-radius: 11px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  background: #153348;
  color: #9ec8ff;
  min-width: 92px;
  text-align: center;
  white-space: nowrap;
}

.round-state.wait {
  background: #0f3f7a;
  color: #b7dbff;
}

.round-state.run {
  background: #5a2032;
  color: #ffd0db;
}

.round-state.win {
  background: #194a3c;
  color: #9cffdb;
}

.round-state.loss {
  background: #48212f;
  color: #ffc2d0;
}

.history-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.history-row::-webkit-scrollbar {
  display: none;
}

.history-pill {
  min-width: 56px;
  border-radius: 10px;
  text-align: center;
  padding: 7px 8px;
  background: rgba(18, 30, 53, 0.9);
  color: #8fa2c6;
  font-size: 13px;
  font-weight: 700;
}

.history-pill.win {
  color: #9effda;
}

.history-pill.loss {
  color: #ffadbf;
}

.ticker-settings {
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: rgba(16, 27, 49, 0.95);
  color: #9baed6;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ico-settings {
  width: 18px;
  height: 18px;
}

.action {
  text-align: center;
}

.crash-quick-stakes {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.crash-quick-stakes::-webkit-scrollbar {
  display: none;
}

.quick-stake-chip {
  border: 1px solid rgba(68, 92, 144, 0.42);
  background: rgba(15, 26, 48, 0.84);
  color: #c7d7f7;
  border-radius: 11px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.quick-stake-chip.active {
  border-color: rgba(45, 175, 255, 0.8);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(45, 175, 255, 0.3);
}

.play-btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.7px;
  cursor: pointer;
  color: #04131a;
  background: linear-gradient(90deg, var(--cyan), var(--emerald));
  box-shadow: 0 12px 24px rgba(12, 173, 195, 0.26);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.play-btn:hover {
  transform: translateY(-1px);
}

.play-btn:disabled {
  opacity: 0.65;
  cursor: default;
  transform: none;
}

.status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--emerald);
}

.status.warn {
  color: var(--amber);
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.feed {
  display: grid;
  gap: 8px;
}

.feed-item {
  border: 1px solid rgba(102, 128, 196, 0.26);
  border-radius: 12px;
  padding: 10px;
  background: rgba(12, 18, 34, 0.88);
  animation: feedIn 0.28s ease;
}

.feed-item.win {
  border-color: rgba(41, 255, 184, 0.42);
}

.feed-item.loss {
  border-color: rgba(255, 84, 120, 0.42);
}

.feed-item p {
  margin: 0;
  font-size: 13px;
}

.feed-item .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-weight: 700;
}

.crash-board {
  min-height: 260px;
  display: grid;
  align-content: start;
  gap: 0;
  border-radius: 14px;
  border: 1px solid rgba(64, 84, 128, 0.4);
  background: linear-gradient(180deg, rgba(16, 22, 34, 0.95), rgba(14, 19, 31, 0.97));
  overflow: hidden;
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  color: #8696bb;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  border-bottom: 1px solid rgba(58, 78, 114, 0.42);
  background: rgba(14, 20, 32, 0.95);
}

.board-out {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.live-list {
  display: grid;
}

.live-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid rgba(53, 73, 108, 0.35);
}

.live-item:first-child {
  border-top: 0;
}

.live-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.live-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #f0f5ff;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(140deg, #ff6d8a, #7e5dff);
}

.live-meta {
  min-width: 0;
}

.live-name {
  margin: 0;
  font-size: 16px;
  color: #f2f7ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-sub {
  margin: 2px 0 0;
  color: #8fa2ca;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.live-mult {
  color: #3ce7a4;
  font-weight: 700;
}

.live-value {
  color: #24e181;
  font-size: 33px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.live-coin {
  width: 15px;
  height: 15px;
  vertical-align: middle;
}

.live-coin.big {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.live-item.pending .live-value {
  color: #8fa2ca;
}

.live-item.rocket .live-value {
  color: #43e8a7;
}

.live-item.loss .live-value {
  color: #f36d8c;
}

.mini-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(72, 89, 126, 0.4);
  background: rgba(11, 15, 24, 0.94);
  backdrop-filter: blur(12px);
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  border: 0;
  background: transparent;
  color: #7f8ca9;
  min-height: 64px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  cursor: pointer;
}

.nav-ico {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ico-nav {
  width: 22px;
  height: 22px;
  opacity: 0.82;
  filter: grayscale(1) saturate(0.2) brightness(0.85);
  transition: opacity 0.18s ease, filter 0.18s ease;
}

.nav-label {
  font-size: 12px;
  font-weight: 600;
}

.nav-item.active {
  color: var(--blue);
}

.nav-item.active .ico-nav {
  opacity: 1;
  filter: grayscale(0) saturate(1.1) brightness(1) drop-shadow(0 0 7px rgba(39, 148, 255, 0.6));
}

.app.crash-focus {
  max-width: 480px;
  padding: 8px 10px 96px;
  gap: 8px;
}

.app.crash-focus .hero,
.app.crash-focus .profile,
.app.crash-focus #modeSection,
.app.crash-focus #stakeSection,
.app.crash-focus #diceOptions,
.app.crash-focus #ringOptions,
.app.crash-focus #rouletteOptions {
  display: none;
}

.app.crash-focus #crashPanel {
  display: block;
  border-radius: 20px;
  border-color: rgba(65, 91, 147, 0.42);
  background: rgba(8, 12, 22, 0.84);
  box-shadow: 0 10px 24px rgba(2, 5, 12, 0.64);
}

.app.crash-focus .action {
  position: sticky;
  bottom: 74px;
  z-index: 60;
  background: rgba(9, 14, 24, 0.95);
  border-radius: 18px;
}

.app.crash-focus .play-btn {
  background: linear-gradient(180deg, #1f8dff, #1376e2);
  color: #f4fbff;
  border-radius: 16px;
  font-size: 35px;
  padding: 16px;
  font-weight: 700;
  letter-spacing: 0.1px;
  box-shadow: 0 10px 26px rgba(19, 118, 226, 0.42);
}

.app.crash-focus .status {
  font-size: 13px;
  margin-top: 9px;
}

.app.crash-focus #resultPanel {
  min-height: 300px;
  background: linear-gradient(180deg, rgba(20, 25, 37, 0.96), rgba(15, 18, 30, 0.98));
  border-color: rgba(62, 74, 104, 0.58);
}

.app.crash-focus #resultFeed,
.app.crash-focus .result-head {
  display: none;
}

.app.crash-focus #crashBoard {
  display: grid;
}

.app.crash-focus #miniNav {
  display: grid;
}

.hidden {
  display: none;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rocketBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes shipHover {
  0%,
  100% {
    transform: translateX(var(--ship-shift)) rotate(var(--ship-tilt)) translateY(0);
  }
  50% {
    transform: translateX(var(--ship-shift)) rotate(var(--ship-tilt)) translateY(-5px);
  }
}

@keyframes dangerPulse {
  0%,
  100% {
    text-shadow: 0 0 12px rgba(255, 67, 104, 0.7), 0 0 26px rgba(255, 67, 104, 0.32);
  }
  50% {
    text-shadow: 0 0 20px rgba(255, 67, 104, 0.9), 0 0 38px rgba(255, 67, 104, 0.56);
  }
}

@keyframes feedIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes noiseShift {
  0% {
    transform: translate(0, 0);
  }
  30% {
    transform: translate(-1px, 1px);
  }
  70% {
    transform: translate(1px, -1px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@media (max-width: 430px) {
  .stake-row {
    flex-wrap: wrap;
  }

  .ghost {
    min-height: 34px;
    flex: 1;
  }

  .hero h1 {
    font-size: 26px;
  }

  .crash-multiplier {
    font-size: 64px;
  }

  .crash-multiplier span {
    font-size: 30px;
  }

  .crash-ship {
    width: 104px;
    height: 74px;
  }

  .ico-ship {
    width: 98px;
    height: 66px;
  }

  .app.crash-focus .play-btn {
    font-size: 34px;
  }
}

@media (min-width: 800px) {
  .app {
    padding: 20px 20px 32px;
    gap: 14px;
  }

  .panel {
    padding: 16px;
  }

  .hero h1 {
    font-size: 36px;
  }
}
