/* ===========================================================
   Self Game — Home Screen (Static UI)
   Theme: dark + neon, inspired by football game UI
   =========================================================== */

:root {
  --bg-0: #050912;
  --bg-1: #0b1224;
  --bg-2: #121b33;
  --bg-card: rgba(20, 28, 52, 0.85);
  --border: rgba(120, 160, 255, 0.14);
  --border-strong: rgba(120, 160, 255, 0.28);

  --text: #f3f6ff;
  --text-mute: #9aa7c7;
  --text-dim: #5d6a8a;

  --cyan:    #1fd4ff;
  --magenta: #ff2e7e;
  --purple:  #b14cff;
  --green:   #44d57b;
  --orange:  #ff9a2e;
  --gold:    #ffd24a;
  --red:     #ff5566;
  --silver:  #d8dff0;

  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px rgba(31, 212, 255, 0.18);

  /* Easing — strong custom curves (built-in ease* are too weak) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* { box-sizing: border-box; }

/* ensure [hidden] always wins over component display rules */
[hidden] { display: none !important; }

html {
  background-color: #03060f;   /* canvas のベタ塗り。横画面で下端に白が出るのを防ぐ */
}
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: #03060f;   /* グラデが届かない領域のフォールバック */
  background-image:
    radial-gradient(900px 600px at 12% -10%, rgba(31, 212, 255, 0.10), transparent 60%),
    radial-gradient(700px 500px at 110% 20%, rgba(177, 76, 255, 0.10), transparent 60%),
    linear-gradient(180deg, #06091a 0%, #050912 60%, #03060f 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Yu Gothic UI", "Noto Sans JP", "Meiryo", sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

button {
  font-family: inherit;
  color: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.app {
  max-width: 1080px;
  margin: 0 auto;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(64px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  position: relative;
}

/* views — invisible wrapper that lets children inherit .app layout */
.view { display: contents; }
.view[hidden] { display: none; }

/* ===========================================================
   Top bar (asset / budget / unlocked / frozen)
   =========================================================== */
.topbar {
  background: linear-gradient(180deg, rgba(11, 18, 36, 0.95), rgba(8, 13, 28, 0.85));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px 12px;
  box-shadow: var(--shadow-lg);
}

.topbar__row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat {
  flex: 1 1 0;
  min-width: 140px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
}

.stat__icon {
  font-size: 22px;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.25));
}

.stat__body {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.stat__label {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}

.stat__value {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.stat--asset    .stat__value { color: var(--silver); }
.stat--budget   .stat__value { color: var(--cyan);   text-shadow: 0 0 12px rgba(31,212,255,0.35); }
.stat--unlocked .stat__value { color: var(--gold);   text-shadow: 0 0 12px rgba(255,210,74,0.35); }
.stat--frozen   .stat__value { color: var(--text-dim); }

.topbar__icons {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  transition: transform 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { transform: translateY(-1px); }
}
.icon-btn:active { transform: scale(0.94); }

.icon-btn__emoji { font-size: 18px; }

.icon-btn__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px var(--bg-0);
}
.icon-btn__badge--neutral { background: var(--orange); }

/* gauge */
.gauge {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.gauge__bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.gauge__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple) 70%, var(--magenta));
  box-shadow: 0 0 14px rgba(31,212,255,0.5);
  transition: width 700ms var(--ease-out);
}
.gauge__text {
  font-size: 12px;
  color: var(--text-mute);
  white-space: nowrap;
}
.gauge__text strong {
  color: var(--text);
  font-size: 13px;
}

/* ===========================================================
   Tabs
   =========================================================== */
.tabs {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 4px;
  background: rgba(15, 22, 44, 0.7);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px;
  backdrop-filter: blur(6px);
}
.tabs__item {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text-mute);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  position: relative;
  transition: background 160ms var(--ease-out), color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .tabs__item:hover { color: var(--text); }
}
.tabs__item:active { transform: scale(0.97); }
.tabs__item.is-active {
  background: linear-gradient(180deg, #2a3252, #1a2140);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong), 0 4px 14px rgba(0,0,0,0.4);
}
.tabs__dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.tabs__dot--alert { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }
.tabs__dot--info  { background: var(--orange);  box-shadow: 0 0 8px var(--orange);  }

/* ===========================================================
   Banner
   =========================================================== */
.banner {
  position: relative;
  margin-top: 16px;
  border-radius: 22px;
  overflow: hidden;
  min-height: 180px;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.banner__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 240px at 80% 20%, rgba(255, 46, 126, 0.55), transparent 65%),
    radial-gradient(700px 300px at 100% 100%, rgba(177, 76, 255, 0.55), transparent 65%),
    linear-gradient(135deg, #2b0e3b 0%, #14163a 60%, #060a1a 100%);
}
.banner__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(115deg, transparent 38%, rgba(255,255,255,0.06) 39%, transparent 41%),
    linear-gradient(115deg, transparent 55%, rgba(255,255,255,0.04) 56%, transparent 58%);
}

.banner__content {
  position: relative;
  z-index: 1;
  padding: 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.banner__title {
  font-size: 30px;
  font-weight: 900;
  margin: 0;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.banner__period {
  margin: 0;
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.banner__period span { color: var(--gold); }
.banner__lead {
  margin: 8px 0 0;
  color: #e2e8ff;
  font-size: 13px;
  line-height: 1.6;
}
.banner__lead strong {
  color: var(--gold);
  font-size: 16px;
}
/* ---------- 直近の目標カルーセル ---------- */
.banner--goals { display: block; }
.goals {
  position: relative;
  z-index: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.goals::-webkit-scrollbar { display: none; }
.goal-slide {
  scroll-snap-align: center;
  flex: 0 0 100%;
  min-width: 100%;
  box-sizing: border-box;
  min-height: 180px;
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.goal-slide__deadline {
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.goal-slide__date {
  font-size: 14px;
  font-weight: 800;
  color: #e2e8ff;
  letter-spacing: 0.02em;
}
.goal-slide__chip {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  color: #0a1020;
  background: var(--gold);
}
.goal-slide__chip--urgent {
  color: #fff;
  background: linear-gradient(180deg, #ff5d8f, #e02e6a);
}
.goal-slide__deadline--none {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
}
/* 追加スライド */
.goal-slide--add { align-items: center; justify-content: center; }
.goal-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.7);
}
.goal-add__plus {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 700;
  border: 1.5px dashed rgba(255,255,255,0.4);
}
.goal-add__label { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; }
/* ドット */
.goals__dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}
.goals__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: width 160ms var(--ease-out), background 160ms var(--ease-out);
}
.goals__dot.is-active { width: 18px; border-radius: 3px; background: var(--gold); }

.banner[data-action="open-goal"] { cursor: pointer; }
.banner__eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #c9d2ff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.banner__edit {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.55);
}
.banner__title--empty {
  color: rgba(255,255,255,0.5);
  font-weight: 800;
}
.contract-submit--ghost {
  margin-top: 0;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: #c9d2ff;
  box-shadow: none;
}

.banner__side {
  position: relative;
  z-index: 1;
  width: 130px;
  display: grid;
  place-items: center;
  padding-right: 20px;
}
.banner__card {
  width: 96px;
  height: 130px;
  border-radius: 14px;
  background: linear-gradient(160deg, #1f2a55, #0a1130);
  border: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.5), 0 0 24px rgba(31,212,255,0.15);
}
.banner__card-rank {
  font-size: 38px;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(31,212,255,0.6);
  line-height: 1;
}
.banner__card-label {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.06em;
}

/* ===========================================================
   5 Action buttons
   =========================================================== */
.actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.action {
  position: relative;
  padding: 18px 8px 14px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: white;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 8px 18px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out), filter 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .action:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.2);
  }
}
.action:active {
  transform: scale(0.97);
  filter: brightness(0.95);
}

.action__icon {
  font-size: 28px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}
.action__label {
  font-size: 13px;
}

.action--match    { background: linear-gradient(180deg, #2fd0e0, #1aa5b8); }
.action--team     { background: linear-gradient(180deg, #ff4d7f, #d12a5d); }
.action--contract { background: linear-gradient(180deg, #b966ff, #7b39c4); }
.action--mission  { background: linear-gradient(180deg, #66e07a, #2fa64a); }
.action--bonus    { background: linear-gradient(180deg, #ffb14a, #e07d18); }

.action__pip {
  position: absolute;
  top: 8px; right: 10px;
  min-width: 20px; height: 20px;
  border-radius: 10px;
  padding: 0 6px;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.4);
}
.action__pip--num { background: var(--red); }

.action__tag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ffd24a, #ff9a2e);
  color: #1a1100;
  font-size: 10px;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(255,154,46,0.35);
}

/* ===========================================================
   Today's Best 3
   =========================================================== */
.block {
  margin-top: 22px;
}

.block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 4px 10px;
}
.block__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.block__title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, var(--cyan), var(--purple));
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: -2px;
  box-shadow: 0 0 8px rgba(31,212,255,0.6);
}
.block__hint {
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
}

.missions {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mission {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .mission:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
  }
}
.mission:active { transform: scale(0.99); }

.mission__delete {
  width: 30px;
  height: 30px;
  margin: -4px -6px -4px 0;   /* trim the gap a little so it hugs the right edge */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color 160ms var(--ease-out), background 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .mission__delete:hover {
    color: var(--red, #ff5d73);
    background: rgba(255, 93, 115, 0.1);
    border-color: rgba(255, 93, 115, 0.4);
  }
}
.mission__delete:active { transform: scale(0.88); }

.mission__rank {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, #2a3252, #1a2140);
  font-weight: 900;
  color: var(--cyan);
  font-size: 16px;
  box-shadow: inset 0 0 0 1px var(--border-strong);
  transition: background 200ms var(--ease-out), color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.mission__rank-num {
  transition: opacity 160ms var(--ease-out), transform 200ms var(--ease-out);
}
.mission__check {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  color: #ffffff;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 200ms var(--ease-out), transform 260ms var(--ease-out);
}

.mission--done {
  opacity: 0.55;
}
.mission--done .mission__title {
  text-decoration: line-through;
  text-decoration-color: rgba(255,255,255,0.4);
}
.mission--done .mission__rank {
  background: linear-gradient(180deg, #2fa64a, #1e7d36);
  color: white;
  box-shadow: inset 0 0 0 1px rgba(80, 220, 130, 0.5), 0 0 14px rgba(68, 213, 123, 0.35);
}
.mission--done .mission__rank-num {
  opacity: 0;
  transform: scale(0.6);
}
.mission--done .mission__check {
  opacity: 1;
  transform: scale(1);
}
.mission--done .mission__amount {
  color: var(--green);
  text-shadow: 0 0 10px rgba(68, 213, 123, 0.4);
}

.mission__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.mission__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.mission__meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-mute);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.chip--diff { color: var(--gold); }
.chip--skill {
  color: var(--cyan);
  border-color: rgba(31, 212, 255, 0.3);
  background: rgba(31, 212, 255, 0.08);
}

.mission__reward {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.mission__amount {
  color: var(--gold);
  font-weight: 900;
  font-size: 16px;
  text-shadow: 0 0 10px rgba(255,210,74,0.4);
}
.mission__penalty {
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  min-height: 14px;
}

/* ===========================================================
   Summary cards
   =========================================================== */
.summary {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.summary__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.summary__label {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}
.summary__value {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
}
.summary__sub {
  font-size: 11px;
  color: var(--text-dim);
}

/* ===========================================================
   Reward splash — floating "+¥XXX" on mission completion
   =========================================================== */
.reward-splash {
  position: absolute;
  z-index: 9999;
  pointer-events: none;
  transform: translate(-50%, -50%);
  color: var(--gold);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px rgba(255, 210, 74, 0.6), 0 2px 8px rgba(0,0,0,0.5);
  animation: reward-splash 900ms var(--ease-out) forwards;
  will-change: transform, opacity;
}
@keyframes reward-splash {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  20%  { opacity: 1; transform: translate(-50%, -70%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -180%) scale(1); }
}

/* ===========================================================
   Level-up / rank-promotion celebration (full-screen burst)
   =========================================================== */
.levelup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  cursor: pointer;
  transition: opacity 220ms var(--ease-out);
}
.levelup.is-in  { opacity: 1; }
.levelup.is-out { opacity: 0; }

.levelup__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(31, 212, 255, 0.14), rgba(3, 6, 15, 0.84) 56%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.levelup--silver .levelup__backdrop {
  background: radial-gradient(circle at 50% 42%, rgba(216, 223, 240, 0.16), rgba(3, 6, 15, 0.86) 58%);
}
.levelup--gold .levelup__backdrop {
  background: radial-gradient(circle at 50% 42%, rgba(255, 210, 74, 0.18), rgba(3, 6, 15, 0.86) 58%);
}

.levelup__stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

/* radiating wedges behind the card */
.levelup__rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 460px;
  height: 460px;
  transform: translate(-50%, -50%) scale(0.5);
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.10) 0deg 6deg,
    transparent 6deg 18deg
  );
  -webkit-mask: radial-gradient(circle, transparent 28%, #000 42%, transparent 74%);
  mask: radial-gradient(circle, transparent 28%, #000 42%, transparent 74%);
  opacity: 0;
  pointer-events: none;
}
.levelup.is-in .levelup__rays {
  animation: levelup-rays 2.6s var(--ease-out) forwards;
}
@keyframes levelup-rays {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.5)  rotate(0deg); }
  22%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15) rotate(56deg); }
}

.levelup__headline {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.32em;
  color: var(--cyan);
  text-shadow: 0 0 16px rgba(31, 212, 255, 0.6);
  opacity: 0;
}
.levelup.is-in .levelup__headline {
  animation: levelup-rise 480ms var(--ease-out) 80ms forwards;
}

.levelup__card {
  transform: scale(0.4);
  opacity: 0;
}
.levelup__card .player-card {
  width: 168px;
  cursor: pointer;
}
.levelup.is-in .levelup__card {
  animation: levelup-pop 540ms var(--ease-out) 60ms forwards;
}
@keyframes levelup-pop {
  0%   { opacity: 0; transform: scale(0.4)  rotate(-6deg); }
  60%  { opacity: 1; transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: scale(1)    rotate(0deg); }
}

.levelup__promo {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 8px 20px;
  border-radius: 999px;
  opacity: 0;
}
.levelup--silver .levelup__promo {
  color: #0c0f1a;
  background: linear-gradient(160deg, #ffffff, var(--silver));
  box-shadow: 0 0 22px rgba(216, 223, 240, 0.55);
}
.levelup--gold .levelup__promo {
  color: #2b1d05;
  background: linear-gradient(160deg, #fff0b8, var(--gold));
  box-shadow: 0 0 26px rgba(255, 210, 74, 0.6);
}
.levelup.is-in .levelup__promo {
  animation: levelup-promo 560ms var(--ease-out) 340ms forwards;
}
@keyframes levelup-promo {
  0%   { opacity: 0; transform: scale(0.7); }
  60%  { opacity: 1; transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}

.levelup__stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
}
.levelup.is-in .levelup__stats {
  animation: levelup-rise 480ms var(--ease-out) 300ms forwards;
}
.levelup__lv {
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
}
.levelup__rating {
  font-size: 15px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 210, 74, 0.5);
}

.levelup__hint {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  opacity: 0;
}
.levelup.is-in .levelup__hint {
  animation: levelup-rise 400ms var(--ease-out) 720ms forwards;
}

@keyframes levelup-rise {
  0%   { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===========================================================
   Footer — discreet reset link
   =========================================================== */
.footer {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.reset-link--danger { color: #6b3a44; }
@media (hover: hover) and (pointer: fine) {
  .reset-link--danger:hover { color: var(--red, #ff5d73); border-color: rgba(255,93,115,0.4); }
}
.reset-link {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .reset-link:hover {
    color: var(--text-mute);
    border-color: var(--border);
  }
}
.reset-link:active { transform: scale(0.97); }

/* ===========================================================
   Backup / Restore modal
   =========================================================== */
.backup { display: flex; flex-direction: column; gap: 18px; }
.backup__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
}
.backup__heading {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.backup__summary { margin: 0; font-size: 11px; color: var(--cyan); font-weight: 700; }
.backup__hint { margin: 0; font-size: 11px; color: var(--text-mute); line-height: 1.6; }
.backup__text {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-mute);
  background: #05060f;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}
.backup__btns { display: flex; gap: 8px; }
.backup__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .backup__btn:hover { background: rgba(255,255,255,0.07); border-color: var(--border-strong); }
}
.backup__btn:active { transform: scale(0.97); }
.backup__btn--accent {
  border-color: transparent;
  background: linear-gradient(180deg, #2fd0e0, #1aa5b8);
  color: #fff;
}
.backup__btn--file { position: relative; }
.backup__input {
  flex: 2;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.backup__input:disabled { opacity: 0.6; }
.backup__input::placeholder { color: var(--text-dim, rgba(255,255,255,0.4)); font-weight: 600; }
.backup__note { margin: 0; font-size: 12px; font-weight: 700; min-height: 1.2em; text-align: center; }
.backup__note.is-ok  { color: #46d39a; }
.backup__note.is-err { color: var(--red, #ff5d73); }

/* ===========================================================
   Team screen — マイチーム
   =========================================================== */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2a3252, #1a2140);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 1px solid var(--border-strong);
  transition: transform 160ms var(--ease-out);
}
.back-btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .back-btn:hover { background: linear-gradient(180deg, #34406b, #1f2855); }
}

.screen-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.team-rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 14px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(91, 64, 18, 0.9), rgba(42, 29, 5, 0.9));
  border: 1px solid rgba(255, 210, 74, 0.4);
  box-shadow: 0 0 16px rgba(255, 210, 74, 0.15);
}
.team-rating__label {
  font-size: 9px;
  color: rgba(255, 210, 74, 0.85);
  font-weight: 800;
  letter-spacing: 0.08em;
}
.team-rating__value {
  font-size: 22px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1.05;
  text-shadow: 0 0 12px rgba(255, 210, 74, 0.4);
}

/* team mode toggle (習慣 / 知識) — top-level filter above position tabs */
.team-mode {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 4px 0 10px;
}
.team-mode__btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: 9px;
  background: transparent;
  color: var(--text-mute);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  transition: background 160ms var(--ease-out), color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.team-mode__btn.is-active {
  background: linear-gradient(180deg, #1a2548, #131c38);
  color: var(--cyan);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 14px rgba(31, 212, 255, 0.18);
}
.team-mode__btn--knowledge.is-active {
  color: var(--gold);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 14px rgba(255, 210, 74, 0.22);
}
@media (hover: hover) and (pointer: fine) {
  .team-mode__btn:not(.is-active):hover { color: var(--text); background: rgba(255,255,255,0.04); }
}
.team-mode__btn:active { transform: scale(0.97); }

/* お金 (knowledge pool) cards — show the pool label in gold to match the theme */
.player-card[data-pool="money"] .player-card__position {
  color: rgba(255, 210, 74, 0.85);
  text-shadow: 0 0 8px rgba(255, 210, 74, 0.25);
}

/* filter tabs */
.filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-mute);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: background 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.filter-tab.is-active {
  background: linear-gradient(180deg, #2a3252, #1a2140);
  color: var(--cyan);
  border-color: rgba(31, 212, 255, 0.4);
  box-shadow: 0 0 14px rgba(31, 212, 255, 0.18);
}
.filter-tab:active { transform: scale(0.97); }

/* card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

/* ===========================================================
   Team list — eFootball-style rows (icon + name + level)
   =========================================================== */
.card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;                  /* allow the row to shrink inside its grid track so the name ellipsizes */
  padding: 10px 14px 10px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 160ms var(--ease-out), transform 160ms var(--ease-out), background 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .card-row:hover { border-color: var(--border-strong); transform: translateY(-1px); }
}
.card-row:active { transform: scale(0.99); }

.card-row__thumb {
  flex: 0 0 auto;
  width: 56px;
  position: relative;   /* ✓ スタンプの位置基準 */
}
/* the mini-card inside a row: shrink, round, and drop its built-in name/level (the row shows them) */
.card-row__thumb .player-card {
  width: 56px;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  pointer-events: none;          /* clicks are handled by the row */
}
.card-row__thumb .player-card__bottom { display: none; }
.card-row__thumb .player-card__top { padding: 6px 7px 0; }
.card-row__thumb .player-card__rating { font-size: 17px; }
.card-row__thumb .player-card__position { font-size: 8px; }
.card-row__thumb .player-card__rarity { font-size: 9px; }
.card-row__thumb .player-card__art { font-size: 26px; }

.card-row__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.card-row__name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.25;
  /* 2カラムで幅が足りなくても切らず、最大3行で折り返す（超過分のみ…） */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.card-row__level {
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.02em;
  white-space: nowrap;   /* 「レベル: 1 / 30」は常に1行 */
}

/* add-new row */
.card-row--add { border-style: dashed; }
.card-row__thumb--add {
  width: 56px;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 900;
  color: var(--cyan);
  border: 1px dashed var(--border-strong);
  background: rgba(31, 212, 255, 0.05);
}
.card-row--add .card-row__name { color: var(--text-mute); }

/* player card */
.player-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}

.player-card--gold {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 210, 74, 0.22), transparent 60%),
    linear-gradient(160deg, #5a3f10 0%, #2b1d05 50%, #18120c 100%);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 210, 74, 0.5),
    0 0 22px rgba(255, 210, 74, 0.12);
}
.player-card--silver {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(216, 223, 240, 0.16), transparent 60%),
    linear-gradient(160deg, #2f364c 0%, #181d2e 50%, #0c0f1a 100%);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(216, 223, 240, 0.32);
}
.player-card--locked {
  background:
    repeating-linear-gradient(135deg, rgba(120, 160, 255, 0.04) 0 8px, transparent 8px 16px),
    linear-gradient(160deg, rgba(40, 48, 70, 0.4), rgba(15, 20, 38, 0.4));
  border: 1px dashed var(--border-strong);
  box-shadow: none;
  opacity: 0.85;
}
.player-card--locked .player-card__rating,
.player-card--locked .player-card__name,
.player-card--locked .player-card__level,
.player-card--locked .player-card__position {
  color: var(--text-mute);
}
.player-card--locked .player-card__art {
  color: var(--text-mute);
  font-weight: 900;
  font-size: 40px;
}

@media (hover: hover) and (pointer: fine) {
  .player-card:hover {
    transform: translateY(-3px);
    box-shadow:
      0 14px 28px rgba(0, 0, 0, 0.55),
      inset 0 0 0 1px rgba(255, 210, 74, 0.65),
      0 0 30px rgba(255, 210, 74, 0.18);
  }
  .player-card--silver:hover {
    box-shadow:
      0 14px 28px rgba(0, 0, 0, 0.55),
      inset 0 0 0 1px rgba(216, 223, 240, 0.5);
  }
}
.player-card:active { transform: scale(0.97); }

.player-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 12px 0;
  position: relative;
  z-index: 2;
}

.player-card__rating-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.player-card__rating {
  font-size: 30px;
  font-weight: 900;
  color: white;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.player-card--gold .player-card__rating {
  color: var(--gold);
  text-shadow: 0 0 14px rgba(255, 210, 74, 0.45);
}
.player-card--silver .player-card__rating {
  color: var(--silver);
}

.player-card__position {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.08em;
  margin-top: 2px;
}
.player-card--gold .player-card__position {
  color: rgba(255, 210, 74, 0.85);
}

.player-card__rarity {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.05em;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(255, 210, 74, 0.35);
}
.player-card--silver .player-card__rarity {
  color: var(--silver);
  text-shadow: none;
}

.player-card__art {
  flex: 1;
  display: grid;
  place-items: center;
  font-size: 56px;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5));
  user-select: none;
}

.player-card__bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 8px 10px 10px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
  position: relative;
  z-index: 2;
  gap: 8px;
}
.player-card__name {
  font-size: 12px;
  font-weight: 800;
  color: white;
  letter-spacing: 0.02em;
  /* 長い名前は省略せず最大2行まで折り返す（はみ出した時だけ … ） */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  line-height: 1.25;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}
.player-card__level {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 700;
  white-space: nowrap;
}

/* ===========================================================
   Modals (card detail / contract)
   =========================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(20px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 12, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  background: linear-gradient(180deg, #131b35 0%, #08091c 100%);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 22px 22px 24px;
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(31, 212, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 240ms var(--ease-out), opacity 240ms var(--ease-out);
}
.modal__panel--narrow { max-width: 380px; }

@starting-style {
  .modal:not([hidden]) .modal__panel {
    transform: scale(0.94);
    opacity: 0;
  }
}

.modal__close {
  position: absolute;
  top: 12px; right: 12px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-mute);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 160ms var(--ease-out), color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .modal__close:hover { background: rgba(255,255,255,0.1); color: var(--text); }
}
.modal__close:active { transform: scale(0.92); }

/* card detail */
.modal__preview {
  display: grid;
  place-items: center;
  margin: 6px 0 18px;
}
.modal__preview .player-card {
  width: 180px;
  aspect-ratio: 3 / 4;
  pointer-events: none;
}

/* 大きく表示するカード（詳細プレビュー / ガチャ表示）は、名前を Lv と横並びにせず
   フル幅で縦積みにして、長い知識カード名が切れないようにする */
.modal__preview .player-card__bottom,
.scout__chamber .player-card__bottom {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.modal__preview .player-card__name,
.scout__chamber .player-card__name {
  width: 100%;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.modal__body { display: flex; flex-direction: column; gap: 14px; }

.modal__row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.modal__label { font-size: 11px; color: var(--text-mute); letter-spacing: 0.06em; font-weight: 800; }
.modal__big { font-size: 24px; color: var(--cyan); font-weight: 900; text-shadow: 0 0 14px rgba(31,212,255,0.3); }
.modal__sub { font-size: 12px; color: var(--text-mute); margin-left: auto; }

.exp-bar {
  position: relative;
  height: 20px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.exp-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple) 80%, var(--magenta));
  box-shadow: 0 0 14px rgba(31, 212, 255, 0.45);
  transition: width 800ms var(--ease-out);
}
.exp-bar__text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25em;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  letter-spacing: 0.04em;
}

.modal__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.modal__stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.modal__stat-label { font-size: 10px; color: var(--text-mute); letter-spacing: 0.04em; }
.modal__stat-value { font-size: 18px; font-weight: 900; color: var(--text); }

.modal__section { display: flex; flex-direction: column; gap: 8px; }
.modal__section-title {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-mute);
}

.modal__missions { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.modal__mission {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.modal__mission.is-done { opacity: 0.5; }
.modal__mission.is-done .modal__mission-title { text-decoration: line-through; }
.modal__mission-title { color: var(--text); }
.modal__mission-reward { color: var(--gold); font-weight: 800; }
.modal__missions-empty {
  font-size: 12px;
  color: var(--text-dim);
  padding: 10px 0;
  text-align: center;
}

/* knowledge section in card-detail modal (only for knowledge cards) */
.modal__section--knowledge {
  background: linear-gradient(160deg, rgba(255, 210, 74, 0.10), rgba(255, 154, 46, 0.04));
  border: 1px solid rgba(255, 210, 74, 0.35);
  border-radius: 12px;
  padding: 12px 14px 14px;
  gap: 10px;
}
.modal__section--knowledge .modal__section-title {
  color: var(--gold);
  letter-spacing: 0.06em;
}
.modal__knowledge-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  letter-spacing: 0.01em;
}
.modal__knowledge-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}
.modal__knowledge-count {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}
.modal__knowledge-count strong {
  color: var(--gold);
  font-weight: 900;
  font-size: 13px;
  margin: 0 2px;
}

.review-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), var(--orange));
  color: #1a1100;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 14px rgba(255, 154, 46, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 160ms var(--ease-out), filter 160ms var(--ease-out);
}
.review-btn__icon { font-size: 13px; }
.review-btn:active { transform: scale(0.96); filter: brightness(0.95); }

/* ---------- カード内 AI チャット ---------- */
.modal__section--ai .modal__section-title { color: var(--cyan); letter-spacing: 0.06em; }
.ai-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 2px;
  -webkit-overflow-scrolling: touch;
}
.ai-chat__empty {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
}
.ai-chat__msg {
  font-size: 13px;
  line-height: 1.6;
  padding: 9px 12px;
  border-radius: 12px;
  max-width: 88%;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-chat__msg--user {
  align-self: flex-end;
  background: linear-gradient(180deg, rgba(31, 212, 255, 0.18), rgba(31, 212, 255, 0.08));
  border: 1px solid rgba(31, 212, 255, 0.3);
  color: var(--text);
  border-bottom-right-radius: 4px;
}
.ai-chat__msg--ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.ai-chat__msg--ai.is-pending::after {
  content: '▋';
  animation: ai-blink 1s steps(2) infinite;
  color: var(--cyan);
}
@keyframes ai-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.ai-chat__msg--error {
  align-self: flex-start;
  background: rgba(255, 85, 102, 0.08);
  border: 1px solid rgba(255, 85, 102, 0.3);
  color: var(--red);
}
/* AI回答を「自分の学び」へ要約保存するボタン（短く/しっかり の2種） */
.ai-chat__saves { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-chat__save {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 74, 0.4);
  background: rgba(255, 210, 74, 0.08);
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: transform 160ms var(--ease-out), opacity 160ms var(--ease-out);
}
.ai-chat__save:active { transform: scale(0.96); }
.ai-chat__save:disabled { opacity: 0.7; }
.ai-chat__save.is-saved {
  border-color: rgba(68, 213, 123, 0.4);
  background: rgba(68, 213, 123, 0.1);
  color: var(--green);
}

.ai-chat__suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-chat__chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(31, 212, 255, 0.05);
  color: var(--text-mute);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 140ms var(--ease-out), color 140ms;
}
.ai-chat__chip:active { transform: scale(0.95); }
@media (hover: hover) {
  .ai-chat__chip:hover { color: var(--cyan); border-color: var(--cyan); }
}

.ai-chat__input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.ai-chat__field {
  flex: 1;
  box-sizing: border-box;
  resize: none;
  max-height: 120px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: #05060f;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 12px;
}
.ai-chat__field::placeholder { color: var(--text-dim); }
.ai-chat__field:focus { outline: none; border-color: var(--cyan); }
.ai-chat__send {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(31, 212, 255, 0.16), rgba(31, 212, 255, 0.06));
  color: var(--cyan);
  font-size: 16px;
  font-weight: 900;
  transition: transform 140ms var(--ease-out), filter 140ms;
}
.ai-chat__send:active { transform: scale(0.94); }
.ai-chat__send:disabled { opacity: 0.4; }

/* 習慣カードの「実行した！」セクション（カード詳細モーダル） */
.modal__section--do {
  background: linear-gradient(160deg, rgba(68, 213, 123, 0.12), rgba(68, 213, 123, 0.03));
  border: 1px solid rgba(68, 213, 123, 0.35);
  border-radius: 12px;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.do-habit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #54e08a, var(--green));
  color: #06351b;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(68, 213, 123, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 160ms var(--ease-out), filter 160ms var(--ease-out);
}
.do-habit-btn:active { transform: scale(0.97); filter: brightness(0.96); }
.do-habit-btn__icon {
  font-size: 16px;
  font-weight: 900;
}
.do-habit-btn__exp {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(6, 53, 27, 0.22);
}
.do-habit-note {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-mute);
}

/* ===========================================================
   デイリーボーナス
   =========================================================== */
.daily-streak-line {
  margin: 2px 0 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}
.daily-streak-line strong {
  color: var(--orange);
  font-weight: 900;
  font-size: 17px;
  margin: 0 3px;
}

.daily-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.daily-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px 9px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  position: relative;
}
.daily-cell__day {
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--text-mute);
}
.daily-cell__amt {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.01em;
}
.daily-cell__mark {
  font-size: 13px;
  line-height: 1;
  min-height: 14px;
}
/* 受取済みの日 */
.daily-cell.is-claimed {
  background: rgba(68, 213, 123, 0.10);
  border-color: rgba(68, 213, 123, 0.4);
}
.daily-cell.is-claimed .daily-cell__mark { color: var(--green); }
.daily-cell.is-claimed .daily-cell__amt { color: var(--text-mute); }
/* 今日受け取れる日（強調） */
.daily-cell.is-today {
  background: linear-gradient(180deg, rgba(255, 210, 74, 0.18), rgba(255, 154, 46, 0.06));
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(255, 210, 74, 0.35);
  transform: scale(1.04);
}
.daily-cell.is-today .daily-cell__amt { color: var(--gold); }
.daily-cell.is-today .daily-cell__day { color: var(--gold); }
/* まだ先の日 */
.daily-cell.is-future { opacity: 0.55; }

.daily-claim-btn {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--gold), var(--orange));
  color: #1a1100;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255, 154, 46, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 160ms var(--ease-out), filter 160ms var(--ease-out);
}
.daily-claim-btn:active { transform: scale(0.97); filter: brightness(0.96); }
.daily-claim-btn.is-claimed,
.daily-claim-btn[disabled] {
  background: var(--bg-2);
  color: var(--text-mute);
  box-shadow: none;
  cursor: default;
}

/* ホームの「デイリーボーナス」ボタン：受取可能なときタグを点滅で誘導 */
.action--bonus.is-ready .action__tag {
  background: linear-gradient(180deg, var(--gold), var(--orange));
  color: #1a1100;
  font-weight: 900;
  animation: bonusPulse 1.5s var(--ease-in-out) infinite;
}
@keyframes bonusPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50%      { transform: scale(1.06); filter: brightness(1.12); }
}

/* ===========================================================
   通知センター
   =========================================================== */
.notif-toolbar {
  display: flex;
  gap: 8px;
  margin: 4px 0 12px;
}
.notif-os-btn,
.notif-clear-btn {
  flex: 1;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter 160ms var(--ease-out);
}
.notif-os-btn.is-on {
  background: linear-gradient(180deg, rgba(31, 212, 255, 0.22), rgba(31, 212, 255, 0.06));
  border-color: var(--cyan);
  color: var(--cyan);
}
.notif-clear-btn { flex: 0 0 auto; color: var(--text-mute); }
.notif-os-btn:active,
.notif-clear-btn:active { filter: brightness(0.92); }

.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 56vh;
  overflow-y: auto;
}
.notif-empty {
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
  padding: 28px 0;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  position: relative;
}
/* 未読は左に色帯＋少し明るく */
.notif-item.is-unread {
  background: rgba(31, 212, 255, 0.07);
  border-color: rgba(31, 212, 255, 0.3);
}
.notif-item.is-unread::before {
  content: '';
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: var(--cyan);
}
.notif-item__icon {
  font-size: 20px;
  line-height: 1.2;
  flex: 0 0 auto;
}
.notif-item__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.notif-item__title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.01em;
}
.notif-item__text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-mute);
}
.notif-item__time {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin-top: 1px;
}
.notif-note {
  margin: 12px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* 一覧の「今日達成済み」✓ スタンプ（サムネイル右上に重ねる） */
.card-row__check {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  color: #06351b;
  background: linear-gradient(180deg, #54e08a, var(--green));
  box-shadow: 0 0 10px rgba(68, 213, 123, 0.5), 0 0 0 2px var(--bg-card);
  pointer-events: none;
}

/* scout pool remaining counter (below rates row) */
.scout__pool {
  text-align: center;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.scout__pool strong {
  color: var(--cyan);
  font-weight: 900;
  font-size: 13px;
  margin: 0 2px;
}
.scout__pool.is-complete {
  color: var(--gold);
}
.scout__pool.is-complete strong {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 210, 74, 0.5);
}

/* disabled state for the scout draw button when complete or no pt */
.scout__draw[disabled] {
  filter: grayscale(0.4) brightness(0.7);
  cursor: not-allowed;
  pointer-events: none;
}

/* knowledge fact text under the scout reveal */
.scout__knowledge {
  margin-top: 14px;
  padding: 10px 14px 12px;
  background: linear-gradient(160deg, rgba(255, 210, 74, 0.12), rgba(255, 154, 46, 0.04));
  border: 1px solid rgba(255, 210, 74, 0.4);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.scout__knowledge-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--gold);
  font-weight: 900;
}
.scout__knowledge-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
}

/* +ミッションを追加 button (inside card-detail modal) */
.add-mission-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--border-strong);
  background: rgba(31, 212, 255, 0.04);
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  width: 100%;
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.add-mission-btn__plus {
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
}
@media (hover: hover) and (pointer: fine) {
  .add-mission-btn:hover {
    background: rgba(31, 212, 255, 0.08);
    border-color: var(--cyan);
  }
}
.add-mission-btn:active { transform: scale(0.98); }

/* ===========================================================
   自分の学び — user study notes on a card
   =========================================================== */
.note-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.note-list__empty {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}
.note-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  /* 金色の枠（.modal__section--notes）の中に入るので、メモ自体は控えめなカードに */
  background: rgba(8, 13, 28, 0.45);
  border: 1px solid rgba(255, 210, 74, 0.18);
  border-radius: 10px;
}
.note-item__text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.note-item__del {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: -2px -4px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 160ms var(--ease-out), background 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .note-item__del:hover { color: var(--red, #ff5d73); background: rgba(255, 93, 115, 0.1); }
}

.modal__notes-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 12px;
}

.note-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.note-add__input {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 44px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: #05060f;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.note-add__input::placeholder { color: var(--text-dim); }
.note-add__input:focus { outline: none; border-color: var(--cyan); }
.note-add__btn {
  align-self: flex-end;
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(31, 212, 255, 0.06);
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .note-add__btn:hover { background: rgba(31, 212, 255, 0.12); border-color: var(--cyan); }
}
.note-add__btn:active { transform: scale(0.97); }

/* card sell button (inside card-detail modal) */
.modal__sell {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sell-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 154, 46, 0.35);
  background: rgba(255, 154, 46, 0.08);
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.sell-btn__label { font-size: 13px; }
.sell-btn__price { font-size: 14px; font-weight: 900; }
@media (hover: hover) and (pointer: fine) {
  .sell-btn:hover { background: rgba(255, 154, 46, 0.14); border-color: var(--gold); }
}
.sell-btn:active { transform: scale(0.98); }
.modal__sell-note { margin: 0; font-size: 10px; color: var(--text-dim); text-align: center; }

/* field row — pair two fields side-by-side inside mission-add form */
.field-row {
  display: flex;
  gap: 10px;
}
.field-row .field { flex: 1 1 0; }
.field-row select.field__input {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-mute) 50%),
    linear-gradient(135deg, var(--text-mute) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

/* contract form */
.modal__title { margin: 0 0 8px; font-size: 18px; font-weight: 900; letter-spacing: 0.04em; }
.modal__lead { margin: 0 0 16px; font-size: 12px; color: var(--text-mute); line-height: 1.6; }

.contract-form { display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field--inline { flex-direction: row; align-items: center; gap: 12px; }
.field--inline .field__label { min-width: 60px; }
.field__label {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.06em;
  font-weight: 800;
}
.field__input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  transition: border-color 160ms var(--ease-out), background 160ms var(--ease-out);
  width: 100%;
}
.field__input:focus {
  outline: none;
  border-color: var(--cyan);
  background: rgba(31, 212, 255, 0.05);
}
.field__input--emoji { font-size: 26px; width: 80px; text-align: center; padding: 6px 8px; }

.position-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.position-picker__opt { cursor: pointer; }
.position-picker__opt input { position: absolute; opacity: 0; pointer-events: none; }
.position-picker__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.06em;
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.position-picker__btn small {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-mute);
  letter-spacing: 0.02em;
}
.position-picker__opt input:checked + .position-picker__btn {
  background: linear-gradient(180deg, #2a3252, #1a2140);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 16px rgba(31, 212, 255, 0.22);
}
.position-picker__opt input:checked + .position-picker__btn small { color: rgba(31, 212, 255, 0.75); }
.position-picker__opt input:focus-visible + .position-picker__btn {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.contract-submit {
  margin-top: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, #2fd0e0, #1aa5b8);
  color: white;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.06em;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 160ms var(--ease-out), filter 160ms var(--ease-out);
}
.contract-submit:active { transform: scale(0.98); filter: brightness(0.95); }

/* bronze card variant */
.player-card--bronze {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(205, 127, 50, 0.2), transparent 60%),
    linear-gradient(160deg, #4a2e10 0%, #221305 50%, #110903 100%);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(205, 127, 50, 0.45);
}
.player-card--bronze .player-card__rating { color: #e09558; text-shadow: 0 0 12px rgba(205, 127, 50, 0.4); }
.player-card--bronze .player-card__rarity  { color: #d28a4e; }
.player-card--bronze .player-card__position { color: rgba(224, 149, 88, 0.85); }
@media (hover: hover) and (pointer: fine) {
  .player-card--bronze:hover {
    box-shadow:
      0 14px 28px rgba(0, 0, 0, 0.55),
      inset 0 0 0 1px rgba(205, 127, 50, 0.7);
  }
}

/* ===========================================================
   Shop view — 契約 (category carousel)
   =========================================================== */
.shop-currency {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(31, 212, 255, 0.08);
  border: 1px solid rgba(31, 212, 255, 0.3);
  font-size: 13px;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 0.04em;
}
.shop-currency__icon { font-size: 14px; }

.shop-lead {
  margin: 14px 4px 12px;
  font-size: 13px;
  color: var(--text-mute);
  line-height: 1.5;
}

.shop-carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 24px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.shop-carousel::-webkit-scrollbar { display: none; }

.shop-tile {
  position: relative;
  flex: 0 0 280px;
  aspect-ratio: 3 / 4;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  scroll-snap-align: center;
  cursor: pointer;
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .shop-tile:not(.shop-tile--coming):hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  }
}
.shop-tile:not(.shop-tile--coming):active { transform: scale(0.98); }

.shop-tile__art {
  flex: 1.4;
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(100% 80% at 50% 30%, rgba(255, 255, 255, 0.16), transparent 70%),
    linear-gradient(160deg, #2a3252, #0a1130);
}
.shop-tile__emoji {
  font-size: 96px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6));
  line-height: 1;
}
.shop-tile__sub {
  position: absolute;
  bottom: 10px;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 900;
  text-transform: uppercase;
}

.shop-tile__body {
  flex: 1;
  padding: 14px 16px 16px;
  background: linear-gradient(180deg, rgba(20, 28, 52, 0.96), rgba(8, 13, 28, 0.98));
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border);
}
.shop-tile__title {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--text);
}
.shop-tile__desc {
  margin: 0;
  font-size: 11px;
  color: var(--text-mute);
  line-height: 1.5;
  flex: 1;
}
.shop-tile__cta {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--cyan);
}

.shop-tile__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), #1aa5b8);
  color: white;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px rgba(31, 212, 255, 0.4);
}
.shop-tile__badge--free {
  background: linear-gradient(180deg, var(--purple), #7b39c4);
  box-shadow: 0 4px 12px rgba(177, 76, 255, 0.4);
}
.shop-tile__badge--soon {
  background: linear-gradient(180deg, #4a536d, #2a3148);
  color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.shop-tile__badge--knowledge {
  background: linear-gradient(180deg, var(--gold), var(--orange));
  color: #1a1100;
  box-shadow: 0 4px 12px rgba(255, 154, 46, 0.45);
}

/* small theme label under tile title */
.shop-tile__theme {
  margin: -2px 0 0;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-weight: 800;
  text-transform: uppercase;
}

/* scout modal — theme subtitle next to the title */
.modal__title-sub {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 210, 74, 0.15);
  border: 1px solid rgba(255, 210, 74, 0.45);
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

/* per-tile colored art backgrounds */
.shop-tile--manual .shop-tile__art {
  background:
    radial-gradient(100% 80% at 50% 30%, rgba(177, 76, 255, 0.45), transparent 70%),
    linear-gradient(160deg, #4a258b 0%, #1a0a3d 70%, #0a0520 100%);
}
.shop-tile--manual .shop-tile__cta { color: #d28aff; }

.shop-tile--scout .shop-tile__art {
  background:
    radial-gradient(100% 80% at 50% 30%, rgba(31, 212, 255, 0.45), transparent 70%),
    linear-gradient(160deg, #0a4e72 0%, #061730 70%, #03060f 100%);
}
.shop-tile--scout .shop-tile__cta { color: var(--cyan); }

.shop-tile--knowledge .shop-tile__art {
  background:
    radial-gradient(100% 80% at 50% 30%, rgba(255, 154, 46, 0.4), transparent 70%),
    linear-gradient(160deg, #5a3f10 0%, #2b1d05 70%, #110903 100%);
}
.shop-tile--knowledge .shop-tile__cta { color: var(--gold); }

.shop-tile--ceo .shop-tile__art {
  background:
    radial-gradient(100% 80% at 50% 30%, rgba(167, 139, 250, 0.42), transparent 70%),
    linear-gradient(160deg, #3a2670 0%, #1a1240 70%, #0a0820 100%);
}
.shop-tile--ceo .shop-tile__cta { color: #b9a6ff; }
.shop-tile__badge--ceo {
  background: linear-gradient(180deg, #a78bfa, #7c5cf0);
  color: #110a2e;
  box-shadow: 0 4px 12px rgba(124, 92, 240, 0.45);
}

/* 世界の設計図（構造）テーマ＝ティール×藍 */
.shop-tile--structure .shop-tile__art {
  background:
    radial-gradient(100% 80% at 50% 30%, rgba(45, 212, 191, 0.4), transparent 70%),
    linear-gradient(160deg, #0d3b3a 0%, #0a1f33 70%, #05101c 100%);
}
.shop-tile--structure .shop-tile__cta { color: #4fe3d0; }
.shop-tile__badge--structure {
  background: linear-gradient(180deg, #4fe3d0, #1f9fb8);
  color: #04201f;
  box-shadow: 0 4px 12px rgba(31, 159, 184, 0.45);
}

.shop-tile--coming {
  opacity: 0.72;
  cursor: not-allowed;
}
.shop-tile--coming .shop-tile__cta { color: var(--text-dim); }
.shop-tile--coming .shop-tile__emoji { filter: grayscale(0.4) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6)); }

@media (max-width: 720px) {
  .shop-tile { flex-basis: 240px; }
  .shop-tile__emoji { font-size: 76px; }
  .shop-tile__title { font-size: 16px; }
}

/* ===========================================================
   Modal tabs (contract / scout)
   =========================================================== */
.modal__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 4px 0 18px;
}
.modal__tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 9px;
  background: transparent;
  color: var(--text-mute);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: background 160ms var(--ease-out), color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.modal__tab-icon { font-size: 14px; }
.modal__tab.is-active {
  background: linear-gradient(180deg, #1a2548, #131c38);
  color: var(--cyan);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 14px rgba(31, 212, 255, 0.18);
}
@media (hover: hover) and (pointer: fine) {
  .modal__tab:not(.is-active):hover { color: var(--text); background: rgba(255,255,255,0.04); }
}
.modal__tab:active { transform: scale(0.97); }

.modal__tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--magenta);
  color: white;
  font-size: 10px;
  font-weight: 900;
  display: inline-grid;
  place-items: center;
  letter-spacing: 0;
}

.modal__tab-content { display: flex; flex-direction: column; }

/* ===========================================================
   Scout (gacha) panel
   =========================================================== */
.scout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* portrait: wrapper is transparent to layout (children flow in .scout as before).
   landscape turns it into the right-hand control column (see landscape media query). */
.scout__controls { display: contents; }

.scout__chamber {
  position: relative;
  aspect-ratio: 3 / 4;
  max-width: 200px;
  margin: 0 auto;
  width: 100%;
  border-radius: 16px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(31, 212, 255, 0.18), transparent 60%),
    linear-gradient(160deg, #0f1631 0%, #060a1a 100%);
  border: 1px dashed rgba(120, 160, 255, 0.35);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.scout__chamber.is-drawing {
  animation: scout-shake 600ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
  border-style: solid;
  border-color: var(--cyan);
  box-shadow: 0 0 30px rgba(31, 212, 255, 0.35), inset 0 0 30px rgba(31, 212, 255, 0.15);
}
.scout__chamber.is-revealed {
  border-style: solid;
  border-color: var(--cyan);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(31, 212, 255, 0.3), transparent 65%),
    linear-gradient(160deg, #122150 0%, #060a1a 100%);
}
.scout__chamber.is-revealed.is-gold {
  border-color: var(--gold);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 210, 74, 0.35), transparent 65%),
    linear-gradient(160deg, #2a2208 0%, #060a1a 100%);
  box-shadow: 0 0 36px rgba(255, 210, 74, 0.4);
}
.scout__chamber.is-revealed.is-silver {
  border-color: var(--silver);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(216, 223, 240, 0.22), transparent 65%),
    linear-gradient(160deg, #1c2238 0%, #060a1a 100%);
}

.scout__chamber .player-card {
  width: 90%;
  max-width: 170px;
  pointer-events: none;
  animation: scout-reveal 600ms var(--ease-out) both;
}
@keyframes scout-reveal {
  0%   { opacity: 0; transform: scale(0.4) rotateY(-40deg); filter: blur(8px); }
  60%  { opacity: 1; transform: scale(1.08) rotateY(0deg); filter: blur(0); }
  100% { opacity: 1; transform: scale(1) rotateY(0deg); filter: blur(0); }
}
@keyframes scout-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px) rotate(-1deg); }
  40% { transform: translateX(5px) rotate(1deg); }
  60% { transform: translateX(-4px) rotate(-0.5deg); }
  80% { transform: translateX(4px) rotate(0.5deg); }
}

.scout__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}
.scout__placeholder-mark {
  font-size: 56px;
  font-weight: 900;
  color: var(--text-mute);
  text-shadow: 0 0 18px rgba(31, 212, 255, 0.18);
}
.scout__placeholder-text { font-size: 11px; letter-spacing: 0.06em; }

.scout__rates {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.scout__rate {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-mute);
}
.scout__rate--gold   { color: var(--gold);   border-color: rgba(255, 210, 74, 0.4); }
.scout__rate--silver { color: var(--silver); border-color: rgba(216, 223, 240, 0.35); }
.scout__rate--bronze { color: #e09558;        border-color: rgba(205, 127, 50, 0.4); }

.scout__cost {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}
.scout__cost-label { font-weight: 800; }
.scout__cost-value { font-size: 16px; font-weight: 900; color: var(--cyan); }
.scout__cost-sep   { color: var(--text-dim); }
.scout__cost-have  { color: var(--text); }
.scout__cost-have strong { color: var(--cyan); font-weight: 900; font-size: 14px; }

.scout__draw {
  background: linear-gradient(180deg, #ff7e3a, #d44a1f) !important;
}
.scout__draw:disabled {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-dim);
  box-shadow: none;
  cursor: not-allowed;
  filter: none;
}
.scout__draw:disabled:active { transform: none; }

.scout__hint {
  margin: -4px 0 0;
  font-size: 10px;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.04em;
}

/* body lock when modal open */
body.modal-open { overflow: hidden; }

/* ===========================================================
   Responsive — mobile
   =========================================================== */
@media (max-width: 720px) {
  .app {
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(48px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .stat { min-width: calc(50% - 6px); flex: 1 1 calc(50% - 6px); }
  .topbar__icons { order: 99; margin-left: auto; }

  .stat__value { font-size: 16px; }

  .banner { min-height: 160px; }
  .banner__title { font-size: 24px; }
  .banner__side { width: 100px; padding-right: 12px; }
  .banner__card { width: 80px; height: 110px; }
  .banner__card-rank { font-size: 32px; }

  .actions { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .action { padding: 12px 4px 10px; border-radius: 14px; }
  .action__icon { width: 42px; height: 42px; font-size: 22px; }
  .action__label { font-size: 11px; letter-spacing: 0.02em; }
  .action__tag { font-size: 9px; padding: 3px 6px; }

  .mission { grid-template-columns: 32px 1fr auto; padding: 12px; gap: 10px; }
  .mission__rank { width: 26px; height: 26px; font-size: 13px; }
  .mission__title { font-size: 14px; }

  .summary { grid-template-columns: 1fr 1fr; }
  .summary__card:last-child { grid-column: span 2; }

  /* team screen — mobile */
  /* minmax(0,1fr) so columns can shrink below the row's content min-width
     (otherwise the nowrap name forces the right column past the screen edge) */
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .screen-title { font-size: 16px; }
  .team-rating { padding: 3px 12px; }
  .team-rating__value { font-size: 20px; }
  .player-card__rating { font-size: 26px; }
  .player-card__art { font-size: 48px; }
}

@media (max-width: 380px) {
  .actions { grid-template-columns: repeat(3, 1fr); }
}

/* ===========================================================
   Landscape — phone in landscape fits to one screen (no scroll)
   =========================================================== */
@media (orientation: landscape) and (max-height: 500px) {
  .app {
    min-height: 100vh;
    min-height: 100svh;
    max-width: 100%;
    padding:
      max(8px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  /* topbar — single compact row */
  .topbar { padding: 6px 10px; }
  .topbar__row { flex-wrap: nowrap; gap: 6px; }
  .stat {
    min-width: 0;
    flex: 1 1 0;
    padding: 4px 8px;
    gap: 6px;
  }
  .stat__icon { font-size: 15px; }
  .stat__label { font-size: 9px; letter-spacing: 0.02em; }
  .stat__value { font-size: 13px; }
  .topbar__icons { gap: 6px; }
  .icon-btn { width: 30px; height: 30px; }
  .icon-btn__emoji { font-size: 14px; }
  .icon-btn__badge { min-width: 14px; height: 14px; font-size: 9px; }

  .gauge { margin-top: 6px; }
  .gauge__bar { height: 5px; }
  .gauge__text { font-size: 10px; }
  .gauge__text strong { font-size: 11px; }

  /* tabs */
  .tabs { margin-top: 0; padding: 3px; }
  .tabs__item { padding: 5px 10px; font-size: 12px; }

  /* banner: 引き伸ばさず内容ぶんの高さに（詰め込みで上下が切れるのを防ぐ） */
  .banner {
    margin-top: 0;
    min-height: 0;
    flex: 0 0 auto;
    border-radius: 16px;
  }
  /* 「直近の目標」スライドの 180px 固定は大きすぎるが、詰めすぎると窮屈なので中間に */
  .goal-slide { min-height: 132px; padding: 20px 18px; gap: 6px; }
  .goal-add__plus { font-size: 24px; }
  .goal-slide__deadline, .goal-slide__deadline--none { margin-top: 2px; }

  /* よく使うショートカットを横画面用に小型化 */
  .quicklinks { margin: 0; }
  .quicklinks__label { display: none; }
  .quicklink { padding: 6px 11px; }
  .quicklink__icon { font-size: 14px; }
  .quicklink__text { font-size: 12px; }
  .banner__content { padding: 12px 18px; gap: 4px; }
  .banner__title { font-size: 22px; }
  .banner__period { font-size: 11px; }
  .banner__lead { font-size: 11px; line-height: 1.5; margin-top: 4px; }
  .banner__lead strong { font-size: 13px; }
  .banner__side { width: 100px; padding-right: 14px; }
  .banner__card { width: 74px; height: 96px; }
  .banner__card-rank { font-size: 28px; }
  .banner__card-label { font-size: 10px; }

  /* 5 action buttons */
  .actions { margin-top: 0; gap: 6px; grid-template-columns: repeat(5, 1fr); }
  .action { padding: 5px 4px; border-radius: 12px; }
  .action__icon { width: 30px; height: 30px; font-size: 16px; }
  .action__label { font-size: 10px; letter-spacing: 0.02em; }
  .action__tag { font-size: 8px; padding: 2px 6px; top: -7px; }
  .action__pip { min-width: 16px; height: 16px; font-size: 9px; top: 4px; right: 6px; }

  /* hide vertical sections — accessible via tabs later */
  .block, .summary, .footer { display: none; }

  /* ---- card-detail modal: 2 columns so the tall card + details fit a short screen ----
     左にカード（固定）、右に詳細（縦スクロール）。横画面の横幅を活かして1画面に収める。 */
  [data-modal="card-detail"] .modal__panel {
    max-width: 680px;
    max-height: 100%;
    overflow: hidden;            /* scroll happens inside .modal__body, card stays put */
    display: grid;
    grid-template-columns: 128px 1fr;
    column-gap: 18px;
    align-items: stretch;
    padding: 16px 18px;
  }
  [data-modal="card-detail"] .modal__preview {
    margin: 0;
    align-self: center;
  }
  [data-modal="card-detail"] .modal__preview .player-card { width: 128px; }
  [data-modal="card-detail"] .modal__body {
    padding-top: 26px;           /* clear the × close button (sits over this column) */
    gap: 10px;
    min-height: 0;               /* allow the grid item to shrink so overflow can scroll */
    /* cap to the visible area (100dvh − .modal padding 40 − panel padding 32) and scroll the rest */
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ---- ガチャ(スカウト)モーダル: 横画面はチャンバー左・操作系右の2カラムで1画面に収める ---- */
  [data-modal="contract"] .modal__panel {
    max-width: 600px;
    max-height: 100%;
    padding: 14px 18px;
  }
  [data-modal="contract"] .modal__tabs { margin-bottom: 8px; }
  [data-modal="contract"] [data-tab-content="scout"] .modal__title { font-size: 15px; margin-bottom: 2px; }
  [data-modal="contract"] [data-tab-content="scout"] .modal__lead { display: none; }
  [data-modal="contract"] .scout {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }
  [data-modal="contract"] .scout__chamber {
    flex: 0 0 128px;
    max-width: 128px;
    margin: 0;
  }
  [data-modal="contract"] .scout__controls {
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
    min-width: 0;
  }
  [data-modal="contract"] .scout__controls .scout__knowledge,
  [data-modal="contract"] .scout__controls .scout__pool { margin-top: 0; }
  [data-modal="contract"] .scout__draw { padding: 11px 14px; }
  [data-modal="contract"] .scout__hint { margin: 0; }

  /* ---- 契約 / shop view: shrink the tall 3:4 tiles so each fits the short height ---- */
  [data-view="shop"] .screen-header { margin-bottom: 4px; }
  [data-view="shop"] .shop-lead { display: none; }       /* tiles are self-explanatory; reclaim height */
  [data-view="shop"] .shop-carousel {
    padding: 4px 4px 8px;
    gap: 12px;
    align-items: stretch;                 /* タイルを行の高さいっぱいに */
    height: calc(100svh - 96px);          /* ヘッダー下を満たし、下の大余白を解消 */
  }
  [data-view="shop"] .shop-tile {
    flex-basis: 240px;
    aspect-ratio: auto;          /* drop the 3:4 lock */
    height: 100%;                /* 内容高さでなくカルーセル高さいっぱいに広げる */
  }
  [data-view="shop"] .shop-tile__art { flex: none; height: 92px; }
  [data-view="shop"] .shop-tile__emoji { font-size: 50px; }
  [data-view="shop"] .shop-tile__sub { bottom: 6px; font-size: 9px; }
  [data-view="shop"] .shop-tile__body { padding: 10px 12px 12px; gap: 4px; }
  [data-view="shop"] .shop-tile__title { font-size: 15px; }
  [data-view="shop"] .shop-tile__theme { font-size: 11px; }
  [data-view="shop"] .shop-tile__desc { font-size: 10px; line-height: 1.4; }
  [data-view="shop"] .shop-tile__cta { font-size: 11px; }
  [data-view="shop"] .shop-tile__badge { top: 8px; right: 8px; padding: 3px 8px; font-size: 11px; }
}

/* 効果音トグル（ミュート時は少し沈ませる） */
.icon-btn.is-muted .icon-btn__emoji { opacity: 0.5; }

/* ===========================================================
   よく使うショートカット（ホーム・横スクロールのチップ）
   =========================================================== */
.quicklinks { margin: 2px 0 14px; }
.quicklinks__label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0 2px 7px;
}
.quicklinks__row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.quicklinks__row::-webkit-scrollbar { display: none; }
.quicklink {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  transition: transform 160ms var(--ease-out);
}
.quicklink:active { transform: scale(0.96); }
.quicklink__icon { font-size: 16px; line-height: 1; }
.quicklink__text { font-size: 13px; font-weight: 800; color: var(--text); white-space: nowrap; }
.quicklink--ceo {
  border-color: rgba(255, 154, 46, 0.45);
  background: linear-gradient(180deg, rgba(255, 154, 46, 0.14), rgba(255, 154, 46, 0.04));
}
.quicklink--money {
  border-color: rgba(255, 210, 74, 0.45);
  background: linear-gradient(180deg, rgba(255, 210, 74, 0.14), rgba(255, 210, 74, 0.04));
}
.quicklink--normal {
  border-color: rgba(31, 212, 255, 0.4);
  background: linear-gradient(180deg, rgba(31, 212, 255, 0.12), rgba(31, 212, 255, 0.04));
}
.quicklink--structure {
  border-color: rgba(79, 227, 208, 0.45);
  background: linear-gradient(180deg, rgba(79, 227, 208, 0.13), rgba(79, 227, 208, 0.04));
}
/* 編集 / 完了 チップ（控えめな点線） */
.quicklink--edit,
.quicklink--done {
  border-style: dashed;
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
}
.quicklink--edit .quicklink__text,
.quicklink--done .quicklink__text { color: var(--text-mute); }
/* 編集モードの候補チップ：追加済み=×／未追加=＋（薄く点線） */
.ql-pick.is-off { opacity: 0.5; border-style: dashed; }
.quicklink__mark { margin-left: 2px; font-size: 13px; font-weight: 900; color: var(--text-mute); }
.ql-pick.is-on .quicklink__mark { color: var(--red); }
.ql-pick.is-off .quicklink__mark { color: var(--cyan); }

/* ===========================================================
   試合（マッチデー） — kickoff / playing / result
   =========================================================== */
.match { position: relative; padding-bottom: 16px; }

.match-cta {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 15px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #061018;
  background: linear-gradient(180deg, var(--cyan), #14a6c0);
  box-shadow: 0 10px 24px rgba(31, 212, 255, 0.35);
  transition: transform 160ms var(--ease-out);
}
.match-cta--go { background: linear-gradient(180deg, var(--green), #2aa657); box-shadow: 0 10px 24px rgba(68, 213, 123, 0.35); }
.match-cta--ghost {
  color: var(--text-mute);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  box-shadow: none;
}
.match-cta:active { transform: scale(0.98); }

.match-kick__lead { margin: 4px 0 14px; color: var(--text); line-height: 1.6; font-size: 14px; }
.match-kick__lead strong { color: var(--cyan); font-size: 18px; }
.match-kick__label { margin: 18px 0 8px; font-size: 12px; font-weight: 800; color: var(--text-mute); letter-spacing: 0.08em; }
.match-kick__note { margin: 10px 2px 0; font-size: 11px; color: var(--text-dim); line-height: 1.6; }

.match-starters { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.match-starter {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.match-starter__pos {
  flex: none; min-width: 38px; text-align: center;
  font-size: 11px; font-weight: 900; color: var(--cyan);
  background: rgba(31, 212, 255, 0.12); border-radius: 6px; padding: 3px 6px;
}
.match-starter__title { flex: 1; font-size: 14px; font-weight: 700; color: var(--text); }
.match-starter__reward { flex: none; font-size: 12px; font-weight: 800; color: var(--gold); }

.match-halves { display: flex; gap: 8px; }
.match-half {
  flex: 1; padding: 12px 6px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--border);
  display: flex; flex-direction: column; gap: 2px; align-items: center;
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.match-half.is-active { border-color: var(--cyan); background: rgba(31, 212, 255, 0.12); box-shadow: var(--shadow-glow); }
.match-half:active { transform: scale(0.97); }
.match-half__label { font-size: 14px; font-weight: 900; color: var(--text); }
.match-half__sub { font-size: 11px; color: var(--text-mute); }

.match-board {
  display: flex; align-items: stretch; gap: 8px;
  margin: 4px 0 14px;
  padding: 16px 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(11, 18, 36, 0.95), rgba(8, 13, 28, 0.92));
  border: 1px solid var(--border-strong);
}
.match-board__side { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: center; }
.match-board__name { font-size: 12px; font-weight: 900; letter-spacing: 0.1em; color: var(--text-mute); }
.match-board__score { font-size: 40px; font-weight: 900; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.match-board__mid { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 6px; }
.match-board__phase { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: var(--cyan); }
.match-board__clock { font-size: 24px; font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; }

.match-play__hint { margin: 0 2px 10px; font-size: 12px; color: var(--text-mute); text-align: center; }

.match-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.match-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.match-row[data-match-goal]:active { transform: scale(0.98); border-color: var(--green); }
.match-row__icon { flex: none; width: 26px; height: 26px; display: grid; place-items: center; font-size: 18px; color: var(--text-dim); }
.match-row__title { flex: 1; font-size: 15px; font-weight: 700; color: var(--text); }
.match-row__reward { flex: none; font-size: 12px; font-weight: 900; color: var(--gold); }
.match-row.is-scored { opacity: 0.62; border-color: rgba(68, 213, 123, 0.35); }
.match-row.is-scored .match-row__title { text-decoration: line-through; color: var(--text-mute); }
.match-row.is-scored .match-row__reward { color: var(--green); }

.match-half-break { text-align: center; padding: 18px 6px 4px; }
.match-half-break__title { margin: 0 0 6px; font-size: 18px; font-weight: 900; color: var(--text); }
.match-half-break__desc { margin: 0 0 4px; font-size: 13px; color: var(--text-mute); }

.match-empty { text-align: center; padding: 40px 16px; }
.match-empty__icon { font-size: 56px; }
.match-empty__title { margin: 10px 0 6px; font-size: 18px; font-weight: 900; color: var(--text); }
.match-empty__desc { margin: 0 0 4px; font-size: 13px; color: var(--text-mute); line-height: 1.6; }

.match-result { text-align: center; padding: 14px 8px 4px; }
.match-result__title { margin: 6px 0 4px; font-size: 34px; font-weight: 900; letter-spacing: 0.04em; }
.match-result--win  .match-result__title { color: var(--gold); text-shadow: 0 0 26px rgba(255, 210, 74, 0.5); }
.match-result--draw .match-result__title { color: var(--silver); }
.match-result--loss .match-result__title { color: var(--text-mute); }
.match-result__sub { margin: 0 0 16px; font-size: 13px; color: var(--text-mute); }
.match-result__score { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; }
.match-result__score span { font-size: 13px; font-weight: 900; letter-spacing: 0.1em; color: var(--text-mute); }
.match-result__score strong { font-size: 48px; font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; }
.match-result__score em { font-size: 28px; color: var(--text-dim); font-style: normal; }

.match-mom {
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  margin: 0 auto 16px; padding: 14px;
  max-width: 320px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 210, 74, 0.12), rgba(255, 210, 74, 0.04));
  border: 1px solid rgba(255, 210, 74, 0.35);
}
.match-mom__label { font-size: 11px; font-weight: 900; letter-spacing: 0.1em; color: var(--gold); }
.match-mom__name { font-size: 17px; font-weight: 900; color: var(--text); }
.match-mom__rating { font-size: 12px; font-weight: 800; color: var(--text-mute); }

.match-result__stats { display: flex; gap: 10px; max-width: 320px; margin: 0 auto 6px; }
.match-result__stats > div {
  flex: 1; display: flex; flex-direction: column; gap: 4px; align-items: center;
  padding: 12px; border-radius: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
}
.match-result__k { font-size: 11px; font-weight: 800; color: var(--text-mute); letter-spacing: 0.06em; }
.match-result__v { font-size: 20px; font-weight: 900; color: var(--text); }
.match-result__btns { display: flex; gap: 10px; max-width: 320px; margin: 14px auto 0; }
.match-result__btns .match-cta { margin-top: 0; }

.goal-fx {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  pointer-events: none;
}
.goal-fx__ball { font-size: 84px; animation: goal-pop 1.1s var(--ease-out) forwards; }
.goal-fx__text { font-size: 40px; font-weight: 900; letter-spacing: 0.1em; color: var(--green);
  text-shadow: 0 0 24px rgba(68, 213, 123, 0.6); animation: goal-pop 1.1s var(--ease-out) forwards; }
@keyframes goal-pop {
  0%   { transform: scale(0.3); opacity: 0; }
  18%  { transform: scale(1.15); opacity: 1; }
  72%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.05); opacity: 0; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .match-board { padding: 10px 10px; margin-bottom: 10px; }
  .match-board__score { font-size: 30px; }
  .match-board__clock { font-size: 20px; }
  .match-result__title { font-size: 26px; }
  .match-result__score strong { font-size: 36px; }
}

/* ===========================================================
   初回オンボーディング（ようこそ画面・リリース版）
   =========================================================== */
.onboard {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  background: rgba(3, 6, 15, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: onboard-fade 240ms var(--ease-out);
}
@keyframes onboard-fade { from { opacity: 0; } to { opacity: 1; } }
.onboard__card {
  width: 100%;
  max-width: 380px;
  max-height: 100%;
  overflow-y: auto;
  text-align: center;
  padding: 28px 22px 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(20, 28, 52, 0.98), rgba(8, 13, 28, 0.98));
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: onboard-pop 280ms var(--ease-out);
}
@keyframes onboard-pop { from { transform: scale(0.92) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.onboard__logo { font-size: 52px; line-height: 1; }
.onboard__title { margin: 10px 0 6px; font-size: 22px; font-weight: 900; color: var(--text); letter-spacing: 0.02em; }
.onboard__lead { margin: 0 0 18px; font-size: 13px; color: var(--text-mute); line-height: 1.6; }
.onboard__steps { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.onboard__step {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.onboard__step-ico { flex: none; font-size: 24px; width: 30px; text-align: center; }
.onboard__step-text { font-size: 13px; line-height: 1.5; color: var(--text); }
.onboard__step-text strong { color: var(--cyan); font-weight: 900; }
.onboard__cta {
  width: 100%;
  padding: 15px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #061018;
  background: linear-gradient(180deg, var(--green), #2aa657);
  box-shadow: 0 10px 24px rgba(68, 213, 123, 0.35);
  transition: transform 160ms var(--ease-out);
}
.onboard__cta:active { transform: scale(0.98); }

/* 横画面では横並びでコンパクトに（上下が切れないようスクロール可） */
@media (orientation: landscape) and (max-height: 500px) {
  .onboard__card { max-width: 560px; padding: 18px 20px; }
  .onboard__logo { font-size: 36px; }
  .onboard__title { font-size: 18px; margin: 6px 0 4px; }
  .onboard__lead { margin-bottom: 12px; }
  .onboard__steps { gap: 8px; margin-bottom: 14px; }
  .onboard__step { padding: 9px 12px; }
}

/* オンボーディングの無料1枚お披露目 */
.onboard__reveal-eyebrow { margin: 0 0 12px; font-size: 13px; font-weight: 900; letter-spacing: 0.06em; color: var(--gold); }
.onboard__reveal-card { display: flex; justify-content: center; margin-bottom: 14px; }
.onboard__reveal-card .player-card { width: 150px; aspect-ratio: 3 / 4; pointer-events: none; }
.onboard__reveal-know {
  margin: 0 0 18px; padding: 12px 14px;
  font-size: 13px; line-height: 1.65; color: var(--text); text-align: left;
  background: linear-gradient(160deg, rgba(255, 210, 74, 0.10), rgba(255, 154, 46, 0.04));
  border: 1px solid rgba(255, 210, 74, 0.35); border-radius: 12px;
}
@media (orientation: landscape) and (max-height: 500px) {
  .onboard__reveal-card .player-card { width: 110px; }
  .onboard__reveal-know { margin-bottom: 12px; font-size: 12px; }
}

/* ショートカット編集：ドラッグ並べ替え（個人版から移植） */
.quicklink.ql-active {
  gap: 5px;
  padding: 6px 8px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.ql-handle {
  flex: 0 0 auto;
  font-size: 15px;
  line-height: 1;
  color: var(--text-mute);
  letter-spacing: -1px;
  padding-right: 1px;
}
.ql-arrow {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  transition: transform 160ms var(--ease-out);
}
.ql-arrow:active { transform: scale(0.9); }
.ql-arrow--rm { color: var(--red); border-color: rgba(255, 93, 143, 0.5); }
.ql-active .quicklink__text { margin: 0 1px; }
.quicklink.ql-dragging {
  cursor: grabbing;
  z-index: 30;
  position: relative;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  opacity: 0.96;
  transition: none;
}
.quicklinks__row.is-editing {
  flex-wrap: wrap;
  overflow-x: visible;
  row-gap: 8px;
}
.ql-break {
  flex: 1 0 100%;
  margin: 2px 0 -2px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.ql-break:empty { height: 0; margin: 0; }
