/* ============================================================
   WASEL — وصل | CSS Variables & Global Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@300;400;500;600&family=Noto+Naskh+Arabic:wght@400;600&display=swap');

:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface2:    #1f2937;
  --border:      #30363d;
  --gold:        #c9a84c;
  --gold-light:  #e8c96e;
  --teal:        #2dd4bf;
  --teal-dim:    #0d4a44;
  --rose:        #f87171;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --text-dim:    #484f58;
  --green:       #3fb950;
  --radius:      14px;
  --shadow:      0 8px 32px rgba(0,0,0,0.4);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Buttons ---- */
.btn-primary {
  background: linear-gradient(135deg, var(--gold), #b8870f);
  color: #0d1117;
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(201,168,76,0.35); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 13px 32px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-teal {
  background: linear-gradient(135deg, var(--teal), #0d9488);
  color: #0d1117;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-teal:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }

/* ---- Form Elements ---- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--gold); }
.form-group select { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---- Tags ---- */
.tags-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tag {
  padding: 5px 14px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  user-select: none;
}
.tag.selected { border-color: var(--gold); color: var(--gold); background: rgba(201,168,76,0.1); }

.tag-sm {
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 10px;
  background: rgba(201,168,76,0.1);
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.3);
}
.tag-teal {
  background: rgba(45,212,191,0.1);
  color: var(--teal);
  border: 1px solid rgba(45,212,191,0.3);
}

/* ---- App Shell ---- */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-header .logo {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.header-actions { display: flex; gap: 10px; align-items: center; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
  color: var(--text);
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }

.bottom-nav {
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 0 8px 4px;
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  z-index: 50;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 10px;
  color: var(--text-dim);
  gap: 3px;
  position: relative;
  text-decoration: none;
}
.nav-item .nav-icon { font-size: 20px; }
.nav-item.active { color: var(--gold); }
.nav-item .badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 16px);
  background: var(--rose);
  color: white;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: 700;
}

/* ---- Section Header ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-header h3 { font-size: 18px; font-weight: 700; }
.section-header a { font-size: 12px; color: var(--gold); cursor: pointer; text-decoration: none; }

/* ---- Main Content ---- */
.main-content {
  padding: 16px;
  padding-bottom: 80px;
}

/* ---- Online Dot ---- */
.online-dot {
  position: absolute;
  bottom: 8px; right: 8px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--surface);
}

/* ---- Modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: fadeUp 0.3s ease;
}
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.modal .sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  margin-top: -4px;
}
.modal-close:hover { color: var(--text); }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 13px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 300;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Divider ---- */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h4 { font-size: 16px; margin-bottom: 6px; color: var(--text); }
.empty-state p { font-size: 13px; }

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ---- Back Button ---- */
.back-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.back-btn:hover { color: var(--text); }

/* ---- Score Box (games) ---- */
.score-row { display: flex; gap: 16px; justify-content: center; margin-bottom: 12px; }
.score-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 20px;
  text-align: center;
}
.score-box .s-name { font-size: 11px; color: var(--text-muted); }
.score-box .s-val  { font-size: 24px; font-weight: 700; color: var(--gold); }
