:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #070914;
  color: #f6f7fb;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: #070914;
}

button,
input {
  font: inherit;
}

.app {
  width: 100vw;
  height: 100svh;
  min-height: 560px;
  padding: clamp(8px, 1.8vw, 18px);
  background:
    radial-gradient(circle at 18% 10%, rgba(58, 142, 255, 0.22), transparent 28%),
    radial-gradient(circle at 84% 24%, rgba(255, 139, 61, 0.18), transparent 24%),
    linear-gradient(135deg, #070914 0%, #151a2d 52%, #080a12 100%);
}

.game-stage {
  position: relative;
  width: min(100%, 960px);
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: #0c1020;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

#game {
  position: absolute;
  inset: 0;
}

#game canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.top-hud,
.bottom-console {
  position: absolute;
  left: clamp(8px, 2vw, 16px);
  right: clamp(8px, 2vw, 16px);
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background: rgba(8, 11, 21, 0.74);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
}

.top-hud {
  top: clamp(8px, 2vw, 16px);
  display: grid;
  grid-template-columns: minmax(126px, 1.2fr) repeat(4, 1fr);
  gap: 8px;
  align-items: stretch;
  padding: 10px;
}

.brand,
.stat {
  min-width: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
}

.dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ff6b35;
  box-shadow: 0 0 0 6px rgba(255, 107, 53, 0.14);
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.1;
}

p {
  margin-top: 3px;
  color: #aeb7ce;
  font-size: 12px;
}

.stat {
  padding: 8px 9px;
}

.stat span,
.bet-input span {
  display: block;
  color: #aeb7ce;
  font-size: 11px;
  line-height: 1.2;
}

.stat strong {
  display: block;
  margin-top: 4px;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-console {
  bottom: clamp(8px, 2vw, 16px);
  display: grid;
  gap: 9px;
  padding: 10px;
}

.history-line {
  display: flex;
  gap: 6px;
  min-height: 27px;
  overflow: hidden;
}

.bet-console {
  display: grid;
  grid-template-columns: minmax(108px, 1fr) 180px;
  gap: 8px;
}

.bet-input {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: center;
  min-width: 0;
  height: 46px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  outline: none;
  background: rgba(0, 0, 0, 0.24);
  color: #fff;
  font-weight: 800;
}

.chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

button {
  height: 46px;
  border: 0;
  border-radius: 8px;
  color: #0a0d13;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    opacity 0.16s ease,
    filter 0.16s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.chip {
  background: #d7deed;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.primary {
  background: #ff8b3d;
}

.success {
  background: #45e0a4;
}

.tag {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 27px;
  padding: 4px 7px;
  border-radius: 7px;
  font-size: 11px;
  line-height: 1.15;
  font-weight: 900;
  white-space: nowrap;
}

.tag.win {
  background: rgba(69, 224, 164, 0.16);
  color: #6ff0be;
}

.tag.loss {
  background: rgba(255, 92, 92, 0.16);
  color: #ff8d8d;
}

@media (max-width: 720px) {
  .app {
    min-height: 100svh;
    padding: 0;
  }

  .game-stage {
    width: 100vw;
    height: 100svh;
    border: 0;
    border-radius: 0;
  }

  .top-hud {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px;
  }

  .brand {
    display: none;
  }

  .stat {
    padding: 7px 6px;
  }

  .stat strong {
    font-size: 15px;
  }

  .bottom-console {
    gap: 7px;
    padding: 8px;
  }

  .bet-console {
    grid-template-columns: 1fr;
  }

  .chips {
    grid-template-columns: repeat(3, 1fr);
  }

  .actions {
    grid-template-columns: 1fr 1fr;
  }

  button {
    height: 44px;
  }
}

@media (max-width: 390px) {
  .stat span {
    font-size: 10px;
  }

  .stat strong {
    font-size: 14px;
  }

  .tag {
    font-size: 10px;
  }
}
