:root {
  --bg: #121212;
  --surface: #1e1e1e;
  --surface-hover: #272727;
  --logo-bg: #ff8c1a;
  --discord: #5865f2;
  --online: #23a55a;
  --text: #ffffff;
  --muted: #b3b3b3;
  --radius: 22px;
  --gap: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 24px 40px;
}

.page-wrapper {
  width: 100%;
  max-width: 1340px;
}

.bento-grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* Top Row */
.top-row {
  display: grid;
  grid-template-columns: 320px 1fr 275px;
  gap: var(--gap);
  align-items: stretch;
}

.brand-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  position: relative;
  display: block;
  text-decoration: none;
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.card:active {
  transform: translateY(0);
}

/* Logo Card */
.logo-card {
  background: var(--logo-bg);
  aspect-ratio: 1 / 0.92;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  cursor: default;
}

.logo-card:hover {
  transform: none;
  box-shadow: none;
}

.logo-img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.25));
}

/* IP Copy Button */
.ip-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 66px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.ip-button:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.14);
}

.ip-button:active {
  transform: scale(0.98);
}

.copy-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.9;
}

.ip-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Image Cards (Store & Stats) */
.image-card {
  min-height: 330px;
}

.card-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.image-card:hover .card-bg-img {
  transform: scale(1.04);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    145deg,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.08) 55%,
    rgba(0, 0, 0, 0.25) 100%
  );
  pointer-events: none;
}

.card-title {
  position: relative;
  z-index: 2;
  display: inline-block;
  padding: 24px 28px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.image-card .card-title {
  position: absolute;
  top: 0;
  left: 0;
}

/* Discord Card */
.discord-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  text-align: center;
}

.discord-card:hover {
  background: var(--surface-hover);
}

.discord-icon {
  width: 56px;
  height: 56px;
  color: var(--discord);
  margin-bottom: 16px;
}

.discord-count {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.discord-label {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--online);
  display: inline-block;
}

/* Bottom Row */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.stats-card {
  min-height: 325px;
}

/* How To Join Card */
.join-card {
  min-height: 325px;
}

.join-card .card-bg-img {
  object-position: center 65%;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #1f1f1f;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: 100%;
  max-width: 540px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-mini-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: var(--logo-bg);
  border-radius: 10px;
  padding: 5px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 800;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.modal-close {
  background: #262626;
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  background: #333;
}

.store-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-btn {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: 10px;
  background: #252525;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--logo-bg);
  color: #fff;
}

.store-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.store-item {
  background: #232323;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.store-item h3 {
  font-size: 14px;
  font-weight: 700;
}

.store-item p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.store-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.price {
  font-size: 14px;
  font-weight: 800;
  color: #4cd964;
}

.add-btn {
  background: #2f2f2f;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.add-btn:hover {
  background: var(--logo-bg);
}

.store-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cart-summary {
  font-size: 13px;
  color: var(--muted);
}

.cart-summary strong {
  color: #fff;
}

.primary-btn {
  background: var(--logo-bg);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn:hover {
  filter: brightness(1.08);
}

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

.stat-box {
  background: #232323;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 16px;
  font-weight: 800;
}

.join-steps {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.5;
  color: #e0e0e0;
}

.join-steps code {
  background: #2a2a2a;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 13px;
  color: #4cd964;
}

/* Responsive */
@media (max-width: 720px) {
  .top-row {
    grid-template-columns: 1fr 1fr;
  }
  .store-card {
    grid-column: 1 / -1;
    order: 2;
  }
  .bottom-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .top-row {
    grid-template-columns: 1fr;
  }
  .store-items,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
