/* =======================================================
   ⚽ GAMBETAS PROFILE.CSS (Centered Modal + Nav Fix)
   ======================================================= */

/* GLOBAL THEME */
:root {
  --neon: #8FD400;
  --bg: #000;
  --ink: #fff;
}

body.profile-page {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

/* ======================
   HEADER / NAV
   ====================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: #111;
  flex-wrap: wrap;
}

.logo a {
  color: var(--neon);
  font-weight: bold;
  text-decoration: none;
  font-size: 1.3rem;
}

.site-header nav a,
.site-header nav button {
  color: var(--ink);
  background: transparent;
  border: none;
  margin-left: 15px;
  text-decoration: none;
  position: relative;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
}

/* Hover / Active underline effect */
.site-header nav a::after,
.site-header nav button::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--neon);
  box-shadow: 0 0 6px var(--neon);
  transition: width 0.3s ease-in-out, left 0.3s ease-in-out;
}
.site-header nav a:hover::after,
.site-header nav a.active::after,
.site-header nav button:hover::after {
  width: 70%;
  left: 15%;
}

@media (max-width: 768px) {
  .site-header { flex-direction: column; align-items: flex-start; }
  .logo { margin-bottom: 8px; }
  .site-header nav {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
  }
}

/* ======================
   MAIN CONTENT
   ====================== */
main.content {
  padding: 130px 20px 24px; /* space for fixed header */
  max-width: 1000px;
  margin: 0 auto;
  box-sizing: border-box;
}
@media (max-width: 768px) {
  main.content { padding-top: 160px; }
}

/* ======================
   PROFILE HERO
   ====================== */
.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 16px;
}
#avatar {
  width: 110px; height: 110px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--neon);
  box-shadow: 0 0 6px rgba(143,212,0,.4);
  display: none;
}
.loading-placeholder {
  width: 110px; height: 110px; border-radius: 50%;
  background: #222; border: 2px solid #333;
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:.4} 50%{opacity:1} }
h1 { color: var(--neon); margin: 0; font-size: 1.4rem; }
.muted { color:#b9b9b9; font-size:.9rem; margin:0; }

/* ======================
   PROFILE BOX
   ====================== */
.profile-box {
  background: #111;
  border: 1px solid var(--neon);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 0 10px rgba(143,212,0,.35);
}
input, textarea, select {
  width: 100%;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
  box-sizing: border-box;
}
textarea { resize: vertical; min-height: 80px; margin-top: 10px; }
label.muted { display:block; margin-top:10px; margin-bottom:2px; }

/* ======================
   BUTTONS
   ====================== */
.btn {
  background: #fff; 
  color: #000; 
  border: 1px solid #ccc;
  border-radius: 8px; 
  padding: 10px 14px; 
  font-weight: 700;
  cursor: pointer; 
  transition: .2s ease;
  box-shadow: 0 0 6px rgba(255,255,255,.15);
}
.btn:hover { background:#eaeaea; }

/* 🔹 Equal, centered “Change Avatar” and “Save Changes” buttons */
#change-avatar-btn,
#save-profile-btn {
  width: 40% !important;
  padding: 8px 10px !important;
  font-size: 0.9rem !important;
  border-radius: 6px !important;
  display: block;
  margin: 14px auto;
  text-align: center;
}

/* ======================
   TABS / PAGINATION
   ====================== */
.tabs {
  display:flex; gap:10px; flex-wrap:wrap;
  margin-top:20px; margin-bottom:8px;
  border-bottom:1px solid #222; padding-bottom:8px;
}
.tab {
  background:transparent; color:#fff; border:1px solid #222;
  padding:8px 12px; border-radius:10px; cursor:pointer; font-weight:600;
  position:relative;
}
.tab:hover, .tab.active {
  color: var(--neon); border-color: var(--neon);
  box-shadow: 0 0 6px rgba(143,212,0,.35);
}
.section-title { color: var(--neon); margin: 10px 0; font-size: 1.1rem; }

/* =========================================================
   🟢 GAME CARDS - Active, Past, Archived
   ========================================================= */
.game-card {
  background: #111;
  border: 1px solid var(--neon);
  border-radius: 12px;
  padding: 10px 15px;
  margin: 10px 0;
  color: #fff;
  box-shadow: 0 0 6px rgba(143, 212, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.game-card:hover {
  transform: scale(1.02);
  box-shadow: 0 0 10px rgba(143, 212, 0, 0.6);
  cursor: pointer;
}
.past-card {
  border: 1px solid rgba(143, 212, 0, 0.4);
  box-shadow: 0 0 4px rgba(143, 212, 0, 0.2);
  opacity: 0.85;
}
.past-card:hover {
  transform: scale(1.015);
  box-shadow: 0 0 8px rgba(143, 212, 0, 0.4);
  border-color: rgba(143, 212, 0, 0.6);
}
.archived-card {
  border: 1px solid #333;
  background: #0a0a0a;
  box-shadow: 0 0 3px rgba(143, 212, 0, 0.15);
  opacity: 0.7;
}
.archived-card:hover {
  transform: scale(1.01);
  border-color: rgba(143, 212, 0, 0.4);
  box-shadow: 0 0 6px rgba(143, 212, 0, 0.3);
}
.game-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}
.game-date {
  margin-top: 4px;
  font-size: 0.9rem;
  color: #ccc;
}
.pill {
  background: transparent;
  border: 1px solid red;
  color: red;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pill:hover { background: red; color: #fff; }

/* Pagination */
.pagination{ text-align:center; margin-top:12px; }
.pagination button{
  background: var(--neon); border:none; padding:6px 14px; margin:0 5px; border-radius:6px; cursor:pointer; color:#000;
}
.pagination button:disabled{ background:#333; color:#777; cursor:not-allowed; }
@media (max-width:600px){
  .pagination button{ color:#fff !important; }
}

/* =========================================================
   🌟 STAR RATING + TOOLTIP
   ========================================================= */
.rating-container{ margin-top:8px; }
.rating-label{ font-weight:700; margin:8px 0 4px; color:#e5e5e5; }
.rating-wrap{ display:flex; align-items:center; gap:10px; margin:6px 0 4px 0; position:relative; }
.stars{ display:inline-flex; gap:6px; font-size:1.5rem; cursor:pointer; }
.star{
  transition: color .15s ease-in-out, transform .08s ease;
  filter: drop-shadow(0 0 3px rgba(0,0,0,.25));
  color:#999;
}
.star.active{ color: var(--neon); }
.star.hover{ color:#FFD700; }
.star:hover{ transform: translateY(-1px); }
.rating-text{ color:#b9b9b9; font-size:.95rem; }

.tooltip{
  opacity:0; pointer-events:none; position:absolute; bottom:28px; left:50%; transform:translateX(-50%);
  background:#000; border:1px solid rgba(143,212,0,.5); box-shadow:0 0 6px rgba(143,212,0,.5);
  color:#fff; padding:6px 10px; white-space:nowrap; font-size:.85rem; border-radius:10px;
  transition: opacity .3s ease-in-out;
}
.rating-wrap.self .stars:hover ~ .tooltip{ opacity:1; }
.rating-wrap.self .stars{ cursor: default; }

/* =========================================================
   🧩 MODALS (avatar picker, toast, game details)
   ========================================================= */
.modal{ 
  display:none;
  position:fixed;
  top:0; left:0; right:0; bottom:0;
  background:rgba(0,0,0,.8);
  align-items:center;
  justify-content:center;
  z-index:1000;
}
.modal-content{
  background:#111;
  border:1px solid var(--neon);
  border-radius:8px;
  padding:16px;
  width:92vw;
  max-width:520px;
  box-shadow:0 0 10px rgba(143,212,0,.5);
  animation: popIn 0.25s ease-out;
}
@keyframes popIn { from {transform:scale(.9);opacity:0;} to {transform:scale(1);opacity:1;} }
.avatar-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:10px; }
.avatar-option{ width:100%; border-radius:8px; border:1px solid #333; object-fit:cover; max-height:100px; }

/* Upload button inside modal */
#avatar-upload {
  margin-top: 10px;
  text-align: center;
}
#avatar-upload input[type="file"] {
  display: none;
}
#avatar-upload label {
  display: inline-block;
  background: #222;
  border: 1px solid var(--neon);
  color: var(--neon);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s ease;
}
#avatar-upload label:hover {
  background: var(--neon);
  color: #000;
}

/* Toast notifications */
#toast-container{
  position: fixed; top:50%; left:50%; transform:translate(-50%,-50%);
  display:flex; flex-direction:column; align-items:center; z-index:2000;
}
.toast{
  background:#000; color:#fff; border:1px solid var(--neon); border-radius:10px;
  padding:10px 16px; margin:5px 0; box-shadow:0 0 8px rgba(143,212,0,.6);
  opacity:0; animation: fadeInOut 3s ease forwards;
}
@keyframes fadeInOut{
  0%{opacity:0; transform:scale(.95)}
  10%,90%{opacity:1; transform:scale(1)}
  100%{opacity:0; transform:scale(.95)}
}

/* =======================================================
   🎯 HOTFIX – Avatar Modal Resize & Centering
   ======================================================= */
#avatar-modal .modal-content {
  max-width: 380px !important;
  padding: 14px 16px !important;
  border-radius: 10px !important;
  box-shadow: 0 0 10px rgba(143, 212, 0, 0.5);
}
#avatar-modal .avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
#avatar-modal .avatar-grid img {
  width: 100%;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #333;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#avatar-modal .avatar-grid img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 8px var(--neon);
}
#avatar-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
@media (max-width: 480px) {
  #avatar-modal .modal-content {
    max-width: 90vw !important;
    padding: 12px !important;
  }
  #avatar-modal .avatar-grid img {
    height: 56px;
  }
}

/* =======================================================
   🔰 HOTFIX – Sign Out identical to nav buttons
   ======================================================= */
#signout-btn {
  background: transparent !important;
  border: none !important;
  color: var(--ink) !important;
  font: inherit !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  cursor: pointer;
  position: relative;
  padding: 0 !important;
  margin-left: 15px !important;
  text-decoration: none;
}
#signout-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--neon);
  box-shadow: 0 0 6px var(--neon);
  transition: width 0.3s ease-in-out, left 0.3s ease-in-out;
}
#signout-btn:hover::after {
  width: 70%;
  left: 15%;
}

/* =======================================================
   🎯 FIX – Avatar Popup Layout (Close Btn, Spacing, Size)
   ======================================================= */

#avatar-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Modal content: slightly larger + breathing room */
#avatar-modal .modal-content {
  position: relative;
  max-width: 400px !important;
  padding: 18px 20px !important;
  border-radius: 10px !important;
  background: #111;
  border: 1px solid var(--neon);
  box-shadow: 0 0 10px rgba(143, 212, 0, 0.5);
  text-align: center;
  animation: popIn 0.25s ease-out;
}

/* Close button now top-right */
#avatar-modal .close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 1.3rem;
  color: var(--neon);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: color 0.3s ease;
}
#avatar-modal .close:hover {
  color: #fff;
}

/* Avatar grid spacing + slightly bigger avatars */
#avatar-modal .avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 26px 0 16px;
}
#avatar-modal .avatar-grid img {
  width: 100%;
  height: 72px; /* slightly bigger */
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #333;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#avatar-modal .avatar-grid img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 8px var(--neon);
}

/* Upload image button with more breathing room */
#avatar-upload {
  margin-top: 20px; /* more space below avatars */
  text-align: center;
}
#avatar-upload input[type="file"] {
  display: none;
}
#avatar-upload label {
  display: inline-block;
  background: #222;
  border: 1px solid var(--neon);
  color: var(--neon);
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s ease;
}
#avatar-upload label:hover {
  background: var(--neon);
  color: #000;
}

@media (max-width: 480px) {
  #avatar-modal .modal-content {
    max-width: 90vw !important;
    padding: 14px !important;
  }
  #avatar-modal .avatar-grid img {
    height: 64px;
  }
}

/* =======================================================
   🎨 AVATAR POPUP FIX — Close button, spacing, avatar size
   ======================================================= */
#avatar-modal .modal-content {
  position: relative;
  padding-top: 40px !important; /* space for top-right close button */
}

/* Move the existing Close button to top-right corner */
#avatar-modal #close-avatar-modal {
  position: absolute;
  top: 10px;
  right: 12px;
  margin: 0 !important;
  z-index: 2;
}

/* Make avatars slightly larger and show full faces */
#avatar-modal .avatar-grid img {
  height: 84px !important;
  object-fit: cover;
  object-position: top center;
  border-radius: 8px;
  border: 1px solid #333;
}

/* Give Upload Image button more breathing room */
#avatar-upload {
  margin-top: 22px !important;
  text-align: center;
}

/* Optional: smaller avatars on mobile */
@media (max-width: 480px) {
  #avatar-modal .avatar-grid img {
    height: 72px !important;
  }
}

/* ⭐ Make rating stars gold */
#stars .star { 
  color: #666;             /* idle */
  transition: color .15s ease;
}

#stars .star.active,
#stars .star.hover {
  color: #FFD700;          /* gold */
}

/* optional: dim stars when self-rating is disabled */
#rating-wrap.self #stars .star { 
  color: #777;
}

/* if something upstream uses neon with !important, add this: */
#stars .star.active,
#stars .star.hover {
  color: #FFD700 !important;
}

