/* Hub account controls. Large click targets. No hover-only actions. */

.account-slot {
  display: flex;
  align-items: center;
}

.account-open {
  min-height: 48px;
  min-width: 112px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg-card, #141b26);
  color: var(--text-primary, #e8e4d9);
  border: 1px solid var(--click-blue, #4488ff);
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.2;
  cursor: pointer;
}

.account-chip {
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  max-width: 220px;
}

.account-chip-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1c2532;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
  font-size: 16px;
}

.account-chip-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .hub-right {
    width: 100%;
    justify-content: flex-end;
  }
}

.account-open-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.account-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(7, 8, 12, 0.84);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.account-modal.is-open {
  display: flex;
}

.account-card {
  width: min(440px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: var(--bg-card, #141b26);
  color: var(--text-primary, #e8e4d9);
  border: 1px solid var(--border-strong, #3a4150);
  border-radius: 16px;
  padding: 22px 22px 16px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.account-title {
  font-size: 22px;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.account-help,
.account-email-line,
.account-status {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-muted, #9aa4b1);
  margin: 0 0 12px;
}

.account-google {
  display: flex;
  justify-content: center;
  min-height: 44px;
  margin-top: 10px;
}

.account-google[hidden] {
  display: none;
}

.account-note {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary, #e8e4d9);
  border-left: 3px solid var(--click-blue, #4488ff);
  padding: 6px 10px;
  margin: 0 0 12px;
}

.account-status {
  min-height: 1.4em;
  color: var(--text-primary, #e8e4d9);
}

.account-status:empty {
  display: none;
  min-height: 0;
  margin: 0;
}

.account-label {
  display: block;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted, #9aa4b1);
  margin: 8px 0 6px;
}

.account-field {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong, #3a4150);
  background: var(--bg-page, #07080c);
  color: var(--text-primary, #e8e4d9);
  font-family: inherit;
  font-size: 18px;
  user-select: text;
}

.account-action,
.account-close {
  display: block;
  width: 100%;
  min-height: 52px;
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 18px;
  cursor: pointer;
}

.account-action[hidden] {
  display: none;
}
.account-action {
  background: var(--click-blue, #4488ff);
  color: #fff;
  border: none;
}

.account-action--ghost,
.account-close {
  background: transparent;
  color: var(--text-primary, #e8e4d9);
  border: 1px solid var(--border-strong, #3a4150);
}

.account-close {
  margin-top: 16px;
}

.account-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  padding: 8px 4px;
  font-size: 18px;
  cursor: pointer;
}

.account-toggle input {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  cursor: pointer;
}

.account-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-avatar-row .account-action {
  flex: 1;
  margin-top: 0;
}

.account-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #1c2532;
  border: 1px solid var(--border-strong, #3a4150);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ── Profile menu + Friends window (online play stage 1) ── */
.account-card--small {
  width: min(400px, 100%);
}

.friends-menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.friends-menu-row .account-action {
  flex: 1;
  margin-top: 0;
}

.friends-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  font-size: 16px;
  cursor: pointer;
  position: relative;
}

.friends-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.friends-switch-track {
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: var(--border-strong, #3a4150);
  position: relative;
  transition: background 0.15s;
}

.friends-switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-primary, #e8e4d9);
  transition: transform 0.15s;
}

.friends-switch input:checked + .friends-switch-track {
  background: #2fbf71;
}

.friends-switch input:checked + .friends-switch-track::after {
  transform: translateX(20px);
}

.friends-switch input:focus-visible + .friends-switch-track {
  outline: 2px solid var(--click-blue, #4488ff);
  outline-offset: 2px;
}

.friends-section {
  margin-top: 14px;
}

.friends-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.friends-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border-strong, #3a4150);
}

.friends-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #5b6472;
}

.friends-dot.is-online {
  background: #2fbf71;
  box-shadow: 0 0 6px #2fbf71;
}

.friends-who {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.friends-name {
  font-size: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friends-handle,
.friends-state {
  font-size: 13px;
  color: var(--text-muted, #9aa4b1);
}

.friends-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.friends-btn {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  background: transparent;
  color: var(--text-primary, #e8e4d9);
  border: 1px solid var(--border-strong, #3a4150);
}

.friends-btn.is-primary {
  background: var(--click-blue, #4488ff);
  border-color: transparent;
  color: #fff;
}

/* ── Inbox, conversation, friend popup, admin (online play stage 2) ── */
.inbox-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 11px;
  background: #e5484d;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.inbox-badge[hidden] {
  display: none;
}

.account-chip {
  position: relative;
}

.friends-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

button.friends-who {
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  font-family: inherit;
  padding: 4px 0;
  cursor: pointer;
}

button.friends-who:hover .friends-name,
button.friends-who:focus-visible .friends-name {
  text-decoration: underline;
}

#friends-modal.is-wide .account-card {
  width: min(860px, 100%);
}

#friends-modal.is-wide .friends-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  max-height: 52vh;
  overflow-y: auto;
}

@media (max-width: 600px) {
  #friends-modal.is-wide .friends-list {
    grid-template-columns: 1fr;
  }
}

.account-chip-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.account-chip-dot.is-on {
  background: #2fbf71;
}

.account-chip-dot.is-off {
  background: #e5484d;
}

.invite-text {
  margin: 4px 0 6px;
  font-size: 18px;
  line-height: 1.4;
}

.invite-match {
  margin: 4px 0 10px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.invite-match[hidden] {
  display: none;
}

.inbox-row .inbox-badge {
  margin-left: auto;
}

.account-card--convo {
  width: min(520px, 100%);
}

.msg-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 4px;
  max-height: 44vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  background: #1c2532;
  border: 1px solid var(--border-strong, #3a4150);
}

.msg.is-mine {
  align-self: flex-end;
  background: #1f3b6e;
  border-color: transparent;
}

.msg-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.msg-meta {
  font-size: 12px;
  color: var(--text-muted, #9aa4b1);
}

.msg-report {
  margin-left: 10px;
  background: none;
  border: none;
  color: var(--text-muted, #9aa4b1);
  text-decoration: underline;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
}

.msg-text {
  min-height: 72px;
  resize: vertical;
}

.msg-foot {
  display: flex;
  justify-content: flex-end;
}

.msg-quote {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 3px solid #e5484d;
  background: #1c2532;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 12px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--border-strong, #3a4150);
  vertical-align: top;
}

.admin-table tr.is-closed {
  opacity: 0.6;
}

.admin-viewer {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--border-strong, #3a4150);
  border-radius: 12px;
  background: var(--bg-card, #141b26);
}

.admin-viewer .admin-reason {
  box-sizing: border-box;
  width: 100%;
}

.admin-viewer[hidden] {
  display: none;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.friends-btn.is-danger {
  border-color: #e5484d;
  color: #ffb3b5;
}

.convo-who {
  all: unset;
  cursor: pointer;
  border-bottom: 1px dashed currentColor;
}

.convo-who:focus-visible {
  outline: 2px solid #4f8cff;
  outline-offset: 3px;
}

.game-picker {
  margin: 8px 0 4px;
}

.game-picker[hidden] {
  display: none;
}

.game-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.game-pick:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Profile page + sign-in, one screen (no vertical scroll) ── */
.account-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.account-card {
  position: relative;
}

.account-foot {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.account-foot > * {
  flex: 1;
  margin-top: 0;
}

.account-foot > [hidden] {
  display: none;
}

.account-modal.is-profile .account-card {
  padding: 18px 18px 14px;
}

.account-modal.is-profile .account-foot .account-action,
.account-modal.is-profile .account-foot .account-close {
  min-height: 48px;
  padding: 8px 12px;
  font-size: 17px;
}

.prof-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.prof-pic-wrap {
  position: relative;
  flex: 0 0 auto;
}

button.prof-pic {
  width: 64px;
  height: 64px;
  padding: 0;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}

button.prof-pic:focus-visible {
  outline: 2px solid var(--click-blue, #4488ff);
  outline-offset: 2px;
}

.prof-pic-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 2;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border-radius: 10px;
  background: #1c2532;
  border: 1px solid var(--border-strong, #3a4150);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.prof-pic-menu[hidden] {
  display: none;
}

.prof-pic-menu button {
  min-height: 46px;
  padding: 8px 12px;
  text-align: left;
  background: transparent;
  color: var(--text-primary, #e8e4d9);
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 17px;
  cursor: pointer;
}

.prof-pic-menu button:hover:not(:disabled),
.prof-pic-menu button:focus-visible {
  background: #26324a;
}

.prof-pic-menu button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.prof-id {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 10px;
}

.prof-handle {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.prof-email {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted, #9aa4b1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Online on/off: green on, red off. Same setting as before (show_online). */
.prof-online {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 52px;
  min-height: 48px;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted, #9aa4b1);
  cursor: pointer;
}

.prof-online input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.prof-switch {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #e5484d;
  position: relative;
  transition: background 0.15s;
}

.prof-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

.prof-online input:checked + .prof-switch {
  background: #2fbf71;
}

.prof-online input:checked + .prof-switch::after {
  transform: translateX(20px);
}

.prof-online input:focus-visible + .prof-switch {
  outline: 2px solid var(--click-blue, #4488ff);
  outline-offset: 2px;
}

.prof-panel {
  margin-bottom: 4px;
}

.prof-panel[hidden],
.prof-viewer[hidden] {
  display: none;
}

.prof-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-action.prof-btn {
  min-height: 46px;
  margin-top: 0;
  padding: 8px 14px;
  font-size: 17px;
}

.prof-btn--fit {
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

.prof-inline > .account-action:not(.prof-btn--fit) {
  flex: 1;
}

.account-field.prof-field {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 8px 12px;
  font-size: 17px;
}

.prof-cancel {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary, #e8e4d9);
  border: 1px solid var(--border-strong, #3a4150);
  font-size: 18px;
  cursor: pointer;
}

.prof-rules {
  margin: 6px 0 0;
  font-size: 13px;
}

.prof-label {
  margin-top: 10px;
}

#account-handle-status:not(:empty) {
  margin: 6px 0 0;
  font-size: 14px;
}

.prof-social {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.prof-social .prof-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.account-toggle--compact {
  min-height: 44px;
  margin-top: 4px;
  padding: 4px 2px;
  font-size: 17px;
}

.account-toggle--compact input {
  width: 26px;
  height: 26px;
}

/* View picture: a large copy over the card. Click it or X to close. */
.prof-viewer {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(7, 8, 12, 0.94);
}

.prof-viewer-pic {
  width: min(280px, 70%);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: #1c2532;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 96px;
}

.prof-viewer-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prof-viewer .prof-cancel {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* Sign-in: Google first, then the keep box, then email. */
#account-view-auth .account-field {
  min-height: 46px;
  padding: 8px 12px;
  font-size: 17px;
}

#account-view-auth .account-label {
  margin: 6px 0 4px;
}

#account-view-auth .account-note,
#account-view-auth .account-help {
  margin-bottom: 8px;
}

#account-view-auth .account-google {
  margin: 4px 0 4px;
}

.account-keep-help {
  display: block;
  font-size: 12px;
  color: var(--text-muted, #9aa4b1);
}

.account-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted, #9aa4b1);
}

.account-or::before,
.account-or::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border-strong, #3a4150);
}

.account-or[hidden] {
  display: none;
}

#account-view-auth .account-action {
  min-height: 48px;
  padding: 10px 16px;
}

.account-switches {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.account-link {
  min-height: 44px;
  padding: 6px 4px;
  background: none;
  border: none;
  color: var(--click-blue, #4488ff);
  font-family: inherit;
  font-size: 15px;
  white-space: nowrap;
  text-decoration: underline;
  cursor: pointer;
}

.account-link[hidden] {
  display: none;
}

@media (max-height: 700px) {
  .account-card {
    padding: 16px 16px 12px;
  }
  .account-title {
    font-size: 20px;
    margin-bottom: 4px;
  }
}
