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

body {
  background: #0f172a;
  color: #e5e7eb;
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding-top: 70px;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ── Menu ── */
.menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transform: translateZ(0);
  will-change: transform;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.menu::-webkit-scrollbar { display: none; }

.menu li a {
  text-decoration: none;
  color: #e5e7eb;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  transition: all 0.15s;
}

.menu li a:hover,
.menu li a.active {
  background: rgba(0, 245, 255, 0.1);
  border-color: rgba(0, 245, 255, 0.3);
  color: #00f5ff;
}

/* ── Role badge (menu) ── */
.menu-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.menu-role-badge {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.menu-role-badge:hover { opacity: 0.75; }
.menu-role-owner {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
}
.menu-role-admin {
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.3);
  color: #fbbf24;
}

/* ── Hamburger & Drawer ── */
.hamburger-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 10px;
  line-height: 1;
  transition: all 0.15s;
  flex-shrink: 0;
}
.hamburger-btn:hover {
  background: rgba(0,245,255,0.1);
  border-color: rgba(0,245,255,0.3);
  color: #00f5ff;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.game-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  background: #0d1b3e;
  border-right: 1px solid rgba(255,255,255,0.08);
  z-index: 201;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}
.game-drawer.open { transform: translateX(0); }

.drawer-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: #475569;
  text-transform: uppercase;
  padding: 0 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px;
}

.drawer-link {
  display: block;
  padding: 11px 20px;
  color: #cbd5e1;
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.drawer-link:hover {
  background: rgba(0,245,255,0.06);
  color: #00f5ff;
  border-left-color: #00f5ff;
}
.drawer-link.active {
  color: #00f5ff;
  border-left-color: #00f5ff;
  background: rgba(0,245,255,0.06);
}

/* ── Avatar & Dropdown ── */
.menu-right {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}
.menu-username {
  font-size: 12px;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-avatar {
  width: 32px !important;
  height: 32px !important;
  min-width: unset !important;
  min-height: unset !important;
  max-width: 32px !important;
  max-height: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  border: none !important;
  box-shadow: none !important;
  background-clip: padding-box;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.menu-avatar:hover { opacity: 0.85; transform: scale(1.08) !important; }

.chat-notify-dot {
  position: absolute;
  top: -2px;
  right: -6px;
  width: 7px;
  height: 7px;
  background: #3b82f6;
  border-radius: 50%;
  border: 2px solid #0f172a;
}

.menu-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: transparent;
  border: none;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.menu-bell:hover { background: rgba(255,255,255,0.06); }
.bell-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #0f172a;
}

/* Bell dropdown panel */
.bell-panel {
  display: none;
  position: fixed;
  z-index: 310;
  background: #1a2744;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  width: 320px;
  max-height: 420px;
  overflow: hidden;
  flex-direction: column;
}
.bell-panel.bp-open { display: flex; }
.bell-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.bell-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 4px;
  font-size: 9px;
  letter-spacing: 2px;
  color: #334155;
  font-weight: 700;
}
.bell-panel-title { font-size: 12px; font-weight: 700; color: #e5e7eb; letter-spacing: 0.5px; }
.bell-panel-viewall { font-size: 11px; color: #10b981; text-decoration: none; }
.bell-panel-viewall:hover { text-decoration: underline; }
.bell-panel-list { overflow-y: auto; flex: 1; }
.bell-panel-empty { font-size: 12px; color: #475569; padding: 16px; text-align: center; }
.bell-ann-item {
  display: block;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  text-decoration: none;
  transition: background 0.12s;
}
.bell-ann-item:last-child { border-bottom: none; }
.bell-ann-item:hover { background: rgba(255,255,255,0.04); }
.bell-ann-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.bell-ann-dot { width: 6px; height: 6px; background: #10b981; border-radius: 50%; flex-shrink: 0; }
.bell-ann-title { font-size: 12px; font-weight: 600; color: #e5e7eb; }
.bell-ann-item.unread .bell-ann-title { color: #fff; }
.bell-ann-body { font-size: 11px; color: #64748b; line-height: 1.4; margin-bottom: 4px; }
.bell-ann-time { font-size: 10px; color: #334155; }

.menu-dropdown {
  position: fixed;
  background: #1a2744;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 4px;
  min-width: 168px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  display: none;
  z-index: 300;
}
.menu-dropdown.dd-open { display: block; }

.dd-item {
  padding: 9px 14px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
  color: #cbd5e1;
  transition: background 0.1s;
  letter-spacing: 0.5px;
}
.dd-item:hover { background: rgba(255,255,255,0.07); }
.dd-danger { color: #f87171; }
.dd-danger:hover { background: rgba(248,113,113,0.12); }
.dd-sep { height: 1px; background: rgba(255,255,255,0.07); margin: 4px 0; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}

.modal {
  background: #0d1b3e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.modal-title { font-size: 14px; font-weight: 600; color: #f1f5f9; letter-spacing: 0.5px; }
.modal-close {
  background: transparent;
  border: none;
  color: #475569;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.modal-close:hover { color: #e2e8f0; }

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 70vh;
  overflow-y: auto;
}

.muted { font-size: 13px; color: #64748b; line-height: 1.6; }

/* ── Profile ── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 4px;
}
.profile-avatar-lg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.profile-name { font-size: 15px; font-weight: 600; color: #f1f5f9; }
.profile-email { font-size: 11px; color: #475569; margin-top: 2px; }

.score-grid { display: flex; flex-direction: column; gap: 10px; }
.score-card {
  background: #111f3a;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px;
}
.score-label { font-size: 10px; letter-spacing: 2px; color: #00f5ff; margin-bottom: 8px; text-transform: uppercase; }
.score-val { font-size: 22px; font-weight: 600; color: #f1f5f9; }
.score-val-sm { font-size: 14px; font-weight: 600; color: #f1f5f9; }
.score-unit { font-size: 12px; color: #64748b; font-weight: 400; }
.score-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
.score-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }

/* ── Settings ── */
.settings-form { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 11px; letter-spacing: 1px; color: #64748b; text-transform: uppercase; }
.field-row { display: flex; align-items: center; gap: 10px; }
.settings-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 6px 0; }

.modal-body input {
  background: #0a142a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 9px 12px;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.modal-body input:focus { border-color: rgba(0,245,255,0.4); }

.btn-primary {
  background: linear-gradient(135deg, #1d4ed8, #4f46e5);
  color: #e5e7eb;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }

.btn-danger {
  background: rgba(239,68,68,0.12);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-danger:hover { background: rgba(239,68,68,0.22); }

.field-status { font-size: 11px; color: #64748b; }
.field-status.ok { color: #34d399; }

/* ── Save status indicator (game pages) ── */
#save-status {
  font-size: 11px;
  letter-spacing: 1px;
  color: #334155;
  margin-top: 8px;
  transition: color 0.3s;
}
#save-status.saving { color: #64748b; }
#save-status.saved  { color: #34d399; }

/* ── Cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 900px;
  width: 100%;
  padding: 0 1.5rem 3rem;
}

.card {
  background: #131f35;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 1.4rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card:hover {
  border-color: rgba(0, 245, 255, 0.25);
  transform: translateY(-2px);
}

.card-eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  color: #00f5ff;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
}

.card-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.7;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.card-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #1e293b;
  color: #475569;
  border: 1px solid #1e293b;
}

/* ── Page header ── */
.page-header {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  max-width: 600px;
}

.page-header .eyebrow {
  font-size: 11px;
  color: #00f5ff;
  letter-spacing: 4px;
  margin-bottom: 12px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 12px;
}

.page-header p {
  font-size: 13px;
  color: #64748b;
  line-height: 1.8;
}

/* ── Skeleton shimmer (bell panel) ── */
@keyframes sk-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.sk-notif { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.sk-notif-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(90deg, #1e293b 25%, #263348 50%, #1e293b 75%);
  background-size: 800px 100%;
  animation: sk-shimmer 1.4s infinite linear;
}
.sk-notif-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.sk-notif-line {
  height: 11px; border-radius: 6px;
  background: linear-gradient(90deg, #1e293b 25%, #263348 50%, #1e293b 75%);
  background-size: 800px 100%;
  animation: sk-shimmer 1.4s infinite linear;
}
.sk-notif-line.sk-short { width: 55%; }

/* ── Mobile ── */
@media (max-width: 600px) {
  body { padding-top: 60px; }

  .menu { padding: 10px 14px; gap: 8px; justify-content: flex-start; }
  .menu li a { font-size: 11px; padding: 5px 10px; }

  .game-drawer { width: 80vw; max-width: 300px; }

  .page-header { padding: 2rem 1rem 1.5rem; }
  .page-header h1 { font-size: 24px; }
  .page-header p { font-size: 12px; }

  .card-grid { grid-template-columns: 1fr; padding: 0 1rem 2rem; gap: 12px; }
  .card { padding: 1.1rem; }
  .card-title { font-size: 14px; }
}
