body {
  padding: 50px 40px 40px;
}

/* Header */
.gamble-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

h1 {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #999;
  margin-bottom: 2px;
}

.gamble-subtitle {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #111;
  margin-bottom: 0;
}

/* Trade slots */
.trade-slots {
  display: flex;
  gap: 12px;
  z-index: 50;
  transition: all 0.2s;
}

.trade-slots.sticky {
  position: fixed;
  top: 12px;
  right: 20px;
  gap: 8px;
}

.trade-slots.sticky .trade-slot {
  width: 50px;
  height: 50px;
}

.trade-slot {
  width: 80px;
  height: 80px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.trade-slot.empty {
  border: 2px dashed #ddd;
  color: #ccc;
  font-size: 24px;
  font-weight: 300;
}

.trade-slot.filled {
  border: 2px solid #111;
  background: #fafafa;
  cursor: pointer;
  padding: 4px;
}
.trade-slot.filled:hover {
  border-color: #DA291C;
  background: #fff5f5;
}

.trade-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Main area */
.gamble-main {
  flex: 1;
}

/* Crate roulette */
#crateSection {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: white url('/donald.webp') no-repeat center bottom;
  background-size: auto 90%;
  z-index: 100;
}

.crate-viewport {
  position: relative;
  width: 100%;
  max-width: 80vw;
  height: 180px;
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(180deg, #f0f0f0 0%, #d8d8d8 3%, #f6f6f6 4%, #fafafa 50%, #ececec 100%);
  border: 1px solid #999;
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.6) inset,
    0 4px 16px rgba(0,0,0,0.15);
}

.crate-marker {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: #DA291C;
  z-index: 10;
}
.crate-marker::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #DA291C;
}
.crate-marker::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 8px solid #DA291C;
}

.crate-strip {
  display: flex;
  gap: 6px;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  align-items: center;
  padding: 0 4px;
}

.crate-card {
  flex-shrink: 0;
  height: 140px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.crate-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Selection phase */

#selectionGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 80px;
}

.selection-count {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #bbb;
  margin-bottom: 16px;
}

.gamble-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  cursor: pointer;
  transition: transform 0.12s;
}
.gamble-item:hover {
  transform: scale(1.05);
}

.gamble-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.1));
}

.gamble-label {
  display: none;
}

.gamble-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: #111;
  color: white;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 6px;
  z-index: 2;
}

.gamble-item.unavailable {
  opacity: 0.3;
  pointer-events: none;
}

/* Aqua buttons */
.gamble-btn-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 16px;
  background: linear-gradient(transparent, white 30%);
  z-index: 100;
}

.gamble-btn {
  padding: 10px 48px;
  background: linear-gradient(180deg, #7ab8f5 0%, #468ccf 45%, #3a7bbd 55%, #2e6aaa 100%);
  color: white;
  border: 1px solid #2a5d94;
  border-radius: 8px;
  font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  text-shadow: 0 -1px 1px rgba(0,0,0,0.3);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 1px 0 rgba(255,255,255,0.3) inset;
  transition: all 0.1s;
}
.gamble-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #8ac4ff 0%, #5098d8 45%, #448bc8 55%, #3876b5 100%);
}
.gamble-btn:active:not(:disabled) {
  background: linear-gradient(180deg, #2e6aaa 0%, #3a7bbd 45%, #468ccf 55%, #7ab8f5 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset;
}
.gamble-btn:disabled {
  background: linear-gradient(180deg, #ccc 0%, #b0b0b0 45%, #a8a8a8 55%, #999 100%);
  border-color: #888;
  color: rgba(255,255,255,0.6);
  cursor: not-allowed;
  text-shadow: none;
}

.gamble-empty {
  text-align: center;
  color: #999;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  margin-top: 80px;
  line-height: 2;
}
.gamble-empty a {
  color: #111;
  font-weight: 600;
  text-decoration: underline;
}

/* Result overlay */
.result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.result-card {
  background: linear-gradient(180deg, #f0f0f0 0%, #d8d8d8 3%, #f6f6f6 4%, #fafafa 50%, #ececec 100%);
  border-radius: 12px;
  border: 1px solid #999;
  padding: 0;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.6) inset,
    0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}

.result-card::before {
  content: '';
  display: block;
  width: 100%;
  height: 24px;
  background: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 45%, #c8c8c8 55%, #c0c0c0 100%);
  border-bottom: 1px solid #aaa;
}

.result-card img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  margin: 24px auto 16px;
  display: block;
}

.result-card h2 {
  font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin-bottom: 2px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}

.result-card .result-set {
  font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 12px;
  color: #3366cc;
  font-weight: normal;
  margin-bottom: 20px;
}

.result-card .result-label {
  font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin: 0;
  padding-top: 16px;
}

.result-card .gamble-btn {
  margin: 0 auto 24px;
}

@media (max-width: 600px) {
  body { padding: 40px 16px 24px; }
  .gamble-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .gamble-subtitle { font-size: 22px; }
  .trade-slots { gap: 8px; }
  .trade-slot { width: 60px; height: 60px; }
  .trade-slots.sticky .trade-slot { width: 40px; height: 40px; }
  #selectionGrid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 6px; }
  .crate-viewport { height: 130px; }
  .crate-card { height: 100px; padding: 6px; }
  .nav-link { font-size: 12px; top: 10px; }
  .nav-link.right { right: 10px; }
}
