/* =========================================================================
   ROBERIX STUDY — main.css
   Tema: preto / cinza-escuro / branco. Visual moderno, tecnológico, limpo.
   ========================================================================= */

:root {
  --bg: #0a0a0a;
  --bg-2: #131313;
  --panel: #1a1a1a;
  --panel-2: #1f1f1f;
  --panel-hi: #262626;
  --line: #2e2e2e;
  --line-2: #3a3a3a;
  --text: #f4f4f4;
  --text-dim: #c8c8c8;
  --text-mute: #8c8c8c;
  --accent: #ffffff;
  --accent-soft: #d9d9d9;
  --good: #c4f5c4;
  --good-bg: #173017;
  --bad: #f5c4c4;
  --bad-bg: #301717;
  --warn: #f5e8c4;
  --warn-bg: #302a17;
  --shadow: 0 8px 28px rgba(0,0,0,.45);
  --radius: 12px;
  --radius-sm: 8px;
  --t-fast: 120ms;
  --t-mid: 220ms;
  --t-slow: 380ms;
  --font: ui-sans-serif, system-ui, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "Fira Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { color-scheme: dark; }

body {
  background:
    radial-gradient(1100px 600px at 80% -10%, #1c1c1c 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #181818 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a { color: var(--accent-soft); text-decoration: none; }
a:hover { color: var(--accent); }

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

/* Layouts comuns ------------------------------------------------------- */

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.screen.center {
  align-items: center;
  justify-content: center;
}

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.lg { gap: 24px; }
.stack.sm { gap: 8px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.spacer { flex: 1; }

/* Header / barra superior --------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10,10,10,.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar .brand {
  font-weight: 700;
  letter-spacing: .12em;
  font-size: 13px;
  color: var(--text);
}
.topbar .brand span { color: var(--text-mute); font-weight: 500; }
.topbar .crumbs { color: var(--text-mute); font-size: 13px; }

/* Painéis e cartões --------------------------------------------------- */

.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.panel.lg { padding: 28px; }
.panel.flat { box-shadow: none; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color var(--t-fast), transform var(--t-fast), background var(--t-fast);
}
.card:hover { border-color: var(--line-2); }
.card.clickable { cursor: pointer; }
.card.clickable:hover { background: var(--panel-2); transform: translateY(-1px); }
.card.locked { opacity: .55; cursor: not-allowed; }
.card.locked:hover { transform: none; background: var(--panel); }

.card .title { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.card .sub { color: var(--text-mute); font-size: .9rem; margin-top: 2px; }
.card .body { margin-top: 12px; color: var(--text-dim); }

.card.world {
  position: relative;
  overflow: hidden;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.card.world::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(140% 80% at 90% 10%, rgba(255,255,255,.05), transparent 60%);
  pointer-events: none;
}
.card.world .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: .12em;
}
.card.world .name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 6px;
}

/* Texto e títulos ----------------------------------------------------- */

h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.9rem; letter-spacing: -.01em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--text-mute);
  text-transform: uppercase;
}
.lead { font-size: 1.08rem; color: var(--text-dim); }

/* Logo ASCII / título grande ------------------------------------------ */

.logo {
  font-family: var(--font-mono);
  letter-spacing: .04em;
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1.05;
  white-space: pre;
  text-shadow: 0 0 24px rgba(255,255,255,.06);
}
.logo .tag {
  display: block;
  font-family: var(--font);
  font-size: .8rem;
  letter-spacing: .35em;
  color: var(--text-mute);
  margin-top: 12px;
}

/* Animações utilitárias ----------------------------------------------- */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 rgba(255,255,255,0); }
  50% { box-shadow: 0 0 22px rgba(255,255,255,.18); }
}
.fadein { animation: fadeUp var(--t-mid) ease both; }
.pulse { animation: pulse 600ms ease both; }
.shake { animation: shake 280ms ease both; }
.glow { animation: glow 1.4s ease infinite; }

/* Reduzir movimento (acessibilidade) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
  }
}

/* Responsivo ---------------------------------------------------------- */

@media (max-width: 800px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .screen { padding: 16px; }
  h1 { font-size: 1.55rem; }
  .panel { padding: 16px; }
}

/* Scrollbar (sutil) --------------------------------------------------- */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #353535; }
