/* Colours lifted from Balatro's own UI: felt table, slate panels, chips blue, mult red, money gold. */
:root {
  color-scheme: dark;
  --felt: #1d3532;
  --felt-dot: #25413d;
  --panel: #374244;
  --panel-inset: #2b3437;
  --panel-edge: #1a2124;
  --slate: #4f6367;
  --slate-edge: #33403f;
  --text: #ffffff;
  --muted: #b9c4c4;
  --red: #fe5f55;
  --red-edge: #a8352f;
  --blue: #009dff;
  --blue-edge: #005f9e;
  --gold: #f3b958;
  --gold-edge: #a2742a;
  --pixel: 'Pixelify Sans', ui-monospace, monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace;
  --radius: 10px;
  --drop: 0 4px 0 var(--panel-edge);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--felt);
  background-image: radial-gradient(var(--felt-dot) 1px, transparent 1px);
  background-size: 6px 6px;
  color: var(--text);
  font: 16px/1.55 var(--sans);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--gold);
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

code {
  font: 0.88em var(--mono);
  background: var(--panel-inset);
  padding: 1px 5px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
.hand-name,
.pill,
.btn,
.brand {
  font-family: var(--pixel);
  font-weight: 500;
  letter-spacing: 0.02em;
}

h1,
h2,
h3 {
  line-height: 1.15;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45);
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
}

h2 {
  margin: 0 0 16px;
  font-size: clamp(1.6rem, 4vw, 2rem);
}

h3 {
  margin: 28px 0 8px;
  font-size: 1.3rem;
}

p {
  margin: 0 0 14px;
}

.muted {
  color: var(--muted);
  font-weight: 500;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: 16px;
}

main > section {
  margin-top: 64px;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--drop);
}

/* ---- buttons: flat, hard bottom edge, press down like the game ---- */

.btn {
  display: inline-block;
  padding: 12px 22px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 1.15rem;
  text-decoration: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 0 var(--edge);
  position: relative;
  top: 0;
}

.btn:active {
  top: 4px;
  box-shadow: 0 0 0 var(--edge);
}

.btn-red {
  background: var(--red);
  --edge: var(--red-edge);
}

.btn-grey {
  background: var(--slate);
  --edge: var(--slate-edge);
}

.btn-sm {
  padding: 6px 14px 4px;
  font-size: 1rem;
}

/* ---- top bar ---- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
}

.topbar-links {
  display: flex;
  gap: 10px;
  flex: none;
}

/* Phones: icon-only brand so the two buttons fit on one row. */
@media (max-width: 460px) {
  .brand span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.2rem;
}

/* ---- hero ---- */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: center;
  margin-top: 40px;
}

.lead {
  margin: 16px 0 24px;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 34em;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.meta {
  margin: 16px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.shot {
  margin: 0;
  padding: 8px;
  background: var(--panel-inset);
  border-radius: var(--radius);
  box-shadow: var(--drop);
}

.shot img {
  border-radius: 4px;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1fr 1.25fr;
    margin-top: 56px;
  }
}

/* ---- "poker hands" table ---- */

.hands {
  padding: 8px;
  display: grid;
  gap: 8px;
}

.hand {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 20px;
  align-items: center;
  padding: 14px 16px;
  background: var(--panel-inset);
  border-radius: 8px;
}

.hand p {
  margin: 0;
  color: var(--muted);
}

.hand-name {
  font-size: 1.25rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

@media (min-width: 760px) {
  .hand {
    grid-template-columns: 170px 1fr auto;
  }

  .chips {
    margin-top: 0;
    justify-content: flex-end;
  }
}

.pill {
  display: inline-block;
  min-width: 3.5em;
  padding: 3px 10px 1px;
  border-radius: 6px;
  text-align: center;
  font-size: 1.05rem;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  background: var(--bg);
  box-shadow: 0 3px 0 var(--edge);
  white-space: nowrap;
}

.pill.red { --bg: var(--red); --edge: var(--red-edge); }
.pill.blue { --bg: var(--blue); --edge: var(--blue-edge); }
.pill.gold { --bg: var(--gold); --edge: var(--gold-edge); color: #3b2a0c; text-shadow: none; }
.pill.grey { --bg: var(--slate); --edge: var(--slate-edge); }
.pill.strike { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }
.pill.ed-foil { --bg: #6c8fb0; --edge: #445d75; }
.pill.ed-holo { --bg: #c45a84; --edge: #803a56; }
.pill.ed-poly { --bg: #7a63c7; --edge: #4d3d82; }
.pill.ed-neg { --bg: #1b1b22; --edge: #000000; color: #d9d0ff; }

.x {
  font-family: var(--pixel);
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--muted);
  padding: 0 2px;
}

/* ---- split section ---- */

.split {
  display: grid;
  gap: 36px;
  align-items: start;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 7fr 5fr;
  }
}

.split > div > p {
  color: var(--muted);
}

.safe {
  padding: 14px 18px 4px;
  margin-top: 14px;
}

.safe h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.safe p {
  color: var(--muted);
}

/* ---- downloads ---- */

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

.dl {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.dl th,
.dl td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
}

.dl th {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--panel-inset);
}

.dl th:first-child { border-top-left-radius: var(--radius); }
.dl th:last-child { border-top-right-radius: var(--radius); }

.dl tbody tr + tr td {
  border-top: 1px solid var(--panel-inset);
}

.dl td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

.dl .file {
  font: 0.9rem var(--mono);
  overflow-wrap: break-word;
}

.dl .size,
.dl .arch {
  color: var(--muted);
  font-weight: 400;
}

.dl .size {
  font-family: var(--sans);
  font-size: 0.85rem;
  white-space: nowrap;
}

.dl .fallback {
  text-align: center;
}

.dl tr.mine td {
  background: rgba(255, 255, 255, 0.04);
}

/* Phones: one stacked block per platform instead of a sideways-scrolling table. */
@media (max-width: 640px) {
  .dl {
    min-width: 0;
  }

  .dl thead {
    display: none;
  }

  .dl tbody,
  .dl tr {
    display: block;
  }

  .dl tr {
    padding: 12px 16px;
  }

  .dl tbody tr + tr {
    border-top: 1px solid var(--panel-inset);
  }

  .dl td,
  .dl tbody tr + tr td {
    display: inline;
    padding: 0;
    border: 0;
  }

  .dl tr.mine td {
    background: none;
  }

  .dl td:first-child,
  .dl td:nth-child(2) {
    display: block;
    margin-bottom: 6px;
  }

  .dl td:nth-child(3) {
    margin-right: 16px;
  }

  .dl .fallback {
    display: block;
    text-align: left;
  }

  .dl tr.mine {
    background: rgba(255, 255, 255, 0.04);
  }
}

.paths {
  margin: 12px 0 0;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px 20px;
}

.paths dt {
  font-weight: 600;
  margin-top: 8px;
}

.paths dt:first-child {
  margin-top: 0;
}

.paths dd {
  margin: 0;
  color: var(--muted);
}

@media (min-width: 700px) {
  .paths {
    grid-template-columns: max-content 1fr;
    align-items: baseline;
  }

  .paths dt {
    margin-top: 0;
  }
}

#download > p {
  color: var(--muted);
}

#download > .note {
  margin-top: 14px;
  font-size: 0.9rem;
}

/* ---- guide pages ---- */

.guide-intro {
  margin-top: 40px;
}

.crumbs {
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.guide h1 {
  font-size: clamp(2rem, 6vw, 3rem);
}

.guide .lead {
  max-width: 42em;
}

.guide .note {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.steps {
  display: grid;
  gap: 14px;
}

@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }
}

.step {
  padding: 16px 18px 4px;
}

.step h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.step p {
  color: var(--muted);
}

kbd {
  font: 0.85em var(--mono);
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--slate);
  box-shadow: 0 2px 0 var(--slate-edge);
}

.cta-panel {
  padding: 22px 24px 24px;
}

.cta-panel h2 {
  margin-bottom: 10px;
}

.cta-panel p {
  color: var(--muted);
  max-width: 44em;
}

/* ---- faq ---- */

.faq details {
  margin-bottom: 12px;
}

.faq summary {
  padding: 14px 18px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  font-family: var(--pixel);
  font-size: 1.3rem;
  line-height: 1;
  color: var(--gold);
}

.faq details[open] summary::after {
  content: '−';
}

.faq details p {
  padding: 0 18px 4px;
  color: var(--muted);
}

/* ---- footer ---- */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 72px;
  padding-top: 20px;
  padding-bottom: 32px;
  border-top: 2px solid var(--felt-dot);
  font-size: 0.9rem;
  color: var(--muted);
}
