/* ===== Shared styles for public SP/MP pages ===== */

/* Hub button */
.hub-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(58, 58, 60, 0.6);
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.hub-btn:hover {
  background: rgba(123, 104, 238, 0.3);
  border-color: var(--purple);
  color: var(--text);
}

/* MP badge */
.mp-badge {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff;
  background: var(--purple);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Header actions wrapper */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Stats toggle button */
.stats-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 28px;
  border-radius: 6px;
  background: rgba(58, 58, 60, 0.5);
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.stats-toggle-btn:hover, .stats-toggle-btn.active {
  background: rgba(123, 104, 238, 0.3);
  border-color: var(--purple);
  color: var(--text);
}

/* Stats Dropdown */
.stats-dropdown {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 476px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  z-index: 80;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  animation: dropdownIn 0.2s ease-out;
}
.stats-dropdown.hidden { display: none; }

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stats-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
}

.stats-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.stat-item {
  text-align: center;
  background: rgba(58, 58, 60, 0.3);
  padding: 8px 4px;
  border-radius: 8px;
}

.stat-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--purple);
}

.stat-lbl {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.stats-history {
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.stats-history:empty { display: none; }

.stats-h-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(58, 58, 60, 0.2);
}

.stats-h-word {
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
}

.stats-h-guesses {
  color: var(--text-dim);
  margin-left: 8px;
}

.stats-h-date {
  color: var(--text-dim);
  font-size: 0.65rem;
}

.stats-h-result {
  font-weight: 700;
  font-size: 0.65rem;
}
.stats-h-result.win { color: var(--green-bright); }
.stats-h-result.loss { color: var(--text-dim); }

.stats-portal-link {
  display: block;
  text-align: center;
  font-size: 0.7rem;
  color: var(--purple);
  text-decoration: none;
  padding: 4px 0;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.stats-portal-link:hover { opacity: 1; text-decoration: underline; }

/* Login Banner (SP mode) */
.login-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(123, 104, 238, 0.15);
  border: 1px solid rgba(123, 104, 238, 0.3);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.7rem;
  color: var(--text-dim);
  flex-shrink: 0;
  margin-top: 4px;
}
.login-banner a {
  color: var(--purple);
  text-decoration: none;
  font-weight: 700;
}
.login-banner a:hover { text-decoration: underline; }
.login-banner.hidden { display: none; }

.banner-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.6;
}
.banner-close:hover { opacity: 1; }

/* MP Login Screen */
.mp-login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  padding: 20px;
}
.mp-login-screen.hidden { display: none; }

.mp-login-card {
  text-align: center;
  max-width: 360px;
  width: 100%;
  padding: 32px 28px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.mp-login-logo {
  font-size: 48px;
  margin-bottom: 12px;
}

.mp-login-card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}

.mp-login-card p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.mp-login-sub {
  margin-bottom: 20px !important;
}

.mp-discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #5865F2;
  color: #fff;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  transition: background 0.2s;
}
.mp-discord-btn:hover { background: #4752c4; }

.mp-github-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  background: #333;
  color: #fff;
  font-size: 0.95rem;
  text-decoration: none;
  font-weight: 700;
  transition: background 0.2s, box-shadow 0.2s;
}
.mp-github-btn:hover { background: #24292e; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }

.mp-login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: var(--text-dim);
  font-size: 0.75rem;
}
.mp-login-divider::before,
.mp-login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

.mp-back-link {
  display: block;
  margin-top: 16px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
}
.mp-back-link:hover { color: var(--text); }
