/* FOLKLORE Simulator - Scoped CSS */
.folklore-simulator {
  background: #f0ede8;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  padding: 20px 0;
}

.folklore-simulator * {
  box-sizing: border-box;
}

.folklore-simulator header {
  width: 100%;
  background: #111;
  color: #fff;
  text-align: center;
  padding: 10px 16px 7px;
  margin: 0;
}

.folklore-simulator header h1 {
  font-size: 15px;
  letter-spacing: .25em;
  font-weight: 400;
  margin: 0;
}

.folklore-simulator header p {
  font-size: 11px;
  color: #666;
  letter-spacing: .15em;
  margin-top: 1px;
}

.folklore-simulator .app {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
}

.folklore-simulator .top-area {
  display: flex;
  flex-direction: row;
  padding: 10px 10px 0;
  gap: 10px;
  align-items: stretch;
}

.folklore-simulator .ctrl-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.folklore-simulator .strap-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 130px;
}

.folklore-simulator .dir-tag {
  width: 100%;
  text-align: center;
  padding: 6px 4px;
  border-radius: 8px;
  background: #333;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
}

.folklore-simulator .dir-tag small {
  display: block;
  font-size: 9px;
  color: #aaa;
  font-weight: 400;
  margin-top: 1px;
}

.folklore-simulator .strap-scroll {
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
}

.folklore-simulator .strap-scroll::-webkit-scrollbar {
  display: none;
}

.folklore-simulator .count-row {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border-radius: 12px;
  padding: 6px 8px;
}

.folklore-simulator .cnt-btn {
  width: 34px;
  height: 34px;
  border: 1px solid #ddd;
  border-radius: 50%;
  background: #fff;
  font-size: 20px;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.folklore-simulator .cnt-btn:active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.folklore-simulator .cnt-num {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  text-align: center;
}

.folklore-simulator .cnt-sub {
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
  text-align: center;
}

.folklore-simulator .sel-box {
  background: #fff;
  border-radius: 12px;
  padding: 8px 12px;
}

.folklore-simulator .box-label {
  font-size: 11px;
  color: #aaa;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.folklore-simulator .sel-info {
  font-size: 13px;
  color: #444;
  line-height: 1.4;
}

.folklore-simulator .sel-info b {
  color: #111;
}

.folklore-simulator .mode-row {
  display: flex;
  gap: 4px;
}

.folklore-simulator .mbt {
  flex: 1;
  padding: 9px 2px;
  border: 1px solid #e0e0e0;
  border-radius: 7px;
  background: #fff;
  font-size: 11px;
  color: #888;
  cursor: pointer;
  transition: all .12s;
}

.folklore-simulator .mbt.on {
  background: #111;
  color: #fff;
  border-color: #111;
}

.folklore-simulator .pal-box {
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
}

.folklore-simulator .palette {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.folklore-simulator .cb-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  min-width: 0 !important;
}

.folklore-simulator .cb-wrap:active {
  background: #f0ede8;
}

.folklore-simulator .cb {
  width: 32px !important;
  height: 32px !important;
  flex-shrink: 0 !important;
  border-radius: 50% !important;
  border: 3px solid transparent !important;
  pointer-events: none !important;
  display: block !important;
  box-sizing: border-box !important;
}

.folklore-simulator .cb.on {
  border-color: #111 !important;
  box-shadow: 0 0 0 2px #fff inset !important;
}

.folklore-simulator .color-name {
  font-size: 12px !important;
  color: #444 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  pointer-events: none !important;
  min-width: 0 !important;
  flex: 1 !important;
  display: block !important;
}

.folklore-simulator .color-name.on {
  font-weight: 600 !important;
  color: #111 !important;
}

@media (max-width:360px) {
  .folklore-simulator .palette { grid-template-columns: repeat(4,1fr); gap: 6px; }
  .folklore-simulator .cb-wrap { justify-content: center; gap: 0; padding: 6px 2px; }
  .folklore-simulator .cb { width: 36px; height: 36px; }
  .folklore-simulator .color-name { display: none; }
}

@media (min-width:361px) and (max-width:400px) {
  .folklore-simulator .cb { width: 28px; height: 28px; }
  .folklore-simulator .color-name { font-size: 10px; }
  .folklore-simulator .cb-wrap { gap: 6px; padding: 5px 4px; }
}

.folklore-simulator .grad-box { background: #fff; border-radius: 12px; padding: 10px 12px; }
.folklore-simulator .grad-note { font-size: 10px; color: #c0392b; margin-bottom: 7px; line-height: 1.5; }
.folklore-simulator .grad-row { display: flex; gap: 6px; flex-wrap: wrap; }
.folklore-simulator .gb { padding: 7px 11px; border-radius: 10px; border: 1px solid #e0e0e0; background: #fff; font-size: 11px; cursor: pointer; color: #666; white-space: nowrap; }
.folklore-simulator .gb:active { background: #111; color: #fff; }
.folklore-simulator .sum-box { background: #fff; border-radius: 12px; padding: 10px 12px; }
.folklore-simulator .summary { font-size: 11px; color: #666; line-height: 2; display: flex; flex-wrap: wrap; gap: 1px 8px; }
.folklore-simulator .si { display: flex; align-items: center; gap: 4px; }
.folklore-simulator .sw { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); flex-shrink: 0; }
.folklore-simulator .share-area { width: 100%; max-width: 520px; padding: 10px 10px 0; margin: 0 auto; }
.folklore-simulator .sbtn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 11px; border: 1px solid #e0e0e0; background: #fff; cursor: pointer; font-size: 12px; color: #444; }
.folklore-simulator .sbtn:active { background: #111; color: #fff; }
.folklore-simulator #toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px); background: #111; color: #fff; padding: 8px 18px; border-radius: 20px; font-size: 11px; opacity: 0; transition: all .3s; pointer-events: none; white-space: nowrap; z-index: 9999; }
.folklore-simulator #toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.folklore-simulator .bottom-bar { width: 100%; max-width: 520px; padding: 8px 10px 24px; display: flex; gap: 6px; margin: 10px auto 0; }
.folklore-simulator .btn-reset { flex: 1; padding: 14px; border: 1px solid #ddd; border-radius: 10px; background: #fff; font-size: 13px; color: #666; cursor: pointer; }
.folklore-simulator .btn-undo { flex: 1; padding: 14px; border: 1px solid #ddd; border-radius: 10px; background: #fff; font-size: 13px; color: #666; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; }
.folklore-simulator .btn-undo:disabled { opacity: .35; cursor: default; }
.folklore-simulator .btn-order { flex: 2.5; padding: 14px; border: none; border-radius: 10px; background: #111; color: #fff; font-size: 13px; cursor: pointer; font-weight: 500; letter-spacing: .04em; }
.folklore-simulator .btn-order:active { opacity: .7; }
.folklore-simulator .btn-order:disabled { opacity: .5; cursor: not-allowed; }
.folklore-simulator .price-display { font-size: 10px; color: #fff; opacity: .8; margin-top: 2px; }
.folklore-simulator .modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.85); z-index: 10000; display: none; align-items: center; justify-content: center; padding: 20px; }
.folklore-simulator .modal.show { display: flex; }
.folklore-simulator .modal-content { background: #fff; border-radius: 16px; padding: 24px; max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto; }
.folklore-simulator .modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.folklore-simulator .modal-header h2 { font-size: 18px; margin: 0; }
.folklore-simulator .modal-close { background: none; border: none; font-size: 24px; color: #999; cursor: pointer; padding: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.folklore-simulator .modal-close:hover { color: #333; }
.folklore-simulator .modal-image { width: 100%; border-radius: 8px; margin-bottom: 16px; }
.folklore-simulator .modal-info { font-size: 14px; color: #666; line-height: 1.8; }
.folklore-simulator .modal-info strong { color: #111; font-weight: 600; }
.folklore-simulator .modal-buttons { display: flex; gap: 8px; margin-top: 20px; }
.folklore-simulator .modal-btn { flex: 1; padding: 14px; border: none; border-radius: 10px; font-size: 14px; cursor: pointer; font-weight: 500; }
.folklore-simulator .modal-btn-secondary { background: #f0f0f0; color: #666; }
.folklore-simulator .modal-btn-primary { background: #111; color: #fff; }
.folklore-simulator .modal-btn:active { opacity: .7; }
.folklore-simulator .loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 9999; display: none; align-items: center; justify-content: center; }
.folklore-simulator .loading-overlay.show { display: flex; }
.folklore-simulator .loading-content { background: #fff; border-radius: 16px; padding: 32px; text-align: center; }
.folklore-simulator .loading-spinner { width: 40px; height: 40px; border: 4px solid #f0f0f0; border-top-color: #111; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.folklore-simulator .loading-text { font-size: 14px; color: #666; }
