:root {
  --ink: #3b3340;
  --sub: #8a7f8c;
  --pink: #f3b9c8;
  --pink-d: #e28aa3;
  --cream: #fbf6ef;
  --line: rgba(59, 51, 64, .12);
  --serif: "Cormorant Garamond", "Didot", "Times New Roman", serif;
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--cream); color: var(--ink); font-family: var(--sans); -webkit-tap-highlight-color: transparent; }
canvas#c { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; touch-action: none; outline: none; }
button { font: inherit; color: inherit; }

.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  background: rgba(251, 246, 239, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo { height: 18px; width: auto; display: block; }
.tag { font-family: var(--serif); font-size: 15px; letter-spacing: .18em; color: var(--sub); }
.cart-btn {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; cursor: pointer; font-size: 13px;
}
.cart-btn b { min-width: 20px; height: 20px; border-radius: 10px; background: var(--pink-d); color: #fff; font-size: 12px; display: grid; place-items: center; padding: 0 6px; }
.cart-btn.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.12); } }

.aisles {
  position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 12px); z-index: 5;
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 0 12px; pointer-events: none;
}
.aisles button {
  pointer-events: auto; cursor: pointer;
  display: flex; align-items: baseline; gap: 6px;
  background: rgba(255, 255, 255, .9); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
  font-size: 12px; box-shadow: 0 6px 18px rgba(59, 51, 64, .08);
}
.aisles button i { font-style: normal; font-family: var(--serif); font-size: 15px; color: var(--pink-d); }
.aisles button.on { background: var(--ink); color: #fff; }
.aisles button.on i { color: var(--pink); }

.hint {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 64px); transform: translateX(-50%); z-index: 4;
  background: rgba(59, 51, 64, .78); color: #fff; font-size: 12px; padding: 7px 14px; border-radius: 999px;
  white-space: nowrap; transition: opacity .6s; pointer-events: none;
}
.hint.off { opacity: 0; }

.joy {
  position: fixed; left: 22px; bottom: calc(env(safe-area-inset-bottom) + 70px); z-index: 5;
  width: 112px; height: 112px; border-radius: 50%;
  background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .9); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: none; touch-action: none;
}
.joy .knob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: #fff; box-shadow: 0 4px 12px rgba(59, 51, 64, .18); }
@media (pointer: coarse) { .joy { display: block; } }

.panel {
  position: fixed; z-index: 8; right: 16px; top: calc(env(safe-area-inset-top) + 70px);
  width: min(340px, calc(100vw - 32px)); max-height: calc(100dvh - 150px); overflow: auto;
  background: #fff; border-radius: 20px; box-shadow: 0 20px 60px rgba(59, 51, 64, .22);
  animation: pop .25s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.panel img { width: 100%; aspect-ratio: 1; max-height: 34dvh; object-fit: cover; display: block; border-radius: 20px 20px 0 0; background: var(--cream); }
.p-body { padding: 16px 18px 18px; }
.p-aisle { margin: 0; font-family: var(--serif); letter-spacing: .14em; color: var(--pink-d); font-size: 14px; }
.panel h2 { margin: 4px 0 2px; font-size: 16px; line-height: 1.5; font-weight: 600; }
.p-color { margin: 0; color: var(--sub); font-size: 13px; }
.p-price { margin: 8px 0 10px; font-family: var(--serif); font-size: 26px; }
.p-price small { font-family: var(--sans); font-size: 11px; color: var(--sub); margin-left: 4px; }
.p-models { font-size: 12px; color: var(--sub); margin-bottom: 14px; }
.p-models summary { cursor: pointer; }
.p-models div { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.p-models span { border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.p-actions { display: grid; gap: 8px; }
.btn { display: block; text-align: center; text-decoration: none; border-radius: 12px; padding: 12px; font-size: 14px; border: 1px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.done { background: var(--pink-d); border-color: var(--pink-d); }
.close { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .1); }

.drawer {
  position: fixed; z-index: 9; right: 0; top: 0; bottom: 0; width: min(380px, 100vw);
  background: #fff; box-shadow: -20px 0 60px rgba(59, 51, 64, .18); display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top); animation: slide .25s ease;
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.d-head { position: relative; padding: 18px 18px 6px; }
.d-head h2 { margin: 0; font-size: 18px; }
.d-head .close { top: 12px; }
.d-note { margin: 0; padding: 0 18px 12px; font-size: 12px; line-height: 1.7; color: var(--sub); border-bottom: 1px solid var(--line); }
.drawer ul { list-style: none; margin: 0; padding: 0 18px; overflow: auto; flex: 1; }
.drawer li { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.drawer li img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: var(--cream); }
.drawer li .n { font-size: 13px; line-height: 1.45; }
.drawer li .n small { display: block; color: var(--sub); }
.drawer li .n a { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--pink-d); }
.drawer li .rm { border: 0; background: none; color: var(--sub); font-size: 12px; cursor: pointer; padding: 6px; }
.drawer .empty { color: var(--sub); font-size: 13px; padding: 24px 0; text-align: center; display: block; border: 0; }
.d-foot { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 18px calc(env(safe-area-inset-bottom) + 16px); border-top: 1px solid var(--line); }
.d-foot b { font-family: var(--serif); font-size: 24px; }

.loading { position: fixed; inset: 0; z-index: 20; background: var(--cream); display: grid; place-content: center; justify-items: center; gap: 14px; transition: opacity .6s; }
.loading img { width: 180px; }
.loading p { margin: 0; font-size: 12px; color: var(--sub); letter-spacing: .08em; }
.loading.off { opacity: 0; pointer-events: none; }

@media (max-width: 640px) {
  .panel { left: 12px; right: 12px; width: auto; top: auto; bottom: calc(env(safe-area-inset-bottom) + 12px); max-height: 72dvh; display: grid; grid-template-columns: 120px 1fr; }
  .panel img { aspect-ratio: auto; height: 100%; min-height: 120px; border-radius: 20px 0 0 0; }
  .p-body { padding: 14px 14px 14px 12px; }
  .panel h2 { font-size: 14px; padding-right: 26px; }
  .p-price { font-size: 22px; margin: 4px 0 8px; }
  .p-models { grid-column: 1 / -1; }
  .aisles { gap: 6px; }
  .aisles button { padding: 7px 10px; font-size: 11px; }
  .aisles button span { display: none; }
}
@media (max-width: 640px) { body.panel-open .aisles, body.panel-open .joy { display: none; } }
.btn.sub { border-color: var(--line); font-size: 12px; padding: 9px; color: var(--sub); }
.btn[hidden] { display: none; }
[hidden] { display: none !important; }
@media (max-width: 1500px) { .aisles button span { display: none; } }
@media (max-width: 640px) { .joy { bottom: calc(env(safe-area-inset-bottom) + 112px); left: 16px; width: 104px; height: 104px; } }
