:root {
  color-scheme: light;
  --ink: #19232c;
  --line: #cbd5df;
  --paper: #eef4f3;
  --panel: #ffffff;
  --green: #257a5a;
  --gold: #c79422;
  --muted: #5a7080;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at top, #f9fcfb 0, var(--paper) 52%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.store {
  width: min(760px, calc(100vw - 28px));
  margin: 22px auto;
  padding: clamp(14px, 2.4vw, 24px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.store-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 1.8rem);
}

.money-line {
  margin: 0;
  color: var(--green);
  font-weight: 800;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.item-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 214px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fbfefd;
}

.item-preview {
  position: relative;
  width: 100%;
  height: 72px;
  border: 1px solid #dfe8e4;
  border-radius: 10px;
  background: #f1f7f5;
  overflow: hidden;
}

.preview-train::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 22px;
  height: 28px;
  border: 3px solid #1f2c38;
  border-radius: 8px;
  background:
    linear-gradient(90deg, #f7d56f 0 30%, #ffffff 30% 36%, #88b6df 36% 70%, #ffffff 70% 76%, #de7d8b 76% 100%);
}

.preview-train::after {
  content: "";
  position: absolute;
  left: 30px;
  bottom: 9px;
  width: 14px;
  height: 14px;
  border: 3px solid #1f2c38;
  border-radius: 50%;
  background: #5c6f7d;
  box-shadow: 44px 0 0 #5c6f7d, 44px 0 0 0 3px #1f2c38;
}

.preview-mobile::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 10px;
  width: 4px;
  height: 36px;
  margin-left: -2px;
  border-radius: 9px;
  background: #5d7080;
}

.preview-mobile::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 42px;
  width: 56px;
  height: 24px;
  margin-left: -28px;
  background:
    radial-gradient(circle at 10px 10px, #ffd973 0 8px, transparent 9px),
    radial-gradient(circle at 28px 14px, #8fbce2 0 9px, transparent 10px),
    radial-gradient(circle at 46px 10px, #de7d8b 0 8px, transparent 9px);
}

.preview-blanket::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 20px;
  height: 34px;
  border: 3px solid #1f2c38;
  border-radius: 10px;
  background:
    linear-gradient(135deg, #f9ccd9 0 22%, #ffffff 22% 30%, #a5cae8 30% 52%, #ffffff 52% 60%, #f7d67c 60% 100%);
  transform: rotate(-4deg);
}

.preview-speedy::before,
.preview-speedy::after {
  content: "";
  position: absolute;
  top: 28px;
  width: 32px;
  height: 18px;
  border: 3px solid #1f2c38;
  border-radius: 10px 14px 8px 10px;
  background: #8fbce2;
}

.preview-speedy::before {
  left: 20px;
}

.preview-speedy::after {
  right: 20px;
}

.preview-warm-bottle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  width: 34px;
  height: 46px;
  margin-left: -17px;
  border: 3px solid #1f2c38;
  border-radius: 12px 12px 14px 14px;
  background:
    linear-gradient(180deg, #ffffff 0 18%, #f6dfb2 18% 100%);
}

.preview-warm-bottle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: 20px;
  height: 18px;
  margin-left: -10px;
  border: 3px solid #1f2c38;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background:
    radial-gradient(circle at 5px 2px, #ffffff 0 3px, transparent 4px),
    radial-gradient(circle at 15px 2px, #ffffff 0 3px, transparent 4px),
    #f7f1e3;
}

.preview-auto-feeder::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 13px;
  width: 58px;
  height: 46px;
  margin-left: -29px;
  border: 3px solid #1f2c38;
  border-radius: 12px 12px 16px 16px;
  background:
    linear-gradient(180deg, transparent 0 20%, #f6df8d 20% 100%),
    #ffffff;
}

.preview-auto-feeder::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 76px;
  height: 16px;
  margin-left: -38px;
  border: 3px solid #1f2c38;
  border-radius: 14px;
  background: #8fbce2;
}

.preview-name-change::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 14px;
  bottom: 14px;
  border: 3px solid #1f2c38;
  border-radius: 8px;
  background: #ffffff;
}

.preview-name-change::after {
  content: "Aa";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #2b62a3;
  font: 800 1.35rem "Courier New", Courier, monospace;
  letter-spacing: 0.04em;
}

.preview-another-baby::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  width: 50px;
  height: 50px;
  margin-left: -25px;
  border: 3px solid #1f2c38;
  border-radius: 50% 50% 14px 14px;
  background:
    radial-gradient(circle at 24px 8px, #2e2119 0 6px, transparent 7px),
    radial-gradient(circle at 18px 18px, #2e2119 0 2px, transparent 3px),
    radial-gradient(circle at 32px 18px, #2e2119 0 2px, transparent 3px),
    radial-gradient(circle at 25px 30px, #f08ca0 0 3px, transparent 4px),
    #ffd9c7;
}

.preview-another-baby::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 56px;
  height: 24px;
  margin-left: -28px;
  border: 3px solid #1f2c38;
  border-radius: 14px;
  background:
    linear-gradient(90deg, #9bc9ea 0 50%, #84b4da 50% 100%);
}

.preview-new-family::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 14px;
  bottom: 14px;
  border: 3px solid #1f2c38;
  border-radius: 8px;
  background:
    radial-gradient(circle at 24px 22px, #ffd9c7 0 8px, transparent 9px),
    radial-gradient(circle at 48px 22px, #ffd9c7 0 8px, transparent 9px),
    radial-gradient(circle at 72px 22px, #ffd9c7 0 8px, transparent 9px),
    linear-gradient(90deg, #b8d8ef 0 100%);
}

.preview-new-family::after {
  content: ">>";
  position: absolute;
  right: 20px;
  bottom: 8px;
  color: #257a5a;
  font: 800 1.4rem Arial, Helvetica, sans-serif;
}

.item-card h2 {
  margin: 0;
  font-size: 1.12rem;
}

.item-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.3;
  font-size: 0.95rem;
}

.item-cost {
  margin: 0;
  color: var(--gold);
  font-weight: 800;
}

.buy-btn {
  min-height: 42px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  cursor: pointer;
  font: 800 1rem Arial, Helvetica, sans-serif;
}

.buy-btn:disabled {
  background: #dde6e3;
  border-color: #c8d3ce;
  color: #70827a;
  cursor: not-allowed;
}

.status-text {
  min-height: 1.3em;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.item-card.owned .status-text {
  color: var(--green);
}

.item-card.blocked .status-text {
  color: #8f4b3a;
}

.back-link {
  display: inline-block;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.picker-dialog {
  border: none;
  padding: 0;
  background: transparent;
}

.picker-dialog::backdrop {
  background: rgb(10 22 30 / 45%);
}

.picker-card {
  width: min(430px, calc(100vw - 30px));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #ffffff;
}

.picker-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.picker-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.picker-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.picker-choice {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfa;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font: 700 0.95rem Arial, Helvetica, sans-serif;
  padding: 10px 12px;
}

.picker-choice:hover {
  border-color: #8fb9a7;
  background: #eef8f4;
}

.picker-cancel {
  min-height: 40px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f8f6;
  color: var(--ink);
  cursor: pointer;
  font: 700 0.95rem Arial, Helvetica, sans-serif;
}

@media (max-width: 700px) {
  .item-grid {
    grid-template-columns: 1fr;
  }
}
