/* Visual inspirado no Steamworks (partner.steamgames.com) e na loja da Steam. */
:root {
  color-scheme: dark;
  --background: #1b1c20;
  --surface: #212328;
  --surface-raised: #2a2d33;
  --field: #111215;
  --line: #3a3d44;
  --line-soft: #2e3137;
  --bar: #3d4450;
  --bar-dark: #262a31;
  --ink: #ebebeb;
  --muted: #8f98a0;
  --soft: #b8bcbf;
  --accent: #66c0f4;
  --accent-line: #4c8fd0;
  --store-blue: #1b2838;
  --store-blue-light: #2a475e;
  --green: #a4d007;
  --green-bg: #4c6b22;
  --danger: #ff8a80;
  --danger-bg: #3d1d20;
  font-family: "Motiva Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
label,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
.file-label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

/* Cabeçalho: barra preta + barra de navegação, como no Steamworks */

.topbar {
  background: #000;
}

.header-content {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
  color: #fff;
  text-decoration: none;
}

.brand-name {
  padding-top: 8px;
  font-size: 19px;
  font-weight: 300;
  letter-spacing: 0.16em;
  line-height: 1;
}

.brand-name strong {
  font-weight: 700;
}

.brand-mark {
  width: 26px;
  height: 17px;
  fill: #fff;
}

.header-tag {
  padding: 2px 8px;
  border: 1px solid #fff;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.subnav {
  background: var(--bar);
  border-bottom: 1px solid #2c3139;
}

.tabs {
  display: flex;
  overflow-x: auto;
}

.tab {
  min-height: 58px;
  padding: 0 24px;
  border: 0;
  background: transparent;
  color: #e5e5e5;
  cursor: pointer;
  font-size: 16px;
  white-space: nowrap;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.tab[aria-selected="true"] {
  background: #5d6676;
  color: #dfe3e6;
}

/* Título da página */

.page-heading {
  margin: 40px 0 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--accent-line);
}

.page-heading h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.2;
}

.page-heading p {
  margin: 4px 0 0;
  color: var(--soft);
  font-size: 22px;
  font-weight: 300;
  line-height: 1.3;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.message {
  margin-bottom: 20px;
  padding: 12px 16px;
  border: 1px solid #7a2e33;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 14px;
}

.message.success {
  border-color: #6a8f2c;
  background: var(--green-bg);
  color: #e3f5c4;
}

/* Layout */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.tool-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.panel {
  padding: 0 20px 20px;
  border: 1px solid var(--line);
  background: var(--surface);
}

/* Barra de título das seções, como "EVENT RECAP" no Steamworks */

.section-heading {
  display: flex;
  align-items: stretch;
  min-height: 38px;
  margin: 0 -20px 16px;
  background: var(--bar);
}

.step {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  min-width: 38px;
  background: var(--bar-dark);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.section-heading h2 {
  align-self: center;
  margin: 0;
  padding: 6px 14px;
  color: #dfe3e6;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.section-description {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

/* Botões */

.button {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  font-size: 15px;
  transition: background 120ms ease, filter 120ms ease;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.button.primary {
  width: 100%;
  min-height: 46px;
  background: linear-gradient(90deg, #06bfff 0%, #2d73ff 100%);
  color: #fff;
  font-size: 16px;
}

.button.primary:hover:not(:disabled) {
  filter: brightness(1.15);
}

.button.secondary {
  flex: 0 0 auto;
  border-color: #c6c6c6;
  background: transparent;
  color: #fff;
  font-size: 14px;
}

.button.secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

/* Campos */

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--soft);
  font-size: 13px;
}

.field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.optional {
  color: var(--muted);
}

.input-with-prefix,
.input-with-suffix,
.partner-row input,
.report-field select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--field);
  color: var(--ink);
}

.input-with-prefix,
.input-with-suffix {
  display: flex;
  align-items: center;
  overflow: hidden;
}

.input-with-prefix:focus-within,
.input-with-suffix:focus-within,
.partner-row input:focus,
.report-field select:focus {
  border-color: var(--accent);
}

.input-with-prefix > span {
  padding-left: 10px;
  color: var(--muted);
  font-size: 13px;
}

.input-with-suffix > span {
  padding-right: 10px;
  color: var(--muted);
  font-size: 13px;
}

.input-with-prefix input,
.input-with-suffix input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.input-with-prefix input {
  padding-left: 6px;
}

input::placeholder {
  color: #5f656c;
  font-style: italic;
}

/* Envio de relatórios */

#report-files {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.upload-controls {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.file-label {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--field);
  cursor: pointer;
  font-size: 14px;
}

.file-label:hover {
  border-color: var(--accent);
}

.file-action {
  flex: 0 0 auto;
  padding: 5px 12px;
  background: var(--bar);
  color: #fff;
}

#file-selection {
  overflow: hidden;
  color: var(--muted);
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history {
  margin-top: 18px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.history p {
  margin: 0;
}

.history-summary {
  font-size: 14px;
}

/* Meses como as etiquetas "GAME"/"DEMO" do Steamworks */
.month-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.month-list span {
  padding: 2px 8px;
  border-radius: 2px;
  background: #4a6a8a;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.coverage {
  margin-top: 12px !important;
  color: var(--muted);
  font-size: 12px;
}

.exchange-field {
  max-width: 360px;
  margin-bottom: 24px;
}

.exchange-controls {
  display: flex;
  gap: 8px;
}

.exchange-controls .input-with-prefix {
  flex: 1;
}

.report-field {
  max-width: 360px;
  margin-bottom: 20px;
}

.report-field select {
  width: 100%;
  padding: 8px 10px;
}

.received-field {
  max-width: 360px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.money-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.money-hint {
  grid-column: 1 / -1;
  margin-top: -6px;
  color: var(--muted);
  font-size: 12px;
}

.form-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Sócios */

.shares-panel {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.partner-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.partner-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 6px;
}

.partner-row input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  outline: 0;
}

.icon-button {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface-raised);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.icon-button:hover {
  border-color: #7a2e33;
  color: var(--danger);
}

.add-partner {
  width: 100%;
}

.share-fields {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.share-fields > p {
  margin: 0;
}

.game-shares {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.game-shares h3 {
  margin: 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

.share-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  column-gap: 12px;
}

.share-row label {
  overflow: hidden;
  color: var(--soft);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-total {
  color: var(--green);
  font-size: 12px;
}

.share-total.incomplete,
.partners-status.error {
  color: var(--danger);
}

.partners-status {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.partners-status:empty {
  display: none;
}

/* Resultados */

.results {
  margin-top: 20px;
  scroll-margin-top: 20px;
}

.split-status {
  margin: 0;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.results-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 16px;
}

.results-heading h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
}

.results-heading .muted {
  margin: 0;
  text-align: right;
}

/* Cartões no estilo dos números "TOTAL PLAYERS" do Steamworks */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.summary-card {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.summary-card p {
  order: 2;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.summary-card strong {
  order: 1;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.summary-card > span {
  order: 3;
  margin-top: 2px;
  color: var(--soft);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.summary-card > span:empty {
  display: none;
}

/* Sócios em azul da loja, como os cartões do calendário */
.partner-card {
  border-color: #3a6185;
  background: linear-gradient(160deg, var(--store-blue-light) 0%, var(--store-blue) 100%);
}

.partner-card p {
  color: var(--accent);
}

.range-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 12px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.range-panel span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.range-panel strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.range-panel p {
  max-width: 280px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.table-panel {
  margin-top: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.table-panel h3 {
  margin: 0;
  padding: 8px 14px;
  background: var(--bar);
  color: #dfe3e6;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
}

th:first-child,
td:first-child {
  text-align: left;
}

thead th {
  background: var(--bar-dark);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

tbody th {
  color: #fff;
  font-weight: 500;
}

tbody tr:hover {
  background: rgba(102, 192, 244, 0.06);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

/* Login */

.subnav-empty {
  min-height: 12px;
}

.login-main {
  display: grid;
  place-items: center;
  padding: 64px 0 24px;
}

.login-panel {
  width: min(100%, 400px);
}

.login-panel .section-heading h1 {
  align-self: center;
  margin: 0;
  padding: 6px 14px;
  color: #dfe3e6;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

/* Rótulos azuis em caixa alta, como no login da Steam */
.login-panel .field label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-panel .field + .field {
  margin-top: 16px;
}

.login-panel .button.primary {
  margin-top: 24px;
}

.reveal-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  align-self: stretch;
  width: 42px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line-soft);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.reveal-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.reveal-button:focus-visible {
  outline-offset: -2px;
}

.reveal-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reveal-button[aria-pressed="true"] .icon-show,
.reveal-button[aria-pressed="false"] .icon-hide {
  display: none;
}

/* O botão de olho já faz isso; evita dois olhos no Edge. */
input::-ms-reveal {
  display: none;
}

.site-footer {
  margin-top: 40px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .shares-panel {
    position: static;
    order: -1;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 600px) {
  .container {
    width: calc(100% - 32px);
  }

  .header-content {
    min-height: 60px;
  }

  .header-tag {
    display: none;
  }

  .tab {
    flex: 1;
    min-height: 48px;
    padding-inline: 12px;
    font-size: 14px;
  }

  .page-heading {
    margin-top: 28px;
  }

  .page-heading h1 {
    font-size: 26px;
  }

  .page-heading p {
    font-size: 17px;
  }

  .panel {
    padding: 0 16px 16px;
  }

  .section-heading {
    margin-inline: -16px;
  }

  .upload-controls {
    flex-direction: column;
  }

  .money-grid {
    grid-template-columns: 1fr;
  }

  .results {
    margin-top: 32px;
  }

  .results-heading,
  .range-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .results-heading .muted,
  .range-panel p {
    text-align: left;
  }
}
