/* ============================================
   HashSlot — Hacker Terminal Theme
   Green-on-black, monospace, matrix vibes
   ============================================ */

@font-face {
  font-family: 'Days';
  src: url('/font/Days.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Modern deep glass colors */
  --bg-primary: #050806;
  /* --bg-secondary: rgba(5, 12, 8, 0.7); */
  /* --bg-card: rgba(0, 15, 5, 0.45); */
  /* --bg-card-solid: #030804; */
  --glass: rgba(0, 255, 65, 0.04);
  --glass-border: rgba(0, 255, 65, 0.15);

  /* Cyber glows */
  /* --accent: #00ff41; */
  /* --accent-light: #4dff88; */
  /* --accent-dark: #00b32d; */
  --accent-glow: rgb(0 0 0 / 40%);
  /* --accent-glow-strong: rgba(0, 255, 65, 0.6); */
  --cyber-cyan: #00f3ff;
  /* --cyber-cyan-glow: rgba(0, 243, 255, 0.4); */

  --gold: #00ff41;
  /* --gold-glow: rgba(0, 255, 65, 0.4); */
  --green: #00ff41;
  /* --green-glow: rgba(0, 255, 65, 0.4); */
  --red: #ff2a2a;
  /* --red-glow: rgba(255, 42, 42, 0.4); */
  --cyan: #00f3ff;
  --pink: #ff00ea;
  --amber: #ffb000;

  --text-primary: #27ffab;
  --text-secondary: #00ff41;
  --text-muted: #ffffff;

  --radius: 6px;
  --radius-sm: 4px;
  --radius-xs: 2px;
  --shadow: 0 8px 32px 0 rgba(0, 255, 65, 0.08);
  --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --font-mono: 'Days', monospace;
  --scanline: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.15) 2px,
      rgba(0, 0, 0, 0.15) 4px);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-mono);
  background-color: var(--bg-primary);
  background-image: url('/img/fons3.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  /* text-shadow: 0 0 10px rgba(0, 255, 65, 0.5); */
  letter-spacing: 0.5px;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1em;
  /* text-shadow: 0 0 10px rgba(0, 255, 65, 0.5); */
  letter-spacing: 1px;
}

/* Scanline overlay */
body::before {
  display: none;
  content: '';
  position: fixed;
  inset: 0;
  background: var(--scanline);
  z-index: 9999;
  pointer-events: none;
  opacity: 0.2;
  /* Subtler scanlines */
}

/* CRT vignette glow */
body::after {
  display: none;
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(2, 5, 3, 0.85) 100%);
  z-index: 0;
  pointer-events: none;
}

/* ---------- Layout ---------- */
.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.key-icon {
  height: 1.25em;
  width: auto;
  vertical-align: middle;
  display: inline-block;
  transform: translateY(-2px);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 28px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 10px var(--accent-glow);
}

.logo-text {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--green) 0%, var(--cyber-cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* text-shadow: 0 0 20px rgba(0, 255, 65, 0.3); */
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: stretch;
  gap: 16px;
}

.hashkey-balance {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--glass-border);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.hashkey-balance .hashkey-icon {
  font-size: 1rem;
}

.hashkey-balance .hashkey-count {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  background: rgba(0, 255, 65, 0.05);
  color: var(--accent);
  backdrop-filter: blur(4px);
  z-index: 1;
  height: auto;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
  z-index: -1;
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 255, 65, 0.1);
  opacity: 0;
  transition: var(--transition);
  z-index: -2;
}

.btn:hover::after {
  opacity: 1;
}

.btn:hover {
  box-shadow: 0 0 20px var(--accent-glow), inset 0 0 10px var(--accent-glow);
  /* text-shadow: 0 0 12px var(--accent); */
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn-buy {
  background: rgba(0, 255, 65, 0.08);
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  padding: 8px 16px 8px 45px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}

.btn-buy-bg {
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  height: 160%;
  opacity: 0.2;
  pointer-events: none;
  filter: drop-shadow(0 0 5px var(--accent-glow));
}

.buy-text-wrapper {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  line-height: 1.15;
}

.buy-text-top {
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  color: var(--text-primary);
}

.buy-text-bottom {
  font-size: 0.90rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.btn-buy:hover {
  background: rgba(0, 255, 65, 0.15);
  box-shadow: 0 0 25px var(--accent-glow);
}

.btn-spin {
  width: 100%;
  padding: 16px 28px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 5px;
  text-transform: uppercase;
  border-radius: var(--radius);
  background-color: transparent;
  background-image: linear-gradient(rgba(147, 51, 234, 0.4), rgba(147, 51, 234, 0.15)), url('/img/mascaraopen.png');
  background-size: cover;
  background-position: center;
  border: 1px solid #a855f7;
  color: #d8b4fe;
  box-shadow: inset 0 2px 20px rgba(147, 51, 234, 0.2);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-spin:active:not(:disabled) {
  transform: translateY(2px);
  border-bottom-width: 1px;
  box-shadow: 0 5px 15px rgba(147, 51, 234, 0.3), inset 0 2px 10px rgba(147, 51, 234, 0.2);
}

.btn-spin:hover:not(:disabled) {
  background-image: linear-gradient(rgba(147, 51, 234, 0.5), rgba(147, 51, 234, 0.25)), url('/img/mascaraopen.png');
  background-size: cover;
  background-position: center;
  box-shadow: 0 15px 40px rgba(147, 51, 234, 0.6), inset 0 2px 25px rgba(147, 51, 234, 0.4);
  border-color: #d8b4fe;
  color: #fff;
  text-shadow: 0 0 15px #a855f7, 0 0 30px #a855f7;
}

.btn-spin:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-bottom-width: 1px;
  transform: none;
}

.btn-spin.spinning {
  animation: terminal-blink 0.8s ease-in-out infinite alternate;
}

.btn-spin::before {
  background: linear-gradient(90deg, transparent, rgba(147, 51, 234, 0.4), transparent);
}

.btn-spin::after {
  background: rgba(147, 51, 234, 0.2);
}

@keyframes terminal-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.7rem;
  border-radius: var(--radius);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Card ---------- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(0, 255, 65, 0.3);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyber-cyan), transparent);
  animation: scan-line 6s linear infinite;
}

@keyframes scan-line {
  0% {
    left: -100%;
  }

  100% {
    left: 200%;
  }
}

.card-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-title::before {
  content: '>';
  color: var(--text-muted);
}

/* ---------- Slot Machine ---------- */
.slot-section {
  margin-bottom: 20px;
}

.slot-machine {
  background: rgba(5, 12, 8, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(0, 255, 65, 0.3);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 255, 65, 0.05);
}

.slot-machine::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--scanline);
  opacity: 0.15;
  pointer-events: none;
  z-index: 1;
}

.slot-label {
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 4px;
  position: relative;
  z-index: 2;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 3px;
}

.slot-sublabel {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
  letter-spacing: 1px;
}

/* Reel Strip */
.reel-container {
  position: relative;
  height: 120px;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(0, 5, 2, 0.8);
  border: 1px solid var(--glass-border);
  margin-bottom: 20px;
  z-index: 2;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 255, 65, 0.05);
}

/* Gradient masks on edges */
.reel-container::before,
.reel-container::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  z-index: 3;
  pointer-events: none;
}

.reel-container::before {
  left: 0;
  background: linear-gradient(90deg, rgba(3, 8, 4, 0.98), transparent);
}

.reel-container::after {
  right: 0;
  background: linear-gradient(-90deg, rgba(3, 8, 4, 0.98), transparent);
}

/* Center highlight */
.reel-highlight {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110px;
  height: 110px;
  border: 1px solid rgba(0, 255, 65, 0.4);
  border-radius: var(--radius);
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 255, 65, 0.05), transparent, rgba(0, 255, 65, 0.05));
  box-shadow: 0 0 20px var(--accent-glow), inset 0 0 20px rgba(0, 255, 65, 0.1);
}

.reel-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  position: absolute;
  top: 50%;
  left: 0;
  width: max-content;
  transform: translateY(-50%);
  transition: none;
}

.reel-strip.animating {
  transition: none;
}

.reel-strip.landing {
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.reel-item {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.7rem;
  text-align: center;
  border: 1px solid rgba(0, 255, 65, 0.08);
  position: relative;
  overflow: hidden;
  color: var(--text-primary);
}

.reel-item .item-icon {
  font-size: 1.8rem;
}

.item-icon-img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}

.history-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
}

.detail-icon-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  vertical-align: middle;
}

.reel-item .item-label {
  font-size: 0.65rem;
  opacity: 0.9;
  line-height: 1.2;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

/* Item rarity colors — hacker style */
.reel-item.rarity-common,
.prize-card.rarity-common {
  background: rgba(169, 169, 169, 0.1);
  border-color: #a9a9a9;
}

.reel-item.rarity-uncommon,
.prize-card.rarity-uncommon {
  background: rgba(181, 138, 255, 0.1);
  border-color: #b58aff;
  box-shadow: 0 0 8px rgba(181, 138, 255, 0.2);
  color: #b58aff;
}

.reel-item.rarity-rare,
.prize-card.rarity-rare {
  background: rgba(134, 18, 255, 0.2);
  border-color: #8612ff;
  box-shadow: 0 0 10px rgba(134, 18, 255, 0.3);
  color: #8612ff;
}

.reel-item.rarity-epic,
.prize-card.rarity-epic {
  background: rgba(255, 44, 44, 0.15);
  border-color: #ff2c2c;
  box-shadow: 0 0 10px rgba(255, 44, 44, 0.25);
  color: #ff2c2c;
}

.reel-item.rarity-legendary,
.prize-card.rarity-legendary {
  background: rgba(230, 164, 16, 0.15);
  border-color: #e6a410;
  box-shadow: 0 0 15px rgba(230, 164, 16, 0.3);
  color: #e6a410;
}

.reel-item.winner {
  animation: winner-glow 0.6s ease-out;
}

@keyframes winner-glow {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 transparent;
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--accent-glow);
  }

  100% {
    transform: scale(1);
  }
}

/* Result display */
.result-display {
  text-align: center;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
  letter-spacing: 1px;
}

.result-display.won {
  color: var(--accent);
  /* text-shadow: 0 0 20px var(--accent-glow); */
  animation: result-pop 0.4s ease-out;
}

.result-display.lost {
  color: var(--red);
  /* text-shadow: 0 0 10px var(--red-glow); */
}

.result-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
}

@keyframes result-pop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  60% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Spin cost badge */
.spin-cost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
  position: relative;
  z-index: 2;
  letter-spacing: 0.5px;
}

/* ---------- Prize Table ---------- */
.prize-table-section {
  margin-bottom: 20px;
}

.prize-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.prize-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  text-align: center;
  transition: var(--transition);
}

.prize-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.prize-card .prize-icon {
  font-size: 1.4rem;
}

.prize-icon-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  margin-bottom: 4px;
}

.prize-card .prize-name {
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

.prize-card .prize-chance {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Provably Fair Panel ---------- */
.fair-section {
  margin-bottom: 20px;
}

.fair-toggle {
  cursor: pointer;
  user-select: none;
}

.fair-toggle .toggle-arrow {
  transition: var(--transition);
  display: inline-block;
  font-size: 0.8em;
}

.fair-toggle .toggle-arrow.open {
  transform: rotate(90deg);
}

.fair-content {
  display: none;
  margin-top: 14px;
}

.fair-content.open {
  display: block;
  animation: fadeSlideIn 0.2s ease-out;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fair-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.fair-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.fair-label::before {
  content: '$ ';
  color: rgba(0, 255, 65, 0.3);
}

.fair-value {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  word-break: break-all;
  line-height: 1.4;
}

.fair-input {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-primary);
  width: 100%;
  outline: none;
  transition: var(--transition);
  /* text-shadow: 0 0 6px rgba(0, 255, 65, 0.3); */
}

.fair-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.fair-row-inline {
  display: flex;
  gap: 10px;
}

.fair-row-inline .fair-row {
  flex: 1;
}

.verify-result {
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 4px;
  display: none;
  font-family: var(--font-mono);
}

.verify-result.pass {
  display: block;
  background: rgba(0, 255, 65, 0.06);
  border: 1px solid rgba(0, 255, 65, 0.25);
  color: var(--accent);
}

.verify-result.fail {
  display: block;
  background: rgba(255, 51, 51, 0.06);
  border: 1px solid rgba(255, 51, 51, 0.25);
  color: var(--red);
}

/* ---------- History ---------- */
.history-section {
  margin-bottom: 20px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
}

.history-list::-webkit-scrollbar {
  width: 4px;
}

.history-list::-webkit-scrollbar-track {
  background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 0;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  background: var(--glass);
  border: 1px solid rgba(0, 255, 65, 0.06);
  font-size: 0.75rem;
  transition: var(--transition);
  cursor: pointer;
}

.history-item:hover {
  border-color: var(--accent);
  background: rgba(0, 255, 65, 0.04);
}

.history-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-num {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 0.65rem;
  min-width: 24px;
}

.history-icon {
  font-size: 1rem;
}

.history-name {
  font-weight: 600;
  font-size: 0.75rem;
}

.history-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-nonce {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.history-badge {
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
}

.history-badge.common {
  background: rgba(0, 255, 65, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(0, 255, 65, 0.1);
}

.history-badge.uncommon {
  background: rgba(0, 255, 65, 0.08);
  color: var(--text-secondary);
  border: 1px solid rgba(0, 255, 65, 0.15);
}

.history-badge.rare {
  background: rgba(0, 255, 204, 0.08);
  color: #00ffcc;
  border: 1px solid rgba(0, 255, 204, 0.2);
}

.history-badge.epic {
  background: rgba(255, 51, 51, 0.08);
  color: #ff6666;
  border: 1px solid rgba(255, 51, 51, 0.2);
}

.history-badge.legendary {
  background: rgba(255, 176, 0, 0.08);
  color: var(--amber);
  border: 1px solid rgba(255, 176, 0, 0.2);
}

.history-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
  font-size: 0.75rem;
  letter-spacing: 1px;
}

.history-empty::before {
  content: '> ';
}

/* ---------- Buy Hashkeys Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: #0a0a0a;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 36px;
  max-width: 550px;
  width: 100%;
  box-shadow: 0 0 40px var(--accent-glow);
  animation: modalSlide 0.2s ease-out;
}

@keyframes modalSlide {
  from {
    transform: translateY(10px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 6px;
  text-align: center;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.modal-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.hashkey-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.hashkey-amount-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.hashkey-amount-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.hashkey-amount-btn.selected {
  border-color: var(--accent);
  background: rgba(0, 255, 65, 0.06);
  box-shadow: 0 0 15px var(--accent-glow);
  color: var(--accent);
}

.hashkey-amount-btn .amount-hashkeys {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.7rem;
  color: inherit;
}

.hashkey-amount-btn .amount-price {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
}

.hashkey-amount-btn .amount-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hashkey-amount-btn img {
  width: 100%;
  height: auto;
  transition: transform 0.2s ease;
}

.hashkey-amount-btn .badge-recommended {
  position: absolute;
  top: 0;
  right: -10px;
  width: 78px;
  height: auto;
  z-index: 10;
  transform: translateY(-50%);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.hashkey-amount-btn:hover .badge-recommended,
.hashkey-amount-btn.selected .badge-recommended {
  transform: translateY(-50%);
  /* prevent badge from scaling with the main key package */
}



.modal-total {
  text-align: center;
  padding: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  margin-bottom: 20px;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.modal-total strong {
  color: var(--accent);
  font-size: 1.3rem;
}

.btn-pay {
  width: 100%;
  padding: 16px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: var(--radius);
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 15px var(--accent-glow);
}

.btn-pay:hover {
  background: rgba(0, 255, 65, 0.08);
  box-shadow: 0 0 25px var(--accent-glow);
  /* text-shadow: 0 0 15px var(--accent); */
}

.modal-close {
  text-align: center;
  margin-top: 10px;
}

.modal-close button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 6px;
  transition: var(--transition);
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

.modal-close button:hover {
  color: var(--red);
}

/* ---------- History Detail Modal ---------- */
.detail-modal .modal {
  max-width: 540px;
}

.detail-seeds {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-seeds .fair-value {
  font-size: 0.68rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .app-wrapper {
    padding: 12px 10px 40px;
  }

  .header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    padding-bottom: 16px;
  }

  .logo {
    justify-content: center;
  }

  .header-right {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .header-right>* {
    margin-left: 0 !important;
  }

  .hashkey-balance {
    font-size: 0.75rem;
    padding: 6px 10px;
  }

  .btn {
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  .slot-machine {
    padding: 16px 12px 14px;
  }

  .slot-label {
    font-size: 1rem;
  }

  .reel-container {
    height: 100px;
  }

  .reel-item {
    width: 80px;
    height: 80px;
  }

  .reel-highlight {
    width: 90px;
    height: 90px;
  }

  .btn-spin {
    font-size: 1rem;
    padding: 12px 20px;
  }

  .prize-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

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

  .fair-row-inline {
    flex-direction: column;
  }
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Confetti canvas */
#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

/* ---------- Custom selection ---------- */
::selection {
  background: rgba(0, 255, 65, 0.3);
  color: var(--accent);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 65, 0.15);
  border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 65, 0.3);
}