:root {
  --bg-deep: #0b2230;
  --bg-mid: #16475c;
  --text: #f8f4eb;
  --muted: rgba(248, 244, 235, 0.8);
  --panel: rgba(11, 28, 37, 0.42);
  --panel-soft: rgba(248, 242, 230, 0.94);
  --felt: #1f6a4f;
  --felt-dark: #154637;
  --gold: #cf9a43;
  --red: #b04d3c;
  --shadow: 0 20px 54px rgba(6, 12, 16, 0.26);
  --card-width: 92px;
  --card-height: 124px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(207, 154, 67, 0.16), transparent 24%),
    radial-gradient(circle at 82% 10%, rgba(72, 170, 132, 0.18), transparent 26%),
    linear-gradient(155deg, var(--bg-deep), var(--bg-mid));
}

.solo-app {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.solo-topbar,
.solo-controls,
.solo-board-panel,
.help-card {
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.solo-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(10, 26, 35, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.solo-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.solo-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
}

.solo-brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), var(--red));
  color: #1d150e;
  font-weight: 900;
}

.solo-brand-copy {
  display: grid;
  gap: 2px;
}

.solo-brand-copy span {
  color: var(--muted);
}

.solo-return,
.solo-support,
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.solo-return,
.solo-support,
.action-button.primary {
  background: linear-gradient(135deg, var(--gold), #f0c274);
  color: #16212a;
}

.solo-support {
  background: linear-gradient(135deg, #ffdc42, #f0b90a);
}

.action-button {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
}

.action-button:hover,
.action-button:focus-visible,
.solo-return:hover,
.solo-return:focus-visible {
  transform: translateY(-1px);
}

.action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.solo-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(380px, 1.08fr);
  gap: 22px;
  align-items: start;
  padding: 30px 0 20px;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.77rem;
  font-weight: 700;
  color: rgba(248, 244, 235, 0.68);
}

.solo-copy h1,
.solo-status h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
}

.solo-copy h1 {
  margin: 0 0 16px;
  max-width: 11ch;
  font-size: clamp(2.3rem, 4.8vw, 4.2rem);
  line-height: 0.95;
}

.solo-copy p {
  margin: 0;
  max-width: 56ch;
  color: var(--muted);
  line-height: 1.65;
}

.solo-controls {
  padding: 20px;
  background: rgba(248, 242, 230, 0.92);
  border: 1px solid rgba(34, 47, 55, 0.08);
  color: #1c2529;
}

.solo-status h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.9rem);
  line-height: 1.1;
}

.solo-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.metric-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
}

.metric-card span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #586568;
}

.metric-card strong {
  font-size: 1.45rem;
}

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

.solo-board-panel {
  padding: 22px;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.12), transparent 18%),
    linear-gradient(145deg, rgba(32, 110, 81, 0.96), rgba(19, 73, 56, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.board-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.draw-area,
.foundation-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.pile-button,
.foundation-slot {
  width: var(--card-width);
  min-width: var(--card-width);
  height: var(--card-height);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  position: relative;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(4, 10, 12, 0.2);
}

.pile-button.empty,
.foundation-slot:not(.occupied) {
  border-style: dashed;
}

.pile-button .pile-back,
.card-back-mark {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 42%),
    linear-gradient(145deg, #d56240, #a53822);
  color: #f8f4eb;
  font-weight: 900;
}

.pile-counter {
  position: absolute;
  right: 10px;
  bottom: 10px;
  min-width: 28px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 28, 37, 0.74);
  color: #f8f4eb;
  font-size: 0.85rem;
  font-weight: 800;
}

.pile-recycle,
.pile-placeholder,
.foundation-symbol {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-weight: 800;
  color: rgba(248, 244, 235, 0.64);
}

.foundation-symbol.red {
  color: rgba(248, 214, 214, 0.8);
}

.foundation-symbol.black {
  color: rgba(248, 244, 235, 0.75);
}

.pile-card,
.tableau-card {
  width: var(--card-width);
  height: var(--card-height);
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(145deg, #fcf8ee, #fffdf8);
  color: #1d252a;
  padding: 0;
  position: relative;
  box-shadow: 0 14px 28px rgba(4, 10, 12, 0.22);
  cursor: pointer;
}

.pile-card.back,
.tableau-card.back {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
}

.pile-card.red,
.tableau-card.red {
  color: var(--red);
}

.card-content {
  width: 100%;
  height: 100%;
  position: relative;
  padding: 10px;
  display: grid;
  place-items: center;
}

.card-corner {
  position: absolute;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
}

.card-corner-top {
  top: 10px;
  left: 10px;
}

.card-corner-bottom {
  right: 10px;
  bottom: 10px;
  transform: rotate(180deg);
}

.card-suit-mark {
  font-size: 2.3rem;
}

.selected-card {
  box-shadow:
    0 0 0 5px rgba(207, 154, 67, 0.22),
    0 18px 34px rgba(4, 10, 12, 0.26);
}

.tableau-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(var(--card-width), 1fr));
  gap: 14px;
}

.tableau-column {
  position: relative;
  min-width: var(--card-width);
}

.tableau-target {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.tableau-target.empty-column {
  background: rgba(255, 255, 255, 0.08);
}

.tableau-card {
  position: absolute;
  left: 0;
  z-index: 2;
}

.solo-help {
  margin-top: 18px;
}

.help-card {
  padding: 18px 20px;
  background: rgba(10, 26, 35, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.help-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
  display: grid;
  gap: 10px;
}

@media (max-width: 1080px) {
  .solo-hero {
    grid-template-columns: 1fr;
  }

  .board-top {
    flex-direction: column;
  }
}

@media (max-width: 860px) {
  :root {
    --card-width: 76px;
    --card-height: 104px;
  }

  .solo-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tableau-board {
    gap: 10px;
  }
}

@media (max-width: 720px) {
  .solo-app {
    width: min(100% - 20px, 900px);
    padding: 20px 0 34px;
  }

  .solo-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .solo-topbar-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .solo-copy h1 {
    max-width: none;
  }

  .solo-metrics {
    grid-template-columns: 1fr;
  }

  .control-row {
    flex-direction: column;
  }

  .action-button,
  .solo-return,
  .solo-support {
    width: 100%;
  }

  .solo-board-panel {
    overflow-x: auto;
  }
}

@media (max-width: 560px) {
  :root {
    --card-width: 68px;
    --card-height: 92px;
  }

  .card-corner {
    font-size: 0.82rem;
  }

  .card-suit-mark {
    font-size: 1.85rem;
  }

  .draw-area,
  .foundation-row,
  .tableau-board {
    width: max-content;
  }
}
