/* 丙的樣式。所有 class 用 f- 開頭，避免跟別人撞名。 */
.f-bar { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 8px; pointer-events: auto; }
.f-slot { position: relative; width: 72px; height: 72px; border-radius: 12px; background: rgba(20, 24, 40, .72);
  border: 3px solid rgba(255, 255, 255, .25); box-sizing: border-box; }
.f-slot[data-i] { cursor: pointer; }
.f-slot.f-on { border-color: #ffd23f; box-shadow: 0 0 14px rgba(255, 210, 63, .7); }
.f-slot img { position: absolute; left: 4px; top: 4px; width: calc(100% - 8px); height: calc(100% - 16px); object-fit: contain; }
.f-style { position: absolute; right: 4px; top: 2px; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.f-dur { position: absolute; left: 6px; right: 6px; bottom: 5px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, .6); overflow: hidden; }
.f-dur > div { height: 100%; background: #6fe37a; }
.f-key { position: absolute; left: 5px; top: 2px; font-size: 11px; font-weight: 800; opacity: .8; }
.f-pending { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-size: 10px; font-weight: 800; color: #ffd23f;
  text-shadow: 0 1px 2px #000; animation: f-pulse 1s infinite; }
.f-name { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); white-space: nowrap; font-size: 15px;
  font-weight: 800; text-shadow: 0 1px 3px #000; pointer-events: none; }
.f-forgebtn { width: 72px; height: 72px; border-radius: 12px; border: 0; background: #ffd23f; color: #1b1b1b; font: inherit; font-size: 28px;
  line-height: 1; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.f-forgebtn span { font-size: 12px; font-weight: 800; }
.f-starthint { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); padding: 14px 22px; border-radius: 14px; text-align: center;
  background: rgba(20, 24, 40, .82); font-size: 18px; line-height: 1.7; font-weight: 700; animation: f-pulse 1.6s infinite; }
.f-starthint[hidden] { display: none; }
.f-starthint b { color: #ffd23f; }
.f-toasts { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 3; }
.f-toast { padding: 8px 16px; border-radius: 999px; background: rgba(20, 24, 40, .9); border: 2px solid #ffd23f; font-size: 15px; font-weight: 700;
  max-width: 90vw; animation: f-in .3s ease-out; }
@keyframes f-in { from { transform: translateY(-10px); opacity: 0; } }
@keyframes f-pulse { 50% { opacity: .55; } }

/* ---------- 鍛造台 ---------- */
.f-panel { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8, 10, 20, .78); pointer-events: auto; overflow-y: auto; z-index: 2; }
.f-panel[hidden], .f-panel [hidden] { display: none !important; }
.f-box { width: min(560px, 94vw); max-height: 96vh; overflow-y: auto; padding: 16px 20px; border-radius: 16px; background: #1b2136; box-sizing: border-box; }
.f-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.f-head h2 { margin: 0; font-size: 20px; }
.f-box button { font: inherit; font-weight: 800; border: 0; border-radius: 10px; cursor: pointer; }
.f-box button:disabled { opacity: .4; cursor: not-allowed; }
.f-main { flex: 1; padding: 12px 16px; font-size: 17px; background: #ffd23f; color: #1b1b1b; }
.f-sub { padding: 10px 14px; font-size: 14px; background: #2e3350; color: #f2f2f5; }
.f-row { display: flex; gap: 10px; margin-top: 10px; }
.f-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.f-tabs button { flex: 1; padding: 9px 12px; font-size: 15px; background: #2e3350; color: #a9b0c7; }
.f-tabs button.f-on { background: #ffd23f; color: #1b1b1b; }
.f-camwrap { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; max-height: 46vh; margin: 0 auto; }
.f-camwrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.f-camwrap video.f-mirror { transform: scaleX(-1); }
.f-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 120px; font-weight: 800; text-shadow: 0 4px 20px #000; }
.f-camoff { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; color: #ffb4b4; line-height: 1.7; }
.f-drawwrap { border-radius: 12px; overflow: hidden; background: #fdfdf8; aspect-ratio: 4 / 3; max-height: 46vh; margin: 0 auto; }
.f-drawwrap canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.f-tools { display: flex; gap: 5px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.f-swatches { display: flex; gap: 4px; }
.f-swatch { width: 26px; height: 26px; padding: 0; border-radius: 50% !important; border: 3px solid transparent !important; }
.f-swatch.f-on { border-color: #fff !important; }
.f-tool { font-size: 13px; padding: 7px 9px; background: #2e3350; color: #f2f2f5; }
.f-tool.f-on { background: #5b64a8; }
.f-spacer { flex: 1; }
.f-what { display: block; margin-top: 12px; font-size: 14px; font-weight: 700; }
.f-what span { color: #a9b0c7; font-weight: 400; }
.f-what input { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 9px 12px; font: inherit; border-radius: 8px; border: 0; background: #2e3350; color: #fff; }
.f-note { margin: 10px 0 0; color: #a9b0c7; font-size: 13px; line-height: 1.6; }
.f-wait { text-align: center; padding: 60px 0; font-size: 20px; color: #ffd23f; }
.f-anvil { display: block; font-size: 56px; animation: f-hammer .5s infinite alternate; }
@keyframes f-hammer { from { transform: rotate(-18deg) translateY(-6px); } to { transform: rotate(8deg); } }
.f-transform { display: grid; grid-template-columns: 2fr auto 3fr; gap: 12px; align-items: center; }
.f-shot { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.f-arrow { font-size: 30px; color: #ffd23f; }
.f-weaponbox { background: #262a40; border-radius: 12px; aspect-ratio: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.f-wimg { width: 100%; height: 100%; object-fit: contain; animation: f-reveal .5s ease-out; }
@keyframes f-reveal { from { transform: scale(.6) rotate(-12deg); opacity: 0; filter: brightness(3); } }
.f-forging { text-align: center; color: #ffd23f; }
.f-wname { font-size: 26px; font-weight: 800; margin: 10px 0 6px; }
.f-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.f-chip { background: #2e3350; border-radius: 999px; padding: 3px 11px; font-size: 13px; }
.f-chipstyle { background: #3d3566; }
.f-from { color: #a9b0c7; font-size: 13px; }
.f-attack { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.f-pips { display: flex; gap: 3px; }
.f-pips i { width: 15px; height: 15px; border-radius: 4px; background: #2e3350; }
.f-pips i.f-on { background: #ff6b5e; }
.f-skill { font-size: 15px; margin: 6px 0; }
.f-skill b { color: #7fd4ff; }
.f-reason { background: #262a40; border-left: 4px solid #ffd23f; border-radius: 8px; padding: 8px 14px; line-height: 1.6; }
.f-reason:empty { display: none; }
.f-status { color: #a9b0c7; font-size: 13px; margin-top: 8px; min-height: 18px; line-height: 1.5; }
.f-error { color: #ff8a8a; font-size: 14px; margin-top: 8px; line-height: 1.5; }
.f-error:empty { display: none; }

/* 窄螢幕（直向手機）：武器欄縮小 */
@media (max-width: 520px) {
  .f-bar { gap: 4px; bottom: 10px; }
  .f-slot, .f-forgebtn { width: 54px; height: 54px; }
  .f-forgebtn { font-size: 22px; }
  .f-forgebtn span, .f-key { display: none; }
  .f-name { bottom: 66px; font-size: 13px; }
  .f-starthint { font-size: 15px; width: 80vw; top: 30%; box-sizing: border-box; }
  .f-title { font-size: 24px; }
}
.f-title { display: block; font-size: 30px; font-weight: 900; color: #ffd23f; letter-spacing: 2px; }
.f-title small { font-size: 14px; color: #fff; letter-spacing: 0; opacity: .8; }
