:root {
  color-scheme: light dark;
  --bg: #0b1726;
  --card-bg: #1f2f46;
  --card-border: #d0d6e0;
  --accent: #f8d34f;
  --text: #f1f5f9;
  --muted: #8ca0c0;
  --focus: #ffffff;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #13223a, var(--bg));
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app-header,
.app-footer {
  background: rgba(10, 20, 35, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-footer {
  border-bottom: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem clamp(1rem, 5vw, 3rem);
}

.header-links {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-links a,
.app-footer a {
  color: var(--accent);
  text-decoration: none;
}

.header-links a:hover,
.header-links a:focus {
  text-decoration: underline;
}

#app-root {
  flex: 1;
  padding: clamp(1rem, 5vw, 3rem);
  display: flex;
  justify-content: center;
}

.legal-page {
  margin: 0 auto;
  padding: clamp(1.5rem, 6vw, 4rem);
  max-width: 720px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.legal-page a {
  color: var(--accent);
}

.board-container {
  width: min(1100px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.board-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.board-controls button,
.board-controls select {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.5rem;
  padding: 0.65rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.board-controls button:hover,
.board-controls button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.board-controls select {
  cursor: default;
}

.board-controls button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: clamp(0.4rem, 1.5vw, 1rem);
}

.column {
  background: rgba(17, 31, 55, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 0.5rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
}

.column:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card {
  background: var(--card-bg);
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.45rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.card.is-face-down {
  background: repeating-linear-gradient(
    45deg,
    #162845,
    #162845 6px,
    #1b3659 6px,
    #1b3659 12px
  );
  border-color: rgba(255, 255, 255, 0.05);
  color: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.card.is-selected {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card.is-movable {
  border-color: var(--accent);
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card .rank {
  font-size: 1.1rem;
}

.card .suit {
  font-size: 0.85rem;
  color: var(--accent);
}

.empty-slot {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 0.65rem;
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  .header-content {
    flex-direction: column;
    gap: 0.75rem;
  }

  .board-controls {
    flex-direction: column;
    align-items: stretch;
  }
}
