/* Modoo desktop app. Tokens come from tokens.css; this file only lays out the app. */

* { box-sizing: border-box; }
html, body { height: 100%; }
body.mo-app {
  margin: 0;
  display: grid;
  grid-template-columns: 236px 1fr;
  background: var(--bg);
  color: var(--fg);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r); }
.mono { font-family: var(--mono); }

/* Sidebar */
.side {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  padding: 18px 12px 12px;
  background: var(--bg-subtle);
  border-right: 1px solid var(--line);
}
.side-brand { padding: 4px 10px 0; color: var(--fg); }
.wordmark { display: block; height: 20px; width: auto; overflow: visible; }
.side-nav { display: grid; gap: 2px; }
.side-label { margin: 10px 10px 4px; font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-faint); }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r);
  background: none;
  color: var(--fg-muted);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.nav-item:hover { color: var(--fg); background: rgba(255, 255, 255, 0.04); }
.nav-item[aria-current="page"] { color: var(--fg); background: var(--bg-muted); }
.nav-item .count { margin-left: auto; font: 500 11.5px/1 var(--mono); color: var(--fg-faint); }

.side-who {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}
.side-who:hover { border-color: var(--line-strong); }
.who-text { display: grid; min-width: 0; }
.who-name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-pass { font-size: 12px; color: var(--fg-muted); }

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--fg-muted);
  font: 600 12px/1 var(--font);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }

/* Main */
.main { min-width: 0; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; }
.view { display: grid; gap: 20px; max-width: 1000px; padding: 28px 32px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.2; }
.page-sub { margin: 4px 0 0; color: var(--fg-muted); font-size: 13.5px; }
.page-actions { display: flex; gap: 8px; }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; font: 500 11.5px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-faint); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--fg);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.btn:hover { background: var(--bg-muted); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: none; color: var(--fg-muted); }
.btn-ghost:hover { color: var(--fg); background: var(--bg-muted); }
.btn-lg { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.btn-google:hover { background: #f2f4f7; }

/* First-run checklist */
.setup { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.setup li { display: flex; gap: 12px; padding: 14px 16px; border-left: 1px solid var(--line); }
.setup li:first-child { border-left: 0; }
.setup .step-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--fg-muted);
  font: 500 11.5px/1 var(--mono);
}
.setup li[data-state="done"] .step-mark { border-color: transparent; background: var(--accent); color: #fff; }
.setup li[data-state="next"] .step-mark { border-color: var(--accent); color: var(--accent-text); }
.setup .step-title { font-weight: 550; }
.setup .step-text { color: var(--fg-muted); font-size: 12.5px; }
.setup li[data-state="done"] .step-title { color: var(--fg-muted); }

/* A game */
.game { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.banner {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-height: 176px;
  padding: 20px;
  background-color: #101013;
  background-image:
    linear-gradient(180deg, rgba(11, 11, 12, 0) 30%, rgba(11, 11, 12, 0.85)),
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.2px);
  background-size: auto, 6px 6px;
  border-bottom: 1px solid var(--line);
}
.banner[data-art] { background-size: cover; background-position: center; }
.banner h2 { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; color: #fff; }
.banner-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.banner-meta { gap: 0; }
.chip { color: rgba(255, 255, 255, 0.78); font-size: 13px; white-space: nowrap; }
.chip + .chip::before { content: "\00b7"; margin: 0 8px; color: rgba(255, 255, 255, 0.45); }
.chip[data-tone="warn"] { color: var(--warn); }

.copies { display: grid; }
.copy-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--fg-faint); font: 400 12px/1.4 var(--mono); }
.copy-row .path { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Mods */
.mods-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; }
.legend { display: flex; gap: 14px; color: var(--fg-faint); font-size: 12px; }
.legend span { white-space: nowrap; }
.mods { margin: 0; padding: 0; list-style: none; }
.mod {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  transition: background var(--fast) var(--ease);
}
.mod[data-on="true"] { background: linear-gradient(90deg, var(--accent-soft), transparent 60%); }
.mod-name { font-weight: 550; }
.mod-sum { color: var(--fg-muted); font-size: 13px; line-height: 1.45; }
.mod-why { color: var(--fg-faint); font-size: 12px; }

.kind { color: var(--fg-faint); font-size: 12.5px; white-space: nowrap; }
.kind[data-kind="live"] { color: var(--accent-text); }
.kind[data-kind="safe_point"] { color: var(--warn); }

/* Activity */
.activity { margin: 0; padding: 4px 16px 12px; list-style: none; border-top: 1px solid var(--line); }
.activity li { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; padding: 8px 0; font-size: 13px; }
.activity li + li { border-top: 1px dashed var(--line); }
.activity li[data-tone="wait"] .what { color: var(--warn); }
.activity .what { color: var(--fg); }
.activity .detail { display: block; color: var(--fg-faint); font: 400 12px/1.5 var(--mono); }
.activity time { color: var(--fg-faint); font: 400 12px/1.6 var(--mono); }
.activity-new { animation: arrive var(--slow) var(--ease); }
@keyframes arrive { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Empty state, added folders */
.empty { display: grid; justify-items: center; gap: 10px; padding: 44px 24px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); text-align: center; color: var(--fg-muted); }
.empty h2 { margin: 0; color: var(--fg); font-size: 16px; font-weight: 600; }
.empty p { margin: 0; max-width: 46ch; }
.list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; }
.list li + li { border-top: 1px solid var(--line); }
.list .path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 12.5px/1.4 var(--mono); color: var(--fg-muted); }

/* Account */
.panel { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.panel h2 { margin: 0; font-size: 15px; font-weight: 600; }
.panel p { margin: 0; color: var(--fg-muted); }
.panel-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.panel-row .grow { flex: 1; min-width: 0; }
.kv { display: grid; grid-template-columns: 160px 1fr; margin: 0; border-top: 1px solid var(--line); }
.kv dt, .kv dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--fg-muted); }
.kv dd { font-variant-numeric: tabular-nums; }
.status { font-weight: 550; }
.status[data-state="ok"] { color: var(--ok); }
.status[data-state="warn"] { color: var(--warn); }
.signin { display: grid; justify-items: center; gap: 16px; padding: 48px 24px; text-align: center; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.signin h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.signin p { margin: 0; max-width: 44ch; color: var(--fg-muted); }
.signin .wordmark { height: 30px; }
.msg { min-height: 20px; margin: 0; font-size: 13px; color: var(--fg-muted); }
.msg[data-state="error"] { color: var(--danger); }
.fine { color: var(--fg-faint); font-size: 12.5px; }

/* The ownership declaration, asked once per game before its first mod */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, 0.62); }
.modal-card { display: grid; gap: 12px; width: 100%; max-width: 460px; padding: 24px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--bg-subtle); box-shadow: var(--shadow-2); }
.modal-card h2 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.modal-card p { margin: 0; color: var(--fg-muted); }
.modal-card #declare-text { color: var(--fg); font-size: 15px; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--bg-muted);
  box-shadow: var(--shadow-2);
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.toast[data-show="true"] { opacity: 1; transform: translate(-50%, 0); }


/* Focus ring the site's guided tour draws around what it is talking about */
[data-spot="true"] { box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px rgba(51, 85, 255, 0.22); border-radius: var(--r-lg); transition: box-shadow var(--slow) var(--ease); }

@media (max-width: 980px) {
  .setup { grid-template-columns: 1fr; }
  .setup li { border-left: 0; border-top: 1px solid var(--line); }
  .setup li:first-child { border-top: 0; }
  .legend { display: none; }
}
