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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #111827 0, #020617 45%, #000000 100%);
  color: #e5e7eb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page { min-height: 100vh; display: flex; flex-direction: column; }

/* Header / brand */

header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(15,23,42, 0.95);
  border-bottom: 1px solid rgba(148,163,184,0.3);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-link {
  text-decoration: none;
  color: inherit;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 30px; height: 30px; border-radius: 999px;
  background: conic-gradient(from 150deg,#22c55e,#3b82f6,#a855f7,#22c55e);
  box-shadow: 0 0 20px rgba(34,197,94,0.7);
}

.brand-text-main {
  font-size: 1rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #f9fafb;
}
.brand-text-sub { font-size: .75rem; color: #9ca3af; }

.brand-text-wrap { display: flex; flex-direction: column; gap: .1rem; }

.top-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Search */

#search {
  width: 260px; max-width: 45vw;
  padding: .5rem .85rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.8);
  background: rgba(15,23,42,.95);
  color: #e5e7eb; font-size: .85rem;
  outline: none;
  transition: .15s;
}
#search::placeholder { color: #6b7280; }
#search:focus {
  border-color: rgba(129,140,248,.95);
  box-shadow: 0 0 0 1px rgba(129,140,248,.7);
  background: rgba(15,23,42,1);
}

/* Top buttons: Suggest / Admin / Settings + admin back button */

.top-btn,
.suggest-btn,
#admin-button,
#settings-button,
.back-link,
.back-btn,
.admin-back-btn {
  padding: .45rem .95rem;
  border-radius: 999px;
  background: rgba(15,23,42,.95);
  color: #e5e7eb;
  border: 1px solid rgba(148,163,184,.5);
  text-decoration: none;
  font-size: .85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition:
    background .15s,
    border-color .15s,
    box-shadow .15s,
    transform .15s;
}

/* keep link color + no underline for the link-style buttons */
.suggest-btn,
.back-link,
.back-btn,
.admin-back-btn {
  color: #e5e7eb;
}
.suggest-btn:link,
.suggest-btn:visited,
.back-link:link,
.back-link:visited,
.back-btn:link,
.back-btn:visited,
.admin-back-btn:link,
.admin-back-btn:visited {
  color: #e5e7eb;
  text-decoration: none;
}

.top-btn span,
.suggest-btn span {
  white-space: nowrap;
}

.top-btn:hover,
.suggest-btn:hover,
#admin-button:hover,
#settings-button:hover,
.back-link:hover,
.back-btn:hover,
.admin-back-btn:hover {
  background: rgba(30,64,175,.95);
  border-color: rgba(129,140,248,.9);
  box-shadow: 0 0 0 1px rgba(129,140,248,.6);
  transform: translateY(-1px);
}

/* Main layout */

main {
  flex: 1; padding: 1.25rem 1.5rem 2rem;
  max-width: 1200px; width: 100%; margin: 0 auto;
}

.page-heading {
  display: flex; align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: .75rem;
}

.page-title { font-size: 1.1rem; font-weight: 600; }
.page-subtitle { font-size: .8rem; color: #9ca3af; }

/* Game grid */

#game-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1rem;
}

.game-card {
  position: relative;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  padding: .9rem 1rem;
  border-radius: 1rem;
  text-decoration: none;
  color: #f9fafb;
  background:
    radial-gradient(circle at top left,rgba(59,130,246,.45),transparent 55%),
    radial-gradient(circle at bottom right,rgba(34,197,94,.3),rgba(15,23,42,.95));
  border: 1px solid rgba(55,65,81,.9);
  box-shadow: 0 18px 40px rgba(15,23,42,.9);
  overflow: hidden;
  transition: .16s;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(129,140,248,.9);
  box-shadow:
    0 24px 60px rgba(15,23,42,.95),
    0 0 40px rgba(129,140,248,.4);
}

.game-name { font-size: 1rem; font-weight: 600; margin-bottom: .15rem; }
.game-meta { font-size: .75rem; color: #d1d5db; opacity: .9; }

/* Footer */

footer {
  padding: .75rem 1.5rem 1.25rem;
  font-size: .75rem; color: #6b7280; text-align: center;
}

/* Helpers */

.hidden { display: none !important; }

/* Announcement popup */

.announcement-overlay {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(8px);
  background: rgba(0,0,0,.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999999;
}

.announcement-panel {
  width: 640px;
  max-width: 92%;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 1rem;
  padding: 1.4rem 1.5rem 1.6rem;
  box-shadow: 0 30px 60px rgba(0,0,0,.65);
  animation: slideDown .4s cubic-bezier(.18,.89,.32,1.28);
  position: relative;
  pointer-events: auto;
}

.announcement-header h2 {
  margin: 0 0 .6rem;
  font-size: 1.4rem;
  color: #f9fafb;
}

.announcement-section h3 {
  margin: 0 0 .35rem;
  font-size: 1rem;
  color: #e5e7eb;
}

.announcement-section p {
  margin: 0 0 .75rem;
  font-size: .9rem;
  color: #d1d5db;
}

.announcement-section ul {
  margin: 0;
  padding-left: 1.2rem;
  font-size: .9rem;
}

/* Shared close button style */

.overlay-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: #111827;
  color: #e5e7eb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* Settings overlay */

.settings-overlay {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(6px);
  background: rgba(0,0,0,.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 500000;
}

.settings-panel {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 1rem;
  width: 420px;
  max-width: 90%;
  padding: 1.4rem 1.5rem 1.6rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  position: relative;          /* << added so #settings-close positions correctly */
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
}

.settings-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: #f9fafb;
}

.settings-section {
  margin-bottom: 1.1rem;
}

.settings-section h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: #f9fafb;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  gap: 0.5rem;
}

.settings-row span {
  font-size: 0.9rem;
  color: #e5e7eb;
}

.settings-row input[type="checkbox"] {
  transform: scale(1.1);
  cursor: pointer;
}

.settings-row input[type="text"],
#tab-title-input {
  padding: 0.35rem 0.5rem;
  background: #111827;
  border: 1px solid #374151;
  color: #e5e7eb;
  border-radius: 0.4rem;
  outline: none;
  width: 190px;
  font-size: 0.85rem;
}

/* Compact & hide-desc classes */

html.compact-layout #game-list { gap: 0.75rem; }
html.compact-layout .game-card { padding: 0.6rem 0.75rem; }
html.compact-layout .game-name { font-size: 0.9rem; }
html.hide-descriptions .game-meta { display: none; }

/* Animation */

@keyframes slideDown {
  from { transform: translateY(-30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Simple maintenance box (if you decide to use it later) */

.maintenance-box {
  margin: 3rem auto 0;
  max-width: 520px;
  padding: 2rem 2.25rem;
  border-radius: 1.25rem;
  background: rgba(15,23,42,.95);
  border: 1px solid #374151;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.7);
}
.maintenance-box h1 {
  margin: 0 0 .75rem;
  font-size: 1.6rem;
  color: #f9fafb;
}
.maintenance-box p {
  margin: 0;
  color: #d1d5db;
  font-size: .95rem;
}

/* Proper styling + positioning for the close X buttons */
#announcement-close,
#settings-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: #111827;
  color: #e5e7eb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;

  /* put them in the top-right of the panel */
  position: absolute;
  top: 16px;
  right: 20px;
}
