/* ===========================================================
   WINR v16 — SETTINGS PAGE
   Tabbed, full-bleed, glassy. Replaces the previous ad-hoc
   settings markup with a real settings surface.
   =========================================================== */

.v16-settings {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 28px 80px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
}

/* ── Page header ── */
.v16-settings-head {
  grid-column: 1 / -1;
  margin-bottom: 8px;
}
.v16-settings-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.8px;
  color: #fff;
  margin: 0 0 4px;
}
.v16-settings-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

/* ── Sidebar ── */
.v16-side {
  position: sticky;
  top: 32px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
}
.v16-side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}
.v16-side-link svg {
  flex: 0 0 16px;
  opacity: 0.7;
}
.v16-side-link:hover {
  background: rgba(255,255,255,0.04);
  color: #fff;
}
.v16-side-link:hover svg { opacity: 1; }
.v16-side-link.active {
  background: transparent;
  color: #fff;
}
.v16-side-link.active:hover {
  background: rgba(255,255,255,0.04);
}
.v16-side-link.active svg {
  opacity: 1;
  color: #fff;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.4));
}
.v16-side-link.danger { color: rgba(255,91,103,0.8); }
.v16-side-link.danger:hover { background: rgba(255,91,103,0.08); color: #ff5b67; }

/* ── Main ── */
.v16-main {
  min-width: 0;
}
.v16-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 18px;
}
.v16-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 16px;
}
.v16-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 2px;
}
.v16-card-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

/* ── Field shell ── */
.v16-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.v16-field:last-child { margin-bottom: 0; }
.v16-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.v16-input,
.v16-textarea,
.v16-select {
  width: 100%;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  color: #fff;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, background .2s;
}
.v16-input:focus,
.v16-textarea:focus,
.v16-select:focus {
  border-color: rgba(255,255,255,0.28);
  background: rgba(0,0,0,0.4);
}
.v16-textarea { min-height: 76px; resize: vertical; line-height: 1.5; }
.v16-input[disabled] {
  background: rgba(255,255,255,0.02);
  color: rgba(255,255,255,0.4);
  cursor: not-allowed;
}
.v16-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  line-height: 1.4;
}

/* Inline @handle */
.v16-handle-row {
  display: flex;
  align-items: stretch;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
}
.v16-handle-row:focus-within {
  border-color: rgba(255,255,255,0.28);
}
.v16-handle-prefix {
  display: flex;
  align-items: center;
  padding: 0 4px 0 13px;
  font-size: 14px;
  color: rgba(255,255,255,0.45);
}
.v16-handle-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  padding-left: 2px !important;
}
.v16-handle-status {
  display: flex;
  align-items: center;
  padding: 0 13px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.v16-handle-ok { color: #39FF14; }
.v16-handle-bad { color: #ff5b67; }

/* ── Avatar block ── */
.v16-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.v16-avatar-circle {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  flex: 0 0 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: rgba(255,255,255,0.65);
}
.v16-avatar-circle.has-img {
  background-size: cover;
  background-position: center;
  color: transparent;
}
.v16-avatar-actions { display: flex; gap: 8px; }
.v16-btn-ghost {
  padding: 8px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.v16-btn-ghost:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.v16-btn-ghost.danger { color: #ff5b67; border-color: rgba(255,91,103,0.3); }
.v16-btn-ghost.danger:hover { background: rgba(255,91,103,0.08); }

/* ── Toggle row ── */
.v16-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.v16-row:last-child { border-bottom: none; }
.v16-row-text { flex: 1; min-width: 0; }
.v16-row-title { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 2px; }
.v16-row-desc { font-size: 12px; color: rgba(255,255,255,0.5); line-height: 1.4; }

/* iOS-style toggle */
.v16-switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex: 0 0 44px;
  display: inline-block;
}
.v16-switch input { display: none; }
.v16-switch-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
}
.v16-switch-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.v16-switch input:checked + .v16-switch-slider {
  background: #34C759;
  box-shadow: 0 0 12px rgba(52,199,89,0.35);
}
.v16-switch input:checked + .v16-switch-slider::before {
  transform: translateX(18px);
}

/* Status pills */
.v16-status-row { display: flex; gap: 6px; }
.v16-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all .15s;
  text-transform: capitalize;
}
.v16-status-pill:hover { background: rgba(255,255,255,0.08); }
.v16-status-pill.active {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border-color: rgba(255,255,255,0.25);
}
.v16-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.v16-status-dot.online  { background: #39FF14; box-shadow: 0 0 6px rgba(57,255,20,0.6); }
.v16-status-dot.idle    { background: #fbbf24; box-shadow: 0 0 6px rgba(251,191,36,0.6); }
.v16-status-dot.offline { background: rgba(255,255,255,0.4); }

/* Skin grid */
.v16-skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.v16-skin-tile {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform .2s, border-color .2s;
  overflow: hidden;
}
.v16-skin-tile:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.2); }
.v16-skin-tile.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.25); }
.v16-skin-tile-name {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
  z-index: 2;
}
.v16-skin-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.6));
  z-index: 1;
}
.v16-skin-tile.locked .v16-skin-tile-name::before {
  content: '🔒 ';
}
.v16-skin-tile.locked { opacity: 0.55; }

/* Connected accounts */
.v16-conn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  margin-bottom: 8px;
}
.v16-conn-row:last-child { margin-bottom: 0; }
.v16-conn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex: 0 0 36px;
}
.v16-conn-name { font-size: 13px; font-weight: 600; color: #fff; }
.v16-conn-meta { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.v16-conn-info { flex: 1; min-width: 0; }
.v16-conn-state {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.v16-conn-state.connected { background: rgba(57,255,20,0.1); color: #39FF14; }
.v16-conn-state.off { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5); }

/* Save bar (sticks to bottom of viewport when dirty) */
.v16-save-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 18px;
  background: rgba(15,15,18,0.92);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.5);
  z-index: 4500;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(0.16,1,0.3,1), opacity .25s ease;
}
.v16-save-bar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.v16-save-bar-text {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}
.v16-btn-cancel,
.v16-btn-save {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all .2s;
}
.v16-btn-cancel {
  background: transparent;
  color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.15);
}
.v16-btn-cancel:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
.v16-btn-save {
  background: #fff;
  color: #0a0a0d;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.v16-btn-save:hover { transform: translateY(-1px); }
.v16-btn-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Danger button */
.v16-btn-danger {
  padding: 9px 16px;
  background: rgba(255,91,103,0.1);
  border: 1px solid rgba(255,91,103,0.3);
  color: #ff5b67;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.v16-btn-danger:hover {
  background: rgba(255,91,103,0.2);
}

@media (max-width: 760px) {
  .v16-settings { grid-template-columns: 1fr; padding: 20px 16px 100px; gap: 18px; }
  .v16-side { position: relative; top: 0; flex-direction: row; overflow-x: auto; padding: 6px; }
  .v16-side-link { white-space: nowrap; }
}
