:root {
  --felt: #1b5e3a;
  --felt-dark: #0f3a23;
  --cream: #f7f4ec;
  --gold: #d4a72c;
  --red: #b0312f;
  --ink: #20242b;

  /* --- design-system adapter (added by the design-system refresh) --- */
  --ds-primary: var(--felt);
  --ds-primary-dark: var(--felt-dark);
  --ds-surface: #ffffff;
  --ds-bg: var(--cream);
  --ds-ink: var(--ink);
  --ds-accent: var(--gold);
  --ds-radius: 10px;
  --ds-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --ds-shadow-hover: 0 4px 10px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
}

header {
  background: var(--felt);
  color: var(--cream);
  padding: 1.2rem 1rem;
  text-align: center;
}

header h1 { margin: 0 0 .25rem; font-size: 1.7rem; }
header p { margin: 0; font-size: .95rem; opacity: .9; }

main { max-width: 760px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

.notice {
  background: #fff3cd; border: 1px solid var(--gold); border-radius: 6px;
  padding: .8rem 1rem; margin-bottom: 1.5rem; font-size: .92rem;
}

h2 { color: var(--felt-dark); border-bottom: 2px solid var(--gold); padding-bottom: .3rem; }

.hint { font-size: .9rem; color: #555; font-style: italic; }

.card-slots { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-slot {
  min-width: 4.5rem; min-height: 48px; padding: .9rem .6rem; font-size: 1.2rem; font-weight: bold;
  background: var(--ds-surface, #fff); color: var(--felt-dark);
  border: 2px dashed color-mix(in srgb, var(--ds-primary) 45%, #bbb); border-radius: var(--ds-radius, 10px);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.card-slot:hover { background: #f0f0f0; border-color: var(--gold); box-shadow: var(--ds-shadow); }

.setup-row { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.setup-row label { min-width: 11rem; font-weight: bold; }
.setup-row select, .setup-row input {
  padding: .6rem .6rem; min-height: 44px; border: 1.5px solid color-mix(in srgb, var(--ds-ink) 18%, transparent);
  border-radius: calc(var(--ds-radius, 10px) * .5); font-family: inherit; width: 8rem; font-size: 1rem;
  background: var(--ds-surface, #fff); color: var(--ds-ink); transition: border-color .15s ease;
}
.setup-row select:focus, .setup-row input:focus { outline: none; border-color: var(--ds-primary); }

button {
  background: var(--ds-primary, var(--felt)); color: var(--ds-surface, #fff); border: 1px solid transparent;
  border-radius: var(--ds-radius, 10px); font-weight: 600; min-height: 44px;
  padding: .7rem 1.3rem; font-size: 1rem; cursor: pointer; margin-bottom: .5rem;
  box-shadow: var(--ds-shadow, 0 1px 3px rgba(0,0,0,.08));
  transition: transform .08s ease, box-shadow .15s ease, opacity .15s ease;
}
button:hover { box-shadow: var(--ds-shadow-hover, 0 4px 10px rgba(0,0,0,.1)); transform: translateY(-1px); }
button:active { transform: translateY(0); opacity: .92; }
button.secondary { background: transparent; color: var(--ds-primary, var(--felt)); border-color: var(--ds-primary, var(--felt)); box-shadow: none; }
button.secondary:hover { background: color-mix(in srgb, var(--ds-primary) 8%, transparent); box-shadow: none; }
button:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }

.error-msg { color: var(--red); font-weight: bold; }

.card-picker-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); z-index: 100;
  align-items: center; justify-content: center; padding: 1rem;
}
.card-picker-box {
  background: var(--ds-bg, var(--cream)); border-radius: var(--ds-radius, 10px); padding: 1rem;
  max-width: 95vw; max-height: 90vh; overflow-y: auto; text-align: center;
  box-shadow: var(--ds-shadow-hover, 0 4px 10px rgba(0,0,0,.10));
}
.card-picker-grid { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.picker-row { display: flex; gap: .3rem; justify-content: center; flex-wrap: wrap; }
.picker-card {
  min-width: 2.8rem; min-height: 44px; padding: .5rem .3rem; font-size: 1rem; font-weight: bold;
  background: var(--ds-surface, #fff); color: var(--felt-dark);
  border: 1px solid #ccc; border-radius: calc(var(--ds-radius, 10px) * .6);
  margin-bottom: 0; transition: background .15s ease, box-shadow .15s ease;
}
.picker-card:hover:not(:disabled) { background: var(--ds-accent, var(--gold)); color: #fff; box-shadow: var(--ds-shadow); }
.picker-card-used { opacity: .3; cursor: not-allowed; }
.picker-card-used:hover { background: #fff; }

.picker-heading { font-size: 1.2rem; font-weight: bold; color: var(--felt-dark); margin-bottom: .5rem; }
.picker-row-suits { gap: .75rem; }
.picker-suit {
  min-width: 7rem; padding: 1.2rem 1rem; font-size: 1.3rem; font-weight: bold;
  background: var(--ds-surface, #fff); color: var(--felt-dark);
  border: 2px solid var(--ds-primary, var(--felt)); border-radius: var(--ds-radius, 10px);
  transition: background .15s ease, box-shadow .15s ease;
}
.picker-suit:hover { background: var(--ds-primary, var(--felt)); color: #fff; box-shadow: var(--ds-shadow); }
.picker-row-ranks .picker-card { min-width: 3.2rem; padding: .9rem .5rem; font-size: 1.3rem; }

.results {
  background: var(--ds-surface, #fff); border: 1px solid transparent;
  border-radius: var(--ds-radius, 10px); box-shadow: var(--ds-shadow, 0 1px 3px rgba(0,0,0,.08));
  padding: 1.2rem; margin-top: 1.5rem;
}
.hand-summary { font-weight: bold; margin-bottom: .75rem; }
.equity-row { display: flex; justify-content: space-between; max-width: 12rem; padding: .2rem 0; }
.equity-label { font-weight: bold; }
.equity-total { font-size: 1.2rem; font-weight: bold; color: var(--felt-dark); margin: .75rem 0; }
.recommendation {
  background: var(--ds-bg, var(--cream)); border-left: 4px solid var(--ds-accent, var(--gold));
  padding: .75rem 1rem; margin: .75rem 0; border-radius: var(--ds-radius, 10px);
}
.recommendation strong { color: var(--felt-dark); font-size: 1.1rem; }
.disclaimer { font-size: .82rem; color: #666; font-style: italic; }

.rules { margin-top: 2rem; }
.rules ol { padding-left: 1.3rem; }

@media (max-width: 480px) {
  .setup-row label { min-width: 100%; }
  .setup-row select, .setup-row input { width: 100%; }
}
