/* ── ON/OFF: ach-banner.js の ACH_BANNER_ON で制御 ──────── */

.ach-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0;
  background: linear-gradient(135deg, #7c5200 0%, #b8780a 30%, #d4960e 50%, #b8780a 70%, #7c5200 100%);
  border: 1.5px solid #c8900a;
  border-radius: 10px;
  margin: 0 0 14px;
  box-shadow: 0 4px 20px rgba(150,100,0,.4);
  min-height: 80px;
}
.ach-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.ach-left {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
}
.ach-icon {
  font-size: 2.2rem;
  color: #fff7c0;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}
.ach-text { min-width: 0; }
.ach-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fde68a;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.ach-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.ach-course {
  font-size: 0.82rem;
  font-weight: 600;
  margin-left: 4px;
}
.ach-detail {
  font-size: 0.78rem;
  font-weight: 500;
  color: #fde68a;
  margin-top: 3px;
}
.ach-right {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 10px 24px;
  border-left: 1px solid rgba(255,255,255,.2);
  text-align: center;
  min-width: 110px;
}
.ach-score-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #fde68a;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0;
}
.ach-score-num {
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,.35), 0 0 20px rgba(255,220,80,.6);
  letter-spacing: -1px;
}
.ach-date {
  font-size: 0.68rem;
  font-weight: 600;
  color: #fde68a;
  margin-top: 4px;
  white-space: nowrap;
}
/* ── 複数人レイアウト ────────────────────────────────────── */
.ach-banner--multi {
  align-items: center;
  padding: 12px 0 12px 16px;
  gap: 14px;
}
.ach-banner--multi .ach-icon {
  font-size: 2.2rem;
  color: #fff7c0;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
  position: relative;
}
.ach-body {
  flex: 1;
  min-width: 0;
  position: relative;
}
.ach-row {
  display: flex;
  align-items: center;
}
.ach-info {
  flex: 1;
  min-width: 0;
}
.ach-sep {
  height: 1px;
  background: rgba(255,255,255,.18);
  margin: 5px 0 5px;
  margin-right: 0;
}
.ach-banner--multi .ach-right {
  padding: 4px 24px;
  min-width: 100px;
}
.ach-banner--multi .ach-score-num {
  font-size: 2.2rem;
}

/* ── 4列グリッドレイアウト ──────────────────────────────── */
.ach-grid {
  flex: 1;
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.ach-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
  padding: 4px 10px;
}
.ach-cell + .ach-cell {
  border-left: 1px solid rgba(255,255,255,.2);
}
.ach-cell .ach-name {
  font-size: 1.05rem;
}
.ach-cell .ach-course {
  display: block;
  margin: 3px 0 0;
  font-size: 0.62rem;
  font-weight: 600;
  color: #fde68a;
  line-height: 1.3;
  min-height: 2.6em;
  word-break: keep-all;
  overflow-wrap: normal;
}
.ach-scores {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: auto;
  padding-top: 6px;
}
.ach-cell .ach-scores {
  margin-top: 0;
}
.ach-score { text-align: center; }
.ach-cell .ach-score-num { font-size: 2.2rem; }
.ach-cell .ach-detail {
  font-size: 0.7rem;
  margin-top: 5px;
  line-height: 1.4;
  min-height: 2.8em;
  word-break: keep-all;
  overflow-wrap: normal;
}

/* ── トロフィーを中央の区切り線上に配置 ─────────────────── */
.ach-banner--grid { padding: 12px 0; }
.ach-banner--grid .ach-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  margin: 0;
}
.ach-banner--grid .ach-cell:nth-child(2) { padding-right: 32px; }
.ach-banner--grid .ach-cell:nth-child(3) { padding-left: 32px; }

@media (max-width: 600px) {
  .ach-right { min-width: 90px; padding: 10px 14px; }
  .ach-score-num { font-size: 2.4rem; }

  .ach-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto 0 auto;
  }
  .ach-cell { padding: 8px 4px; }
  .ach-cell:nth-child(1) { grid-row: 1; grid-column: 1; }
  .ach-cell:nth-child(2) { grid-row: 1; grid-column: 2; }
  .ach-cell:nth-child(3) { grid-row: 3; grid-column: 1; }
  .ach-cell:nth-child(4) { grid-row: 3; grid-column: 2; }
  .ach-cell + .ach-cell { border-left: none; }
  .ach-cell:nth-child(even) { border-left: 1px solid rgba(255,255,255,.2); }
  .ach-cell:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.2); }
  .ach-cell .ach-name { font-size: 0.95rem; }
  .ach-cell .ach-course { font-size: 0.52rem; margin-top: 2px; line-height: 1.25; min-height: 2.5em; }
  .ach-cell .ach-score-num { font-size: 1.6rem; }
  .ach-cell .ach-score-label { font-size: 0.58rem; }
  .ach-cell .ach-detail { font-size: 0.6rem; letter-spacing: -0.02em; }
  .ach-scores { gap: 14px; }

  .ach-banner--grid { padding: 10px 0; }
  .ach-banner--grid .ach-icon {
    position: static;
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: center;
    align-self: center;
    transform: none;
    font-size: 1.4rem;
    margin: 0;
  }
  .ach-banner--grid .ach-cell:nth-child(2) { padding-right: 8px; }
  .ach-banner--grid .ach-cell:nth-child(3) { padding-left: 8px; }

  .ach-banner--multi { align-items: flex-start; padding: 10px 0 10px 12px; gap: 10px; }
  .ach-banner--multi .ach-icon { font-size: 1.5rem; margin-top: 6px; }
  .ach-banner--multi .ach-name {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 4px;
    font-size: 0.95rem;
  }
  .ach-banner--multi .ach-course { font-size: 0.6rem; margin-left: 0; font-weight: 500; opacity: .85; }
  .ach-banner--multi .ach-detail { font-size: 0.68rem; }
  .ach-banner--multi .ach-right { min-width: 62px; padding: 3px 10px; }
  .ach-banner--multi .ach-score-label { font-size: 0.58rem; }
  .ach-banner--multi .ach-score-num { font-size: 1.6rem; }
  .ach-banner--multi .ach-sep { margin: 4px 0; }
}

/* ── ダークテーマ（app/index.php 用）─────────────────────── */
.ach-banner--dark {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(70,162,218,.18);
  box-shadow: none;
}
.ach-banner--dark .ach-icon {
  color: #ffc400;
  filter: none;
}
.ach-banner--dark .ach-name {
  font-family: "Space Mono", monospace;
  color: #e0ecf6;
  text-shadow: none;
}
.ach-banner--dark .ach-course { color: #a8c2d8; }
.ach-banner--dark .ach-detail { color: #c8d8e8; }
.ach-banner--dark .ach-sep { background: rgba(255,255,255,.08); }
.ach-banner--dark .ach-right { border-left-color: rgba(70,162,218,.18); }
.ach-banner--dark .ach-cell + .ach-cell { border-left-color: rgba(70,162,218,.18); }
.ach-banner--dark .ach-cell:nth-child(even) { border-left-color: rgba(70,162,218,.18); }
.ach-banner--dark .ach-cell:nth-child(n+3) { border-top-color: rgba(70,162,218,.18); }
.ach-banner--dark .ach-score-label {
  font-family: "Space Mono", monospace;
  color: #a8c2d8;
}
.ach-banner--dark .ach-score-num {
  font-family: "Space Mono", monospace;
  color: #00e5ff;
  text-shadow: 0 0 14px rgba(0,229,255,.4);
}
