/* Player profile page: picture, name, bio, games they want, weekly calendar. */

/* Anything marked hidden must stay hidden, even when a class gives it a display style. */
[hidden] { display: none !important; }

/* This page's own top bar is widened to line up with the sidebar below it (the
   shared site-wide header everyone else uses stays narrower, unaffected). */
.site-header .nav { max-width: 1800px; padding-left: 2em; padding-right: 2em; }

.me { width: 100%; max-width: 1560px; margin: 0 auto; padding: 2.4em 2em 4.5em; }
.me-muted { color: var(--text-muted); margin: 0.3em 0 0; }

/* ---------- sidebar + panels ---------- */
.me-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2.2em; align-items: start; }
.me-rail { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 0.4em; }
.me-rail-btn {
  position: relative; display: flex; align-items: center; gap: 0.75em; text-align: left; width: 100%;
  font: inherit; font-weight: 700; font-size: 0.92rem; color: var(--text-muted); cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 14px; padding: 0.75em 1em;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.me-rail-btn svg { flex: none; color: inherit; }
.me-rail-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.me-rail-btn.active {
  color: #fff; background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  border-color: transparent; box-shadow: 0 4px 14px rgba(107, 70, 193, 0.4);
}
.me-rail-dot { margin-left: auto; width: 9px; height: 9px; border-radius: 50%; background: #ff6b81; flex: none; }
.me-rail-dot.gold { background: var(--gold); }
#me-review-body { max-width: 640px; }
#me-review-body .rv-section > h4 { display: none; }
#me-review-body .rv-head { padding-right: 0; }
.me-panels { min-width: 0; }
.me-panel { animation: me-panel-in 0.15s ease-out; }
@keyframes me-panel-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .me-panel { animation: none; } }

.me-notif-read { margin-bottom: 1em; }
.me-notif-list { display: flex; flex-direction: column; gap: 0.6em; }
.me-notif-empty { color: var(--text-muted); margin: 0.5em 0; }
.me-notif-item {
  display: flex; flex-direction: column; gap: 0.2em; padding: 0.9em 1.1em; border-radius: 14px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
}
.me-notif-item.unread { border-color: rgba(242, 184, 79, 0.5); background: rgba(242, 184, 79, 0.06); }
.me-notif-item .ni-kind { font-weight: 800; color: var(--gold); font-size: 0.85rem; }
.me-notif-item .ni-body { color: var(--text-muted); font-size: 0.88rem; }
.me-notif-item .ni-time { color: var(--text-muted); font-size: 0.74rem; }

@media (max-width: 860px) {
  .me-shell { grid-template-columns: 1fr; }
  .me-rail { position: static; flex-direction: row; flex-wrap: wrap; gap: 0.5em; }
  .me-rail-btn { width: auto; flex: 1 1 auto; justify-content: center; padding: 0.65em 0.9em; }
  .me-rail-btn span:not(.me-rail-dot) { display: none; }
  .me-rail-dot { position: absolute; top: 6px; right: 10px; margin-left: 0; }
}
.me-pill {
  background: rgba(127, 217, 154, 0.15); color: #7fd99a; border: 1px solid rgba(127, 217, 154, 0.4);
  border-radius: 999px; padding: 0.35em 1em; font-weight: 700; font-size: 0.85rem;
}

.me-card {
  background: linear-gradient(180deg, rgba(38, 27, 64, 0.92), rgba(28, 18, 48, 0.92));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.7em 1.8em;
  margin-bottom: 1.5em;
  box-shadow: var(--shadow);
}
.me-card h1, .me-card h2 { font-family: var(--font-display); margin: 0; }
.me-card h2 { font-size: 1.35rem; }
.me-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1em; margin-bottom: 1.1em; }

.me-status { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); min-height: 1.2em; white-space: nowrap; }
.me-status.ok { color: #7fd99a; }
.me-status.err { color: #ff8ea3; white-space: normal; }

/* ---------- login ---------- */
.me-login { max-width: 460px; margin: 3em auto; display: grid; gap: 0.9em; text-align: center; }
.me-login form { display: grid; gap: 0.7em; text-align: left; }

/* ---------- inputs ---------- */
.me input[type="text"], .me input[type="email"], .me input[type="password"], .me input[type="search"], .me textarea {
  width: 100%; font: inherit; color: var(--text);
  background: rgba(10, 5, 22, 0.55); border: 1px solid var(--border); border-radius: 12px;
  padding: 0.7em 0.95em; transition: border-color 0.15s, box-shadow 0.15s;
}
.me textarea { resize: vertical; min-height: 6.5em; line-height: 1.5; }
.me input:focus, .me textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 184, 79, 0.18); }
.me-field { display: grid; gap: 0.4em; margin-bottom: 1em; }
.me-field > span { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); display: flex; justify-content: space-between; gap: 1em; }
.me-field > span em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 600; opacity: 0.8; }
.me-row { display: grid; grid-template-columns: 1fr minmax(160px, 0.6fr); gap: 1em; }

/* ---------- hero ---------- */
.me-hero { display: grid; grid-template-columns: 280px 1fr; gap: 3em; align-items: start; position: relative; overflow: hidden; padding: 2.4em 2.6em; }
.me-hero::before {
  content: ''; position: absolute; inset: -40% -10% auto auto; width: 560px; height: 560px; pointer-events: none;
  background: radial-gradient(circle, rgba(155, 109, 255, 0.22), transparent 65%);
}
.me-avatar-col { display: grid; justify-items: center; gap: 0.9em; position: relative; }
.me-avatar-btn {
  position: relative; width: 240px; height: 240px; border-radius: 50%; padding: 6px; border: 0; cursor: pointer;
  background: conic-gradient(from 210deg, var(--purple), var(--gold), var(--purple));
  box-shadow: 0 0 44px rgba(155, 109, 255, 0.35); transition: transform 0.2s, box-shadow 0.2s;
}
.me-avatar-btn:hover, .me-avatar-btn:focus-visible { transform: scale(1.03); box-shadow: 0 0 56px rgba(242, 184, 79, 0.4); outline: none; }
.me-avatar {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: var(--tk, #2f5fa8); font-size: 6.2rem; line-height: 1;
}
.me-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-avatar-edit {
  position: absolute; inset: 5px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.85rem; font-weight: 800; color: #fff; text-align: center; padding: 0 1em;
  background: rgba(10, 5, 22, 0.6); opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.me-avatar-btn:hover .me-avatar-edit, .me-avatar-btn:focus-visible .me-avatar-edit { opacity: 1; }
.me-remove { font-size: 0.85rem; }

.me-actions { display: flex; align-items: center; gap: 1em; flex-wrap: wrap; margin-top: 0.4em; }

/* ---------- games list ---------- */
.me-search { margin-bottom: 0.9em; }
.me-picked { display: flex; flex-wrap: wrap; gap: 0.5em; align-items: center; padding: 0.8em 1em; margin-bottom: 1.2em; border-radius: 14px; background: rgba(155, 109, 255, 0.1); border: 1px dashed rgba(155, 109, 255, 0.4); }
.me-picked-label { font-weight: 800; font-size: 0.9rem; color: var(--gold); }
.me-picked-empty { margin: 0; }
.me-pill-picked {
  font: inherit; font-size: 0.85rem; font-weight: 700; color: #241407; background: var(--gold); border: 0; border-radius: 999px;
  padding: 0.3em 0.85em; cursor: pointer; transition: transform 0.15s;
}
.me-pill-picked:hover { transform: scale(1.04); }
.me-group { margin-bottom: 1.3em; }
.me-group h3 { font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 0.04em; margin: 0 0 0.6em; color: var(--blue-accent); }
.me-chips { display: flex; flex-wrap: wrap; gap: 0.5em; }
.me-chip, .me-chip-btn {
  font: inherit; font-size: 0.9rem; font-weight: 700; color: var(--text); cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: 999px; padding: 0.42em 1em;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.me-chip:hover, .me-chip-btn:hover { border-color: var(--purple); transform: translateY(-1px); }
.me-chip.on {
  background: linear-gradient(135deg, var(--purple), var(--purple-deep)); border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(107, 70, 193, 0.5);
}
.me-chip.on::before { content: '\2713  '; }
.me-other { margin: 1.2em 0 0; }

/* ---------- calendar ---------- */
.me-presets { display: flex; flex-wrap: wrap; gap: 0.6em; margin-bottom: 1.1em; }
.me-chip-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15em; border-radius: 14px; padding: 0.55em 1.1em;
}
.me-chip-btn .mp-label { font-weight: 700; }
.me-chip-btn .mp-range { font-size: 0.74rem; font-weight: 600; color: var(--text-muted); }
.me-chip-btn.active {
  background: linear-gradient(135deg, var(--purple), var(--purple-deep)); border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(107, 70, 193, 0.5);
}
.me-chip-btn.active .mp-range { color: rgba(255, 255, 255, 0.8); }
.me-chip-clear { border-style: dashed; }
.me-cal-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); background: rgba(10, 5, 22, 0.4); padding: 0.6em; }
.me-cal { display: grid; grid-template-columns: 58px repeat(7, minmax(46px, 1fr)); gap: 3px; min-width: 470px; touch-action: none; user-select: none; -webkit-user-select: none; }
.me-day {
  font: inherit; font-weight: 800; font-size: 0.85rem; color: var(--gold); cursor: pointer;
  background: none; border: 0; padding: 0.7em 0 0.5em; border-bottom: 1px solid var(--border);
}
.me-day:hover { color: #fff; }
.me-hour { font: inherit; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-align: right; padding: 0 0.6em 0 0; background: none; border: 0; cursor: pointer; height: 27px; }
.me-hour:hover { color: #fff; }
.me-cell {
  height: 27px; border-radius: 7px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer; transition: background 0.12s, transform 0.12s, box-shadow 0.12s;
}
.me-cell.odd { background: rgba(255, 255, 255, 0.075); }
.me-cell:hover { border-color: var(--gold); }
.me-cell.on {
  background: linear-gradient(135deg, #b58bff, #6b46c1); border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 10px rgba(155, 109, 255, 0.45); animation: me-pop 0.18s ease-out;
}
@keyframes me-pop { 0% { transform: scale(0.85); } 100% { transform: scale(1); } }
.me-cal-total { margin: 0.9em 0 0; font-weight: 800; color: var(--gold); }
@media (prefers-reduced-motion: reduce) { .me-cell.on { animation: none; } }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .me-card { padding: 1.3em 1.1em; }
  .me-hero { grid-template-columns: 1fr; }
  .me-row { grid-template-columns: 1fr; }
  .me-card-head { flex-direction: column; }
}

/* ============ My games (My schedule tab) ============ */
.mg-sep { border: 0; border-top: 1px solid var(--border); margin: 1.8em 0 1.5em; }
.mg-list { display: grid; gap: 0.9em; }
.mg-empty { color: var(--text-muted); margin: 0; }
.mg-empty a { color: var(--blue-accent); font-weight: 700; }
.mg-card { position: relative; overflow: hidden; background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.mg-card:hover { transform: translateY(-2px); border-color: rgba(242, 184, 79, 0.55); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(242, 184, 79, 0.18); }
.mg-cover { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 1em; min-height: 128px; padding: 1em 1.2em; text-decoration: none; color: #fff; background: #1a1230 center / cover no-repeat; isolation: isolate; }
.mg-cover::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(14, 9, 28, 0.94) 0%, rgba(14, 9, 28, 0.72) 42%, rgba(14, 9, 28, 0.18) 100%), linear-gradient(0deg, rgba(14, 9, 28, 0.55), transparent 60%); }
.mg-cover::after { content: 'Game page \203A'; position: absolute; top: 0.8em; right: 1em; font-size: 0.78rem; font-weight: 800; color: var(--gold); background: rgba(14, 9, 28, 0.6); border: 1px solid rgba(242, 184, 79, 0.45); border-radius: 999px; padding: 0.2em 0.8em; backdrop-filter: blur(4px); }
.mg-cover:hover::after { background: var(--gold); color: #1a1230; }
.mg-info { min-width: 0; }
.mg-group { display: inline-block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #1a1230; background: var(--gold); border-radius: 999px; padding: 0.15em 0.75em; margin-bottom: 0.45em; box-shadow: 0 0 14px rgba(242, 184, 79, 0.45); }
.mg-title { font-family: 'Cinzel', serif; font-weight: 700; font-size: 1.35rem; line-height: 1.15; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8); }
.mg-next { color: rgba(255, 255, 255, 0.82); font-size: 0.86rem; margin-top: 0.3em; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }
.mg-countdown { flex: none; font-size: 0.8rem; font-weight: 800; color: #b7f0c9; background: rgba(40, 140, 80, 0.28); border: 1px solid rgba(120, 220, 160, 0.5); border-radius: 999px; padding: 0.3em 0.9em; backdrop-filter: blur(4px); white-space: nowrap; }
.mg-sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.65em; padding: 0.9em 1em 1.05em; }
.mg-session { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 0.65em 0.8em 0.7em 1em; display: flex; flex-direction: column; gap: 0.3em; background: rgba(255, 255, 255, 0.03); overflow: hidden; }
.mg-session::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #5fd08a; }
.mg-session.skipped { border-style: dashed; background: rgba(242, 184, 79, 0.05); }
.mg-session.skipped::before { background: var(--gold); }
.mg-session.by-ash { background: rgba(255, 120, 120, 0.06); }
.mg-session.by-ash::before { background: #ff8a8a; }
.mg-when { font-weight: 700; font-size: 0.9rem; }
.mg-state { font-size: 0.78rem; font-weight: 800; color: #7fd99a; }
.mg-session.skipped .mg-state { color: var(--gold); }
.mg-session.by-ash .mg-state { color: #ff9a9a; }
.mg-note { font-size: 0.76rem; color: var(--text-muted); }
.mg-btn { align-self: flex-start; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: 0.3em 0.95em; font: inherit; font-weight: 700; font-size: 0.8rem; cursor: pointer; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.mg-btn:hover { background: var(--gold); border-color: var(--gold); color: #1a1230; }
.mg-btn[disabled] { opacity: 0.5; cursor: wait; }
@media (max-width: 560px) {
  .mg-cover { min-height: 150px; align-items: flex-end; flex-wrap: wrap; }
  .mg-cover::after { top: 0.6em; right: 0.7em; }
  .mg-title { font-size: 1.15rem; }
}
.me-preview-bar { background: #3a2a10; color: var(--gold); text-align: center; font-size: 0.82rem; font-weight: 700; padding: 0.5em 1em; border-bottom: 1px solid rgba(242, 184, 79, 0.4); }

/* The footer stays at the bottom of the window, even when a tab is short (like Messages). */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main.me { flex: 1 0 auto; }
body > .site-footer { margin-top: auto; }
