/* アカウント欄・きせかえ（account.js）。クラス名はすべて acc- で始める */
.acc-root {
  --acc-ink: var(--ink, #5A4632);
  --acc-muted: var(--muted, #7C6C50);
  --acc-yellow: var(--yellow, #FFD85C);
  --acc-round: var(--round, "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", system-ui, sans-serif);
  --acc-display: var(--display, "M PLUS Rounded 1c", "Hiragino Sans", system-ui, sans-serif);
  font-family: var(--acc-round);
  font-weight: 700;
  color: var(--acc-ink);
}
.acc-card, .acc-modal {
  --acc-ink: var(--ink, #5A4632);
  --acc-muted: var(--muted, #7C6C50);
  --acc-round: var(--round, "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", system-ui, sans-serif);
  --acc-display: var(--display, "M PLUS Rounded 1c", "Hiragino Sans", system-ui, sans-serif);
}
.acc-card {
  background: rgba(255, 255, 255, 0.96); color: var(--acc-ink); border-radius: 24px; padding: 14px 14px 12px;
  border: 2px solid #FFF9E8; box-shadow: 0 7px 0 #D8C6A3, 0 16px 34px rgba(90, 70, 50, .12);
  display: flex; flex-direction: column; gap: 10px; font-family: var(--acc-round); font-weight: 700;
}
.acc-loading { flex-direction: row; justify-content: center; gap: 8px; padding: 22px; }
.acc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--acc-muted); animation: acc-blink 1s infinite ease-in-out; }
.acc-dot:nth-child(2) { animation-delay: .15s; } .acc-dot:nth-child(3) { animation-delay: .3s; }
@keyframes acc-blink { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

/* ---------- ボタン ---------- */
.acc-btn {
  font-family: inherit; font-size: 17px; font-weight: 800; padding: 11px 14px; border-radius: 16px;
  border: 2px solid #FFF9E8; color: var(--acc-ink); background: #fff; cursor: pointer; touch-action: manipulation;
  box-shadow: 0 5px 0 #D8C6A3; position: relative; transition: transform .06s; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.acc-btn::after { content: none; }
.acc-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #D8C6A3; }
.acc-yellow { background: #F7CD46; }
.acc-blue { background: #8FD3A8; color: #fff; text-shadow: 0 2px 0 #D8C6A3; }
.acc-ghost { background: #FBF3DD; color: var(--acc-muted); border-color: #DCCFB2; box-shadow: 0 5px 0 #DCCFB2; font-size: 15px; }
.acc-ghost::after { display: none; }
.acc-small { font-size: 14px; padding: 8px 11px; border-width: 3px; box-shadow: 0 4px 0 #D8C6A3; white-space: nowrap; }

/* ---------- 未ログイン ---------- */
.acc-out-top { display: flex; align-items: center; gap: 10px; }
.acc-teaser { display: flex; flex: none; margin: -4px 0 -6px; }
.acc-teaser-char { display: block; margin-right: -14px; filter: drop-shadow(0 3px 0 rgba(90, 70, 50, .18)); }
.acc-teaser-char:nth-child(2) { transform: translateY(-5px); z-index: 1; position: relative; }
.acc-teaser-char:last-child { margin-right: 0; }
.acc-lead { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--acc-ink); }
.acc-lead b { color: #986131; white-space: nowrap; }
.acc-login { width: 100%; background: #F7CD46; font-size: 18px; }
.acc-g {
  width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid #FFF9E8;
  display: inline-grid; place-items: center; font-family: var(--acc-display); font-weight: 400; font-size: 15px; line-height: 1; color: #3e7bf0;
}

/* ---------- ログイン中 ---------- */
.acc-me { display: flex; align-items: center; gap: 12px; }
.acc-stage {
  flex: none; width: 84px; height: 96px; border-radius: 18px; border: 2px solid #FFF9E8;
  background: radial-gradient(circle at 50% 30%, #fff8d6 0%, #ffe79a 55%, #ffc94a 100%);
  display: grid; place-items: end center; overflow: hidden; position: relative;
}
.acc-stage::before { content: ""; position: absolute; left: 12px; right: 12px; bottom: 7px; height: 10px; border-radius: 50%; background: rgba(90, 70, 50, .2); }
.acc-avatar { display: block; position: relative; margin-bottom: -2px; }
.acc-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.acc-name { font-size: 19px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-points { display: flex; align-items: baseline; gap: 5px; }
.acc-points b {
  font-family: var(--acc-display); font-weight: 400; font-size: 32px; line-height: 1.05; color: #FFD85C;
  -webkit-text-stroke: 6px var(--acc-ink); paint-order: stroke fill; text-shadow: 0 3px 0 #D8C6A3; letter-spacing: 1px;
}
.acc-points span { font-size: 13px; color: var(--acc-muted); }
.acc-wearing { font-size: 13px; color: var(--acc-muted); }
.acc-wearing b { color: var(--acc-ink); }

.acc-progress { display: flex; flex-direction: column; gap: 4px; }
.acc-progress-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 30px; }
.acc-progress-label { font-size: 13px; line-height: 1.35; padding-bottom: 2px; }
.acc-progress-label b { color: #986131; }
.acc-next-char { display: block; flex: none; margin-bottom: -10px; filter: drop-shadow(0 2px 0 rgba(90, 70, 50, .2)); }
.acc-bar { height: 18px; border-radius: 10px; border: 2px solid #FFF9E8; background: #FBF3DD; overflow: hidden; position: relative; }
.acc-bar i {
  display: block; height: 100%; min-width: 8px; border-radius: 6px;
  background: linear-gradient(#a6f0a0, #3fb85a); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .5);
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
}
.acc-actions { display: flex; gap: 8px; }
.acc-actions .acc-yellow { flex: 1; }
.acc-stats { font-size: 12px; color: var(--acc-muted); text-align: center; }
.acc-stats b { color: var(--acc-ink); }

/* ---------- きせかえ ---------- */
.acc-modal {
  position: fixed; inset: 0; z-index: 40; background: rgba(90, 70, 50, .28);
  display: flex; align-items: flex-start; justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 12px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  font-family: var(--acc-round); font-weight: 700; color: var(--acc-ink);
  animation: acc-fade .15s ease-out;
}
@keyframes acc-fade { from { opacity: 1; } }
.acc-sheet {
  position: relative; background: #fff; border: 2px solid #FFF9E8; border-radius: 24px; box-shadow: 0 8px 0 #D8C6A3;
  padding: 14px 14px 16px; width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 10px;
  animation: acc-pop .22s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes acc-pop { from { transform: translateY(14px) scale(.96); } }
.acc-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.acc-sheet-title { margin: 0; font-family: var(--acc-display); font-weight: 400; font-size: 26px; letter-spacing: 1px; }
.acc-close {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid #FFF9E8; background: #fff; color: var(--acc-ink);
  font-size: 18px; font-weight: 800; cursor: pointer; box-shadow: 0 3px 0 #D8C6A3; font-family: inherit;
}
.acc-hero {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px 6px; border-radius: 18px; border: 2px solid #FFF9E8;
  background: radial-gradient(circle at 30% 40%, #fff8d6 0%, #ffe79a 50%, #ffc94a 100%);
}
.acc-big { display: block; flex: none; }
.acc-hero-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.acc-hero-name { font-family: var(--acc-display); font-weight: 400; font-size: 22px; }
.acc-hero-desc { font-size: 13px; line-height: 1.45; }
.acc-hero-pt { font-size: 12px; color: #7a5a1a; }
.acc-hero-pt b { font-size: 16px; color: var(--acc-ink); }
.acc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.acc-item {
  position: relative; font-family: inherit; font-weight: 800; color: var(--acc-ink); cursor: pointer;
  border: 2px solid #FFF9E8; border-radius: 16px; background: #FFF8E7;
  box-shadow: 0 4px 0 #D8C6A3; padding: 6px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  touch-action: manipulation; transition: transform .06s;
}
.acc-item:active { transform: translateY(3px); box-shadow: 0 1px 0 #D8C6A3; }
.acc-item-char { display: block; }
.acc-item-name { font-size: 11px; line-height: 1.2; white-space: nowrap; letter-spacing: -.5px; }
.acc-item.acc-on { background: #F7CD46; box-shadow: 0 4px 0 #D8C6A3, 0 0 0 3px #fff inset; }
.acc-item.acc-locked { background: #FFF8E7; }
.acc-item.acc-locked .acc-item-char { filter: grayscale(.85) brightness(.55) contrast(.9); opacity: .75; }
.acc-item.acc-locked .acc-item-name { color: #7C6C50; }
.acc-badge {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 10.5px; padding: 2px 7px; border-radius: 10px; border: 2px solid #FFF9E8; line-height: 1.25;
}
.acc-badge-on { background: #78C27A; color: #fff; text-shadow: 0 1px 0 #D8C6A3; }
.acc-badge-lock { background: #5A4632; color: #fff; border-color: #5A4632; }
.acc-msg { margin: 0; min-height: 1.3em; text-align: center; font-size: 13px; color: #986131; }
.acc-name-row { display: flex; gap: 8px; align-items: center; border-top: 2px dashed #DCCFB2; padding-top: 10px; }
.acc-input {
  flex: 1; min-width: 0; font: inherit; font-size: 17px; font-weight: 800; padding: 9px 12px; border-radius: 14px;
  border: 3px solid #DCCFB2; background: #FBF3DD; color: var(--acc-ink); -webkit-user-select: text; user-select: text;
}
.acc-input:focus { outline: none; border-color: #4fb3ff; background: #fff; }

/* 確認ページ用のシート */
.acc-sheet-row { display: flex; align-items: flex-end; gap: 6px; }
.acc-sheet-label { width: 64px; flex: none; font-size: 12px; line-height: 1.2; color: #fff; }
.acc-sheet-label small { display: block; color: #DCCFB2; }

/* 島のクローゼット：アイコンの棚と、説明用のコマンド窓。 */
.acc-card { background: #FFF9E8; border-radius: 28px; box-shadow: 0 6px 24px #5A46321A; }
.acc-btn { --acc-button-shadow: #D8C6A3; border-radius: 999px; box-shadow: 0 5px 0 var(--acc-button-shadow); background: #FFF9E8; }
.acc-btn:active { box-shadow: 0 1px 0 var(--acc-button-shadow); }
.acc-yellow, .acc-login { --acc-button-shadow: #D7AD3E; background: #F7CD46; }
.acc-blue { --acc-button-shadow: #5AAE5E; background: #8FD3A8; color: var(--acc-ink); text-shadow: none; }
.acc-ghost { color: var(--acc-ink); background: #FBF3DD; border-color: #F0E5CA; }
.acc-g { border: 0; border-radius: 9px; color: #5A9671; font-weight: 800; }
.acc-lead b, .acc-progress-label b { color: #986131; }
.acc-stage { border-radius: 22px; background: #F7E9B5; }
.acc-points b { color: var(--acc-ink); -webkit-text-stroke: 0; text-shadow: none; font-weight: 800; }
.acc-bar { border: 2px solid #DBCEB0; }
.acc-bar i { background: linear-gradient(#ACD997, #78C27A); }
.acc-sheet { background: #FFF9E8; border-radius: 28px; box-shadow: 0 10px 32px #5A463224; }
.acc-sheet-title { font-weight: 800; font-size: 24px; }
.acc-close { background: #FBF3DD; border-color: #E8DCC2; box-shadow: 0 3px 0 #D8C6A3; }
.acc-hero { background: #000; color: #fff; border: 3px solid #fff; border-radius: 9px; box-shadow: var(--window-shadow); padding: 16px 12px; font-family: var(--dot); font-weight: 400; }
.acc-hero-name { font-family: var(--dot); font-size: 22px; }
.acc-hero-desc { font-size: 14px; line-height: 1.65; }
.acc-hero-pt, .acc-hero-pt b { color: #fff; font-weight: 400; }
.acc-grid { gap: 14px 8px; padding-top: 8px; }
.acc-item { border: 2px solid #ECE2C6; background: #FBF3DD; border-radius: 20px; box-shadow: 0 4px 0 #D8C6A3; }
.acc-item.acc-on { background: #FFE79C; box-shadow: 0 4px 0 #D7AD3E, inset 0 0 0 2px #FFF9E8; }
.acc-item.acc-locked { background: #E8E3D5; }
.acc-badge { border: 1px solid #FFF9E8; }
.acc-badge-on { background: #78C27A; color: var(--acc-ink); text-shadow: none; }
.acc-badge-lock { background: #9B8C70; color: #fff; border-color: #FFF9E8; }
.acc-msg { color: #986131; }
.acc-input { border-width: 2px; }
.acc-input:focus { border-color: #5AAE5E; }
.acc-sheet-label { color: #5A4632; }
.acc-sheet-label small { color: #7C6C50; }

/* 第2弾：きせかえのボタンも指定の単色と厚みに統一。 */
.acc-btn, .acc-item, .acc-item.acc-locked {
  --acc-button-shadow: #D8C9A3; background: #FFF8E7; color: #6B5536;
  border-radius: 999px; font-weight: 700; box-shadow: 0 4px 0 var(--acc-button-shadow); text-shadow: none;
}
.acc-btn.acc-yellow, .acc-btn.acc-login, .acc-item.acc-on { --acc-button-shadow: #D9A92E; background: #F7CD46; }
.acc-btn.acc-blue { --acc-button-shadow: #5FAF7E; background: #8FD3A8; }
.acc-btn:active, .acc-item:active { transform: translateY(4px); box-shadow: 0 0 0 var(--acc-button-shadow); }
.acc-hero, .acc-msg:not(:empty) { background: #000; color: #fff; border: 3px solid #fff; border-radius: 8px; box-shadow: none; padding: 14px 16px; font-family: var(--dot); }
.acc-close { width: auto; min-height: 44px; height: auto; padding: 8px 10px; background: #000; color: #fff; border: 3px solid #fff; border-radius: 8px; box-shadow: none; font: 400 16px/1.5 var(--dot); }
.acc-badge-lock { background: #FFF8E7; color: #6B5536; }
.acc-badge-lock .ui-icon { width: 14px; height: 14px; }

/* 小さいスマホでも、服の名前と解放条件を棚の中に収める。 */
.acc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.acc-item { min-width: 0; }
.acc-item-name { max-width: 100%; white-space: normal; text-align: center; overflow-wrap: anywhere; }
.acc-badge-lock { max-width: 100%; white-space: normal; text-align: center; }
@media (max-width: 380px) {
  .acc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* 服装ショップ：残高、服装セット、ひとつの購入ボタン。 */
.acc-actions > .acc-btn { flex: 1; min-width: 0; }
.acc-logout { align-self: center; min-height: 44px; font-size: 13px; box-shadow: none; }
.acc-sheet-head { gap: 12px; }
.acc-sheet-title:focus { outline: none; }
.acc-balance { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; background: #F7E9B5; border-radius: 16px; }
.acc-balance > span { font-size: 13px; }
.acc-balance strong { font-size: 27px; line-height: 1.2; }
.acc-balance small { font-size: 14px; margin-left: 4px; }
.acc-back { align-self: flex-start; min-height: 44px; font-size: 14px; padding: 10px 12px; box-shadow: none; }
.acc-section-label { margin: 4px 0; font-size: 13px; line-height: 1.6; text-align: center; }
.acc-shop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.acc-shop-item { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px 14px; background: #FBF3DD; border: 2px solid #E8DCC2; border-radius: 22px; }
.acc-shop-char { display: block; }
.acc-shop-name { display: grid; place-items: center; min-height: 2.6em; margin: 0; font: inherit; font-size: 14px; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.acc-shop-price { font-size: 16px; }
.acc-shop-item > .acc-btn { width: 100%; min-height: 44px; font-size: 14px; padding: 10px 4px; }
.acc-modal .acc-btn:disabled { background: #E8E3D5; color: #6B604D; cursor: default; box-shadow: none; transform: none; }
.acc-confirm { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0; }
.acc-confirm > h3 { margin: 0; font-size: 19px; text-align: center; }
.acc-confirm > .acc-btn { width: 100%; min-height: 48px; }
.acc-confirm-desc { margin: 0; font-size: 13px; text-align: center; }
.acc-after-balance { margin: 0; padding: 12px; border-radius: 14px; background: #F7E9B5; font-size: 15px; line-height: 1.6; text-align: center; }
.acc-after-balance b { white-space: nowrap; }
.acc-modal .acc-item-name { font-size: 12px; }
.acc-modal .acc-item { border-radius: 20px; min-height: 112px; }
.acc-modal button:focus-visible { outline: 3px solid #986131; outline-offset: 3px; }
.acc-shop-sheet .acc-msg:empty { display: none; }
@media (min-width: 600px) {
  .acc-shop-sheet { max-width: 660px; }
  .acc-shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .acc-modal, .acc-sheet, .acc-dot { animation: none; }
  .acc-btn, .acc-item { transition: none; }
}
