@font-face {
  font-family: "shag";
  src: url(Shag-Lounge.otf);
}

:root {
  --bg: #0f1222;
  --surface: #171a2b;
  --surface-2: #1e2236;
  --text: #e8ecff;
  --muted: #96a0c6;
  --brand: #ffbd00;
  --accent: #ffbd00;
  --ok: #22d3ee;
  --warn: #fbbf24;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --glow: 0 0 15px rgba(110, 231, 255, 0.3);
}

* {
  box-sizing: border-box;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

html,
body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "shag";
  background: radial-gradient(1200px 800px at 10% -10%, #1c2140 0%, #0f1222 60%) fixed;
  color: var(--text);
  line-height: 1.6;
}

.app-bar {
  position: fixed;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: linear-gradient(180deg, rgba(15, 18, 34, 0.9), rgba(15, 18, 34, 0.65));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #232742;
  box-shadow: var(--shadow);
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.logo {
  font-size: 1.2rem;
  color: var(--brand);
  transition: all 0.3s;
}

.logo:hover {
  transform: scale(1.1, 1.1);
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #14183b;
  border: 1px solid #27305c;
  border-radius: 999px;
  margin-left: auto;
  padding: 0.25rem 0.4rem 0.25rem 0.6rem;
  transition: box-shadow 0.3s ease;
}

.search-wrap:focus-within {
  box-shadow: 0 0 2px #a78bfa;
  border-color: var(--brand);
}

.search-wrap input, .search-wrap input:focus {
  font-family: "shag";
  color: #e8ecff;
  background: transparent;
  border: none;
  outline: none;
  width: 14ch;
  font-size: 0.95rem;
}

#filterInput::placeholder {
  color: #ffffff2e;
  opacity: 1;
  transition: color 0.3s ease;
}

#filterInput:focus::placeholder {
  color: #ffffff69;
  opacity: 1;
}

.icon-btn.sm {
  width: 28px;
  height: 28px;
}

#app {
  max-width: 1100px;
  margin: 0 auto;
  margin-top: 100px;
  padding: 1rem;
  scrollbar-color: var(--brand)  rgba(0,0,0,0);
  scrollbar-width: thin;
}

.starter {
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid #242948;
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: clip;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  background: linear-gradient(180deg, #1b2040, #171a2b);
  border-bottom: 1px solid #2a2f56;
}

.card-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.card-body {
  padding: 1rem;
}

.card-body.two-col {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.desc-col {
  color: var(--muted);
  line-height: 1.5;
}

.meta {
  margin: 0.6rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.thumb-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

a {
  font-size: 1rem;
  color: #e8ecff;
  transition: all 0.3s ease;
}

a:hover {
  font-size: 1.1rem;
}
.thumb {
  height: 160px;
  border-radius: 12px;
  background: #151833;
  border: 2px dashed #2c335c;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.3s ease;
  aspect-ratio: 16/9;
}

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

.thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.thumb:hover img {
  transform: scale(1.05);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  padding: 1rem;
}

.game-btn {
  font-family: "shag";
  border: 1px solid #28305d;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  background: #151938;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.game-btn:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  background: #1a2148;
}

.game-btn.active {
  outline: 2px solid var(--accent);
  background: #1a2148;
}

.game-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.game-btn:hover .game-img {
  transform: scale(1.1);
}

.leaderboard {
  position: relative;
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid #242948;
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: clip;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lb-header {
  position: sticky;
  top: 56px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: linear-gradient(180deg, #1b2040, #171a2b);
  border-bottom: 1px solid #2a2f56;
}

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

.lb-title {
  display: flex;
  flex-direction: column;
}

.lb-name {
  font-weight: 700;
}

.lb-sub {
  color: var(--muted);
  font-size: 0.9rem;
}

.lb-stats {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid #232742;
  min-width: 0;
}

.stat-card {
  flex: 1;
  min-width: 0;
  background: #151938;
  border-radius: 10px;
  padding: 0.8rem;
  margin-top: 0;
  border: 1px solid #28305d;
  text-align: center;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.stat-card:hover {
  transform: scale(1.05);
  border-color: var(--accent);
  z-index: 2;
}

.stat-value {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  display: block;
  color: var(--brand);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  display: block;
}

.lb-table-wrap {
  position: relative;
  overflow: auto;
  max-height: calc(100vh - 310px);
  border-top: 1px solid #232742;
}

.lb-table {
  width: max(720px, 100%);
  border-collapse: collapse;
  background: #121530;
}

.lb-table th,
.lb-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #232742;
  white-space: nowrap;
  text-align: left;
}

.lb-table thead th {
  position: sticky;
  top: 0;
  background: #1b2040;
  z-index: 1;
  font-weight: 700;
  user-select: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.lb-table thead th:hover {
  background: #1e2448;
}

.lb-table thead th .sort {
  margin-left: 0.35rem;
  color: var(--muted);
  font-size: 0.85em;
}

.lb-table tbody tr:nth-child(odd) {
  background: #14183a;
}

.lb-table tbody tr:nth-child(1) td:nth-child(1) {
  color: var(--warn);
  font-weight: 800;
}

.lb-table tbody tr:hover {
  background: #1a2048;
}

.lb-table a {
  color: var(--ok);
  text-decoration: none;
  transition: color 0.3s ease;
}

.lb-table a:hover {
  text-decoration: underline;
  color: var(--brand);
}

.lb-footer {
  padding: 0.7rem 0.9rem;
  color: var(--muted);
  border-top: 1px solid #232742;
  background: #151938;
}

.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(9, 12, 30, 0.6);
  backdrop-filter: blur(1px);
  z-index: 50;
}

.hidden {
  display: none;
}

#drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: 300px;
  max-width: 85vw;
  transform: translateX(-102%);
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s linear;
  background: #0e1226;
  border-right: 1px solid #27305c;
  opacity: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto 1fr auto;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
}

#drawer[data-open="true"] {
  transform: translateX(0);
  opacity: 1;
}

#drawerBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(1px);
  z-index: 90;
  animation: fadeIn 0.18s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.drawer-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem;
  border-bottom: 1px solid #27305c;
}

.drawer-title {
  font-weight: 700;
}

.drawer-items {
  padding: 0.4rem;
  overflow: auto;
}

.drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  color: var(--text);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.drawer-link:hover {
  background: #141a36;
  border-color: #2a2f56;
  transform: translateX(3px);
}

.drawer-footer {
  padding: 0.6rem 0.8rem;
  border-top: 1px solid #27305c;
  color: var(--muted);
}

.icon-btn {
  appearance: none;
  border: none;
  outline: none;
  cursor: pointer;
  height: 36px;
  width: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #131739;
  color: var(--text);
  border: 1px solid #28305d;
  transition: all 0.3s ease;
}

.icon-btn:hover {
  background: #18204a;
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(110, 231, 255, 0.2);
}

.announcement-list {
  padding: 1rem;
}

.announcement-card {
  margin-bottom: 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
  background: var(--surface);
  border: 1px solid #242948;
}

.announcement-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.announcement-header {
  padding: 1rem 1.5rem;
  background: linear-gradient(90deg, #ffbd00, #fff000);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.announcement-title {
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0;
  paint-order: stroke fill;
  -webkit-text-stroke: 5px #743601;
}

.announcement-date {
  color: #743601;
  font-size: 0.875rem;
  opacity: 0.9;
  font-weight: bold;
}

.announcement-body {
  padding: 1.5rem;
  background: var(--surface);
}

.announcement-content {
  line-height: 1.6;
  color: var(--text);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  color: var(--muted);
  opacity: 0.5;
}

.announcement-tags {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.announcement-tag {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--surface-2);
  border: 1px solid #2a2f56;
  color: var(--muted);
}

.announcement-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.announcement-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.announcement-actions {
  display: flex;
  gap: 0.5rem;
}

.announcement-action-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.announcement-action-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

form.card {
  margin-top: 1rem;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  display: block;
}

input[type="text"] {
  font-family: "shag";
  width: 100%;
  padding: 0.8rem 1rem;
  background: #151938;
  border: 1px solid #28305d;
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 189, 0, 0.2);
  background: #1a2148;
}

input[type="text"]::placeholder {
  color: #96a0c680;
  font-style: italic;
}

input[type="text"]:hover {
  border-color: #3a4270;
  transform: translateY(-1px);
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
  cursor: pointer;
  padding: 0.6rem 1rem;
  background: #151938;
  border: 1px solid #28305d;
  border-radius: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.radio-group label:hover {
  background: #1a2148;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.radio-group input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #28305d;
  border-radius: 50%;
  background: #0f1222;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.radio-group input[type="radio"]:checked {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 189, 0, 0.2);
}

.radio-group input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: #0f1222;
  border-radius: 50%;
}

.genericbutton {
  font-family: "shag";
  background: linear-gradient(180deg, #ffbd00, #ffd700);
  color: #0f1222;
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 14px rgba(255, 189, 0, 0.3);
  margin-top: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.genericbutton:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(255, 189, 0, 0.4);
  background: linear-gradient(180deg, #ffd700, #ffbd00);
}

.genericbutton:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 189, 0, 0.3);
}

input:required + label::after,
label:has(input:required)::after {
  content: " *";
  color: #ef4444;
}

input:focus,
.radio-group input:focus + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .card-body.two-col {
    grid-template-columns: 1fr;
  }
  
  .thumb {
    height: 120px;
  }
  
  .announcement-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .announcement-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .announcement-actions {
    align-self: flex-end;
  }
}

@media (max-width: 768px) {
  .radio-group {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .radio-group label {
    width: 100%;
  }
  
  input[type="text"] {
    padding: 0.7rem 0.9rem;
  }
  
  .genericbutton {
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
  }
}