/* ===== DASHBOARD LAYOUT ===== */
body {
  display: flex;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
}

/* ===== UPDATED SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 230px;
  height: 100vh;
  background: linear-gradient(180deg, rgba(20,10,5,0.97), rgba(35,15,10,0.95));
  border-right: 1px solid rgba(212,175,55,0.25);
  box-shadow: 4px 0 15px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1rem;
  transition: width 0.3s ease;
}

.sidebar:hover {
  width: 250px; /* slight expansion on hover for tactile feel */
}

.sidebar-header {
  text-align: center;
  margin-bottom: 2rem;
}

.sidebar-logo {
  width: 60px;
  height: auto;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 8px rgba(212,175,55,0.5));
  transition: transform 0.3s ease;
}

.sidebar:hover .sidebar-logo {
  transform: scale(1.05);
}

.sidebar-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--color-primary);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
  opacity: 0.9;
}

/* ===== NAV LINKS ===== */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 0 0 2rem;
  text-align: left;
  padding-left: 0.5rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  position: relative;
  transition: all 0.3s ease;
}

.sidebar-nav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--color-primary);
  transition: height 0.3s ease;
  border-radius: 2px;
}

.sidebar-nav a:hover::before,
.sidebar-nav a.active::before {
  height: 70%;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--color-primary);
  background: rgba(212,175,55,0.07);
  text-shadow: 0 0 8px rgba(212,175,55,0.6);
}

/* subtle icons beside links */
.sidebar-nav a svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-primary);
  opacity: 0.8;
  transition: opacity 0.3s ease, stroke 0.3s ease;
}

.sidebar-nav a:hover svg,
.sidebar-nav a.active svg {
  opacity: 1;
  stroke: var(--color-highlight);
}

/* ===== SIDEBAR FOOTER ===== */
.sidebar-footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(212,175,55,0.2);
}

.sidebar-footer .btn-accent {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.9rem;
  border-radius: 6px;
  letter-spacing: 1px;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 900px) {
  .sidebar {
    width: 200px;
    padding: 1rem 0.75rem;
  }

  .dashboard-main {
    margin-left: 200px;
  }
}

@media (max-width: 700px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--color-primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 1rem;
    margin: 0;
    padding: 0;
  }

  .dashboard-main {
    margin-left: 0;
    width: 100%;
    padding: 2rem 1rem;
  }

  .sidebar-footer {
    display: none;
  }
}

/* MAIN CONTENT */
.dashboard-main {
  margin-left: 250px; /* leave space for sidebar */
  padding: 3rem 2rem;
  width: calc(100% - 250px);
  overflow-y: auto;
  background: radial-gradient(circle at top left, rgba(140,45,32,0.2), transparent 60%);
}

.dash-section {
  margin-bottom: 4rem;
}

.dash-section h2 {
  font-family: 'Cinzel', serif;
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(212,175,55,0.3);
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(212,175,55,0.2);
  padding-bottom: 0.5rem;
}

/* Cards already styled in byzantine.css */
.cards {
  justify-content: flex-start;
}

#library .cards {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.library-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.library-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.library-card-button {
  width: 230px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--color-primary);
  border-radius: 14px;
  background: rgba(20, 10, 5, 0.85);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
}

.library-card-button.dlc-card-button {
  border-color: #3bcf7a;
  box-shadow: 0 0 18px rgba(59, 207, 122, 0.35);
}

.library-card-button.dlc-card-button:hover,
.library-card-button.dlc-card-button:focus-visible {
  border-color: #5cf39a;
  box-shadow: 0 0 24px rgba(92, 243, 154, 0.4);
}

.library-card-button:focus-visible {
  outline: 2px solid var(--color-highlight);
  outline-offset: 4px;
}

.library-card-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.05), rgba(12, 6, 3, 0.95));
}

.library-card-button.dlc-card-button img {
  background: radial-gradient(circle at 50% 50%, rgba(92, 243, 154, 0.12), rgba(12, 24, 18, 0.95));
}

.library-card:hover .library-card-button:not(.dlc-card-button) {
  transform: translateY(-4px);
  border-color: var(--color-highlight);
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.25);
}

.library-card:hover .library-card-button.dlc-card-button,
.library-card:focus-within .library-card-button.dlc-card-button {
  transform: translateY(-4px);
}

.library-card-title {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  color: var(--color-primary);
  font-family: 'Cinzel', serif;
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.library-card:hover .library-card-title,
.library-card:focus-within .library-card-title {
  opacity: 1;
  transform: translateY(0);
}

.dlc-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(142, 68, 173, 0.85), rgba(108, 52, 131, 0.8));
  color: #f3e9ff;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.coming-soon-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.95), rgba(176, 129, 40, 0.95));
  color: #1a0f0a;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  font-size: 0.75rem;
}

.pre-purchase-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(76, 196, 255, 0.95), rgba(64, 140, 214, 0.95));
  color: #05131f;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  font-size: 0.75rem;
}

.dlc-check {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, #5cf39a, #2fa262);
  color: #0f251a;
  font-weight: 800;
  font-size: 1rem;
  border: 2px solid rgba(15, 37, 26, 0.8);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .sidebar {
    width: 200px;
    padding: 1.5rem 0.75rem;
  }

  .dashboard-main {
    margin-left: 200px;
    padding: 2rem 1rem;
  }
}

/* ===== MOBILE SIDEBAR REFINEMENT ===== */
@media (max-width: 768px) {
  /* Stack layout vertically */
  body {
    flex-direction: column;
    overflow-x: hidden;
  }

  /* Turn sidebar into top nav bar */
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(20,10,5,0.95);
    border-right: none;
    border-bottom: 1px solid rgba(212,175,55,0.25);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    z-index: 1000;
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
  }

  .sidebar-logo {
    width: 40px;
    height: auto;
    filter: drop-shadow(0 0 4px rgba(212,175,55,0.5));
  }

  .sidebar-title {
    font-size: 1rem;
    letter-spacing: 1px;
  }

  /* Compact nav links into a horizontal row */
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
  }

  .sidebar-nav a {
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
  }

  /* Hide the side gold bar for cleaner mobile look */
  .sidebar-nav a::before {
    display: none;
  }

  /* Footer logout button moves to dropdown-style item */
  .sidebar-footer {
    display: none; /* optional: hide if taking too much room */
  }

  /* Main content adjusts to full width */
  .dashboard-main {
    margin-left: 0;
    width: 100%;
    padding: 2rem 1rem;
  }

  /* Game cards & sections scale comfortably */
  .cards {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
  }

  .game-card,
  .card {
    width: 90%;
    max-width: 360px;
  }

  .dash-section h2 {
    text-align: center;
    font-size: 1.5rem;
  }

  #library .library-card-button {
    width: 100%;
    max-width: 320px;
  }
}

.empty-banner {
  text-align: center;
  padding: 6rem 1rem;
  background: linear-gradient(180deg, #faf6f0 0%, #fff 100%);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  margin: 2rem auto;
  max-width: 800px;
}

.empty-banner-inner h2 {
  font-family: "Cinzel", serif;
  color: #3b2e13;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.empty-banner-inner p {
  font-size: 1.05rem;
  color: #555;
  margin-bottom: 1.5rem;
}

.empty-banner .btn-gold {
  background: #b8860b;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.empty-banner .btn-gold:hover {
  background: #a07409;
}

/* ===== BYZANTINE SETTINGS MODAL ===== */
.settings-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  background: rgba(30, 20, 10, 0.6);
  z-index: 9999;
}

.settings-modal.show {
  display: flex;
  animation: fadeIn 0.4s ease;
}

.settings-content::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  background: linear-gradient(45deg, #b68c42, #fff6d0, #b68c42);
  z-index: -1;
  opacity: 0.6;
}

.settings-content {
  position: relative;
  background: #fdfaf4; /* parchment base */
  color: #2e1b0d;
  border: 2px solid #b68c42;
  border-radius: 14px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  padding: 2rem 2.5rem;
  width: 90%;
  max-width: 720px;
  font-family: "Cinzel", serif;
  background-image: radial-gradient(circle at top left, #fff8e7 0%, #f9f4ea 100%);
  animation: modalPop 0.4s ease;
}

@keyframes modalPop {
  from { transform: translateY(30px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.settings-title {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  text-align: center;
  color: #3b2e13;
  border-bottom: 1px solid rgba(182, 140, 66, 0.4);
  padding-bottom: 0.5rem;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #8b5a1b;
  transition: color 0.2s ease;
}
.close-modal:hover {
  color: #b68c42;
}

/* Tabs */
.hub-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0 1.5rem;
  justify-content: center;
}

.hub-tab {
  padding: 0.5rem 1rem;
  border: 1px solid #b68c42;
  border-radius: 6px 6px 0 0;
  background: #faf4e6;
  color: #4a3820;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.hub-tab.active {
  background: linear-gradient(to bottom, #d4b35e, #b68c42);
  color: #fff;
  border-bottom-color: transparent;
}

/* Tab Content */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}
.tab-content.active {
  display: block;
}

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

/* Account Info */
.account-info label {
  font-weight: 600;
  color: #4a3820;
  margin-top: 1rem;
  display: block;
}
.account-info input {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.3rem;
  border: 1px solid #b68c42;
  border-radius: 6px;
  background: #fffaf1;
  font-family: "Inter", sans-serif;
}
.account-info button.btn-gold {
  margin-top: 1rem;
  background: linear-gradient(to bottom, #d4b35e, #b68c42);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.account-info button.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Purchase Table */
#history-table {
  width: 100%;
  border-collapse: collapse;
  background: #fffdf8;
  border-radius: 6px;
  overflow: hidden;
}
#history-table th, #history-table td {
  padding: 0.6rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  color: #3b2e13;
}
#history-table th {
  background: #f4ead5;
  color: #4a3820;
  font-weight: 600;
}
#history-table tr:hover {
  background: #faf3df;
}

/* ===== AVATAR SELECTION ===== */
.avatar-select-section {
  margin-top: 2rem;
  border-top: 1px solid rgba(182, 140, 66, 0.4);
  padding-top: 1.2rem;
}

.avatar-select-section h3 {
  font-family: "Cinzel", serif;
  color: #3b2e13;
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  text-align: center;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.8rem;
  justify-items: center;
  margin-bottom: 1rem;
}

.avatar-grid img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid #d1b46f;
  background: #fdfaf4;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease, border-color 0.3s;
}

.avatar-grid img:hover {
  transform: scale(1.05);
  border-color: #b68c42;
  box-shadow: 0 0 10px rgba(182, 140, 66, 0.4);
}

.avatar-grid img.selected {
  border: 3px solid #b68c42;
  box-shadow: 0 0 15px rgba(182, 140, 66, 0.8);
  transform: scale(1.07);
}

/* ===== SUPPORT BANNER ===== */
.support-banner {
  background: rgba(26,15,10,0.85);
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 10px;
  padding: 1.2rem 1.8rem;
  text-align: center;
  margin: 3rem auto 0;
  max-width: 600px;
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
  color: var(--color-text);
  font-size: 1rem;
  letter-spacing: 0.2px;
  backdrop-filter: blur(6px);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.support-banner:hover {
  background: rgba(26,15,10,0.95);
  box-shadow: 0 0 20px rgba(212,175,55,0.2);
}

.support-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease, text-shadow 0.3s ease;
}

.support-link:hover {
  color: var(--color-highlight);
  border-color: var(--color-primary);
  text-shadow: 0 0 8px rgba(212,175,55,0.4);
}
