@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700;800&display=swap");

:root {
  --primary: #2eb086;
  --primary-light: #e8f8f2;
  --primary-dark: #1f9a72;
  --secondary: #4a9fe8;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1c1c1e;
  --muted: #8e8e93;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(46, 176, 134, 0.15);
  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 72px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --app-h: 100dvh;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  margin: 0;
  padding: 0;
  height: 100%;
  height: var(--app-h, 100dvh);
  overflow: hidden;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  min-height: var(--app-h, 100dvh);
  height: 100%;
  height: var(--app-h, 100dvh);
  font-family: "Noto Sans JP", "Hiragino Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: none;
}

.phone-shell {
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: 100%;
  min-height: var(--app-h, 100dvh);
  height: 100%;
  height: var(--app-h, 100dvh);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  box-sizing: border-box;
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
}

/* メニュー「スマホ縦サイズで固定」ON（既定） */
body.phone-viewport--fixed {
  background: #e8eaed;
}

body.phone-viewport--fixed .phone-shell {
  width: 100%;
  max-width: 390px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
}

body.phone-viewport--fluid .phone-shell {
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-shadow: none;
}

/* ── 画面共通ヘッダー ── */
.screen-header {
  position: relative;
  padding: 14px 20px 10px;
  background: var(--card);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.help-popover {
  position: absolute;
  top: calc(100% - 2px);
  right: 16px;
  z-index: 60;
  width: min(280px, calc(100% - 32px));
  padding: 12px 14px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  border: 1px solid #e8ecef;
}

.help-popover p {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
}

.help-popover p strong {
  font-weight: 800;
  color: var(--primary-dark);
}

.help-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 18px;
  width: 12px;
  height: 12px;
  background: var(--card);
  border-left: 1px solid #e8ecef;
  border-top: 1px solid #e8ecef;
  transform: rotate(45deg);
}

.icon-btn--help[aria-expanded="true"] {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.screen-header__center {
  flex: 1;
  text-align: center;
  padding: 0 8px;
}

.screen-header__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.screen-header__game-date {
  margin: 0 0 2px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.screen-header__center--date-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 0;
  flex: 1;
}

.screen-header__game-date--main {
  margin: 0;
  font-size: clamp(0.78rem, 3.2vw, 0.92rem);
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  line-height: 1.2;
}

.screen-header__game-date--main span {
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
}

.screen-header__sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.screen-header__sub.live {
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg);
  border-radius: 12px;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 8px);
  -webkit-overflow-scrolling: touch;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* ── ホーム：公園ヒーロー ── */
#view-home {
  background: var(--bg);
}

.home-park {
  position: relative;
  min-height: 400px;
  background-color: #7ec8e8;
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  padding-bottom: 8px;
  transition: background-color 0.6s ease;
}

html.app-booting #view-home .screen-header--park,
html.app-booting #view-home .home-hero,
html.app-booting #view-home .home-scroll > *,
html.app-reloading #view-home .screen-header--park,
html.app-reloading #view-home .home-hero,
html.app-reloading #view-home .home-scroll > * {
  visibility: hidden;
}

html.app-booting #view-home > .home-park,
html.app-booting #view-home > .home-scroll,
html.app-reloading #view-home > .home-park,
html.app-reloading #view-home > .home-scroll {
  pointer-events: none;
}

html.app-booting .home-skeleton,
html.app-reloading .home-skeleton {
  display: block;
}

html.app-booting .bottom-nav,
html.app-reloading .bottom-nav {
  opacity: 0.35;
  pointer-events: none;
}

.home-skeleton {
  display: none;
  padding: 0 0 8px;
}

.home-skeleton__park {
  min-height: 400px;
  padding: 8px 16px 12px;
  background: linear-gradient(180deg, #b8dde8 0%, #d4e8ef 100%);
}

.home-skeleton__scroll {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.skeleton-block {
  border-radius: var(--radius);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(255, 255, 255, 0.72) 45%,
    rgba(255, 255, 255, 0.35) 90%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.15s ease-in-out infinite;
}

.skeleton-block--header {
  width: 42%;
  height: 22px;
  margin: 8px auto 24px;
  border-radius: 99px;
}

.skeleton-block--ring {
  width: 220px;
  height: 220px;
  margin: 0 auto;
  border-radius: 50%;
}

.skeleton-block--stats {
  height: 88px;
}

.skeleton-block--point {
  height: 92px;
}

.skeleton-block--calendar {
  height: 280px;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.sidebar-backup-formats {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #667080;
}

.sidebar-backup-formats__em {
  color: #c62828;
  font-weight: 800;
}

.confirm-modal__formats {
  color: #c62828;
  font-weight: 800;
}

@keyframes homeEnterUp {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes homeEnterRing {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#view-home.home-enter--play .screen-header--park {
  animation: homeEnterUp 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#view-home.home-enter--play .home-hero {
  animation: homeEnterRing 0.62s cubic-bezier(0.22, 1, 0.36, 1) 0.07s both;
}

#view-home.home-enter--play .effort-card {
  animation: homeEnterUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

#view-home.home-enter--play .point-cards {
  animation: homeEnterUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

#view-home.home-enter--play .step-calendar-card {
  animation: homeEnterUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.26s both;
}

.bottom-nav.home-enter--play {
  animation: homeEnterUp 0.48s cubic-bezier(0.22, 1, 0.36, 1) 0.32s both;
}

@media (prefers-reduced-motion: reduce) {
  html.app-booting #view-home .screen-header--park,
  html.app-booting #view-home .home-hero,
  html.app-booting #view-home .home-scroll > *,
  html.app-reloading #view-home .screen-header--park,
  html.app-reloading #view-home .home-hero,
  html.app-reloading #view-home .home-scroll > * {
    visibility: visible;
  }

  html.app-booting .home-skeleton,
  html.app-reloading .home-skeleton {
    display: none;
  }

  html.app-booting .bottom-nav,
  html.app-reloading .bottom-nav {
    opacity: 1;
  }

  .skeleton-block {
    animation: none;
  }

  #view-home.home-enter--play .screen-header--park,
  #view-home.home-enter--play .home-hero,
  #view-home.home-enter--play .effort-card,
  #view-home.home-enter--play .point-cards,
  #view-home.home-enter--play .step-calendar-card,
  .bottom-nav.home-enter--play {
    animation: none;
  }
}

/* 朝・昼（5:00〜16:59） */
.home-park[data-time-period="day"] {
  background-color: #8ecae6;
  background-image: url("../images/park_morning.webp");
}

/* 夕方（17:00〜19:59） */
.home-park[data-time-period="evening"] {
  background-color: #e8a060;
  background-image: url("../images/park_sunset.webp");
}

.home-park[data-time-period="evening"][data-sunset-variant="1"] {
  background-image: url("../images/park_sunset.webp");
}

.home-park[data-time-period="evening"][data-sunset-variant="2"] {
  background-image: url("../images/park_sunset2.webp");
}

/* 夜（20:00〜4:59） */
.home-park[data-time-period="night"] {
  background-color: #1a2a44;
  background-image: url("../images/night1.webp");
}

.home-park[data-time-period="night"]::after {
  background: linear-gradient(to bottom, transparent, var(--bg));
  height: 56px;
}

.home-park::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

.screen-header--park {
  background: transparent;
  border: none;
  position: relative;
  z-index: 2;
  padding-top: max(8px, env(safe-area-inset-top, 0px));
  align-items: center;
}

.screen-header--park .screen-header__title {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.icon-btn--help-sm {
  width: 32px;
  height: 32px;
  font-size: 0.88rem;
  border-radius: 10px;
}

.icon-btn--light {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
  color: #fff;
}

.home-park[data-time-period="day"] .icon-btn--light {
  background: rgba(255, 255, 255, 0.94);
  color: #1a5c4a;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.14);
}

.home-park[data-time-period="day"] .icon-btn--light:active {
  background: rgba(255, 255, 255, 0.82);
}

.home-park[data-time-period="day"] .icon-btn--help[aria-expanded="true"] {
  background: #e8f8f2;
  color: #0d6b4f;
}

.icon-btn--help[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.55);
}

.help-popover--park {
  right: 16px;
}

.home-hero {
  position: relative;
  z-index: 1;
  padding: 4px 16px 12px;
  display: flex;
  justify-content: center;
  touch-action: pan-y;
}

.steps-ring-wrap {
  position: relative;
  width: 300px;
  height: 300px;
}

.steps-ring-wrap--animating .count,
.steps-ring-wrap--animating .remaining {
  animation: steps-ring-count-pulse 0.28s ease-in-out infinite;
}

@keyframes steps-ring-count-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

.steps-center .count,
.steps-center .remaining {
  display: inline-block;
  transform-origin: center center;
  font-variant-numeric: tabular-nums;
}

@keyframes homeDaySlideLeft {
  0% {
    opacity: 0.35;
    transform: translate3d(22px, 0, 0) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes homeDaySlideRight {
  0% {
    opacity: 0.35;
    transform: translate3d(-22px, 0, 0) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.home-hero.home-day-slide--left,
.effort-card.home-day-slide--left {
  animation: homeDaySlideLeft 0.52s cubic-bezier(0.2, 0.75, 0.2, 1);
}

.home-hero.home-day-slide--right,
.effort-card.home-day-slide--right {
  animation: homeDaySlideRight 0.52s cubic-bezier(0.2, 0.75, 0.2, 1);
}

.steps-ring-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

.steps-glass {
  position: absolute;
  width: 200px;
  height: 200px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 14px 18px;
  box-sizing: border-box;
}

.steps-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  pointer-events: none;
  z-index: 4;
  width: 100%;
  gap: 1px;
  transform: translateY(-4px);
}

.steps-glass__icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 4px rgba(46, 176, 134, 0.35));
}

.steps-center .count-line {
  margin: 0;
  line-height: 1.05;
}

.steps-center .count {
  font-size: 2.15rem;
  font-weight: 800;
  color: #1c1c1e;
  letter-spacing: -0.03em;
}

.steps-center .count-unit {
  font-size: 1rem;
  font-weight: 700;
  color: #1c1c1e;
  margin-left: 2px;
}

.steps-center .goal-line {
  margin: 0;
  font-size: 0.72rem;
  color: #6b7280;
  font-weight: 500;
  line-height: 1.2;
}

.steps-center .remaining {
  margin: 0;
  font-size: 1.05rem;
  color: #2eb086;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.65);
}

.home-scroll {
  position: relative;
  z-index: 2;
  margin-top: -12px;
  padding: 0 16px 8px;
}

.effort-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 14px;
  margin-bottom: 12px;
  touch-action: pan-y;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 4px 10px;
  min-width: 0;
}

.stat-item:not(:last-child) {
  border-right: 1px solid #e8ecef;
}

.stat-item .stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
}

.stat-data {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.stat-data__icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.stat-data__icon--time {
  font-size: 1.05rem;
  line-height: 1;
  width: auto;
  height: auto;
}

.stat-item .stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-item .stat-unit {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.point-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.point-card {
  border: none;
  border-radius: var(--radius);
  padding: 14px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-family: inherit;
  cursor: default;
}

.point-card--teal {
  background: linear-gradient(145deg, #3cc9a0, #2eb086);
  color: #fff;
  box-shadow: 0 4px 14px rgba(46, 176, 134, 0.35);
  cursor: pointer;
  width: 100%;
}

.point-card--teal:active {
  transform: scale(0.98);
}

.point-card--mint {
  background: linear-gradient(145deg, #e8f8f2, #d4f0e4);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  justify-content: space-between;
  width: 100%;
}

.point-card--ad {
  background: linear-gradient(135deg, #ffb347 0%, #ff8c00 55%, #ff6b00 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 140, 0, 0.38);
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.point-card--ad:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #b8bcc4;
  box-shadow: none;
}

.point-card-ad__play {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

.point-card--ad .label {
  font-size: 0.68rem;
  opacity: 0.95;
}

.point-card--ad .value {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.point-card-ad__sub {
  font-size: 0.62rem;
  font-weight: 600;
  opacity: 0.92;
  line-height: 1.25;
  margin-top: 2px;
}

.coin-p {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  box-shadow: none;
}

.coin-p img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.point-card--teal .label {
  font-size: 0.68rem;
  opacity: 0.92;
}

.point-card--teal .value {
  font-size: 1.2rem;
  font-weight: 800;
}

.point-card--mint .label {
  font-size: 0.68rem;
  color: var(--muted);
}

.point-card--mint .value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.point-card .value small {
  font-size: 0.68rem;
  font-weight: 600;
}

.point-card--mint .chevron {
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 300;
  line-height: 1;
}

.btn-ad-double {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 0 0 14px;
  padding: 18px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ffb347 0%, #ff8c00 50%, #ff6b00 100%);
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(255, 140, 0, 0.45);
  cursor: pointer;
  line-height: 1.35;
}

.btn-ad-double::before {
  content: "▶";
  display: inline-flex;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.btn-ad-double:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #ccc;
  box-shadow: none;
}

.goal-bonus-hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 8px 0 0;
}

.step-calendar-card {
  position: relative;
  margin: 0 0 14px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 12px 48px;
  touch-action: pan-y;
  user-select: none;
}

.step-calendar-card .step-calendar-nav__btn {
  touch-action: manipulation;
}

.step-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
}

.step-calendar-nav__btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.step-calendar-nav__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.step-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.step-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.step-calendar-day {
  position: relative;
  aspect-ratio: 1;
  min-height: 40px;
  border: none;
  border-radius: 10px;
  background: #f4f6f8;
  padding: 4px 2px 2px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  font: inherit;
  color: var(--text);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.step-calendar-day--empty {
  background: transparent;
  pointer-events: none;
}

.step-calendar-day--today {
  background: #f0faf6;
}

.step-calendar-day--today:not(.step-calendar-day--selected) {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.step-calendar-day--goal {
  background: #e8f8f0;
}

.step-calendar-day--selected {
  box-shadow: inset 0 0 0 2px #3b82f6;
  background: #eef4ff;
}

.step-calendar-day--preview {
  box-shadow: inset 0 0 0 2px #f59e0b;
  background: #fffbeb;
}

.step-calendar-day--preview.step-calendar-day--selected {
  box-shadow: inset 0 0 0 2px #3b82f6, inset 0 0 0 4px #f59e0b;
}

.step-calendar-day--future {
  opacity: 0.38;
  cursor: not-allowed;
}

.step-calendar-day__head {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}

.step-calendar-day__markers {
  position: absolute;
  top: 2px;
  right: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  pointer-events: none;
}

.step-calendar-day__num {
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
}

.step-calendar-day__goal-check {
  position: relative;
  flex-shrink: 0;
  width: 6px;
  height: 6px;
}

.step-calendar-day__goal-check::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 4px;
  border: solid #22a06b;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  box-sizing: border-box;
}

.step-calendar-day__steps {
  margin-top: auto;
  padding-bottom: 1px;
  font-size: 0.56rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}

.step-calendar-day--goal .step-calendar-day__steps {
  color: #166534;
}

.step-calendar-day__memo {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
}

.step-calendar-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 2px 0;
  padding-right: 44px;
  font-size: 0.68rem;
  color: var(--muted);
}

.step-calendar-legend__goal-check {
  position: relative;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: #e8f8f0;
}

.step-calendar-legend__goal-check::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 3px;
  height: 6px;
  border: solid #22a06b;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  box-sizing: border-box;
}

.step-calendar-add {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #159f90, #2eb086);
  color: #fff;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 3px 12px rgba(21, 159, 144, 0.45);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.step-calendar-add:active {
  transform: scale(0.94);
}

@keyframes stepCalendarSlideLeft {
  0% {
    transform: translateX(14px);
    opacity: 0.5;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes stepCalendarSlideRight {
  0% {
    transform: translateX(-14px);
    opacity: 0.5;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.step-calendar-card--slide-left {
  animation: stepCalendarSlideLeft 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.step-calendar-card--slide-right {
  animation: stepCalendarSlideRight 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-sheet--day-detail {
  width: min(100%, 340px);
  max-width: 340px;
  padding: 16px 18px 18px;
  box-sizing: border-box;
}

.modal-sheet--day-detail h2 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 800;
}

.day-detail-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
}

.day-detail-field__label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.day-detail-field input,
.day-detail-field textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.92rem;
  box-sizing: border-box;
}

.day-detail-field textarea {
  resize: vertical;
  min-height: 72px;
}

.day-detail-goal-hint {
  margin: 0 0 12px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

.day-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.modal-sheet--day-detail .btn-day-detail {
  flex: 1;
  width: auto;
  min-width: 0;
  margin-top: 0;
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 10px;
}

.modal-sheet--april-welcome {
  width: min(100%, 360px);
  max-width: 360px;
  padding: 18px 18px 16px;
  box-sizing: border-box;
}

.modal-sheet--april-welcome h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 800;
}

.april-welcome__lead {
  margin: 0 0 12px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text);
}

.april-welcome__block {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f6f8;
}

.april-welcome__block h3 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
}

.april-welcome__block p,
.april-welcome__fallback {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.april-welcome__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.april-welcome__person {
  padding: 6px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.april-welcome__person:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.april-welcome__person-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  font-weight: 700;
}

.april-welcome__grade {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  color: #334155;
  background: #e8edf2;
}

.april-welcome__name {
  font-weight: 700;
}

.april-welcome__person-records {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 4px;
  padding-left: 2px;
}

.april-welcome__person-records .rec-chip {
  font-size: 0.62rem;
}

.modal-sheet--april-welcome .btn-primary {
  width: 100%;
  margin-top: 4px;
}

body.april-welcome-lock {
  overflow: hidden;
}

.modal-overlay--forced.open {
  pointer-events: auto;
}

.seasonal-calendar-event--roster .seasonal-calendar-event__title {
  color: #0f766e;
}

.modal-sheet--day-detail .btn-day-detail.btn-ghost {
  border: 1px solid #dde3ea;
  background: #f6f8fa;
  color: var(--text);
}

.day-detail-date-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.day-detail-date-row input[type="number"] {
  width: 4.2rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 8px;
  font: inherit;
  font-size: 0.92rem;
  box-sizing: border-box;
  text-align: center;
}

.day-detail-date-row input#dayDetailYear {
  width: 5rem;
}

.day-detail-date-row__unit {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  margin-right: 2px;
}

.dev-panel {
  margin: 0 0 16px;
  padding: 12px;
  border: 2px dashed #c5e8d8;
  border-radius: var(--radius-sm);
  background: #f8fffb;
}

.dev-panel h4 {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--primary-dark);
}

.dev-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.dev-steps button {
  padding: 10px 4px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.dev-steps button.dev-steps--minus {
  background: #fff;
  color: #e74c3c;
  border: 1.5px solid #f5c6c0;
}

/* ── 実績（履歴） ── */
.history-body {
  padding: 0 16px 16px;
}

.history-period-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 2px 0 10px;
  padding: 4px;
  background: #eef2f4;
  border-radius: 14px;
}

.history-period-tab {
  border: none;
  background: transparent;
  color: #667080;
  font-size: 0.86rem;
  font-weight: 700;
  border-radius: 11px;
  padding: 7px 0;
  font-family: inherit;
  cursor: pointer;
}

.history-period-tab--on {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tabs {
  display: flex;
  gap: 0;
  margin: 0 16px 12px;
  background: #e8ecef;
  border-radius: 12px;
  padding: 4px;
}

.tabs button {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.tabs button.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.week-nav[hidden] {
  display: none !important;
}

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #159f90, #2eb086);
  color: #fff;
  border-radius: 12px 12px 0 0;
  padding: 10px 14px;
  margin-bottom: 0;
  font-weight: 600;
  font-size: 0.94rem;
}

.week-nav button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
}

.week-total {
  text-align: left;
  margin: 0;
  padding: 12px 14px 8px;
  background: #fff;
  border-left: 1px solid #ebeff3;
  border-right: 1px solid #ebeff3;
}

.week-total .label {
  font-size: 0.76rem;
  color: var(--muted);
}

.week-total .value {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1f9683;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.week-total #histTotal {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  transform-origin: center center;
}

.week-total--animating #histTotal {
  animation: hist-total-pulse 0.32s ease-in-out infinite;
}

@keyframes hist-total-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

.week-total .unit {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1f9683;
}

.chart-card {
  background: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 12px 14px;
  margin-bottom: 14px;
  border: 1px solid #ebeff3;
  border-top: none;
  touch-action: pan-y;
}

.chart-scroll {
  overflow-x: hidden;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 2px;
}

.chart-card--year-line .chart-scroll {
  overflow-x: auto;
  touch-action: pan-x pan-y;
  scroll-behavior: smooth;
}

.chart-card--year-line .chart-canvas {
  display: block;
  max-width: none;
}

@keyframes chartCardSlideLeft {
  0% {
    transform: translateX(16px);
    opacity: 0.45;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes chartCardSlideRight {
  0% {
    transform: translateX(-16px);
    opacity: 0.45;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.chart-card--slide-left {
  animation: chartCardSlideLeft 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.chart-card--slide-right {
  animation: chartCardSlideRight 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.chart-canvas {
  width: 100%;
  height: 220px;
  display: block;
}

.summary-pair {
  display: none;
}

.summary-box {
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 14px;
  text-align: center;
}

.summary-box .label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.summary-box .value {
  font-size: 1.25rem;
  font-weight: 800;
}

.breakdown-card {
  display: none;
}

.breakdown-card h4 {
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.breakdown-row {
  margin-bottom: 12px;
}

.breakdown-row:last-child {
  margin-bottom: 0;
}

.breakdown-row .row-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.breakdown-row .row-head strong {
  color: var(--primary);
}

.breakdown-bar {
  height: 8px;
  background: #eef1f4;
  border-radius: 99px;
  overflow: hidden;
}

.breakdown-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  border-radius: 99px;
}

/* ── トレーニング ── */
#view-training.active {
  display: flex;
  flex-direction: column;
}

.training-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 16px 100px;
  min-height: 0;
}

.points-hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.points-hero__coin {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.points-hero .pt-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.points-hero .pt-value small {
  font-size: 1rem;
  font-weight: 600;
}

.character-wrap {
  position: relative;
  text-align: center;
  margin-bottom: 12px;
  min-height: 120px;
  overflow: visible;
}

.character-float-particle {
  position: absolute;
  bottom: 16px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  animation: training-float-rise 1.15s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  will-change: transform, opacity;
}

.character-float-particle img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(231, 76, 60, 0.28));
}

.character-float-particle--st img {
  width: 28px;
  height: 28px;
  filter: brightness(0) saturate(100%) invert(42%) sepia(72%) saturate(1800%) hue-rotate(186deg)
    brightness(96%) contrast(92%) drop-shadow(0 2px 8px rgba(52, 152, 219, 0.3));
}

@keyframes training-float-rise {
  0% {
    opacity: 0;
    transform: translate(calc(-50% + var(--float-drift, 0px)), 16px) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translate(calc(-50% + var(--float-drift, 0px) * 0.15), 2px) scale(1.08);
  }
  55% {
    opacity: 0.92;
    transform: translate(calc(-50% + var(--float-drift, 0px) * 0.55), -36px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--float-drift, 0px)), -92px) scale(0.82);
  }
}

.character-img {
  width: 120px;
  height: auto;
  max-height: 160px;
  object-fit: contain;
  margin: 0 auto;
  display: block;
  transform-origin: center bottom;
}

@keyframes trainingGrowPop {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.22);
  }
  55% {
    transform: scale(0.94);
  }
  100% {
    transform: scale(1);
  }
}

.training-grow-pop {
  animation: trainingGrowPop 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.character-img.training-grow-pop--sp {
  filter: drop-shadow(0 4px 12px rgba(231, 76, 60, 0.45));
}

.character-img.training-grow-pop--st {
  filter: drop-shadow(0 4px 12px rgba(52, 152, 219, 0.45));
}

.teammate-row__avatar.training-grow-pop--sp {
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.35);
  border-radius: 8px;
}

.teammate-row__avatar.training-grow-pop--st {
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.35);
  border-radius: 8px;
}

.alloc-panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px 20px;
}

.stat-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 0;
}

.stat-card {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 14px 12px 36px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  border: 1px solid #eef1f4;
  text-align: left;
  font-family: inherit;
  width: 100%;
}

.stat-card--tap {
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, filter 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -3px 0 rgba(0, 0, 0, 0.06),
    0 8px 16px rgba(0, 0, 0, 0.12);
}

.stat-card--tap:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -3px 0 rgba(0, 0, 0, 0.06),
    0 12px 20px rgba(0, 0, 0, 0.15);
}

.stat-card--tap:active:not(:disabled) {
  transform: translateY(2px) scale(0.99);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04),
    0 3px 8px rgba(0, 0, 0, 0.12);
  filter: saturate(1.05);
}

.stat-card--tap:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stat-card__plus {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  background: linear-gradient(180deg, #ffffff 0%, #f3f6fb 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(0, 0, 0, 0.06),
    0 5px 10px rgba(0, 0, 0, 0.18);
}

.stat-card--sp .stat-card__plus {
  color: #e74c3c;
}

.stat-card--st .stat-card__plus {
  color: #2f8fdd;
}

.stat-card--sp {
  background: linear-gradient(160deg, #ff9f86 0%, #ff7a5f 45%, #e74c3c 100%);
  border-color: #d74b3d;
  color: #fff;
}

.stat-card--st {
  background: linear-gradient(160deg, #74c0ff 0%, #4ea8ff 45%, #2f8fdd 100%);
  border-color: #2f7ec2;
  color: #fff;
}

.stat-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.stat-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  overflow: hidden;
  flex-shrink: 0;
}

.stat-badge img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.stat-badge--st img {
  width: 24px;
  height: 24px;
  filter: brightness(0) saturate(100%) invert(42%) sepia(72%) saturate(1800%) hue-rotate(186deg)
    brightness(96%) contrast(92%);
}

.stat-badge--sp {
  background: #fff0eb;
}

.stat-badge--st {
  background: #e8f2fc;
}

.hero-records {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eef1f4;
}

.hero-records .rec-chip--hero {
  display: grid;
  grid-template-columns: 6.5em 1fr;
  align-items: baseline;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.hero-records .rec-chip__label {
  font-weight: 800;
  color: var(--primary-dark);
}

.hero-records .rec-chip__val {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 1.05rem;
  font-weight: 800;
}

.hero-records .rec-chip__val--hint {
  font-size: 0.78rem;
  font-weight: 700;
  color: #667080;
  font-variant-numeric: normal;
}

.stat-card__title {
  font-size: 0.82rem;
  font-weight: 700;
  color: currentColor;
}

.stat-card .stat-lv {
  font-size: 1rem;
  font-weight: 800;
  color: currentColor;
  margin-bottom: 4px;
}

.stat-card .bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 2px;
}

.stat-card .bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}

.stat-card .bar--sp span {
  background: linear-gradient(90deg, #ff9a76, #e74c3c);
}

.stat-card .bar--st span {
  background: linear-gradient(90deg, #6eb5f5, #3498db);
}

.stat-card .xp {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.92);
  text-align: right;
  font-weight: 700;
  margin-bottom: 4px;
}

.teammates-panel {
  flex: 1 1 auto;
  margin-top: 12px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 24px;
  min-height: min(52dvh, 480px);
  display: flex;
  flex-direction: column;
}

.teammates-panel__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 0.9rem;
  font-weight: 700;
}

.mates-sort-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 1.5px solid #dce8f8;
  border-radius: 999px;
  background: #f5f9ff;
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mates-sort-btn:active {
  transform: scale(0.97);
}

.teammates-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 200px;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.teammate-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 6px 10px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f2f5;
  align-items: start;
}

.teammate-row[data-mate-id] {
  will-change: transform;
}

.teammate-row--tap {
  cursor: pointer;
}

.teammate-row--tap:active {
  opacity: 0.92;
}

.role-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  vertical-align: middle;
  background: #fff3cd;
  color: #856404;
}

.role-badge--captain {
  background: #ffebee;
  color: #c62828;
}

.role-badge--vice {
  background: #e3f2fd;
  color: #1565c0;
}

.rec-chip--est {
  color: var(--muted);
}

.teammate-row__avatar {
  width: 36px;
  height: 36px;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  transform-origin: center center;
}

.teammate-row:last-child {
  border-bottom: none;
}

.teammate-row--hero {
  background: var(--primary-light);
  margin: 0 -16px;
  padding: 12px 16px;
  border-radius: 12px;
  border-bottom: none;
  margin-bottom: 8px;
}

.teammate-row__name {
  font-weight: 700;
  font-size: 0.88rem;
}

.teammate-row__grade {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  color: #334155;
  background: #e8edf2;
  vertical-align: middle;
}

.teammate-row__grade--captain {
  color: #fff;
  background: #c62828;
}

.teammate-row__grade--vice {
  color: #fff;
  background: #1565c0;
}

.teammate-row__retire {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: 2px;
}

.teammate-row__name small {
  font-weight: 600;
  color: var(--primary);
  margin-left: 6px;
  font-size: 0.7rem;
}

.teammate-row__stats {
  display: flex;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

.teammate-row__stats .sp-tag {
  color: #e74c3c;
  font-weight: 700;
}

.teammate-row__stats .st-tag {
  color: #3498db;
  font-weight: 700;
}

.teammate-row__records {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 4px;
  padding-left: 46px;
}

.rec-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.rec-chip small {
  font-weight: 600;
  color: var(--muted);
}

.alloc-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 8px;
}

.alloc-slider-wrap .side-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  width: 28px;
  text-align: center;
}

.alloc-slider-wrap input[type="range"] {
  flex: 1;
  height: 8px;
  accent-color: var(--primary);
}

.alloc-pt-display {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.alloc-pt-display span {
  font-size: 0.9rem;
  font-weight: 700;
}

.alloc-pt-display .sp-pt {
  color: #e74c3c;
}
.alloc-pt-display .st-pt {
  color: #3498db;
}

.team-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 16px;
}

.btn-confirm {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
}

.btn-confirm:disabled {
  opacity: 0.45;
  box-shadow: none;
}

.training-footer-space {
  height: 20px;
}

/* ── レース ── */
.race-body {
  padding: 0 16px 16px;
}

.race-points-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(145deg, #ffe566, #f5a623);
  padding: 6px 14px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(245, 166, 35, 0.35);
}

.race-points-badge__coin {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.race-hero-card {
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 14px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.race-hero-card:active {
  transform: scale(0.99);
  filter: brightness(0.96);
}

.race-hero-card h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.race-hero-card__sub {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
}

.race-hero-card__lockhint {
  margin: 8px 2px 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}

.race-levelmatch {
  display: block;
  width: 100%;
  box-sizing: border-box;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0;
  padding: 0 18px;
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transition:
    max-height 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s ease,
    padding 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    margin 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.race-levelmatch.is-open {
  max-height: 320px;
  opacity: 1;
  margin: -8px 0 14px;
  padding: 14px 18px 16px;
}

.race-levelmatch--ekiden.is-open {
  background: linear-gradient(135deg, #1a5c4a 0%, #238f6e 40%, #2eb086 100%);
  color: #fff;
}

.race-levelmatch--track.is-open {
  background: linear-gradient(135deg, #6b1515 0%, #b71c1c 45%, #e53935 100%);
  color: #fff;
}

.race-levelmatch__title {
  margin: 0 0 8px;
  font-size: 0.76rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
}

.race-levelmatch__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.race-levelmatch__btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.25;
}

.race-levelmatch__btn:active {
  background: rgba(255, 255, 255, 0.28);
}

.race-levelmatch__btn--active {
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.32);
  font-weight: 800;
}

.race-levelmatch__btn--locked {
  opacity: 0.38;
  filter: grayscale(0.55);
  cursor: not-allowed;
  pointer-events: none;
}

.race-hero-card--ekiden {
  background: linear-gradient(135deg, #1a5c4a 0%, #238f6e 40%, #2eb086 100%);
  color: #fff;
}

.race-hero-card--track {
  background: linear-gradient(135deg, #6b1515 0%, #b71c1c 45%, #e53935 100%);
  color: #fff;
}

.race-hero-card--record {
  background: linear-gradient(135deg, #6b5200 0%, #9a7b0a 45%, #c9a227 100%);
  color: #fff;
  cursor: default;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.race-hero-card--record h3,
.race-hero-card--record .race-hero-card__sub {
  pointer-events: none;
}

.race-hero-card--locked {
  filter: grayscale(0.75) brightness(0.72);
  opacity: 0.68;
}

.race-hero-card--record.race-hero-card--locked .record-grid--on-hero button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.race-official-hero {
  border-radius: var(--radius);
  padding: 16px 14px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #1a5c4a 0%, #238f6e 40%, #2eb086 100%);
  color: #fff;
}

.race-official-hero__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.race-official-hero__head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  flex: 1;
  min-width: 0;
}

.race-official-hero__calendar-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.race-official-hero__calendar-btn img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.race-official-hero__calendar-btn:active {
  opacity: 0.82;
}

.race-official-featured {
  display: flex;
  align-items: stretch;
  gap: 10px;
  border-radius: calc(var(--radius) - 4px);
  padding: 12px 12px 12px 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.race-official-featured--inactive {
  filter: grayscale(0.55) brightness(0.82);
  opacity: 0.88;
}

.race-official-featured__main {
  flex: 1;
  min-width: 0;
}

.race-official-featured__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.race-official-featured__name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
}

.race-official-featured__level {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 999px;
  padding: 2px 8px;
}

.race-official-featured__month {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.race-official-featured .official-seasonal-cond {
  color: rgba(255, 255, 255, 0.88);
}

.race-official-featured__countdown {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 6px;
  text-align: center;
  line-height: 1;
}

.race-official-featured__countdown-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2px;
}

.race-official-featured__countdown-num {
  font-size: 2.4rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.race-official-featured__countdown-unit {
  font-size: 0.82rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  margin-top: 2px;
}

.race-official-featured__status {
  flex-shrink: 0;
  min-width: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.88);
  padding: 8px 6px;
}

.race-official-featured .official-seasonal-btn--ready {
  align-self: center;
  min-width: 72px;
  background: #fff;
  color: #1c1c1e;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.race-official-featured .official-seasonal-btn--path-ok {
  background: linear-gradient(135deg, #e53935, #ff5252);
  color: #fff;
  border: none;
  box-shadow: 0 2px 12px rgba(229, 57, 53, 0.55);
  font-weight: 800;
}

.race-official-featured .official-seasonal-btn--path-ng {
  background: rgba(255, 255, 255, 0.92);
  color: #667080;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.race-official-featured .official-seasonal-btn--wait,
.race-official-featured .official-seasonal-btn--disabled,
.race-official-featured .official-seasonal-btn--done {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.race-official-season {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #ebeff3;
  padding: 16px 14px 10px;
  margin-bottom: 14px;
}

.race-official-season__head h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1c1c1e;
}

.race-official-season__seeds {
  margin: 0 0 12px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
}

.official-seasonal-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid #eef2f4;
}

.official-seasonal-row:first-child {
  border-top: none;
  padding-top: 0;
}

.official-seasonal-row__info {
  flex: 1;
  min-width: 0;
}

.official-seasonal-row__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.official-seasonal-row__name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #1c1c1e;
}

.official-seasonal-row__band {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: #e8f8f2;
  border-radius: 999px;
  padding: 2px 8px;
}

.official-seasonal-cond {
  margin: 0;
  padding-left: 1.1em;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--muted);
}

.official-seasonal-cond li + li {
  margin-top: 2px;
}

.official-seasonal-btn {
  flex-shrink: 0;
  min-width: 72px;
  border: none;
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.2;
  text-align: center;
}

.official-seasonal-btn--ready {
  background: linear-gradient(135deg, #159f90, #2eb086);
  color: #fff;
}

.official-seasonal-btn--wait,
.official-seasonal-btn--disabled,
.official-seasonal-btn--done {
  background: #eef2f4;
  color: #667080;
  cursor: default;
}

.official-seasonal-btn--ready:active {
  filter: brightness(0.95);
}

.modal-sheet--seasonal {
  max-height: min(82vh, 640px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.seasonal-calendar-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.seasonal-calendar-modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.seasonal-calendar-body {
  overflow-y: auto;
  padding-bottom: 8px;
}

.seasonal-calendar-seeds {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f6f8;
  border: 1px solid #e0e4e8;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--text);
}

.seasonal-calendar-seeds__label {
  font-weight: 800;
  margin-right: 4px;
}

.seasonal-calendar-seed-sep {
  margin: 0 0.15em;
  color: var(--muted);
  font-weight: 500;
}

.seasonal-calendar-seed--ok {
  color: #1a5c4a;
}

.seasonal-calendar-seed--ok strong {
  color: #159f90;
}

.seasonal-calendar-seed--ng {
  color: #9aa3ad;
}

.seasonal-calendar-seed--ng strong {
  color: #b0b8c0;
  font-weight: 700;
}

.seasonal-calendar-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.seasonal-calendar-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f4;
}

.seasonal-calendar-row:first-child {
  padding-top: 0;
}

.seasonal-calendar-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.seasonal-calendar-row--current {
  background: linear-gradient(90deg, rgba(35, 143, 110, 0.22) 0%, rgba(35, 143, 110, 0.06) 100%);
  margin: 0 -12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(35, 143, 110, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.seasonal-calendar-row--current + .seasonal-calendar-row {
  border-top: none;
}

.seasonal-calendar-row__month {
  flex-shrink: 0;
  width: 3.2em;
  font-size: 0.82rem;
  font-weight: 900;
  color: #238f6e;
  padding-top: 2px;
  line-height: 1.35;
}

.seasonal-calendar-row--current .seasonal-calendar-row__month {
  color: #1a5c4a;
}

.seasonal-calendar-row__now {
  display: block;
  margin-top: 2px;
  font-size: 0.58rem;
  font-weight: 800;
  color: #fff;
  background: #238f6e;
  border-radius: 4px;
  padding: 1px 4px;
  text-align: center;
  letter-spacing: 0.04em;
}

.seasonal-calendar-row__events {
  flex: 1;
  min-width: 0;
}

.seasonal-calendar-event + .seasonal-calendar-event {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e4eaee;
}

.seasonal-calendar-event__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.seasonal-calendar-event__title {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.seasonal-calendar-event__level {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: #eef2f4;
  border-radius: 999px;
  padding: 2px 8px;
}

.seasonal-calendar-event--eligible .seasonal-calendar-event__level {
  color: #b71c1c;
  background: #ffebee;
}

.seasonal-calendar-event__status {
  margin-top: 4px;
  font-size: 0.72rem;
  line-height: 1.45;
}

.seasonal-calendar-event--eligible .seasonal-calendar-event__title {
  color: #c62828;
}

.seasonal-calendar-event--eligible .seasonal-calendar-event__status {
  color: #d84343;
}

.seasonal-calendar-event--ineligible .seasonal-calendar-event__title,
.seasonal-calendar-event--ineligible .seasonal-calendar-event__status {
  color: #9aa3ad;
}

.seasonal-calendar-event--ineligible .seasonal-calendar-event__level {
  color: #b0b8c0;
  background: #f3f5f7;
}

.seasonal-calendar-event--empty {
  font-size: 0.82rem;
  color: #c8ced4;
  padding-top: 2px;
}

.status-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.status-card h4 {
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.status-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.record-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.record-grid button {
  padding: 14px 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

.record-grid--on-hero button:active {
  background: rgba(255, 255, 255, 0.28);
}

.race-pick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.race-pick-grid#ekidenLegGrid {
  grid-template-columns: repeat(2, 1fr);
}

.race-pick-btn {
  border: 2px solid var(--primary-light);
  background: #fff;
  border-radius: 12px;
  padding: 12px 8px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}

.race-pick-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.race-pick-btn__title {
  display: block;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--primary-dark);
}

.race-pick-btn__sub {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 4px;
}

.btn-race-full,
.btn-race-placement {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}

.modal-sheet--placement {
  max-width: min(100%, 400px);
  max-height: calc(100dvh - var(--nav-h) - var(--safe-b) - 8px);
  border-radius: 20px 20px 0 0;
  padding: 16px 16px 12px;
  overflow-y: auto;
}

#ekidenPlacementModal.modal-overlay.open,
#trackPlacementModal.modal-overlay.open {
  padding-bottom: calc(var(--nav-h) + var(--safe-b));
  align-items: flex-end;
}

#ekidenPlacementModal .modal-sheet--placement,
#trackPlacementModal .modal-sheet--placement {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - var(--nav-h) - var(--safe-b) - 4px);
  min-height: min(78dvh, calc(100dvh - var(--nav-h) - var(--safe-b) - 8px));
}

#ekidenPlacementModal .cpu-slots.cpu-slots--map10,
#trackPlacementModal .cpu-slots.cpu-slots--map10 {
  gap: 5px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

#ekidenPlacementModal .cpu-slots.cpu-slots--map10 .cpu-slot-inner,
#trackPlacementModal .cpu-slots.cpu-slots--map10 .cpu-slot-inner {
  padding: 4px 8px;
}

#ekidenPlacementModal .cpu-slots.cpu-slots--map10 .cpu-slot-leg-num,
#trackPlacementModal .cpu-slots.cpu-slots--map10 .cpu-slot-leg-num {
  font-size: 0.68rem;
}

#ekidenPlacementModal .cpu-slots.cpu-slots--map10 .cpu-slot-km,
#trackPlacementModal .cpu-slots.cpu-slots--map10 .cpu-slot-km {
  font-size: 0.62rem;
}

#ekidenPlacementModal .cpu-slots.cpu-slots--map10 .cpu-slot-player-name,
#trackPlacementModal .cpu-slots.cpu-slots--map10 .cpu-slot-player-name {
  font-size: 0.72rem;
}

#ekidenPlacementModal .cpu-slots.cpu-slots--map10 .cpu-slot-stat-num,
#trackPlacementModal .cpu-slots.cpu-slots--map10 .cpu-slot-stat-num {
  font-size: 0.68rem;
}

#ekidenPlacementModal .cpu-pick-list,
#trackPlacementModal .cpu-pick-list {
  flex: 1 1 auto;
  max-height: none;
  min-height: 160px;
  overflow-y: auto;
  margin-bottom: 6px;
}

#ekidenPlacementModal .cpu-actionbar,
#trackPlacementModal .cpu-actionbar {
  margin-bottom: 8px;
}

#ekidenPlacementModal .placement-title-row,
#trackPlacementModal .placement-title-row {
  margin-bottom: 2px;
}

#ekidenPlacementModal .placement-title-row h2,
#trackPlacementModal .placement-title-row h2 {
  font-size: 1rem;
}

.modal-overlay.open .modal-sheet--placement {
  border-radius: 20px;
}

.placement-hint {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.placement-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.placement-title-row h2 {
  margin: 0;
  font-size: 1.1rem;
}

.placement-title-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cpu-placement-time-toggle-btn {
  padding: 6px 10px;
  border: 1.5px solid #dce8f8;
  border-radius: 999px;
  background: #f5f9ff;
  color: var(--primary-dark);
  font-size: 0.68rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.cpu-placement-time-toggle-btn:active {
  transform: scale(0.97);
}

.placement-close-top {
  flex-shrink: 0;
}

.cpu-actionbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: stretch;
}

.cpu-actionbar .btn-clear-placement {
  flex: 0 0 52px;
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  margin-top: 0;
  padding: 12px 6px;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: normal;
}

.cpu-actionbar .btn-start-placement {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin-top: 0;
  padding: 12px 16px;
  font-size: 0.95rem;
}

.cpu-actionbar .btn-start-placement--wait,
.cpu-actionbar .btn-start-placement:disabled {
  background: #d8dde3;
  color: #8a939e;
  border-color: #d8dde3;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

.cpu-actionbar .btn-start-placement--ready:not(:disabled) {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.cpu-slots.cpu-slots--track5 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, auto);
  grid-template-areas:
    "z5a z5b"
    "z5c z5d"
    "z5e .";
  gap: 6px;
  margin-bottom: 12px;
}

.cpu-slots.cpu-slots--track5 > [data-track-slot="0"] {
  grid-area: z5a;
}

.cpu-slots.cpu-slots--track5 > [data-track-slot="1"] {
  grid-area: z5b;
}

.cpu-slots.cpu-slots--track5 > [data-track-slot="2"] {
  grid-area: z5c;
}

.cpu-slots.cpu-slots--track5 > [data-track-slot="3"] {
  grid-area: z5d;
}

.cpu-slots.cpu-slots--track5 > [data-track-slot="4"] {
  grid-area: z5e;
}

.cpu-slots.cpu-slots--track5 .cpu-slot-inner {
  padding: 6px 10px;
}

.cpu-placement-divider {
  border: none;
  border-top: 1px solid #e8ecef;
  margin: 4px 0 12px;
}

.btn-ghost--inline {
  width: auto;
  padding: 8px 14px;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.field-tag-dev {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fff3e0;
  color: #e65100;
  font-size: 0.65rem;
  font-weight: 700;
  vertical-align: middle;
}

.field--dev {
  display: none;
}

html.dev-mode .field--dev {
  display: block;
}

.promo-code-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.promo-code-row .settings-text-input {
  flex: 1;
  min-width: 0;
}

.btn-promo-apply {
  flex-shrink: 0;
  padding: 10px 12px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.dev-panel--sidebar {
  margin-top: 12px;
}

.dev-panel__hint {
  margin: 0 0 10px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
}

.dev-panel__date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.player-detail-dev-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #d8dee4;
}

.player-detail-dev-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.player-detail-dev-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.player-detail-dev-grid input {
  width: 100%;
  padding: 8px;
  border: 1px solid #d8dee4;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
}

.player-detail-dev-best {
  margin-bottom: 8px;
}

.player-detail-dev-best__label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.player-detail-dev-best__inputs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
}

.player-detail-dev-best__inputs input {
  width: 3.2rem;
  padding: 6px 4px;
  border: 1px solid #d8dee4;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  text-align: center;
}

.race-levelmatch__note {
  margin: 0 0 8px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

.race-levelmatch__btn--selected {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.race-levelmatch__btn-main {
  display: block;
}

.race-levelmatch__reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  border-radius: 999px;
  white-space: nowrap;
}

.race-levelmatch__reward img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
}

.race-levelmatch__reward--pending {
  padding: 3px 7px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.race-levelmatch__reward--claimed {
  padding: 3px 7px;
  background: rgba(0, 0, 0, 0.14);
  color: rgba(255, 255, 255, 0.55);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.45);
}

.race-levelmatch__reward--claimed img {
  opacity: 0.45;
  filter: grayscale(0.85);
}

.race-result-bonus {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff8e6;
  color: #8a6a00;
  font-size: 0.86rem;
  font-weight: 800;
}

.race-result-bonus__coin {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.race-result-unlock {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.race-result-unlock--new {
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 1.05rem;
  margin-top: 16px;
}

.race-result-unlock-sub {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

.prelim-body {
  padding: 0 4px 8px;
  max-width: 100%;
  box-sizing: border-box;
}

#seasonalPrelimModal .modal-sheet--placement {
  width: min(100%, 420px);
  max-width: 420px;
  max-height: min(92vh, 720px);
  overflow-y: auto;
}

.cpu-slots.cpu-slots--prelim {
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.cpu-slots.cpu-slots--prelim-h {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cpu-slots.cpu-slots--prelim-z {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "z1a z1b"
    "z2a z2b"
    "z3a z3b"
    "z4a z4b";
}

.cpu-slots.cpu-slots--prelim-z > [data-prelim-slot-index="0"] {
  grid-area: z1a;
}

.cpu-slots.cpu-slots--prelim-z > [data-prelim-slot-index="1"] {
  grid-area: z1b;
}

.cpu-slots.cpu-slots--prelim-z > [data-prelim-slot-index="2"] {
  grid-area: z2a;
}

.cpu-slots.cpu-slots--prelim-z > [data-prelim-slot-index="3"] {
  grid-area: z2b;
}

.cpu-slots.cpu-slots--prelim-z > [data-prelim-slot-index="4"] {
  grid-area: z3a;
}

.cpu-slots.cpu-slots--prelim-z > [data-prelim-slot-index="5"] {
  grid-area: z3b;
}

.cpu-slots.cpu-slots--prelim-z > [data-prelim-slot-index="6"] {
  grid-area: z4a;
}

.cpu-slots.cpu-slots--prelim-z > [data-prelim-slot-index="7"] {
  grid-area: z4b;
}

.cpu-slots.cpu-slots--prelim .cpu-slot-card {
  width: 100%;
  box-sizing: border-box;
}

.cpu-slots.cpu-slots--prelim .cpu-slot-inner {
  height: 4.1rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.cpu-slots.cpu-slots--prelim .cpu-slot-meta {
  margin-bottom: 2px;
  flex-shrink: 0;
}

.cpu-slots.cpu-slots--prelim .cpu-slot-player-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 1.25rem;
  flex-shrink: 0;
}

.cpu-slots.cpu-slots--prelim .cpu-slot-stat-num--placeholder {
  visibility: hidden;
}

.cpu-slots.cpu-slots--prelim .cpu-slot-player-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cpu-slots.cpu-slots--prelim .cpu-slot-stat-num {
  flex-shrink: 0;
  white-space: nowrap;
}

#seasonalPrelimModal .cpu-pick-list {
  max-height: min(36vh, 280px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#seasonalPrelimResultModal .modal-sheet--record {
  width: min(100%, 420px);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.prelim-result-tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 8px;
}

.prelim-result-tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e0e4e8;
  background: #f4f6f8;
  font-size: 0.78rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  color: var(--muted);
}

.prelim-result-tab--on {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.prelim-heat-divider {
  height: 0;
  border-top: 3px solid color-mix(in srgb, var(--primary) 35%, #fff);
  margin: 4px 0;
}

.prelim-actionbar {
  margin-bottom: 8px;
}

.prelim-pick-list {
  max-height: 320px;
  overflow: auto;
}

.prelim-result-tab-label {
  margin: 12px 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
}

.prelim-result-seed-line {
  margin: 6px 0;
  font-size: 0.72rem;
  opacity: 0.85;
  text-align: center;
}

.prelim-lead {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

.prelim-slots {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.prelim-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #e0e4e8;
  background: var(--card);
  font-family: inherit;
  font-size: 0.82rem;
  text-align: left;
  width: 100%;
}

.prelim-slot--empty {
  color: var(--muted);
}

.prelim-slot--filled {
  cursor: pointer;
}

.prelim-slot__label {
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 4.5rem;
}

.prelim-pick-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  margin-bottom: 12px;
}

.prelim-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px;
  border: 1px solid #e0e4e8;
  border-radius: var(--radius-sm);
  background: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.prelim-pick--on {
  border-color: var(--primary);
  background: var(--primary-light);
}

.prelim-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.prelim-result-body {
  text-align: left;
  max-height: 50vh;
  overflow: auto;
}

.prelim-result-pass {
  margin: 0 0 10px;
  font-weight: 800;
  color: var(--primary-dark);
}

.prelim-result-fail {
  margin: 0 0 10px;
  color: var(--muted);
}

.prelim-result-row {
  padding: 4px 0;
  font-size: 0.82rem;
  border-bottom: 1px solid #eef1f3;
}

.prelim-result-row--animate {
  opacity: 0;
  transform: translateY(6px);
  animation: prelimResultRowIn 0.32s ease forwards;
}

@keyframes prelimResultRowIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prelim-result-row--mine {
  color: var(--primary-dark);
  font-weight: 800;
}

.prelim-z-heat-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
}

.prelim-z-heat-nav-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.prelim-z-heat-nav-btn {
  min-width: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e0e4e8;
  background: #f4f6f8;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.prelim-z-heat-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.prelim-z-result-panels {
  display: grid;
  gap: 8px;
}

.prelim-z-result-panel {
  border: 1px solid #e8ecef;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fafbfc;
  max-height: min(28vh, 220px);
  overflow-y: auto;
}

.prelim-z-result-panel-title {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
}

.prelim-z-final-note {
  margin: 0 0 8px;
  font-size: 0.75rem;
  color: var(--muted);
}

.prelim-z-final-groups {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.prelim-z-final-group {
  border: 1px solid #e8ecef;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fafbfc;
}

.prelim-z-final-group-title {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.prelim-z-final-total-title {
  margin: 0 0 6px;
}

.sidebar-premium {
  display: none !important;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e8ecef;
}

html.is-apple-mobile .sidebar-premium {
  display: none !important;
}

.btn-premium-ads {
  width: 100%;
  padding: 14px 12px;
  border: 2px solid #c9a227;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fff9e6 0%, #ffecb3 100%);
  color: #6b5200;
  font-size: 0.88rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}

.btn-premium-ads.is-active {
  background: linear-gradient(180deg, #e8f8f2 0%, #d4f0e4 100%);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.sidebar-premium__status {
  margin: 8px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
}

.cpu-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.cpu-slots.cpu-slots--map5 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, auto);
  grid-template-areas:
    "z5a z5b"
    "z5c z5d"
    "z5e .";
}

.cpu-slots.cpu-slots--map5 > [data-cpu-slot-leg="0"] {
  grid-area: z5a;
}

.cpu-slots.cpu-slots--map5 > [data-cpu-slot-leg="1"] {
  grid-area: z5b;
}

.cpu-slots.cpu-slots--map5 > [data-cpu-slot-leg="2"] {
  grid-area: z5c;
}

.cpu-slots.cpu-slots--map5 > [data-cpu-slot-leg="3"] {
  grid-area: z5d;
}

.cpu-slots.cpu-slots--map5 > [data-cpu-slot-leg="4"] {
  grid-area: z5e;
}

.cpu-slots.cpu-slots--map8 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, auto);
  grid-template-areas:
    "l1 l2"
    "l3 l4"
    "l5 l6"
    "l7 l8";
}

.cpu-slots.cpu-slots--map8 > [data-cpu-slot-leg="0"] {
  grid-area: l1;
}

.cpu-slots.cpu-slots--map8 > [data-cpu-slot-leg="1"] {
  grid-area: l2;
}

.cpu-slots.cpu-slots--map8 > [data-cpu-slot-leg="2"] {
  grid-area: l3;
}

.cpu-slots.cpu-slots--map8 > [data-cpu-slot-leg="3"] {
  grid-area: l4;
}

.cpu-slots.cpu-slots--map8 > [data-cpu-slot-leg="4"] {
  grid-area: l5;
}

.cpu-slots.cpu-slots--map8 > [data-cpu-slot-leg="5"] {
  grid-area: l6;
}

.cpu-slots.cpu-slots--map8 > [data-cpu-slot-leg="6"] {
  grid-area: l7;
}

.cpu-slots.cpu-slots--map8 > [data-cpu-slot-leg="7"] {
  grid-area: l8;
}

.cpu-slots.cpu-slots--map10 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(5, auto);
  grid-template-areas:
    "o1 o2"
    "o3 o4"
    "o5 o6"
    "o7 o8"
    "o9 o10";
}

.cpu-slots.cpu-slots--map10 > [data-cpu-slot-leg="0"] {
  grid-area: o1;
}

.cpu-slots.cpu-slots--map10 > [data-cpu-slot-leg="1"] {
  grid-area: o2;
}

.cpu-slots.cpu-slots--map10 > [data-cpu-slot-leg="2"] {
  grid-area: o3;
}

.cpu-slots.cpu-slots--map10 > [data-cpu-slot-leg="3"] {
  grid-area: o4;
}

.cpu-slots.cpu-slots--map10 > [data-cpu-slot-leg="4"] {
  grid-area: o5;
}

.cpu-slots.cpu-slots--map10 > [data-cpu-slot-leg="5"] {
  grid-area: o6;
}

.cpu-slots.cpu-slots--map10 > [data-cpu-slot-leg="6"] {
  grid-area: o7;
}

.cpu-slots.cpu-slots--map10 > [data-cpu-slot-leg="7"] {
  grid-area: o8;
}

.cpu-slots.cpu-slots--map10 > [data-cpu-slot-leg="8"] {
  grid-area: o9;
}

.cpu-slots.cpu-slots--map10 > [data-cpu-slot-leg="9"] {
  grid-area: o10;
}

.cpu-slot-card {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.cpu-slot-card--empty .cpu-slot-inner {
  border-style: dashed;
  background: #f4f6f8;
}

.cpu-slot-card--filled .cpu-slot-inner {
  border-color: var(--primary);
  background: var(--primary-light);
}

.cpu-slot-card--selected .cpu-slot-inner {
  box-shadow: 0 0 0 2px var(--primary);
}

.cpu-slot-inner {
  border: 2px solid #e8ecef;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.cpu-slot-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.cpu-slot-leg-num {
  font-weight: 800;
  color: var(--primary-dark);
}

.cpu-slot-km {
  font-size: 0.75rem;
  color: var(--muted);
}

.cpu-slot-player-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.cpu-slot-player-name {
  font-weight: 700;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cpu-slot-empty-hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.cpu-slot-stat-num {
  font-size: 0.8rem;
  color: var(--muted);
  flex-shrink: 0;
}

.cpu-pick-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 36dvh;
  overflow-y: auto;
  margin-bottom: 12px;
}

.cpu-pick-player-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px;
  border: 2px solid #e8ecef;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  will-change: transform;
}

.cpu-pick-player-btn--placed {
  border-color: var(--primary);
  background: #f0faf6;
}

.cpu-pick-name {
  font-weight: 700;
  font-size: 0.88rem;
}

.cpu-pick-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.modal-sheet--record {
  width: 100%;
  max-width: min(100%, 390px);
  max-height: min(88dvh, 92%);
  padding: 12px 14px 14px;
  box-sizing: border-box;
}

.modal-sheet--record h2 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.3;
}

.modal-sheet--record > .btn-primary {
  margin-top: 4px;
  padding: 12px;
  font-size: 0.88rem;
}

.record-meet-result-lines {
  max-height: min(58dvh, 420px);
  overflow-y: auto;
  margin: 0 0 10px;
  -webkit-overflow-scrolling: touch;
}

.record-meet-result-line {
  padding: 6px 0;
  border-bottom: 1px solid #eef1f4;
  font-size: 0.74rem;
  overflow: hidden;
}

.record-meet-line-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.45em;
  white-space: nowrap;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.record-meet-rank {
  flex: 0 0 auto;
  font-weight: 800;
  color: var(--muted);
  min-width: 1.1em;
  text-align: right;
}

.record-meet-name {
  flex: 0 1 auto;
  max-width: 5em;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-meet-stats {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.45em;
  min-width: 0;
}

.record-meet-prev {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 0.25em;
  font-size: 0.58rem;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.2;
  opacity: 0.72;
}

.record-meet-prev__label {
  font-weight: 600;
}

.record-meet-prev__val {
  font-weight: 500;
}

.record-meet-now {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 0.25em;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.record-meet-now__label {
  font-size: 0.58rem;
  font-weight: 600;
  opacity: 0.72;
}

.record-meet-now--pb .record-meet-now__val {
  color: #c62828;
}

.record-meet-now__pb {
  font-size: 0.58rem;
  font-weight: 800;
  color: #c62828;
  letter-spacing: 0.02em;
}

.race-result-body {
  text-align: center;
  padding: 8px 0 20px;
}

.race-result-rank {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.race-result-time {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.race-result-sub {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.race-result-runner {
  margin: 0 0 4px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.record-meet-result-line--hero {
  background: #f0faf6;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 8px;
}

.record-meet-result-rank {
  font-weight: 700;
}


.record-meet-pb-note {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: var(--muted);
}

.placement-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-ghost {
  width: 100%;
  padding: 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.results-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
  overflow: hidden;
}

.results-card__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.results-card__toggle h4 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
}

.results-card__chevron {
  font-size: 0.85rem;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.results-card--collapsed .results-card__chevron {
  transform: rotate(-90deg);
}

.results-card__body {
  padding: 0 16px 12px;
}

.results-card--collapsed .results-card__body {
  display: none;
}

.modal-sheet--player-detail {
  max-height: min(88vh, 640px);
  overflow-y: auto;
}

.player-detail-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.player-detail-modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.player-detail-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-detail-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.player-detail-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.player-detail-name-input {
  width: 5.5em;
  max-width: 42%;
  flex: 0 0 auto;
}

.player-detail-role-btns--inline {
  margin-left: auto;
  flex-shrink: 0;
}

.player-detail-name-count {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.player-detail-grade {
  display: inline-block;
  margin: 8px 0 0;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #334155;
  background: #e8edf2;
}

.player-detail-grade--captain {
  color: #fff;
  background: #c62828;
}

.player-detail-grade--vice {
  color: #fff;
  background: #1565c0;
}

.player-detail-stat {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.player-detail-stat .sp-tag {
  color: #e74c3c;
}

.player-detail-stat .st-tag {
  color: #3498db;
}

.player-detail-stat-sep {
  color: var(--muted);
  font-weight: 500;
}

.player-detail-role-btns {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}

.player-detail-role-btns .player-detail-role-btn {
  width: auto;
  padding: 5px 12px;
  font-size: 0.72rem;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  background: #f6f8fa;
  color: var(--text);
}

.player-detail-role-btn--on {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.player-detail-role-btn--on.player-detail-role-btn[data-role-action="captain"] {
  background: #c9a227;
  border-color: #b8921f;
  color: #fff;
}

.player-detail-role-btn--on.player-detail-role-btn[data-role-action="vice"] {
  background: #5dade2;
  border-color: #4a9fd4;
  color: #fff;
}

.player-detail-fav-value {
  margin: 4px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.player-detail-section-title {
  margin: 8px 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
}

.player-detail-best-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  padding: 4px 0;
  border-bottom: 1px solid #f0f2f5;
}

.player-detail-best-line:last-child {
  border-bottom: none;
}

.player-detail-best-line strong {
  font-variant-numeric: tabular-nums;
}

.player-detail-best-line--no-record strong {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.settings-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #dde3ea;
  font-size: 0.88rem;
  font-family: inherit;
  background: #fff;
}

.player-detail-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.race-history-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.race-history-item:last-child {
  border-bottom: none;
}

.medal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.medal--gold {
  background: linear-gradient(145deg, #ffe566, #f5a623);
}
.medal--silver {
  background: linear-gradient(145deg, #e8e8e8, #b0b0b0);
}
.medal--bronze {
  background: linear-gradient(145deg, #e8c4a0, #cd7f32);
}
.medal--other {
  background: var(--bg);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}

.race-history-item .detail .rank-line {
  font-weight: 800;
  font-size: 0.95rem;
}

.race-history-item .detail .name-line {
  font-size: 0.8rem;
  color: var(--text);
  margin-top: 2px;
}

.race-history-item .detail .date-line {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ── 下部ナビ ── */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: var(--card);
  border-top: 1px solid #ebebeb;
  z-index: 100;
  overflow: hidden;
}

.bottom-nav__bg,
.bottom-nav__underline {
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

.bottom-nav--ready .bottom-nav__bg,
.bottom-nav--ready .bottom-nav__underline {
  opacity: 1;
}

.bottom-nav__bg {
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  border-radius: 12px;
  z-index: 0;
}

.bottom-nav__underline {
  bottom: 0;
  left: 0;
  width: 40px;
  height: 4px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  z-index: 2;
}

.bottom-nav--ready .bottom-nav__bg {
  transition:
    left 0.42s cubic-bezier(0.34, 1.15, 0.64, 1),
    top 0.42s cubic-bezier(0.34, 1.15, 0.64, 1),
    width 0.42s cubic-bezier(0.34, 1.15, 0.64, 1),
    height 0.42s cubic-bezier(0.34, 1.15, 0.64, 1);
}

.bottom-nav--ready .bottom-nav__underline {
  transition:
    left 0.42s cubic-bezier(0.34, 1.15, 0.64, 1),
    width 0.42s cubic-bezier(0.34, 1.15, 0.64, 1);
}

.bottom-nav button {
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  padding-top: 8px;
  position: relative;
  z-index: 1;
  transition: color 0.28s ease;
}

.bottom-nav button.active {
  color: var(--primary-dark);
  font-weight: 700;
}

.bottom-nav .nav-icon {
  width: 44px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
}

.bottom-nav .nav-icon svg {
  width: 22px;
  height: 22px;
  transition: transform 0.28s ease;
}

.bottom-nav button.active .nav-icon svg {
  transform: scale(1.05);
}

@keyframes bottom-nav-icon-pop {
  0% {
    transform: scale(1);
  }
  38% {
    transform: scale(1.22);
  }
  72% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1.05);
  }
}

.bottom-nav .nav-icon--pop svg {
  animation: bottom-nav-icon-pop 0.48s cubic-bezier(0.34, 1.45, 0.64, 1);
}

/* ── サイドバー（☰ フェードイン） ── */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  pointer-events: none;
}

.sidebar-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* display:none / z-index:-1 だと WebView でファイル選択が効かないことがある */
.visually-hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(88vw, 320px);
  max-width: 100%;
  z-index: 230;
  background: var(--card);
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.18);
  transform: translateX(-104%);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.app-sidebar.open {
  transform: translateX(0);
  opacity: 1;
}

.app-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
  border-bottom: 1px solid #eef1f3;
}

.app-sidebar__head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.app-sidebar__body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 24px;
}

.field--checkbox {
  margin-bottom: 12px;
}

.field--checkbox .checkbox-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: auto;
  max-width: 100%;
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.field--checkbox .checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.field--checkbox .checkbox-row__text {
  flex: 1;
  line-height: 1.35;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.sidebar-backup-panel {
  margin: 18px 0 16px;
  border: 1.5px solid #d8e3ec;
  border-radius: 14px;
  background: linear-gradient(180deg, #f4f9f7 0%, #fff 48%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.sidebar-backup-panel__title {
  margin: 0;
  padding: 11px 14px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: rgba(46, 176, 134, 0.1);
  border-bottom: 1px solid #dce8e3;
}

.sidebar-backup-panel__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
}

.app-sidebar__section {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

/* ── モーダル ── */
@keyframes modalBackdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSheetIn {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes modalBackdropOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes modalSheetOut {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(100%);
  }
}

@keyframes modalCenterPopIn {
  from {
    opacity: 0;
    transform: scale(0.52, 0.42) skewX(-3deg);
  }
  to {
    opacity: 1;
    transform: scale(1, 1) skewX(0deg);
  }
}

@keyframes modalCenterPopOut {
  from {
    opacity: 1;
    transform: scale(1, 1) skewX(0deg);
  }
  to {
    opacity: 0;
    transform: scale(0.88, 0.82) skewX(2deg);
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
}

.modal-overlay.open {
  display: flex;
  animation: modalBackdropIn 0.22s ease-out forwards;
}

.modal-overlay.open .modal-sheet {
  animation: modalSheetIn 0.32s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

.modal-overlay.modal-overlay--closing {
  animation: modalBackdropOut 0.2s ease-in forwards;
}

.modal-overlay.modal-overlay--closing .modal-sheet {
  animation: modalSheetOut 0.26s ease-in forwards;
}

.modal-overlay.modal-overlay--center-pop {
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
}

#recordMeetResultModal.modal-overlay--center-pop {
  padding: 10px 12px;
}

.modal-overlay.modal-overlay--center-pop.open .modal-sheet {
  animation: modalCenterPopIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  border-radius: 20px;
  transform-origin: center center;
}

.modal-overlay.modal-overlay--center-pop.modal-overlay--closing .modal-sheet {
  animation: modalCenterPopOut 0.24s ease-in forwards;
}

.modal-overlay--tutorial {
  pointer-events: auto;
  z-index: 280;
}

.modal-overlay--tutorial.open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 1;
}

.modal-overlay--tutorial.open .modal-sheet--tutorial {
  opacity: 1;
  transform: scale(1);
  animation: tutorialSheetIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes tutorialSheetIn {
  from {
    transform: scale(0.92);
  }
  to {
    transform: scale(1);
  }
}

body.tutorial-lock {
  overflow: hidden;
}

.modal-overlay--tutorial .modal-sheet--tutorial {
  border-radius: 20px;
  max-height: min(90dvh, 640px);
  padding: 20px 18px 24px;
}

.tutorial-modal-title {
  margin: 0 0 14px;
  font-size: 1.1rem;
  text-align: center;
}

.tutorial-carousel {
  overflow: hidden;
  touch-action: pan-y;
}

.tutorial-slide__visual {
  position: relative;
  margin: 0 auto 12px;
  max-width: 280px;
}

.tutorial-slide__img {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 12px;
}

.tutorial-slide__icon {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
  pointer-events: none;
}

.tutorial-slide__title {
  margin: 0 0 8px;
  font-size: 1rem;
  text-align: center;
}

.tutorial-slide__text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
}

.tutorial-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}

.tutorial-nav-btn {
  border: none;
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: var(--muted);
}

.tutorial-nav-btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(46, 176, 134, 0.35);
  min-width: 72px;
}

.tutorial-nav-btn--primary:active {
  opacity: 0.92;
}

.tutorial-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.tutorial-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex: 1;
}

.tutorial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #d0d5db;
  cursor: pointer;
}

.tutorial-dot--active {
  background: var(--primary);
  transform: scale(1.15);
}

.tutorial-setup {
  margin-top: 4px;
  max-height: min(52vh, 380px);
  overflow-y: auto;
}

.tutorial-nick-field {
  display: block;
  margin-bottom: 16px;
}

.tutorial-nick-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
  text-align: left;
}

.tutorial-nick-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 7px 12px;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  border: 2px solid #dde3ea;
  border-radius: 12px;
  font-family: inherit;
  letter-spacing: 0.08em;
}

.tutorial-nick-input:focus {
  outline: none;
  border-color: var(--primary);
}

.tutorial-block {
  margin-bottom: 14px;
}

.tutorial-block__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.tutorial-sp-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

.player-detail-best-line .best-derived {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
}

.tutorial-goal-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tutorial-goal-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border: 2px solid #e8ecef;
  border-radius: 12px;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
}

.tutorial-goal-chip span {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
}

.tutorial-goal-chip--on {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.tutorial-type-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.tutorial-type-chip {
  padding: 10px;
  border: 2px solid #e8ecef;
  border-radius: 12px;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
}

.tutorial-type-chip--on {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.tutorial-best-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tutorial-preset-chip {
  padding: 10px 14px;
  border: 2px solid #e8ecef;
  border-radius: 999px;
  background: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  font-family: inherit;
}

.tutorial-preset-chip--on {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.tutorial-best-hint {
  margin: 0 0 10px;
  font-size: 0.75rem;
  line-height: 1.45;
  text-align: center;
  color: var(--muted);
}

.tutorial-dial-panel {
  margin-top: 10px;
  padding: 12px 8px 8px;
  background: #f6f8fa;
  border-radius: 14px;
}

.tutorial-dial-preview {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--primary-dark);
  line-height: 1.4;
}

.wheel-picker {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

.wheel-picker__highlight {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 44px;
  margin-top: -22px;
  border-radius: 10px;
  background: rgba(46, 176, 134, 0.12);
  border: 1px solid rgba(46, 176, 134, 0.35);
  pointer-events: none;
  z-index: 1;
}

.wheel-picker__cols {
  display: flex;
  justify-content: center;
  gap: 4px;
  position: relative;
  z-index: 2;
}

.wheel-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}

.wheel-col__cap {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.wheel-col__viewport {
  height: 132px;
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 28%,
    #000 72%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 28%,
    #000 72%,
    transparent 100%
  );
}

.wheel-col__list {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 132px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.wheel-col__list::-webkit-scrollbar {
  display: none;
}

.wheel-col__pad {
  height: 44px;
  flex-shrink: 0;
  scroll-snap-align: center;
  pointer-events: none;
}

.wheel-col__item {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  scroll-snap-align: center;
  flex-shrink: 0;
}

.modal-sheet--level-up {
  text-align: center;
  border-radius: 20px;
  padding: 28px 24px;
}

.level-up-badge {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--primary);
}

.level-up-stat {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.level-up-stat--sp {
  color: #e74c3c;
}

.level-up-stat--st {
  color: #3498db;
}

.level-up-level {
  margin: 8px 0 20px;
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.btn-sidebar-action {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.btn-sidebar-action:active {
  transform: scale(0.98);
}

.field--checkbox .sidebar-action-hint {
  margin: 0;
  padding-left: 28px;
}

.sidebar-support-ad {
  margin: 4px 0 18px;
  padding: 12px 14px;
  border: 1.5px solid #f0d9a8;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffbf0 0%, #fff 100%);
}

.sidebar-support-ad[hidden] {
  display: none !important;
}

.btn-sidebar-support {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid #e8a84a;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff4d6 0%, #ffe8a8 100%);
  color: #6b4a00;
  font-size: 0.9rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(232, 168, 74, 0.22);
}

.btn-sidebar-support:active {
  transform: scale(0.985);
}

.sidebar-support-ad__hint {
  margin: 8px 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #8a7348;
  text-align: center;
}

.sidebar-action-hint {
  margin: -4px 0 14px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
}

.modal-overlay--best-settings .modal-sheet--best-settings {
  max-height: min(92vh, 640px);
  overflow-y: auto;
  padding: 18px 16px 20px;
}

.best-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.best-settings-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.best-settings-hint {
  margin: 0 0 14px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.best-settings-dial {
  margin: 12px 0 16px;
}

.app-sidebar__section--danger {
  margin-top: 20px;
  color: #c0392b;
}

.btn-reset-data {
  width: 100%;
  padding: 12px;
  border: 1px solid #f0c4c4;
  border-radius: 12px;
  background: #fff5f5;
  color: #c0392b;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.sidebar-backup-hint {
  margin: 0;
  font-size: 0.76rem;
  color: #5c6670;
  line-height: 1.5;
}

.btn-sidebar-backup {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1.5px solid #cfd9e2;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  text-align: center;
  font-size: 0.86rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-sidebar-backup:active {
  transform: scale(0.985);
}

.btn-sidebar-backup--primary {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(46, 176, 134, 0.18);
}

.btn-sidebar-takeout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-sidebar-takeout__icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-reset-hint {
  margin: 8px 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
}

.modal-sheet--confirm {
  max-width: min(100%, 400px);
  border-radius: 20px;
  padding: 22px 18px 20px;
}

.modal-sheet--confirm h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.confirm-modal__text {
  margin: 0 0 18px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
}

.confirm-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.confirm-modal__actions .btn-ghost,
.confirm-modal__actions .btn-danger,
.confirm-modal__actions .btn-primary,
.confirm-modal__actions label.btn-csv-import-label {
  flex: none;
  width: 100%;
  margin-top: 0;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  box-sizing: border-box;
}

.confirm-modal__actions .btn-ghost {
  border: 1px solid #dde3ea;
  background: #f6f8fa;
  color: var(--text);
}

.confirm-modal__actions label.btn-csv-import-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}

.btn-danger {
  border: none;
  background: #e74c3c;
  color: #fff;
}

.btn-danger:active {
  opacity: 0.9;
}

.modal-sheet {
  width: 100%;
  max-width: 100%;
  max-height: 85dvh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(32px + var(--safe-b));
  will-change: transform;
}

.modal-sheet h2 {
  margin: 0 0 20px;
  font-size: 1.15rem;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.field input:not([type="color"]):not([type="checkbox"]) {
  width: 100%;
  padding: 14px;
  border: 1.5px solid #e8ecef;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
}

.field--color .color-picker-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.color-picker-swatch {
  width: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 12px;
  border: 2px solid #e0e4e8;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.field--color input[type="color"] {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 56px;
  height: 56px;
  padding: 8px;
  border: 2px solid #e8ecef;
  border-radius: 12px;
  cursor: pointer;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}

.field--color input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 4px;
}

.field--color input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
}

.field--color input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 8px;
}

.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}


.btn-secondary {
  background: #eef1f4;
  color: var(--text);
}

.web-interstitial {
  position: fixed;
  inset: 0;
  z-index: 560;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(0, 0, 0, 0.72);
}

.web-interstitial[hidden] {
  display: none !important;
}

.web-interstitial__panel {
  width: min(100%, 320px);
  background: #fff;
  border-radius: 16px;
  padding: 20px 18px 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.web-interstitial__tag {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #888;
}

.web-interstitial__mock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 180px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: linear-gradient(145deg, #2eb086 0%, #1a7f62 100%);
  color: #fff;
}

.web-interstitial__mock-title {
  font-size: 1.35rem;
  font-weight: 800;
}

.web-interstitial__mock-sub {
  font-size: 0.82rem;
  opacity: 0.9;
}

.web-interstitial__countdown {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: #667080;
}

.web-interstitial__close {
  width: 100%;
}

.web-interstitial__close:disabled {
  opacity: 0.45;
}

.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28, 28, 30, 0.92);
  color: #fff;
  padding: 12px 20px;
  border-radius: 99px;
  font-size: 0.85rem;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}

.app-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(244, 246, 248, 0.55);
  backdrop-filter: blur(2px);
  pointer-events: none;
}

html.app-booting .app-loading-overlay,
html.app-reloading .app-loading-overlay {
  background: rgba(244, 246, 248, 0.42);
}

.app-loading-overlay[hidden] {
  display: none !important;
}

.app-loading-overlay:not([hidden]) {
  pointer-events: auto;
}

.app-loading-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(46, 176, 134, 0.22);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: app-loading-spin 0.75s linear infinite;
}

.app-loading-label {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

@keyframes app-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

body.app-loading {
  overflow: hidden;
}

.toast.show {
  opacity: 1;
}
