@import url("../assets/common.css");

.back-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: calc(env(safe-area-inset-top, 0px) + var(--back-bar-body));
  padding:
    calc(env(safe-area-inset-top, 0px) + 10px)
    max(16px, env(safe-area-inset-right))
    10px
    max(16px, env(safe-area-inset-left));
  background: rgba(15, 20, 25, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
}

.back-bar .back-link {
  min-height: 36px;
  padding: 0 4px;
}

.page-with-back-bar {
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--back-bar-body) + var(--back-bar-gap));
}

.strategy-guide {
  margin: 20px 0 8px;
  padding: 18px 20px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(26, 35, 50, 0.72);
  box-shadow: var(--shadow);
}

.strategy-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--text);
}

.strategy-intro {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.strategy-attrs {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.6;
}

.strategy-attrs li + li {
  margin-top: 6px;
}

.strategy-attrs strong {
  color: #e8d5a8;
  font-weight: 600;
}

.strategy-events {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.strategy-source {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.strategy-source a {
  color: var(--accent);
  text-decoration: none;
}

.strategy-source a:hover {
  text-decoration: underline;
}

.strategy-guide-compact {
  margin-bottom: 4px;
}

.strategy-guide-compact .strategy-intro {
  display: none;
}

.age-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.age-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 16px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(26, 35, 50, 0.92);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.age-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.age-card-title {
  margin: 0;
  font-size: 1.02rem;
  color: var(--text);
}

.age-card-desc {
  margin: 0;
  flex: 1;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.age-card-tag {
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
}

.age-card-requirements .age-card-tag {
  background: rgba(155, 89, 182, 0.2);
  color: #c39bd3;
}

.age-card-adulthood .age-card-tag {
  background: rgba(46, 204, 113, 0.18);
  color: #58d68d;
}

.stage-header {
  margin-bottom: 4px;
}

.stage-header .subtitle {
  margin-top: 6px;
}

.stage-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 16px;
  padding: 8px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(26, 35, 50, 0.6);
  font-size: 0.88rem;
}

.stage-nav-link {
  color: var(--accent);
  text-decoration: none;
  min-width: 0;
}

.stage-nav-link:hover {
  text-decoration: underline;
}

.stage-nav-prev,
.stage-nav-next {
  flex: 1 1 0;
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-nav-prev {
  text-align: left;
}

.stage-nav-next {
  text-align: right;
}

.stage-nav-home {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  font-weight: 600;
  white-space: nowrap;
}

.stage-nav-disabled.stage-nav-next {
  text-align: right;
}

.stage-nav-disabled {
  color: var(--muted);
  opacity: 0.35;
  pointer-events: none;
}

.goal-panel {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
}

.goal-panel strong {
  color: var(--accent);
}

.goal-hints {
  margin: 8px 0 0;
  padding-left: 1.15rem;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.55;
}

.goal-hints li + li {
  margin-top: 4px;
}

.career-eval {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 600;
}

.source-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.info-panel {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(26, 35, 50, 0.92);
  box-shadow: var(--shadow);
}

.info-panel h2 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
}

.requirements-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 520px;
}

.requirements-cards {
  display: none;
  gap: 10px;
}

.req-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.req-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.req-card-label {
  font-weight: 600;
  color: var(--text);
}

.req-card-min {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.req-card-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.requirements-table th,
.requirements-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.requirements-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
}

.requirements-table td.num {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.info-block {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-block + .info-block {
  margin-top: 10px;
}

.info-block h3 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 600;
}

.info-block ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text);
}

.info-block li + li {
  margin-top: 4px;
}

.attrs-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.attrs-panel {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(26, 35, 50, 0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.attrs-panel h2 {
  margin: 0;
  padding: 12px 16px;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 600;
}

.attrs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.attr-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.attr-item:nth-child(odd) {
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.attr-item:nth-last-child(-n + 2) {
  border-bottom: none;
}

.attr-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.attr-value {
  font-weight: 600;
  font-size: 0.92rem;
}

.section-title {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--text);
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

.scroll-hint {
  display: none;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(26, 35, 50, 0.92);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #162033;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--panel-border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tbody tr:hover {
  background: var(--row-hover);
}

.action-name {
  display: block;
  font-weight: 600;
}

.action-scene {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.type-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.type-guide {
  background: rgba(155, 89, 182, 0.2);
  color: #c39bd3;
}

.type-life {
  background: rgba(46, 204, 113, 0.18);
  color: #58d68d;
}

.type-work {
  background: rgba(241, 196, 15, 0.18);
  color: #f4d03f;
}

.type-study {
  background: rgba(91, 140, 255, 0.2);
  color: var(--accent);
}

.num {
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.num.highlight {
  color: var(--accent);
  font-weight: 700;
}

.effect-cell {
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 220px;
}

.note-cell {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  max-width: 200px;
}

.mobile-cards {
  gap: 12px;
}

.action-card {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(26, 35, 50, 0.92);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.action-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.action-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.action-stat {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.action-stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.action-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.action-stat-value.highlight {
  color: var(--accent);
}

.action-effect {
  margin: 0 0 6px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.action-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.footer {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer p {
  margin: 0;
  line-height: 1.55;
}

.data-note {
  margin-top: 8px !important;
  font-size: 0.84rem !important;
  color: var(--muted);
}

@media (max-width: 900px) and (min-width: 769px) {
  .scroll-hint {
    display: block;
  }
}

@media (max-width: 768px) {
  .back-bar .back-link {
    min-height: 44px;
  }

  .strategy-guide,
  .info-panel,
  .goal-panel {
    padding: 12px 14px;
  }

  .strategy-title {
    font-size: 1rem;
  }

  .strategy-attrs,
  .strategy-events,
  .strategy-source {
    font-size: 0.84rem;
  }

  .attrs-section {
    grid-template-columns: 1fr;
  }

  .attrs-panel h2 {
    font-size: 0.88rem;
    line-height: 1.4;
  }

  .desktop-only {
    display: none;
  }

  .mobile-only.mobile-cards,
  .mobile-only.requirements-cards {
    display: grid;
  }

  .age-list {
    grid-template-columns: 1fr;
  }

  .stage-nav {
    padding: 6px 8px;
    gap: 4px;
    font-size: 0.82rem;
  }

  .stage-nav-home {
    padding: 8px 14px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .stage-nav-prev,
  .stage-nav-next {
    min-height: 36px;
    line-height: 36px;
  }

  .attrs-grid {
    grid-template-columns: 1fr;
  }

  .attr-item:nth-child(odd) {
    border-right: none;
  }

  .attr-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }

  .footer {
    font-size: 0.88rem;
  }

  .footer .disclaimer {
    font-size: 0.76rem;
  }

  .data-note {
    font-size: 0.8rem !important;
  }
}

@media (max-width: 380px) {
  .action-card-grid {
    grid-template-columns: 1fr;
  }
}

.empty-actions-note {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  line-height: 1.5;
}
