/* 스타포스 시뮬레이터 */

.starforce-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.starforce-hero {
  text-align: center;
}

.starforce-hero .h1 {
  margin-bottom: 8px;
}

.starforce-hero .p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.starforce-notice {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.starforce-app-card {
  padding: 24px;
}

/* 메인 게임 영역 */
.sf-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.sf-item-card {
  padding: 24px 32px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,248,239,0.4));
  text-align: center;
  min-width: 260px;
}

.sf-item-img {
  display: block;
  max-width: 120px;
  max-height: 120px;
  margin: 0 auto 12px;
  object-fit: contain;
}

.sf-item-header {
  position: relative;
  margin-bottom: 4px;
}

.sf-item-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--title);
  text-align: center;
}

.sf-item-header .sf-btn-reset-sm {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.sf-btn-reset-sm {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  min-height: auto;
  background: #5EC4B5;
  color: #FFFDF8;
  border: 1px solid #4DB6AC;
}

.sf-btn-reset-sm:hover {
  background: #4DB6AC;
  border-color: #3DA89E;
  transform: none;
}

.sf-item-header .sf-btn-reset-sm:hover {
  transform: translateY(-50%);
}

.sf-item-level {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.sf-stars {
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 6px;
}

.sf-star-count {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.sf-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.sf-stat {
  font-size: 14px;
  color: var(--text);
}

.sf-stat strong {
  color: var(--title);
}

.sf-options-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.sf-level-setting,
.sf-spare-setting {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.sf-level-setting label,
.sf-spare-setting label {
  white-space: nowrap;
}

.sf-level-setting select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

.sf-spare-setting input {
  width: 72px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  text-align: right;
}

.sf-history {
  width: 100%;
  max-width: 360px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.5);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
}

.sf-history-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.sf-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sf-history-item {
  font-size: 13px;
  padding: 4px 0;
}

.sf-history-item.sf-success {
  color: var(--accent-green);
  font-weight: 700;
}

.sf-history-item.sf-fail {
  color: var(--muted);
}

.sf-history-item.sf-destroy {
  color: #C75C5C;
  font-weight: 600;
}

.sf-history-item.sf-recovery {
  color: var(--accent);
  font-weight: 600;
}

/* 파괴 후 복구 선택 */
.sf-recovery-card {
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  border: 2px solid #C75C5C;
  background: rgba(199, 92, 92, 0.06);
  text-align: center;
  min-width: 280px;
}

.sf-destroyed-img {
  display: block;
  max-width: 140px;
  max-height: 140px;
  margin: 0 auto 12px;
  object-fit: contain;
}

.sf-recovery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.sf-recovery-title {
  font-size: 18px;
  font-weight: 800;
  color: #C75C5C;
}

.sf-recovery-desc {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text);
}

.sf-recovery-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.sf-btn-recovery {
  flex: 1;
  min-width: 140px;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  font-size: 14px;
  background: var(--bg-sub);
  color: var(--title);
  border: 1px solid var(--line);
}

.sf-btn-recovery:hover {
  background: #FFF1D8;
  border-color: #CFA46D;
}

.sf-recovery-cost {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.sf-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}

.sf-btn:hover {
  transform: translateY(-2px);
}

.sf-btn-enhance {
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  color: #FFFDF8;
  box-shadow: 0 6px 16px rgba(227, 139, 61, 0.3);
}

.sf-btn-enhance:hover {
  box-shadow: 0 8px 20px rgba(227, 139, 61, 0.4);
}

.sf-protect-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.sf-protect-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.sf-protect-option.is-disabled {
  color: var(--muted);
  cursor: default;
}

.sf-protect-option.is-disabled input[type="checkbox"] {
  cursor: not-allowed;
}

/* 클리어 화면 */
.sf-clear {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px;
  gap: 16px;
}

.sf-clear-img {
  max-width: 180px;
  max-height: 180px;
  object-fit: contain;
}

.sf-clear-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--title);
}

.sf-clear-item {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.sf-clear-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
}

.sf-clear-stats strong {
  color: var(--title);
}

.sf-clear-luck {
  font-size: 22px;
  font-weight: 900;
  color: var(--accent);
  padding: 12px 20px;
  background: rgba(242,166,90,0.15);
  border-radius: var(--radius-md);
}

.sf-clear-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 360px;
}

.sf-btn-reset {
  background: var(--bg-sub);
  color: var(--title);
  border: 1px solid var(--line);
  margin-top: 8px;
}

.sf-btn-reset:hover {
  background: #FFF1D8;
  border-color: #CFA46D;
}

@media (max-width: 560px) {
  .sf-item-card {
    padding: 20px 24px;
    min-width: auto;
    width: 100%;
  }

  .sf-stars {
    font-size: 16px;
    letter-spacing: 1px;
  }

  .sf-protect-btns {
    flex-direction: column;
  }

  .sf-protect-btns .sf-btn {
    width: 100%;
  }

  .sf-recovery-options {
    flex-direction: column;
  }

  .sf-btn-recovery {
    width: 100%;
  }
}

/* 다크모드 */
html[data-theme="dark"] .sf-item-card {
  background: linear-gradient(180deg, rgba(42, 37, 30, 0.9), rgba(36, 32, 25, 0.85));
}

html[data-theme="dark"] .sf-history {
  background: rgba(36, 32, 25, 0.8);
}

html[data-theme="dark"] .sf-btn-reset-sm {
  background: rgba(201, 168, 76, 0.18);
  border-color: rgba(201, 168, 76, 0.4);
  color: #e8c96e;
}

html[data-theme="dark"] .sf-btn-reset-sm:hover {
  background: rgba(201, 168, 76, 0.28);
  border-color: rgba(201, 168, 76, 0.5);
}

html[data-theme="dark"] .sf-btn-recovery:hover,
html[data-theme="dark"] .sf-btn-reset:hover {
  background: #3d352c;
  border-color: var(--line-soft);
}

html[data-theme="dark"] .sf-recovery-card {
  background: rgba(199, 92, 92, 0.12);
  border-color: #b85a4a;
}

html[data-theme="dark"] .sf-recovery-title {
  color: #e8a090;
}

html[data-theme="dark"] .sf-clear-luck {
  background: rgba(107, 168, 168, 0.2);
}

html[data-theme="dark"] .sf-btn-enhance {
  background: rgba(201, 168, 76, 0.22);
  border: 1px solid rgba(201, 168, 76, 0.45);
  color: #e8c96e;
  box-shadow: 0 8px 20px rgba(201, 168, 76, 0.2);
}

html[data-theme="dark"] .sf-btn-enhance:hover {
  background: rgba(201, 168, 76, 0.32);
  border-color: rgba(201, 168, 76, 0.55);
  box-shadow: 0 10px 24px rgba(201, 168, 76, 0.25);
}

html[data-theme="dark"] .sf-protect-option input[type="checkbox"] {
  accent-color: #c9a84c;
}
