/*
 * 発信元: claude（Phase3）／発信先: codex、モコ（企画部）、オーナー
 * 参加者の画面（画面契約_v1 P1〜P6）。値は tokens_v1.css（.crtto-modern の中で有効）。参加者の画面は最大 560px。
 */
.pl-view { display: grid; gap: var(--sp-4); width: min(100%, 560px); margin-inline: auto; padding-bottom: calc(72px + env(safe-area-inset-bottom)); color: var(--text); font-family: var(--font); }
.pl-view h1, .pl-view h2, .pl-view p { margin: 0; }
.pl-view h1 { font-size: 1.5rem; line-height: 1.3; }
.pl-view h2 { font-size: 1.15rem; }
.pl-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pl-muted { color: var(--text-muted); font-size: var(--fs-small); }
.pl-center { text-align: center; }
.pl-section { display: grid; gap: var(--sp-3); }
.pl-card { display: grid; gap: var(--sp-2); min-width: 0; padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); color: var(--text); text-align: left; font: inherit; }
.pl-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pl-back { justify-self: start; min-height: 44px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.pl-link { color: var(--text); font-weight: 700; text-underline-offset: 4px; }
.pl-loading { padding: var(--sp-4); }

/* ボタン：主ボタン（コーラル）は1画面に1つ。副ボタンはネイビーの枠 */
.pl-primary { width: 100%; min-height: var(--h-onsite); border: 0; border-radius: var(--r-m); background: var(--cta); color: var(--on-cta); font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; }
.pl-primary:hover { background: var(--cta-hover); }
.pl-primary:disabled { background: var(--disabled-bg); color: var(--disabled-text); cursor: not-allowed; }
.pl-secondary { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: var(--h-btn); padding: 0 var(--sp-4); border: 2px solid var(--navy); border-radius: var(--r-m); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.pl-secondary.is-small { width: auto; justify-self: start; min-height: 44px; }
.pl-row > .pl-secondary { flex: 1 1 10rem; width: auto; }
.pl-danger { width: 100%; min-height: var(--h-btn); border: 2px solid var(--error); border-radius: var(--r-m); background: var(--surface); color: var(--error); font: inherit; font-weight: 700; cursor: pointer; }
.pl-row > .pl-danger { flex: 1 1 10rem; width: auto; }
.pl-primary-bar { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 10; display: grid; gap: var(--sp-1); padding: var(--sp-3) 0; background: var(--paper); }
.pl-primary-bar.is-inline { position: static; padding: var(--sp-2) 0 0; background: none; }
.pl-reason { color: var(--text-muted); font-size: var(--fs-small); text-align: center; }

/* 状態バッジ（2-3）。文言付き */
.pl-badge { display: inline-block; padding: 2px 8px; border-radius: var(--r-s); font-size: 13px; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.pl-badge.is-ok { background: var(--ok-bg); color: var(--ok); }
.pl-badge.is-wait { background: var(--wait-bg); color: var(--wait); }
.pl-badge.is-neutral { background: var(--navy-tint); color: var(--text); }
.pl-badge.is-muted { background: var(--navy-tint); color: var(--text-muted); }
.pl-badge.is-navy { background: var(--navy); color: #fff; }
.pl-error, .pl-field-error { display: flex; gap: var(--sp-2); color: var(--error); font-size: var(--fs-small); }
.pl-error { padding: var(--sp-3); border: 2px solid var(--error); border-radius: var(--r-m); background: var(--error-bg); }

/* P1 開催カード（カード全体が押せる） */
.pl-event-card { padding: 0; overflow: hidden; }
.pl-event-card.is-today { border: 2px solid var(--navy); }
.pl-card-hit { display: grid; gap: var(--sp-1); width: 100%; padding: var(--sp-4); border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pl-card-date { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-card-title { color: var(--text-muted); font-size: var(--fs-small); }
.pl-card-badges { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-top: var(--sp-1); }
.pl-event-card > .pl-primary { width: calc(100% - 2 * var(--sp-4)); margin: 0 var(--sp-4) var(--sp-4); }
.pl-empty { justify-items: center; text-align: center; }
.pl-field { display: grid; gap: var(--sp-1); font-weight: 700; }
.pl-field input { min-height: 48px; padding: 0 var(--sp-3); border: 1px solid var(--line-strong); border-radius: var(--r-m); background: var(--surface); font-size: 16px; }
.pl-field input[aria-invalid="true"] { border: 2px solid var(--error); }
.pl-invite summary { min-height: 44px; display: flex; align-items: center; color: var(--text-muted); font-weight: 700; cursor: pointer; }
.pl-invite form { display: grid; gap: var(--sp-2); }
.pl-reading { display: grid; gap: var(--sp-2); }
.pl-article-list { display: grid; gap: var(--sp-1); margin: 0; padding: 0; list-style: none; }
.pl-article-list a { display: flex; justify-content: space-between; gap: var(--sp-2); min-height: 44px; align-items: center; color: var(--text); }

/* P2〜P4 */
.pl-head { display: grid; gap: var(--sp-1); }
.pl-head-venue { font-weight: 700; }
.pl-venue { display: grid; gap: var(--sp-1); margin: var(--sp-2) 0 0; font-size: var(--fs-small); }
.pl-venue div { display: grid; grid-template-columns: fit-content(40%) minmax(0, 1fr); gap: var(--sp-2); }
.pl-venue dt { color: var(--text-muted); font-weight: 700; }
.pl-venue dd { margin: 0; white-space: pre-line; }
.pl-checkin form { display: grid; gap: var(--sp-2); }
.pl-confirm { border: 2px solid var(--error); }
.pl-next { display: grid; gap: var(--sp-2); }
.pl-next-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.pl-next-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-4); background: var(--navy); color: #fff; }
.pl-next-head strong { font-size: 1.5rem; }
.pl-next-card > .pl-versus, .pl-next-card > .pl-primary-bar { padding-inline: var(--sp-4); }
.pl-next-card > .pl-versus { padding-block: var(--sp-4); }
.pl-next-card > .pl-primary-bar { padding-bottom: var(--sp-4); }
.pl-versus { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--sp-2); text-align: center; }
.pl-vs { color: var(--text-muted); font-size: var(--fs-small); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-versus .pn-pair-name .pn-names { justify-content: center; }
.pl-practice-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.pl-waiting { text-align: center; }

/* P5 */
.pl-score-title { font-size: 1.5rem; }
.pl-score-form { display: grid; gap: var(--sp-3); }
.pl-score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.pl-team-card { display: grid; justify-items: center; gap: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); text-align: center; }
.pl-score-num { font-size: var(--fs-score); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.pl-counter { display: flex; gap: var(--sp-2); }
.pl-step { width: var(--h-onsite); height: var(--h-onsite); border: 2px solid var(--navy); border-radius: var(--r-m); background: var(--surface); color: var(--navy); font-size: 1.5rem; font-weight: 700; cursor: pointer; }
.pl-step.is-plus { background: var(--navy); color: #fff; }
.pl-step:disabled { border-color: var(--disabled-bg); background: var(--disabled-bg); color: var(--disabled-text); cursor: not-allowed; }
.pl-score-line { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.pl-score-line strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.pl-conflict { display: grid; gap: var(--sp-1); padding: var(--sp-3); border: 2px solid var(--wait); border-radius: var(--r-m); background: var(--wait-bg); color: var(--wait); }

/* P6 */
.pl-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--r-m); background: var(--navy-tint); }
.pl-switch button { min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.pl-switch button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.pl-match-list { display: grid; gap: var(--sp-3); }
.pl-match { gap: var(--sp-2); }
.pl-match.is-own { border: 2px solid var(--navy); cursor: pointer; }
.pl-match-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }

/* 下部タブ（ホーム／履歴／アカウント）。現在地はコーラルの線＋ネイビーの文字 */
/* Keep footer guidance reachable above the fixed participant navigation. */
body:has(.pl-tabs) { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.pl-tabs { position: fixed; z-index: 20; inset: auto 0 0; display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 max(var(--sp-2), env(safe-area-inset-right)) env(safe-area-inset-bottom) max(var(--sp-2), env(safe-area-inset-left)); border-top: 1px solid var(--line, #DDE0E6); background: var(--surface, #fff); }
.pl-tabs button { min-height: 56px; border: 0; border-top: 3px solid transparent; background: none; color: var(--text-muted, #4A5268); font: inherit; font-size: var(--fs-small, .875rem); font-weight: 700; cursor: pointer; }
.pl-tabs button[aria-current="page"] { border-top-color: var(--coral, #F04A2E); color: var(--navy, #172240); }
.pl-view :focus-visible, .pl-tabs :focus-visible { outline: 3px solid var(--focus, #172240); outline-offset: 2px; }

@media (max-width: 380px) {
  .pl-step { width: 48px; height: 48px; }
  .pl-score-grid { gap: var(--sp-2); }
  .pl-team-card { padding: var(--sp-2); }
}
@media (min-width: 1024px) {
  .pl-tabs { position: static; width: min(100%, 560px); margin: var(--sp-4) auto 0; border: 1px solid var(--line, #DDE0E6); border-radius: var(--r-l, 14px); }
  .pl-view { padding-bottom: 0; }
  .pl-primary-bar { bottom: 0; }
}
.pl-card .pl-primary-bar { position: static; padding: var(--sp-2) 0 0; background: none; }
.pl-team-card { grid-template-rows: minmax(3.2em, auto) auto auto; align-items: center; }
/* P7 結果・レーティング */
.pl-result-line { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-rating-value { font-size: var(--fs-num); font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-setting { justify-self: start; min-height: 44px; padding: 0; border: 0; background: none; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
