/* Javlox — Roblox-style shell + avatar editor */

:root {
  --bg-page: #f3f3f5;
  --bg-top: #ffffff;
  --bg-sidebar: #ffffff;
  --border-soft: #e5e5e8;
  --text: #121215;
  --text-muted: #6b6b70;
  --accent: #335fff;
  --accent-hover: #2547d6;
  --sidebar-w: 88px;
  --top-h: 56px;
  --radius-card: 8px;
  --radius-search: 24px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);
  --panel-max: 440px;
  --warn: #c42b2b;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-page);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* ——— Sidebar ——— */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 12px 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0;
  transition: color 0.15s, background 0.15s;
  text-align: center;
}

a.nav-item {
  text-decoration: none;
}

.nav-item:hover:not(:disabled) {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

.nav-item:disabled {
  cursor: default;
  opacity: 0.45;
}

.nav-item.is-active {
  color: var(--text);
  position: relative;
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 28px;
  background: var(--text);
  border-radius: 0 4px 4px 0;
}

.nav-item svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item svg:not([fill="currentColor"]) {
  fill: none;
}

/* ——— Column + topbar ——— */
.column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--top-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px 0 16px;
  background: var(--bg-top);
  border-bottom: 1px solid var(--border-soft);
}

.topbar-brand {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--text);
  min-width: 4.5rem;
}

.search-wrap {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  max-height: 280px;
  overflow-y: auto;
  z-index: 40;
}

.search-results.is-hidden {
  display: none;
}

.search-hit {
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  border: none;
  width: 100%;
  text-align: left;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.search-hit:hover,
.search-hit:focus {
  background: #eeeff2;
  outline: none;
}

.search-hit small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.username-status {
  min-height: 1.25em;
  font-size: 13px;
  margin: 6px 0 0;
}

.username-status.is-ok {
  color: #15803d;
}

.username-status.is-bad {
  color: var(--warn);
}

.username-status.is-muted {
  color: var(--text-muted);
}

.nav-item--operator.is-hidden {
  display: none;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 16px;
  background: #eeeff2;
  border-radius: var(--radius-search);
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.search:focus-within {
  background: #fff;
  border-color: var(--accent);
}

.search svg {
  flex-shrink: 0;
  opacity: 0.45;
}

.search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  outline: none;
  min-width: 0;
}

.search input::placeholder {
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 200px;
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b8cff, #7c5cff);
  flex-shrink: 0;
}

.username {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.currency {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.notify {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text);
}

.notify:hover {
  background: rgba(0, 0, 0, 0.05);
}

.notify-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: #e00;
  border-radius: 8px;
}

/* ——— Main content ——— */
.content--javlox {
  flex: 1;
  padding: 28px 36px 48px;
  overflow-x: hidden;
  max-width: min(520px, calc(var(--panel-max) + 96px));
}

.page-title {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-sub {
  margin: 0 0 24px;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 520px;
}

.notice {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: var(--radius-card);
  border: 1px solid #f0b4b4;
  background: #fff5f5;
  color: #8b1a1a;
  font-size: 14px;
  max-width: var(--panel-max);
}

.notice.is-hidden {
  display: none;
}

.notice--info {
  border-color: #c5d4f5;
  background: #f0f4fd;
  color: #1e3a5c;
}

.section-head--tight {
  margin-bottom: 8px;
}

.section-head--tight .panel-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.javlox-panel {
  max-width: var(--panel-max);
  margin-bottom: 16px;
  padding: 22px 24px 24px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.hint,
.field-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 0 16px;
}

.field-hint {
  margin: -6px 0 16px;
}

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

input[type="text"] {
  width: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: #fafafb;
  color: var(--text);
  font-size: 15px;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.req {
  color: var(--warn);
}

.colors {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 14px 8px;
  margin: 0 0 16px;
}

.colors legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.colors label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  margin-bottom: 8px;
}

input[type="color"] {
  width: 48px;
  height: 32px;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
}

.avatar-editor {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 14px 14px;
  margin: 0 0 16px;
}

.avatar-editor > legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.ed-hint {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.slider-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.sl {
  display: block;
}

.sl-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.sl-label {
  font-size: 13px;
  font-weight: 600;
}

.sl-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.sl input[type="range"] {
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
}

.face-block {
  margin-bottom: 14px;
}

.sub-legend {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.face-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.face-pills .pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: #fafafb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.face-pills .pill:has(input:checked) {
  border-color: var(--accent);
  background: #eef2ff;
  color: var(--accent);
}

.face-pills .pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.hat-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  padding-top: 4px;
  border-top: 1px solid var(--border-soft);
  margin-top: 4px;
}

.hat-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.hat-color-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.hat-color-wrap input[type="color"] {
  width: 40px;
  height: 28px;
}

.preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 16px 0 20px;
  padding: 16px 16px 20px;
  background: #eeeff2;
  border-radius: 10px;
  position: relative;
  overflow: visible;
}

.preview-cap {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.fig {
  position: relative;
  width: 72px;
  height: 120px;
  transform-origin: 50% 100%;
  transition: transform 0.08s ease-out;
}

.fig-hat {
  position: absolute;
  left: 50%;
  top: 0;
  width: 40px;
  height: 11px;
  margin-left: -20px;
  border-radius: 4px 4px 2px 2px;
  background: #3d4f6f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  z-index: 3;
}

.fig-torso {
  position: absolute;
  left: 12px;
  top: 36px;
  width: 48px;
  height: 52px;
  border-radius: 4px;
  background: #22324a;
  transition: width 0.08s, height 0.08s, left 0.08s;
}

.fig-head {
  position: absolute;
  left: 18px;
  top: 6px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #f0c29a;
  transform-origin: 50% 100%;
  transition: transform 0.08s ease-out;
  z-index: 2;
  overflow: visible;
}

.fig-face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.fig-face[data-face="dots"]::before,
.fig-face[data-face="dots"]::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  background: #141414;
  border-radius: 50%;
  top: 42%;
}

.fig-face[data-face="dots"]::before {
  left: 22%;
}

.fig-face[data-face="dots"]::after {
  right: 22%;
}

.fig-face[data-face="shades"]::before {
  content: "";
  position: absolute;
  left: 9%;
  right: 9%;
  top: 38%;
  height: 8px;
  background: #0c0c0c;
  border-radius: 2px;
}

.fig-face[data-face="visor"]::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 34%;
  height: 14px;
  background: rgba(70, 160, 255, 0.72);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.fig-arm {
  position: absolute;
  top: 40px;
  width: 10px;
  height: 40px;
  border-radius: 3px;
  background: #d0a37b;
  transition: height 0.08s, top 0.08s;
}

.fig-arm.l {
  left: 0;
}

.fig-arm.r {
  right: 0;
}

.fig-leg {
  position: absolute;
  top: 86px;
  width: 14px;
  height: 34px;
  border-radius: 3px;
  background: #080b14;
  transition: height 0.08s, top 0.08s;
}

.fig-leg.l {
  left: 18px;
}

.fig-leg.r {
  right: 18px;
}

.btn {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  width: 100%;
}

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn.ghost {
  background: transparent;
  border-color: var(--border-soft);
  color: var(--text-muted);
  width: 100%;
  margin-top: 10px;
}

.btn.ghost:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.btn.full {
  width: 100%;
}

.actions.is-hidden {
  display: none;
}

.form-hidden {
  display: none !important;
}

.fineprint {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.javlox-foot {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  max-width: var(--panel-max);
}

.javlox-foot a {
  color: var(--accent);
  font-weight: 600;
}

.javlox-foot a:hover {
  text-decoration: underline;
}

.javlox-panel--games {
  margin-bottom: 8px;
}

.game-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-soft);
  background: #fff;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s, transform 0.12s;
}

.game-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.game-card-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.game-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin: 16px 0 12px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  max-width: 320px;
}

.auth-tab {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: #f8f8fa;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}

.auth-tab.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--text);
}

.auth-panel {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-soft);
  background: #fafafa;
}

.auth-panel.is-hidden {
  display: none;
}

.login-msg {
  min-height: 1.2em;
  font-size: 13px;
  margin: 8px 0;
  color: var(--text-muted);
}

.login-msg.is-bad {
  color: var(--warn);
}

.login-msg.is-ok {
  color: #15803d;
}

.signup-password-block.is-hidden {
  display: none;
}

#profileForm.is-hidden {
  display: none;
}

@media (max-width: 720px) {
  .sidebar {
    display: none;
  }

  .content--javlox {
    padding: 20px 16px 40px;
    max-width: none;
  }

  .javlox-panel,
  .notice,
  .javlox-foot {
    max-width: none;
  }

  .username {
    max-width: 100px;
  }

  .search-wrap {
    max-width: none;
  }
}
