:root {
  --bg-base:         #0d2b0d;
  --bg-panel:        #1a4d1a;
  --bg-deep:         #070f07;
  --border-color:    #2e8b2e;
  --border-muted:    #1a4d1a;
  --text-primary:    #f0f0f0;
  --text-muted:      #9fcf9f;
  --accent-gold:     #f1c40f;
  --accent-red:      #c0392b;
  --radius-btn:      8px;
  --radius-panel:    12px;
  --shadow-card:     0 2px 8px rgba(0,0,0,0.4);
  --shadow-selected: 0 8px 20px rgba(241,196,15,0.65);
  --table-felt:      radial-gradient(ellipse at 50% 40%, #225c22 0%, #1a5c1a 55%, #133c13 100%);
  --transition-card: 0.15s cubic-bezier(0.25,0.8,0.25,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', sans-serif;
  background: #0d2b0d;
  color: #f0f0f0;
  min-height: 100vh;
}

.hidden { display: none !important; }

button,
.mode-card,
.code-value,
.rule-btn,
.card {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ═══════════════════════════════════════════
   サイト情報 / 静的コンテンツ
═══════════════════════════════════════════ */
a {
  color: inherit;
}

.home-screen {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  flex-direction: column;
  padding: 0;
}

.site-nav {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: #d8efd8;
}

.site-brand {
  font-size: 1.02rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 1px;
  white-space: nowrap;
}

.site-nav nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.86rem;
  margin-left: auto;
}

.site-nav nav a {
  color: #a9cfa9;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-nav nav a:hover,
.site-nav nav a:focus-visible {
  color: #fff;
  border-bottom-color: #f1c40f;
}

.home-stage {
  width: 100%;
  min-height: min(680px, calc(100vh - 96px));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px 28px;
}

.home-content {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 42px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.content-section {
  background: #f6f2e8;
  color: #1f2d24;
  border: 1px solid #dfd5c0;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.18);
}

.intro-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
}

.solo-league-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 22px;
  align-items: stretch;
}

.solo-league-board {
  background: #fffdf7;
  border: 1px solid #e8dec9;
  border-radius: 8px;
  padding: 18px;
}

.solo-board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #24563a;
  font-weight: 800;
  margin-bottom: 10px;
}

.solo-board-head small {
  color: #8a6a10;
  font-size: 0.74rem;
}

.solo-score-rule-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.solo-score-rule-list span {
  background: #f7f0df;
  border: 1px solid #e8dec9;
  border-radius: 6px;
  color: #24563a;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 9px 8px;
  text-align: center;
}

.solo-home-leaderboard {
  display: grid;
  gap: 8px;
}

.solo-leader-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #e8dec9;
  color: #33483a;
  font-size: 0.86rem;
  padding: 7px 0;
}

.solo-leader-row:last-child {
  border-bottom: 0;
}

.solo-leader-place,
.solo-leader-score {
  color: #8a6a10;
  font-weight: 800;
}

.solo-leader-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.solo-leader-title-logo {
  flex: 0 0 auto;
  width: 38px;
  aspect-ratio: 20 / 11;
  object-fit: contain;
  filter: drop-shadow(0 0 5px rgba(241,196,15,0.28));
}

.solo-leader-name-main {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.solo-leader-display-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-kicker {
  color: #8a6a10;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.content-section h2 {
  font-size: 1.45rem;
  color: #193f2b;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.content-section h3 {
  font-size: 1rem;
  color: #24563a;
  margin-bottom: 8px;
}

.content-section p,
.content-section li {
  font-size: 0.95rem;
  line-height: 1.85;
  color: #33483a;
}

.card-preview {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.card-preview span {
  width: 54px;
  height: 78px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #111;
  border: 1px solid #d0c7b5;
  border-radius: 7px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  font-weight: 800;
}

.card-preview span:nth-child(even) {
  color: #b8322a;
  transform: translateY(8px);
}

.guide-grid,
.rule-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.rule-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.guide-grid article,
.rule-summary > div {
  background: #fffdf7;
  border: 1px solid #e8dec9;
  border-radius: 8px;
  padding: 18px;
}

.plain-list {
  padding-left: 1.1rem;
}

.plain-list li + li {
  margin-top: 8px;
}

.text-link {
  display: inline-block;
  color: #17613f;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid #17613f;
}

.text-link:hover,
.text-link:focus-visible {
  color: #8a6a10;
  border-bottom-color: #8a6a10;
}

.guide-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.guide-link-card {
  display: flex;
  min-height: 104px;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  background: #fffdf7;
  border: 1px solid #e8dec9;
  border-radius: 8px;
  color: #24563a;
  padding: 16px;
  text-decoration: none;
}

.guide-link-card:hover,
.guide-link-card:focus-visible {
  border-color: #8a6a10;
  box-shadow: 0 8px 18px rgba(138,106,16,0.16);
  color: #8a6a10;
}

.guide-link-card span {
  font-weight: 800;
}

.guide-link-card small {
  color: #526859;
  font-size: 0.82rem;
  line-height: 1.55;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-list details {
  background: #fffdf7;
  border: 1px solid #e8dec9;
  border-radius: 8px;
  padding: 14px 16px;
}

.faq-list summary {
  color: #24563a;
  cursor: pointer;
  font-weight: 800;
}

.faq-list p {
  margin-top: 10px;
}

.site-footer {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: #9fcf9f;
  font-size: 0.82rem;
}

.site-footer a {
  color: #c9e3c9;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #fff;
  border-bottom-color: #f1c40f;
}

.content-page .site-footer {
  color: #65756a;
}

.content-page .site-footer a {
  color: #315945;
}

.content-page .site-footer a:hover,
.content-page .site-footer a:focus-visible {
  color: #8a6a10;
  border-bottom-color: #8a6a10;
}

.content-page {
  background: #f6f2e8;
  color: #1f2d24;
}

.content-page .site-nav {
  color: #193f2b;
  border-bottom: 1px solid #dfd5c0;
}

.content-page .site-brand {
  color: #193f2b;
}

.content-page .site-nav nav a {
  color: #315945;
}

.content-page .site-nav nav a:hover,
.content-page .site-nav nav a:focus-visible {
  color: #8a6a10;
}

.static-main {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 70px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #65756a;
  font-size: 0.84rem;
  margin-bottom: 18px;
}

.breadcrumb a {
  color: #315945;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: #8a6a10;
  border-bottom-color: #8a6a10;
}

.static-hero {
  margin-bottom: 24px;
}

.static-hero h1 {
  color: #193f2b;
  font-size: 2rem;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.static-hero p {
  color: #415846;
  font-size: 1rem;
  line-height: 1.85;
}

.static-section {
  background: #fffdf7;
  border: 1px solid #e4dac7;
  border-radius: 8px;
  padding: 24px 26px;
  margin-top: 16px;
}

.static-section h2 {
  color: #24563a;
  font-size: 1.18rem;
  margin-bottom: 10px;
}

.static-section h3 {
  color: #315945;
  font-size: 1rem;
  margin: 18px 0 8px;
}

.static-section p,
.static-section li {
  color: #33483a;
  font-size: 0.95rem;
  line-height: 1.85;
}

.static-section ul,
.static-section ol {
  padding-left: 1.2rem;
}

.static-section li + li {
  margin-top: 6px;
}

.static-section a {
  color: #17613f;
  font-weight: 700;
}

.rules-hub .guide-link-grid {
  margin-top: 16px;
}

.effect-figure {
  margin: 0 0 18px;
}

.effect-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #e4dac7;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}

.effect-figure figcaption {
  color: #526859;
  font-size: 0.86rem;
  line-height: 1.7;
  margin-top: 8px;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.related-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #d8ccb6;
  border-radius: 999px;
  background: #f6f2e8;
  text-decoration: none;
}

.related-links a:hover,
.related-links a:focus-visible {
  border-color: #8a6a10;
  color: #8a6a10;
}

.static-note {
  background: #eef4e9;
  border-left: 4px solid #2e8b2e;
  padding: 12px 14px;
  margin-top: 12px;
  color: #315945;
  line-height: 1.75;
}

.rules-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  background: #fff;
}

.rules-table th,
.rules-table td {
  border: 1px solid #e4dac7;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
  line-height: 1.65;
}

.rules-table th {
  background: #eef4e9;
  color: #24563a;
  font-weight: 800;
}

.rules-table td:first-child,
.rules-table td:nth-child(2) {
  font-weight: 800;
  color: #24563a;
  white-space: nowrap;
}

.updated-date {
  color: #65756a;
  font-size: 0.85rem;
  margin-top: 16px;
}

/* ═══════════════════════════════════════════
   フォームスクリーン共通（スタート / 作成 / 参加 / ロビー）
═══════════════════════════════════════════ */
.screen-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.form-box {
  background: #1a4d1a;
  border: 2px solid #2e8b2e;
  border-radius: 16px;
  padding: 44px 52px;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.form-box h1 {
  font-size: 2.8rem;
  letter-spacing: 4px;
  text-align: center;
}

.form-box h2 {
  font-size: 1.6rem;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 4px;
}

.subtitle {
  text-align: center;
  color: #9fcf9f;
  font-size: 0.95rem;
}

.form-box label {
  font-size: 0.85rem;
  color: #9fcf9f;
  margin-bottom: -8px;
}

.form-box input {
  padding: 11px 14px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #4a8a4a;
  background: #0d2b0d;
  color: #f0f0f0;
  outline: none;
  width: 100%;
}

.form-box input:focus { border-color: #7dca7d; }

.hint-text {
  font-size: 0.78rem;
  color: #7da07d;
  text-align: center;
  line-height: 1.5;
  margin-top: -4px;
}

/* プレイヤー数セレクター */
#count-selector {
  display: flex;
  gap: 8px;
}

.count-btn {
  flex: 1;
  padding: 10px 0;
  background: #0d3a0d;
  color: #9fcf9f;
  border: 1px solid #3a6a3a;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.count-btn:hover { background: #1a5a1a; border-color: #5a9a5a; }

.count-btn.active {
  background: #2e8b2e;
  border-color: #4ab84a;
  color: #fff;
}

#difficulty-selector {
  display: flex;
  gap: 8px;
}

.diff-btn {
  flex: 1;
  padding: 10px 0;
  background: #0d3a0d;
  color: #9fcf9f;
  border: 1px solid #3a6a3a;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.diff-btn:hover:not(.active) { background: #1a5a1a; border-color: #5a9a5a; }

.diff-btn.active {
  background: #2e8b2e;
  border-color: #4ab84a;
  color: #fff;
}

.diff-btn.is-locked {
  background: #161b16;
  border-color: #454d45;
  color: #7f897f;
}

.diff-btn.is-locked:hover {
  background: #202720;
  border-color: #687368;
  color: #aeb8ae;
}

.diff-btn[data-d="extra_hard"]:not(.is-locked) {
  border-color: #9a6bca;
  color: #d8b8ff;
}

.diff-btn[data-d="extra_hard"].active {
  background: #6d35a4;
  border-color: #b783e6;
  color: #fff;
}

.extra-hard-hint {
  margin-top: -4px;
  color: #8e9a8e;
  text-align: right;
}

.extra-hard-hint.is-unlocked {
  color: #c59bea;
}

/* スタートメニュー拡張 */
.start-box { max-width: 520px; }

.mode-select-label {
  font-size: 0.8rem;
  color: #7da07d;
  text-align: center;
  margin-bottom: -6px;
}

.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mode-card {
  background: #0d3a0d;
  border: 2px solid #2e5a2e;
  border-radius: 12px;
  padding: 16px 10px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: background 0.15s, border-color 0.15s;
}

.mode-card:hover { background: #1a4d1a; border-color: #4a8a4a; }

.mode-card.active {
  background: #1a5a1a;
  border-color: #4ab84a;
  box-shadow: 0 0 10px rgba(74,184,74,0.3);
}

.mode-card-icon { font-size: 1.4rem; }
.mode-card-title { font-size: 0.88rem; font-weight: bold; color: #c8f0c8; }
.mode-card-desc  { font-size: 0.72rem; color: #7da07d; line-height: 1.45; }

.mode-card.active .mode-card-title { color: #fff; }

.mode-card-zen { border-color: #4a3a00; }
.mode-card-zen:hover { background: #2a1e00; border-color: #8a6a00; }
.mode-card-zen.active {
  background: #2a1e00;
  border-color: #c8a020;
  box-shadow: 0 0 10px rgba(200,160,32,0.35);
}
.mode-card-zen.active .mode-card-title { color: #f1c40f; }
.mode-card-zen.active .mode-card-desc  { color: #c8a020; }

.ranked-start-btn {
  border-color: #c8a020;
  color: #f1c40f;
  background: #2a1e00;
}

.ranked-start-btn:hover {
  background: #3a2c05;
}

.solo-official-start-btn {
  border-color: #d98d34;
  color: #ffd49a;
  background: #301b08;
}

.solo-official-start-btn:hover {
  background: #44260b;
}

.solo-rank-strip {
  background: rgba(10, 28, 12, 0.78);
  border: 1px solid rgba(241, 196, 15, 0.32);
  border-radius: 8px;
  padding: 11px 12px;
}

.solo-rank-strip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: #ffd49a;
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 7px;
}

.solo-rank-strip-head small {
  color: #a9cfa9;
  font-size: 0.68rem;
  white-space: nowrap;
}

.solo-rank-strip .solo-home-leaderboard {
  gap: 5px;
}

.solo-rank-strip .solo-leader-row {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  border-bottom: 1px solid rgba(159, 207, 159, 0.16);
  color: #e8f4e8;
  font-size: 0.78rem;
  padding: 5px 0;
}

.solo-rank-strip .solo-leader-place,
.solo-rank-strip .solo-leader-score {
  color: #f1c40f;
}

.solo-rank-strip .solo-leader-name {
  min-width: 0;
}

.solo-rank-strip .solo-leader-title-logo {
  width: 34px;
}

.solo-rank-strip .solo-leader-name small {
  color: #8fb88f;
  font-size: 0.68rem;
}

.solo-leader-more {
  width: 100%;
  margin-top: 7px;
  padding: 6px 8px;
  background: transparent;
  border: 1px solid rgba(159, 207, 159, 0.25);
  border-radius: 6px;
  color: #cfe8cf;
  cursor: pointer;
  font-size: 0.72rem;
}

.solo-leader-more:hover {
  background: rgba(159, 207, 159, 0.08);
}

.solo-title-progress-card {
  width: 100%;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  background: linear-gradient(135deg, rgba(48,27,8,0.86), rgba(10,40,10,0.72));
  border: 1px solid rgba(255,212,154,0.42);
  border-radius: 8px;
  color: #e8f4e8;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.solo-title-progress-card:hover {
  background: linear-gradient(135deg, rgba(68,38,11,0.94), rgba(14,52,14,0.84));
  border-color: rgba(255,212,154,0.72);
  box-shadow: 0 0 18px rgba(241,196,15,0.18);
  transform: translateY(-1px);
}

.solo-title-progress-card.has-claim {
  border-color: #ffd49a;
  box-shadow: 0 0 18px rgba(241,196,15,0.25);
}

.solo-title-progress-card.has-title-event {
  border-color: #f7dc6f;
  box-shadow: 0 0 0 1px rgba(247,220,111,0.18), 0 0 20px rgba(247,220,111,0.28);
}

.solo-title-progress-card.has-title-event .solo-title-progress-badge {
  background: rgba(247,220,111,0.24);
  color: #fff7d0;
}

.solo-title-progress-loading {
  grid-column: 1 / -1;
  color: #a9cfa9;
  font-size: 0.76rem;
  text-align: center;
}

.solo-title-logo-wrap {
  width: 78px;
  aspect-ratio: 20 / 11;
  display: grid;
  place-items: center;
  overflow: visible;
}

.solo-title-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(241,196,15,0.32));
}

.solo-title-progress-main {
  min-width: 0;
}

.solo-title-progress-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.solo-title-progress-name {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.solo-title-progress-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(241,196,15,0.16);
  border: 1px solid rgba(255,212,154,0.25);
  color: #ffd49a;
  font-size: 0.64rem;
  font-weight: 900;
  padding: 3px 7px;
}

.solo-title-progress-next {
  color: #a9cfa9;
  font-size: 0.7rem;
  line-height: 1.35;
  margin-bottom: 7px;
}

.solo-title-progress-mini {
  display: grid;
  gap: 5px;
}

.solo-title-progress-mini-line {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 56px;
  gap: 6px;
  align-items: center;
  color: #cfe8cf;
  font-size: 0.64rem;
}

.solo-title-progress-mini-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.09);
}

.solo-title-progress-mini-fill {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, #58d68d, #f1c40f);
  border-radius: inherit;
}

.home-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.home-action-btn {
  position: relative;
  min-height: 56px;
  border-width: 2px;
  color: #fff;
  font-size: 1.03rem;
  letter-spacing: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.34),
    inset 0 -3px 0 rgba(0,0,0,0.18),
    0 8px 18px rgba(0,0,0,0.34);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.home-action-btn:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -3px 0 rgba(0,0,0,0.16),
    0 11px 22px rgba(0,0,0,0.42);
  filter: brightness(1.08) saturate(1.08);
  transform: translateY(-1px);
}

.home-action-btn:focus-visible {
  outline: 3px solid rgba(255,255,255,0.82);
  outline-offset: 3px;
}

.home-action-btn.home-action-create,
.home-action-btn.home-action-join {
  background: linear-gradient(180deg, #2f6f74 0%, #1f525c 56%, #153942 100%);
  border-color: #8cc9cc;
  color: #f3ffff;
}

.home-action-btn.home-action-create:hover,
.home-action-btn.home-action-join:hover {
  background: linear-gradient(180deg, #3b7f84 0%, #28616a 56%, #1b4650 100%);
}

.solo-official-start-btn.home-action-btn,
.ranked-start-btn.home-action-btn {
  background: linear-gradient(180deg, #a8892f 0%, #715312 56%, #3f2c07 100%);
  border-color: #e5c66a;
  color: #fff7d0;
}

.solo-official-start-btn.home-action-btn:hover,
.ranked-start-btn.home-action-btn:hover {
  background: linear-gradient(180deg, #b99837 0%, #805f18 56%, #4b3509 100%);
}

.solo-home-panel {
  background: rgba(7, 15, 7, 0.62);
  border: 1px solid rgba(159, 207, 159, 0.22);
  border-radius: 8px;
  color: #d8efd8;
  padding: 11px 12px;
}

.solo-home-title {
  color: #f1c40f;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 5px;
  text-align: center;
}

.solo-home-summary {
  color: #a9cfa9;
  font-size: 0.78rem;
  line-height: 1.55;
  text-align: center;
}

.solo-home-summary strong {
  color: #fff;
}

.solo-home-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.solo-home-stat {
  background: rgba(10, 40, 10, 0.7);
  border: 1px solid rgba(143, 210, 143, 0.16);
  border-radius: 8px;
  padding: 7px 5px;
}

.solo-home-stat b {
  display: block;
  color: #f1c40f;
  font-size: 0.86rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.solo-home-stat span {
  color: #8fb88f;
  font-size: 0.68rem;
}

.solo-roadmap-home {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.solo-roadmap-open-btn {
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  background: #2a1e00;
  border: 1px solid rgba(241,196,15,0.58);
  border-radius: 8px;
  color: #f7dc6f;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.solo-roadmap-open-btn:hover {
  background: #3a2c05;
  border-color: rgba(255,212,154,0.78);
  color: #fff3bf;
}

.solo-roadmap-open-btn.has-claim {
  background: #3a2506;
  border-color: #ffd49a;
  color: #fff;
  box-shadow: 0 0 14px rgba(241,196,15,0.24);
}

.solo-roadmap-home-status {
  min-height: 16px;
  color: #8fb88f;
  font-size: 0.68rem;
  line-height: 1.45;
  text-align: center;
}

.ranked-box {
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
}

.ranked-summary {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.ranked-stat {
  background: #0d2b0d;
  border: 1px solid #2e5a2e;
  border-radius: 8px;
  padding: 12px;
}

.ranked-stat-main {
  font-size: 1.5rem;
  font-weight: bold;
  color: #f1c40f;
}

.ranked-stat-label {
  color: #8fb88f;
  font-size: 0.78rem;
  margin-top: 3px;
}

.ranked-record {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.ranked-record span {
  background: rgba(10, 40, 10, 0.7);
  border: 1px solid rgba(143, 210, 143, 0.18);
  border-radius: 8px;
  color: #cfe8cf;
  font-size: 0.78rem;
  padding: 7px 5px;
  text-align: center;
}

.ranked-queue-status {
  min-height: 22px;
  color: #c8f0c8;
  font-size: 0.86rem;
  margin: 10px 0;
  text-align: center;
}

.ranked-actions {
  display: grid;
  gap: 8px;
}

.ranked-leaderboard-section {
  margin-top: 18px;
  text-align: left;
}

.ranked-leaderboard {
  display: grid;
  gap: 6px;
}

.ranked-leader-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #2e5a2e;
  color: #d8f0d8;
  font-size: 0.84rem;
  padding: 7px 0;
}

.ranked-leader-place {
  color: #f1c40f;
  font-weight: bold;
  text-align: right;
}

.ranked-leader-rating {
  color: #c8f0c8;
  font-weight: bold;
}

.ranked-result-panel {
  background: rgba(10, 40, 10, 0.6);
  border: 1px solid rgba(241, 196, 15, 0.5);
  border-radius: 8px;
  margin: 6px 0 18px;
  padding: 12px;
  text-align: left;
}

.ranked-result-title {
  color: #f1c40f;
  font-weight: bold;
  margin-bottom: 8px;
  text-align: center;
}

.ranked-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #e8f4e8;
  font-size: 0.86rem;
  padding: 5px 0;
}

.ranked-delta-pos { color: #58d68d; font-weight: bold; }
.ranked-delta-neg { color: #ec7063; font-weight: bold; }

.solo-result-panel {
  background: rgba(48, 27, 8, 0.68);
  border: 1px solid rgba(217, 141, 52, 0.72);
  border-radius: 8px;
  margin: 6px 0 18px;
  padding: 12px;
  text-align: center;
}

.solo-result-title {
  color: #ffd49a;
  font-weight: bold;
  margin-bottom: 10px;
}

.solo-result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.solo-result-stats div {
  background: rgba(10, 40, 10, 0.46);
  border: 1px solid rgba(255, 212, 154, 0.2);
  border-radius: 8px;
  padding: 8px 5px;
}

.solo-result-stats b {
  display: block;
  color: #fff;
  font-size: 0.96rem;
}

.solo-result-stats span {
  color: #d9b27b;
  font-size: 0.72rem;
}

.solo-title-up {
  color: #ffd49a;
  font-size: 0.82rem;
  line-height: 1.55;
  margin-top: 9px;
}

/* ゲーム作成スクリーン */
.create-box { max-height: 92vh; overflow-y: auto; }

.zen-all-on-note {
  background: #1a1000;
  border: 1px solid #c8a020;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.82rem;
  color: #f1c40f;
  line-height: 1.65;
  text-align: center;
}

/* ルールトグル */
#screen-create .form-box {
  max-width: 480px;
}

#rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.rule-btn {
  padding: 8px 6px;
  background: #0d2b0d;
  color: #5a7a5a;
  border: 1px solid #2a4a2a;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: bold;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.rule-btn:hover { background: #1a4a1a; border-color: #4a7a4a; color: #9fcf9f; }

.rule-btn.active {
  background: #1a4d1a;
  border-color: #4ab84a;
  color: #9fcf9f;
}

/* ルールボタン ツールチップ */
.rule-btn {
  position: relative;
  overflow: visible;
}

.rule-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #071407;
  color: #b8d8b8;
  border: 1px solid #2e8b2e;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: normal;
  line-height: 1.55;
  width: 200px;
  text-align: left;
  z-index: 2000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s, visibility 0.18s;
  white-space: normal;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

.rule-btn[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ボタン */
.btn-primary {
  padding: 13px;
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 1px;
  background: #2e8b2e;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: #3aaa3a; }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-secondary {
  padding: 13px;
  font-size: 1rem;
  font-weight: bold;
  background: #1a4d1a;
  color: #9fcf9f;
  border: 1px solid #4a8a4a;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover { background: #224d22; }

.tutorial-start-btn {
  border-color: rgba(241,196,15,0.68);
  color: #f7dc6f;
  background: #2a2508;
}

.tutorial-start-btn:hover {
  background: #3a320b;
}

.btn-ghost {
  padding: 10px;
  font-size: 0.9rem;
  background: transparent;
  color: #7da07d;
  border: 1px solid #3a6a3a;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.btn-ghost:hover { border-color: #6aaa6a; color: #9fcf9f; }

/* ロビー */
.lobby-box { max-width: 500px; }

.code-row {
  text-align: center;
  font-size: 1rem;
  color: #9fcf9f;
}

.code-value {
  font-family: monospace;
  font-size: 1.8rem;
  font-weight: bold;
  color: #f1c40f;
  letter-spacing: 6px;
  background: #0d2b0d;
  padding: 4px 14px;
  border-radius: 6px;
  border: 1px solid #4a8a4a;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.code-value:hover {
  background: #1a3a0d;
  border-color: #7dca7d;
}

.code-value:active { transform: scale(0.97); }

.code-value.copied {
  border-color: #4ab84a;
  color: #4ab84a;
}

#lobby-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0;
}

.lobby-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #0d2b0d;
  border-radius: 8px;
  border: 1px solid #2e5a2e;
  font-size: 0.95rem;
}

.lobby-slot.filled { border-color: #2e8b2e; }
.lobby-slot.reserved {
  border-color: #b58b2a;
  background: #2b240d;
}

.slot-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2e5a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  flex-shrink: 0;
}

.lobby-slot.filled .slot-num { background: #2e8b2e; }
.lobby-slot.reserved .slot-num {
  background: #b58b2a;
  color: #1b1406;
}

.slot-name { flex: 1; }
.slot-status { font-size: 0.8rem; color: #7da07d; }
.lobby-slot.filled .slot-status { color: #4ab84a; }
.lobby-slot.reserved .slot-status { color: #f1c66d; }

#lobby-actions { display: flex; flex-direction: column; gap: 8px; }

/* ═══════════════════════════════════════════
   ゲームボード
═══════════════════════════════════════════ */
#game-board {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #0d2b0d;
}

/* ── ヘッダー ── */
#header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: #1a4d1a;
  border-bottom: 2px solid #2e8b2e;
  flex-shrink: 0;
  z-index: 10;
}

#game-title {
  font-size: 1.2rem;
  font-weight: bold;
  flex: 1;
  letter-spacing: 2px;
}

#zen-mode-badge {
  background: #2a1e00;
  border: 1px solid #c8a020;
  color: #f1c40f;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: bold;
}

#revolution-badge {
  background: #c0392b;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: bold;
  animation: pulse 1s infinite;
}

#j-back-badge {
  background: #7d3c98;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: bold;
}

#suit-lock-badge {
  background: #1a5276;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: bold;
}

#six-strongest-badge {
  background: #2a1500;
  border: 1px solid #e67e22;
  color: #f39c12;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: bold;
  animation: pulse 1s infinite;
}

#effect-nullified-badge {
  background: #2a0a2a;
  border: 1px solid #9b59b6;
  color: #bb8fce;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: bold;
}

#ten-nullified-badge {
  background: #0a0a2a;
  border: 1px solid #3498db;
  color: #7fb3e8;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: bold;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.header-btn {
  padding: 5px 12px;
  background: #1a4d1a;
  border: 1px solid #4a8a4a;
  border-radius: 6px;
  color: #9fcf9f;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.12s;
}
.header-btn:hover { background: #2e5a2e; }

#new-game-btn {
  padding: 5px 12px;
  background: #2a2a2a;
  border: 1px solid #666;
  border-radius: 6px;
  color: #bbb;
  cursor: pointer;
  font-size: 0.82rem;
}
#new-game-btn:hover { background: #3a3a3a; }

/* ── コンテンツ（メイン ＋ ログ） ── */
#game-content {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}

/* ── テーブルラッパー（囲み型グリッド） ── */
#table-wrapper {
  flex: 1 0 420px;
  min-height: 420px;
  display: grid;
  grid-template-columns: 164px 1fr 164px;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "tl  top  tr"
    "lft tbl  rgt";
  gap: 6px;
}

/* opp-row はデスクトップで透明（display:contents により子が直接 Grid に参加） */
#opp-row { display: contents; }

/* ── 各席スロット ── */
.opp-slot {
  display: flex;
  align-items: flex-end;   /* 下寄せ＝テーブル寄り */
  justify-content: center;
}

#opp-top-left  { grid-area: tl;  justify-content: flex-start; }
#opp-top       { grid-area: top; }
#opp-top-right { grid-area: tr;  justify-content: flex-end; }
#opp-left      { grid-area: lft; align-items: center; justify-content: flex-end; }
#opp-right     { grid-area: rgt; align-items: center; justify-content: flex-start; }
#table-area    { grid-area: tbl; }

/* ── プレイヤーボックス ── */
.cpu-player {
  background: #1a4d1a;
  border: 1px solid #2e8b2e;
  border-radius: 10px;
  padding: 10px 12px;
  flex: none;
  width: 150px;
}

/* 左右スロットは列幅いっぱいに広げる */
#opp-left .cpu-player,
#opp-right .cpu-player {
  width: 158px;
}

.cpu-player.is-current {
  border-color: var(--accent-gold);
  box-shadow: 0 0 14px rgba(241,196,15,0.5), inset 0 0 8px rgba(241,196,15,0.08);
  position: relative;
}
.cpu-player.is-current::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  border-radius: var(--radius-panel) var(--radius-panel) 0 0;
  animation: active-bar-pulse 1.6s ease-in-out infinite;
}
@keyframes active-bar-pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}
.cpu-player.is-finished { opacity: 0.5; }
.cpu-player.is-substitute {
  border-color: #d8a344;
}
.cpu-player.is-left {
  border-style: dashed;
}

.cpu-name {
  font-size: 0.88rem;
  font-weight: bold;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-presence-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin: -1px 0 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(241, 196, 15, 0.16);
  border: 1px solid rgba(241, 196, 15, 0.45);
  color: #f4d35e;
  font-size: 0.68rem;
  font-weight: bold;
}
.cpu-player.is-left .player-presence-badge {
  background: rgba(192, 57, 43, 0.16);
  border-color: rgba(231, 76, 60, 0.45);
  color: #f1948a;
}

.cpu-rank-badge {
  display: inline-block;
  font-size: 0.72rem;
  background: #8b2222;
  padding: 1px 8px;
  border-radius: 10px;
  margin-bottom: 5px;
}

.cpu-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 4px;
  max-height: 72px;
  overflow: hidden;
}

.card-back {
  width: 22px;
  height: 32px;
  background: linear-gradient(135deg, #1a3a8c 30%, #2a50c0 70%);
  border: 1px solid #4a6fdf;
  border-radius: 3px;
}

.cpu-count {
  font-size: 0.72rem;
  color: #9fcf9f;
  margin-top: 3px;
}

/* ── 場 ── */
#table-area {
  background: var(--table-felt);
  border: 2px dashed #3a9a3a;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  min-height: 250px;
  display: grid;
  grid-template-rows: auto auto minmax(84px, 1fr) auto auto;
  align-items: center;
  justify-items: center;
  align-content: center;
  gap: 8px;
  overflow: hidden;
  transition: border-color 0.24s, box-shadow 0.24s, background 0.24s;
}

#table-label {
  font-size: 0.8rem;
  color: #7dca7d;
  font-weight: bold;
  letter-spacing: 2px;
}

#table-state-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 24px;
}

.table-state-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.28);
  color: #d8f0d8;
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 0;
  white-space: nowrap;
}

.table-state-chip.revolution {
  border-color: rgba(231,76,60,0.7);
  color: #ffb0a7;
  background: rgba(130,20,18,0.46);
}

.table-state-chip.six {
  border-color: rgba(245,176,65,0.72);
  color: #ffd889;
  background: rgba(90,44,0,0.46);
}

.table-state-chip.reverse {
  border-color: rgba(178,109,224,0.72);
  color: #d7b2ef;
  background: rgba(74,30,110,0.46);
}

.table-state-chip.lock {
  border-color: rgba(93,173,226,0.72);
  color: #b9ddf5;
  background: rgba(20,72,112,0.46);
}

.table-state-chip.nullify {
  border-color: rgba(155,89,182,0.72);
  color: #d7b2ef;
  background: rgba(55,20,70,0.46);
}

#table-cards {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  min-height: 84px;
  max-width: 100%;
  box-sizing: border-box;
}

#table-hint {
  font-size: 0.78rem;
  color: #9fcf9f;
  min-height: 18px;
  line-height: 1.35;
}

/* ── 全役職モード: 捨て札/除外パイル ── */
#zen-piles {
  display: flex;
  gap: 10px;
  margin-top: 0;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.zen-pile {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  min-width: 92px;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: default;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.zen-pile.pile-active {
  border-color: #f1c40f;
  box-shadow: 0 0 10px rgba(241,196,15,0.5);
  cursor: pointer;
}

.zen-pile-stack {
  position: relative;
  width: 30px;
  height: 42px;
  flex: none;
}

.zen-pile-card {
  width: 30px !important;
  height: 42px !important;
  border-radius: 4px !important;
  position: absolute;
  top: 0;
  left: 0;
}

.zen-pile-card-removed {
  background: linear-gradient(135deg, #4a1a4a 0%, #2a0a2a 100%) !important;
  border-color: #8e44ad !important;
}

.zen-pile-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.zen-pile-label {
  font-size: 0.62rem;
  color: #8fa88f;
}

.zen-pile-count {
  font-size: 0.8rem;
  font-weight: bold;
  color: #d5e8d5;
}

#game-board.state-revolution #table-area {
  border-color: #e74c3c;
  background:
    radial-gradient(circle at 50% 38%, rgba(231,76,60,0.18), transparent 55%),
    var(--table-felt);
  box-shadow: inset 0 0 28px rgba(231,76,60,0.22), 0 0 20px rgba(231,76,60,0.18);
}

#game-board.state-j-back #table-area {
  border-color: #9b59b6;
  box-shadow: inset 0 0 24px rgba(155,89,182,0.18);
}

#game-board.state-suit-lock #table-area {
  border-color: #5dade2;
  box-shadow: inset 0 0 24px rgba(93,173,226,0.18);
}

#game-board.state-six-strongest #table-area {
  border-color: #f5b041;
  background:
    radial-gradient(circle at 50% 38%, rgba(245,176,65,0.16), transparent 55%),
    var(--table-felt);
}

#game-board.state-effect-nullified #table-area,
#game-board.state-ten-nullified #table-area {
  border-style: solid;
}

#game-board.board-flash-revolution::after,
#game-board.board-flash-one-chance::after,
#game-board.board-flash-one-chance-success::after,
#game-board.board-flash-one-chance-fail::after,
#game-board.board-flash-lock::after,
#game-board.board-flash-reverse::after,
#game-board.board-flash-cut::after,
#game-board.board-flash-nullify::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 320;
  opacity: 0;
}

#game-board.board-flash-revolution::after {
  background:
    radial-gradient(circle at 50% 44%, rgba(255,240,210,0.30), transparent 22%),
    linear-gradient(135deg, rgba(231,76,60,0.34), rgba(70,0,0,0.08) 52%, rgba(231,76,60,0.28));
  animation: revolution-screen-flash 0.86s ease-out;
}

#game-board.board-flash-one-chance::after {
  background:
    radial-gradient(circle at 50% 44%, rgba(255,245,210,0.26), transparent 20%),
    linear-gradient(135deg, rgba(192,57,43,0.36), rgba(15,10,24,0.08) 52%, rgba(247,220,111,0.24));
  animation: one-chance-screen-flash 0.72s ease-out;
}

#game-board.board-flash-one-chance-success::after {
  background:
    radial-gradient(circle at 50% 44%, rgba(255,252,220,0.38), transparent 24%),
    linear-gradient(135deg, rgba(247,220,111,0.32), rgba(231,76,60,0.14) 58%, rgba(255,255,255,0.20));
  animation: one-chance-success-flash 0.82s ease-out;
}

#game-board.board-flash-one-chance-fail::after {
  background:
    radial-gradient(circle at 50% 42%, rgba(149,165,166,0.30), transparent 30%),
    linear-gradient(180deg, rgba(44,62,80,0.26), rgba(0,0,0,0.04) 54%, rgba(127,140,141,0.18));
  animation: table-soft-flash 0.68s ease-out;
}

#game-board.board-flash-lock::after {
  background: radial-gradient(circle at 50% 42%, rgba(93,173,226,0.30), transparent 34%);
  animation: table-soft-flash 0.72s ease-out;
}

#game-board.board-flash-reverse::after {
  background: linear-gradient(180deg, rgba(155,89,182,0.28), rgba(0,0,0,0) 52%, rgba(155,89,182,0.20));
  animation: table-soft-flash 0.72s ease-out;
}

#game-board.board-flash-cut::after {
  background: radial-gradient(circle at 50% 42%, rgba(243,156,18,0.30), transparent 34%);
  animation: table-soft-flash 0.64s ease-out;
}

#game-board.board-flash-nullify::after {
  background: radial-gradient(circle at 50% 42%, rgba(155,89,182,0.30), transparent 34%);
  animation: nullify-screen-flash 0.68s ease-out;
}

#game-board.board-flash-revolution #table-cards .table-card,
#game-board.board-flash-one-chance-success #table-cards .table-card {
  animation: table-card-revolt 0.72s ease-out;
}

@keyframes one-chance-screen-flash {
  0%   { opacity: 0; transform: scale(1); }
  16%  { opacity: 1; transform: scale(1.01); }
  48%  { opacity: 0.64; }
  100% { opacity: 0; transform: scale(1.018); }
}

@keyframes one-chance-success-flash {
  0%   { opacity: 0; transform: scale(1); }
  12%  { opacity: 1; transform: scale(1.012); }
  46%  { opacity: 0.76; }
  100% { opacity: 0; transform: scale(1.024); }
}

@keyframes revolution-screen-flash {
  0%   { opacity: 0; transform: scale(1); }
  14%  { opacity: 1; transform: scale(1.01); }
  42%  { opacity: 0.72; }
  100% { opacity: 0; transform: scale(1.02); }
}

@keyframes table-soft-flash {
  0%   { opacity: 0; }
  18%  { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes nullify-screen-flash {
  0%   { opacity: 0; filter: saturate(1); }
  20%  { opacity: 1; filter: saturate(0.4); }
  100% { opacity: 0; filter: saturate(0.8); }
}

@keyframes table-card-revolt {
  0%   { transform: translateY(0) rotateY(0deg); }
  42%  { transform: translateY(-10px) rotateY(180deg); }
  100% { transform: translateY(0) rotateY(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  #game-board.board-flash-revolution::after,
  #game-board.board-flash-one-chance::after,
  #game-board.board-flash-one-chance-success::after,
  #game-board.board-flash-one-chance-fail::after,
  #game-board.board-flash-lock::after,
  #game-board.board-flash-reverse::after,
  #game-board.board-flash-cut::after,
  #game-board.board-flash-nullify::after,
  #game-board.board-flash-revolution #table-cards .table-card,
  #game-board.board-flash-one-chance-success #table-cards .table-card {
    animation: none;
  }
}

/* ── カード共通 ── */
.card {
  width: 52px;
  height: 76px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  flex-shrink: 0;
}

.card.red { color: #c0392b; }
.card.black { color: #1a1a1a; }

.card.selected {
  transform: translateY(-14px);
  box-shadow: 0 8px 20px rgba(241,196,15,0.65);
  border-color: #f1c40f;
  border-width: 2px;
}

.card.table-card {
  cursor: default;
  width: 58px;
  height: 84px;
}

.card-rank { font-size: 0.95rem; line-height: 1; }
.card-suit { font-size: 1.05rem; line-height: 1; }

/* ── ターン状態バー ── */
#turn-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 14px;
  background: rgba(26, 77, 26, 0.6);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-panel);
  font-size: 0.82rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}
#tsb-player     { font-weight: bold; color: var(--accent-gold); }
#tsb-card-count { color: var(--text-muted); }
#tsb-constraints { color: #7fb3e8; font-size: 0.78rem; }

/* ── ミニログ ── */
#mini-log {
  padding: 2px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.mini-log-item {
  font-size: 0.75rem;
  color: #9fb89f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-log-item:first-child { color: #d8f0d8; }

/* ── 手札 inactive（自分のターン以外はグレーアウト） ── */
#player-hand.hand-inactive .card {
  opacity: 0.6;
  filter: saturate(0.45) brightness(0.82);
  cursor: default;
  pointer-events: none;
  transition: opacity 0.3s, filter 0.3s;
}

/* ── ログトグルボタン（デスクトップでは非表示） ── */
#log-toggle-btn { display: none; }

/* ── プレイヤーエリア ── */
#player-area {
  background: #1a4d1a;
  border: 2px solid #2e8b2e;
  border-radius: 12px;
  padding: 12px 14px;
}

#player-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

#my-name { font-weight: bold; font-size: 0.95rem; }

#my-turn-badge {
  background: #f1c40f;
  color: #1a1a1a;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: bold;
}

#player-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  min-height: 78px;
  align-items: flex-end;
}

#discard-area {
  background: #1a0d00;
  border: 2px solid #e67e22;
  border-radius: 10px;
  padding: 9px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.discard-hint {
  font-size: 0.82rem;
  color: #e67e22;
  flex: 1;
  min-width: 180px;
}

#discard-btn {
  padding: 7px 18px;
  background: #e67e22;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.12s;
}
#discard-btn:hover:not(:disabled) { background: #f39c12; }
#discard-btn:disabled { opacity: 0.35; cursor: not-allowed; }

#discard-skip-btn {
  padding: 7px 14px;
  background: transparent;
  color: #9fcf9f;
  border: 1px solid #4a8a4a;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
}
#discard-skip-btn:hover { background: #1a4d1a; }

/* ── 全役職: カード取得エリア（4/K効果）── */
#pickup-area {
  background: #1a0a2a;
  border: 2px solid #9b59b6;
  border-radius: 10px;
  padding: 9px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pickup-hint {
  font-size: 0.82rem;
  color: #bb8fce;
  flex: 1;
  min-width: 180px;
}

#pickup-pile {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 134px;
  overflow-y: auto;
  padding-top: 14px;
  margin-top: -6px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

#pickup-pile .card {
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}

#pickup-pile .card.selected {
  transform: translateY(-12px);
  box-shadow: 0 8px 20px rgba(155,89,182,0.65);
  border-color: #9b59b6;
  border-width: 2px;
}

#pickup-confirm-btn {
  padding: 7px 18px;
  background: #9b59b6;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.12s;
}
#pickup-confirm-btn:hover:not(:disabled) { background: #af7ac5; }
#pickup-confirm-btn:disabled { opacity: 0.35; cursor: not-allowed; }

#pickup-action {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── 全役職: カードを渡すエリア（7効果）── */
#give-area {
  background: #001a14;
  border: 2px solid #1abc9c;
  border-radius: 10px;
  padding: 9px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.give-hint {
  font-size: 0.82rem;
  color: #1abc9c;
  flex: 1;
  min-width: 180px;
}

#give-btn {
  padding: 7px 18px;
  background: #1abc9c;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.12s;
}
#give-btn:hover:not(:disabled) { background: #16a085; }
#give-btn:disabled { opacity: 0.35; cursor: not-allowed; }

#action-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#play-btn, #pass-btn {
  padding: 9px 26px;
  font-size: 0.95rem;
  font-weight: bold;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.12s, opacity 0.12s;
}

#play-btn { background: #2e8b2e; color: #fff; }
#play-btn:hover:not(:disabled) { background: #3aaa3a; }

#pass-btn { background: #3a3a3a; color: #ccc; border: 1px solid #666; }
#pass-btn:hover:not(:disabled) { background: #4a4a4a; }

#play-btn:disabled, #pass-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── 全役職: ワンチャンスボタン ── */
#one-chance-btn, #one-chance-skip-btn {
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

#one-chance-btn {
  border: 2px solid #e74c3c;
  background: #3a0808;
  color: #f0a0a0;
}
#one-chance-btn:hover { background: #5a1010; color: #fff; border-color: #c0392b; }

#one-chance-skip-btn {
  border: 1px solid #666;
  background: #2a2a2a;
  color: #ccc;
}
#one-chance-skip-btn:hover { background: #3a3a3a; color: #fff; }

#selected-info { font-size: 0.82rem; color: #9fcf9f; }

#selected-effect-preview {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(241,196,15,0.55);
  background: rgba(241,196,15,0.12);
  color: #f7dc6f;
  font-size: 0.78rem;
  font-weight: bold;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════
   サイドログ
═══════════════════════════════════════════ */
#log-area {
  width: 240px;
  flex-shrink: 0;
  background: #070f07;
  border-left: 2px solid #1a4d1a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#log-title {
  font-size: 0.78rem;
  font-weight: bold;
  color: #7dca7d;
  letter-spacing: 1px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid #1a4d1a;
  flex-shrink: 0;
}

#log-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
}

#log-scroll::-webkit-scrollbar { width: 4px; }
#log-scroll::-webkit-scrollbar-thumb { background: #2e5a2e; border-radius: 2px; }

.log-item {
  font-size: 0.8rem;
  color: #9fb89f;
  padding: 4px 0;
  border-bottom: 1px solid #0f200f;
  line-height: 1.4;
  word-break: break-all;
}

.log-item:first-child { color: #e0f0e0; }

/* ═══════════════════════════════════════════
   ゲーム終了モーダル
═══════════════════════════════════════════ */
#end-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 16px;
  overflow-y: auto;
  z-index: 200;
}

#end-modal {
  background: #1a4d1a;
  border: 2px solid #2e8b2e;
  border-radius: 16px;
  padding: 40px 52px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.8);
  min-width: 320px;
  max-width: min(560px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

#end-modal h2 { font-size: 1.7rem; margin-bottom: 22px; }

#end-results { margin-bottom: 18px; }

.result-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid #2e5a2e;
}

.result-rank { font-weight: bold; min-width: 80px; text-align: right; }
.result-name { flex: 1; text-align: left; font-size: 0.95rem; }

.rematch-ready-list {
  background: rgba(0, 20, 0, 0.24);
  border: 1px solid rgba(143, 210, 143, 0.26);
  border-radius: 12px;
  margin: 0 0 18px;
  padding: 10px 12px;
}

.rematch-ready-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  color: #e5f4e5;
  font-size: 0.88rem;
}

.rematch-ready-row + .rematch-ready-row {
  border-top: 1px solid rgba(143, 210, 143, 0.16);
}

.rematch-ready-name {
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rematch-ready-status {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.76rem;
  border: 1px solid rgba(184, 216, 184, 0.3);
  color: #b8d8b8;
}

.rematch-ready-status.is-ready {
  color: #062706;
  background: #8fe08f;
  border-color: #8fe08f;
  font-weight: bold;
}

.rematch-ready-status.is-waiting {
  color: #f4d78b;
  border-color: rgba(244, 215, 139, 0.45);
}

.end-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.end-note {
  min-height: 1.2em;
  margin: -2px 0 2px;
  color: #b8d8b8;
  font-size: 0.82rem;
  line-height: 1.45;
}

#end-modal .btn-primary {
  padding: 12px 32px;
  background: #2e8b2e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: bold;
}
#end-modal .btn-primary:hover { background: #3aaa3a; }

#end-modal .btn-secondary {
  padding: 11px 32px;
  background: #f1c40f;
  color: #173417;
  border: none;
  border-radius: 8px;
  font-size: 0.96rem;
  cursor: pointer;
  font-weight: bold;
}
#end-modal .btn-secondary:hover { background: #f4d03f; }

#end-modal .btn-ghost {
  padding: 10px 32px;
  background: transparent;
  color: #9fcf9f;
  border: 1px solid #4a8a4a;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}
#end-modal .btn-ghost:hover { background: #1a4d1a; color: #c8f0c8; }

#end-modal button:disabled,
#end-modal button:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

/* ═══════════════════════════════════════════
   退出確認モーダル
═══════════════════════════════════════════ */
#confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
}

#confirm-modal {
  background: #1a3a1a;
  border: 2px solid #c0392b;
  border-radius: 14px;
  padding: 32px 40px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.8);
  max-width: 380px;
  width: 90%;
}

.confirm-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 14px;
  color: #f5a5a0;
}

.confirm-body {
  font-size: 0.88rem;
  color: #c8d8c8;
  line-height: 1.7;
  margin-bottom: 24px;
}

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

.btn-danger {
  padding: 11px 28px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
}
.btn-danger:hover { background: #e74c3c; }

/* ═══════════════════════════════════════════
   ルール確認モーダル
═══════════════════════════════════════════ */
#rules-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 180;
}

#rules-modal {
  background: #1a4d1a;
  border: 2px solid #2e8b2e;
  border-radius: 14px;
  padding: 28px 32px;
  min-width: 300px;
  max-width: 460px;
  width: 90%;
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.8);
}

#rules-modal::-webkit-scrollbar { width: 4px; }
#rules-modal::-webkit-scrollbar-thumb { background: #2e5a2e; border-radius: 2px; }

#rules-modal h3 {
  font-size: 1.15rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 18px;
  letter-spacing: 1px;
}

#rules-list { display: flex; flex-direction: column; gap: 0; }

.rules-item {
  padding: 10px 0;
  border-bottom: 1px solid #2e5a2e;
}

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

.rules-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.rules-item-name {
  font-weight: bold;
  font-size: 0.92rem;
  color: #c8f0c8;
}

.rules-item-status {
  font-size: 0.72rem;
  font-weight: bold;
  padding: 1px 7px;
  border-radius: 10px;
}

.status-on  { background: #1e5c1e; color: #4ab84a; }
.status-off { background: #1a1a1a; color: #555; }

.rules-item-desc {
  font-size: 0.8rem;
  color: #9fb89f;
  line-height: 1.55;
}

.rules-item-off .rules-item-name { color: #5a7a5a; }
.rules-item-off .rules-item-desc { color: #4a5a4a; }

/* ═══════════════════════════════════════════
   ソロロードマップ
═══════════════════════════════════════════ */
#solo-roadmap-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 185;
}

#solo-roadmap-modal {
  background: #140f05;
  border: 2px solid #c8a020;
  border-radius: 14px;
  padding: 22px 24px;
  width: min(620px, calc(100% - 28px));
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 8px 42px rgba(0,0,0,0.86);
}

#solo-roadmap-modal::-webkit-scrollbar { width: 4px; }
#solo-roadmap-modal::-webkit-scrollbar-thumb { background: #5a4000; border-radius: 2px; }

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

.solo-roadmap-modal-head h3 {
  color: #f1c40f;
  font-size: 1.18rem;
  letter-spacing: 1px;
}

.solo-roadmap-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,212,154,0.24);
  border-radius: 8px;
  color: #ffd49a;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.solo-roadmap-close:hover {
  background: rgba(255,212,154,0.12);
  color: #fff;
}

.solo-roadmap-content {
  display: grid;
  gap: 12px;
}

.solo-roadmap-feedback {
  background: rgba(46,139,46,0.2);
  border: 1px solid rgba(88,214,141,0.34);
  border-radius: 8px;
  color: #c8f0c8;
  font-size: 0.82rem;
  line-height: 1.55;
  padding: 9px 10px;
}

.solo-roadmap-summary-card,
.solo-roadmap-next-card,
.solo-roadmap-milestone {
  background: rgba(10,40,10,0.62);
  border: 1px solid rgba(255,212,154,0.18);
  border-radius: 8px;
}

.solo-roadmap-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.solo-roadmap-title-label {
  color: #ffd49a;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.solo-roadmap-current-title {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.solo-roadmap-score-block {
  text-align: right;
}

.solo-roadmap-score-block b {
  display: block;
  color: #f1c40f;
  font-size: 1.08rem;
  line-height: 1.2;
}

.solo-roadmap-score-block span {
  color: #9fcf9f;
  font-size: 0.7rem;
}

.solo-roadmap-next-card {
  padding: 12px;
}

.solo-roadmap-section-title {
  color: #ffd49a;
  font-size: 0.82rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.solo-roadmap-next-title {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.solo-roadmap-ascent {
  position: relative;
  min-height: max(var(--ascent-height, 1140px), 1140px);
  margin-top: 10px;
  padding: 24px 10px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(181,109,255,0.12), transparent 32%),
    linear-gradient(0deg, rgba(88,214,141,0.12), transparent 34%),
    rgba(4,14,6,0.44);
  border: 1px solid rgba(255,212,154,0.18);
  border-radius: 8px;
}

.solo-ascent-rail {
  position: absolute;
  left: 38px;
  top: 32px;
  bottom: 32px;
  width: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.09);
  box-shadow: inset 0 0 14px rgba(0,0,0,0.55);
}

.solo-ascent-fill {
  position: absolute;
  left: 38px;
  bottom: var(--ascent-fill-start, 32px);
  width: 10px;
  height: var(--ascent-fill-height, 0%);
  border-radius: 999px;
  background: linear-gradient(0deg, #58d68d, #f1c40f 68%, #b56dff);
  box-shadow: 0 0 14px rgba(241,196,15,0.5);
}

.solo-ascent-current {
  position: absolute;
  left: 19px;
  bottom: var(--current-y, 32px);
  width: 48px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f1c40f;
  color: #1a1000;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  box-shadow: 0 0 16px rgba(241,196,15,0.68);
  transform: translateY(50%);
  z-index: 3;
}

.solo-ascent-node {
  position: absolute;
  left: 70px;
  right: 12px;
  bottom: var(--node-y, 0px);
  transform: translateY(50%);
  z-index: 2;
}

.solo-ascent-node-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  background: rgba(10,40,10,0.78);
  border: 1px solid rgba(255,212,154,0.22);
  border-radius: 8px;
  padding: 9px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.28);
}

.solo-ascent-node.is-unlocked .solo-ascent-node-card {
  border-color: rgba(88,214,141,0.45);
}

.solo-ascent-node.is-claimable .solo-ascent-node-card {
  border-color: rgba(255,212,154,0.78);
  box-shadow: 0 0 18px rgba(241,196,15,0.2), 0 4px 18px rgba(0,0,0,0.28);
}

.solo-ascent-node.is-current .solo-ascent-node-card {
  background: rgba(48,27,8,0.88);
}

.solo-ascent-logo {
  width: 92px;
  aspect-ratio: 20 / 11;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255,212,154,0.35));
}

.solo-ascent-node-main {
  min-width: 0;
}

.solo-ascent-node-actions {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.solo-ascent-node-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.solo-ascent-node-title {
  color: #fff;
  font-size: 0.84rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.solo-ascent-node-requirement {
  flex: 0 0 auto;
  color: #ffd49a;
  font-size: 0.64rem;
  font-weight: 900;
}

.solo-ascent-extra-hard {
  margin-top: 3px;
  color: #cfe8cf;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.solo-ascent-claim-btn {
  width: 100%;
  padding: 7px 9px;
  background: #d98d34;
  border: none;
  border-radius: 8px;
  color: #1a1000;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
}

.solo-ascent-claim-btn:hover:not(:disabled) {
  background: #ffd49a;
}

.solo-ascent-claim-btn:disabled {
  cursor: wait;
  opacity: 0.55;
}

.solo-ascent-replay-btn {
  width: 100%;
  padding: 7px 9px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,212,154,0.32);
  border-radius: 8px;
  color: #ffd49a;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
}

.solo-ascent-replay-btn:hover {
  background: rgba(255,212,154,0.12);
  border-color: rgba(255,212,154,0.58);
  color: #fff7d0;
}

.solo-progress-lines {
  display: grid;
  gap: 7px;
}

.solo-progress-line {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 78px;
  gap: 8px;
  align-items: center;
  color: #cfe8cf;
  font-size: 0.74rem;
}

.solo-progress-track {
  height: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
}

.solo-progress-fill {
  height: 100%;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, #58d68d, #f1c40f);
  border-radius: inherit;
}

.solo-roadmap-milestones {
  display: grid;
  gap: 9px;
}

.solo-roadmap-milestone {
  padding: 12px;
}

.solo-roadmap-milestone.is-claimable {
  border-color: rgba(255,212,154,0.62);
  box-shadow: 0 0 16px rgba(241,196,15,0.16);
}

.solo-roadmap-milestone.is-claimed {
  border-color: rgba(88,214,141,0.28);
}

.solo-roadmap-milestone-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 9px;
}

.solo-roadmap-milestone-title {
  color: #fff;
  font-size: 0.92rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.solo-roadmap-milestone-desc {
  color: #9fcf9f;
  font-size: 0.72rem;
  line-height: 1.5;
  margin-top: 2px;
}

.solo-roadmap-status {
  min-width: 70px;
  border-radius: 999px;
  padding: 3px 8px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 900;
}

.solo-roadmap-status.is-locked {
  background: rgba(149,165,166,0.14);
  color: #9aa7a7;
}

.solo-roadmap-status.is-claimable {
  background: rgba(241,196,15,0.2);
  color: #ffd49a;
}

.solo-roadmap-status.is-claimed {
  background: rgba(88,214,141,0.16);
  color: #9ff0bd;
}

.solo-roadmap-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.solo-roadmap-reward {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,212,154,0.16);
  border-radius: 999px;
  color: #e8f4e8;
  font-size: 0.7rem;
  line-height: 1.3;
  padding: 4px 8px;
}

.solo-roadmap-reward small {
  color: #d9b27b;
  font-size: 0.64rem;
  font-weight: 800;
}

.solo-roadmap-claim-btn {
  width: 100%;
  margin-top: 10px;
  padding: 9px 10px;
  background: #d98d34;
  border: none;
  border-radius: 8px;
  color: #1a1000;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
}

.solo-roadmap-claim-btn:hover:not(:disabled) {
  background: #ffd49a;
}

.solo-roadmap-claim-btn:disabled {
  cursor: wait;
  opacity: 0.55;
}

.solo-roadmap-bottom-close {
  width: 100%;
  margin-top: 14px;
}

/* ═══════════════════════════════════════════
   ソロ称号到達演出
═══════════════════════════════════════════ */
.solo-title-ceremony-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 230;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 46%, rgba(247,220,111,0.16), transparent 28%),
    rgba(0,0,0,0.84);
}

.solo-title-ceremony-modal {
  --title-accent: #f1c40f;
  position: relative;
  width: min(520px, 100%);
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--title-accent) 72%, #ffffff 18%);
  border-radius: 12px;
  padding: 26px 24px 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), transparent 22%),
    radial-gradient(circle at 50% 10%, color-mix(in srgb, var(--title-accent) 28%, transparent), transparent 42%),
    #100b04;
  box-shadow:
    0 0 34px color-mix(in srgb, var(--title-accent) 46%, transparent),
    0 18px 54px rgba(0,0,0,0.78);
  color: #fff;
  text-align: center;
  isolation: isolate;
}

.solo-title-ceremony-modal::before,
.solo-title-ceremony-modal::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid color-mix(in srgb, var(--title-accent) 38%, transparent);
  border-radius: 8px;
  pointer-events: none;
  z-index: -1;
}

.solo-title-ceremony-modal::after {
  inset: auto 32px 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--title-accent), transparent);
  border: 0;
  box-shadow: 0 -260px 0 rgba(255,255,255,0.04);
}

.solo-title-ceremony-aura,
.solo-title-ceremony-rays {
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.solo-title-ceremony-aura {
  inset: 54px 76px auto;
  height: 230px;
  border-radius: 50%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--title-accent) 34%, transparent), transparent 64%),
    conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--title-accent) 32%, transparent), transparent 26%, transparent 52%, color-mix(in srgb, #ffffff 20%, transparent), transparent);
  filter: blur(0.5px);
  opacity: 0.86;
  animation: solo-title-aura-spin 8s linear infinite;
}

.solo-title-ceremony-rays {
  inset: -40px 0 auto;
  height: 260px;
  background:
    linear-gradient(100deg, transparent 24%, color-mix(in srgb, var(--title-accent) 18%, transparent) 25%, transparent 30%),
    linear-gradient(80deg, transparent 58%, color-mix(in srgb, #ffffff 14%, transparent) 60%, transparent 64%);
  opacity: 0.72;
  animation: solo-title-rays 2.8s ease-in-out infinite alternate;
}

.solo-title-ceremony-kicker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  margin-bottom: 13px;
  padding: 3px 12px;
  border: 1px solid color-mix(in srgb, var(--title-accent) 42%, transparent);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: #fff7d0;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
}

.solo-title-ceremony-logo-frame {
  position: relative;
  width: min(310px, 78vw);
  aspect-ratio: 20 / 11;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
}

.solo-title-ceremony-logo-frame::before {
  content: "";
  position: absolute;
  inset: 10% 4%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--title-accent) 26%, transparent);
  filter: blur(24px);
}

.solo-title-ceremony-logo {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 0 14px color-mix(in srgb, var(--title-accent) 64%, transparent))
    drop-shadow(0 8px 12px rgba(0,0,0,0.46));
  animation: solo-title-logo-rise 640ms cubic-bezier(.2,.9,.26,1.15) both;
}

.solo-title-ceremony-name {
  color: #fff;
  font-size: clamp(1.52rem, 4.8vw, 2.4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 8px;
  text-shadow: 0 0 18px color-mix(in srgb, var(--title-accent) 44%, transparent);
}

.solo-title-ceremony-message {
  color: #e8f4e8;
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0 auto 14px;
}

.solo-title-ceremony-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.solo-title-ceremony-meta span {
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid rgba(255,212,154,0.18);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
}

.solo-title-ceremony-meta b,
.solo-title-ceremony-meta small {
  display: block;
  overflow-wrap: anywhere;
}

.solo-title-ceremony-meta b {
  color: #fff7d0;
  font-size: 0.86rem;
  line-height: 1.25;
}

.solo-title-ceremony-meta small {
  color: #9fcf9f;
  font-size: 0.64rem;
  margin-top: 2px;
}

.solo-title-ceremony-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 9px;
}

.solo-title-ceremony-actions.is-single {
  grid-template-columns: 1fr;
}

@keyframes solo-title-logo-rise {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.88);
  }
  72% {
    opacity: 1;
    transform: translateY(-3px) scale(1.04);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes solo-title-aura-spin {
  to { transform: rotate(360deg); }
}

@keyframes solo-title-rays {
  from { transform: translateX(-18px); opacity: 0.42; }
  to { transform: translateX(18px); opacity: 0.78; }
}

/* ═══════════════════════════════════════════
   カード効果モーダル（全役職大富豪モード）
═══════════════════════════════════════════ */
#card-rules-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 180;
}

#card-rules-modal {
  background: #1a1000;
  border: 2px solid #c8a020;
  border-radius: 14px;
  padding: 28px 32px;
  min-width: 300px;
  max-width: 460px;
  width: 90%;
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.85);
}

#card-rules-modal::-webkit-scrollbar { width: 4px; }
#card-rules-modal::-webkit-scrollbar-thumb { background: #5a4000; border-radius: 2px; }

#card-rules-modal h3 {
  font-size: 1.15rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 18px;
  letter-spacing: 1px;
  color: #f1c40f;
}

#card-rules-list { display: flex; flex-direction: column; gap: 0; }

.card-rule-item {
  padding: 10px 0;
  border-bottom: 1px solid #2a1e00;
}

.card-rule-item:last-child { border-bottom: none; }

.card-rule-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.card-rule-rank {
  font-weight: bold;
  font-size: 0.9rem;
  color: #f1c40f;
  min-width: 38px;
}

.card-rule-name {
  font-weight: bold;
  font-size: 0.9rem;
  color: #c8f0c8;
  flex: 1;
}

.card-rule-pending {
  font-size: 0.7rem;
  color: #7da07d;
  background: #0d2b0d;
  padding: 1px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

.card-rule-desc {
  font-size: 0.8rem;
  color: #9fb89f;
  line-height: 1.55;
}

/* ═══════════════════════════════════════════
   初回プレイ向けチュートリアル
═══════════════════════════════════════════ */
.tutorial-coach {
  position: fixed;
  right: 18px;
  bottom: 18px;
  transform: none;
  z-index: 170;
  width: min(460px, calc(100vw - 28px));
  padding: 16px;
  background: rgba(8, 27, 8, 0.96);
  border: 1px solid rgba(241,196,15,0.55);
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.62), 0 0 22px rgba(241,196,15,0.12);
  color: var(--text-primary);
}

.tutorial-coach-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--accent-gold);
  font-size: 0.78rem;
  font-weight: bold;
  letter-spacing: 1px;
}

.tutorial-close-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid rgba(241,196,15,0.35);
  border-radius: 8px;
  color: #d8efd8;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.tutorial-close-btn:hover {
  background: rgba(241,196,15,0.12);
}

.tutorial-coach h3 {
  margin: 0 0 8px;
  color: #f7dc6f;
  font-size: 1.02rem;
  line-height: 1.35;
}

.tutorial-coach p {
  margin: 0;
  color: #c8e6c8;
  font-size: 0.86rem;
  line-height: 1.65;
}

.tutorial-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.tutorial-progress-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid rgba(159,207,159,0.24);
  border-radius: 999px;
  color: #7da07d;
  background: rgba(0,0,0,0.22);
  font-size: 0.68rem;
  font-weight: bold;
}

.tutorial-progress-pill.done {
  border-color: rgba(241,196,15,0.58);
  color: #f7dc6f;
  background: rgba(241,196,15,0.13);
}

.tutorial-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.tutorial-actions .btn-primary,
.tutorial-actions .btn-ghost {
  padding: 8px 14px;
  font-size: 0.82rem;
}

.tutorial-highlight {
  position: relative;
  z-index: 160;
  outline: 2px solid var(--accent-gold);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px rgba(241,196,15,0.14), 0 0 18px rgba(241,196,15,0.45) !important;
}

/* ═══════════════════════════════════════════
   エフェクトバナー（8切り・革命など）
═══════════════════════════════════════════ */
#effect-banner {
  --effect-banner-x: 50vw;
  --effect-banner-y: 50vh;
  position: fixed;
  left: var(--effect-banner-x);
  top: var(--effect-banner-y);
  translate: -50% -50%;
  display: block;
  width: max-content;
  max-width: calc(100vw - 24px);
  pointer-events: none;
  z-index: 350;
}

#effect-text {
  display: inline-block;
  box-sizing: border-box;
  max-width: calc(100vw - 24px);
  font-size: 3.2rem;
  font-weight: bold;
  letter-spacing: 6px;
  line-height: 1.16;
  padding: 14px 36px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.65);
  text-align: center;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
  overflow-wrap: anywhere;
  animation: banner-pop 1.2s ease-out forwards;
}

#effect-text.effect-banner-revolution {
  background: rgba(70, 0, 0, 0.78);
  box-shadow: 0 0 42px rgba(231,76,60,0.62), 0 4px 32px rgba(0,0,0,0.5);
  animation: revolution-banner-pop 1.2s ease-out forwards;
}

#effect-text.effect-banner-one-chance {
  background: rgba(72, 13, 18, 0.82);
  box-shadow: 0 0 42px rgba(231,76,60,0.56), 0 0 24px rgba(247,220,111,0.20), 0 4px 32px rgba(0,0,0,0.5);
  animation: one-chance-banner-pop 1.2s ease-out forwards;
}

#effect-text.effect-banner-one-chance-success {
  background: rgba(78, 55, 5, 0.82);
  box-shadow: 0 0 42px rgba(247,220,111,0.58), 0 0 24px rgba(231,76,60,0.24), 0 4px 32px rgba(0,0,0,0.5);
  animation: one-chance-banner-pop 1.2s ease-out forwards;
}

#effect-text.effect-banner-one-chance-fail {
  background: rgba(38, 50, 56, 0.84);
  box-shadow: 0 0 34px rgba(149,165,166,0.44), 0 4px 32px rgba(0,0,0,0.5);
}

#effect-text.effect-banner-lock {
  background: rgba(4, 34, 58, 0.78);
  box-shadow: 0 0 36px rgba(93,173,226,0.48), 0 4px 32px rgba(0,0,0,0.5);
}

#effect-text.effect-banner-reverse {
  background: rgba(42, 12, 72, 0.78);
  box-shadow: 0 0 36px rgba(155,89,182,0.50), 0 4px 32px rgba(0,0,0,0.5);
}

#effect-text.effect-banner-nullify {
  background: rgba(36, 12, 46, 0.80);
  box-shadow: 0 0 36px rgba(155,89,182,0.48), 0 4px 32px rgba(0,0,0,0.5);
}

#effect-text.effect-banner-cut {
  background: rgba(58, 32, 0, 0.78);
  box-shadow: 0 0 36px rgba(243,156,18,0.50), 0 4px 32px rgba(0,0,0,0.5);
}

@keyframes banner-pop {
  0%   { opacity: 0; transform: scale(0.4); }
  12%  { opacity: 1; transform: scale(1.18); }
  22%  { transform: scale(1.0); }
  72%  { opacity: 1; transform: scale(1.0); }
  100% { opacity: 0; transform: scale(1.0) translateY(-24px); }
}

@keyframes revolution-banner-pop {
  0%   { opacity: 0; transform: scale(0.35) rotate(-2deg); }
  14%  { opacity: 1; transform: scale(1.22) rotate(1deg); }
  28%  { transform: scale(1.0) rotate(0); }
  72%  { opacity: 1; transform: scale(1.0); }
  100% { opacity: 0; transform: scale(1.04) translateY(-26px); }
}

@keyframes one-chance-banner-pop {
  0%   { opacity: 0; transform: scale(0.42) rotate(-1deg); }
  12%  { opacity: 1; transform: scale(1.18) rotate(1deg); }
  24%  { transform: scale(1.0) rotate(0); }
  72%  { opacity: 1; transform: scale(1.0); }
  100% { opacity: 0; transform: scale(1.02) translateY(-22px); }
}

/* ═══════════════════════════════════════════
   アニメーションオーバーレイ
═══════════════════════════════════════════ */
#anim-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
  overflow: hidden;
}

.effect-pixi-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ── カード効果の全画面演出 ── */
.effect-scene {
  --scene-color: #f7dc6f;
  --scene-origin-x: 50vw;
  --scene-origin-y: 50vh;
  position: fixed;
  inset: 0;
  display: block;
  overflow: hidden;
  color: var(--scene-color);
  opacity: 0;
  isolation: isolate;
}

.effect-scene.is-active {
  animation: effect-scene-fade 1.38s ease-out forwards;
}

.effect-scene-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--scene-origin-x) var(--scene-origin-y), rgba(255,255,255,0.22), transparent 16%),
    radial-gradient(circle at var(--scene-origin-x) var(--scene-origin-y), rgba(0,0,0,0.06), rgba(0,0,0,0.56) 86%);
  transform-origin: var(--scene-origin-x) var(--scene-origin-y);
  animation: effect-backdrop-pulse 1.28s ease-out forwards;
}

.effect-scene-core {
  position: absolute;
  left: var(--scene-origin-x);
  top: var(--scene-origin-y);
  translate: -50% -50%;
  display: grid;
  width: min(36vw, 260px);
  height: min(36vw, 260px);
  place-items: center;
  border: 3px solid currentColor;
  border-radius: 50%;
  background: rgba(0,0,0,0.36);
  box-shadow:
    0 0 18px currentColor,
    0 0 72px currentColor,
    inset 0 0 32px rgba(255,255,255,0.18);
  animation: effect-core-burst 1.24s cubic-bezier(.17,.84,.36,1) forwards;
}

.effect-scene-glyph {
  position: relative;
  z-index: 2;
  color: #fff;
  font-size: clamp(5rem, 16vw, 9.5rem);
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 0 8px #fff,
    0 0 22px var(--scene-color),
    0 0 46px var(--scene-color);
}

.effect-scene-ring {
  position: absolute;
  left: var(--scene-origin-x);
  top: var(--scene-origin-y);
  translate: -50% -50%;
  width: min(31vw, 230px);
  height: min(31vw, 230px);
  border: 3px solid currentColor;
  border-radius: 50%;
  opacity: 0;
  animation: effect-ring-expand 1.12s var(--delay) ease-out forwards;
}

.effect-scene-ray {
  position: absolute;
  left: var(--scene-origin-x);
  top: var(--scene-origin-y);
  width: 4px;
  height: 52vmax;
  background: linear-gradient(to top, currentColor, rgba(255,255,255,0.72), transparent 78%);
  box-shadow: 0 0 14px currentColor;
  opacity: 0;
  transform-origin: 50% 100%;
  animation: effect-ray-burst 0.92s var(--delay) ease-out forwards;
}

.effect-scene-particle {
  position: absolute;
  left: var(--scene-origin-x);
  top: var(--scene-origin-y);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
  opacity: 0;
  animation: effect-particle-burst 1.02s var(--delay) ease-out forwards;
}

.scene-revolution .effect-scene-backdrop,
.scene-fall .effect-scene-backdrop {
  background:
    radial-gradient(circle at var(--scene-origin-x) var(--scene-origin-y), rgba(255,240,210,0.44), transparent 15%),
    conic-gradient(from 18deg at var(--scene-origin-x) var(--scene-origin-y), rgba(231,76,60,0.38), transparent 16%, rgba(231,76,60,0.26) 28%, transparent 45%, rgba(231,76,60,0.34) 72%, transparent);
}

.scene-revolution .effect-scene-glyph {
  animation: effect-glyph-revolution 1.16s ease-out forwards;
}

.scene-one-chance .effect-scene-backdrop,
.scene-one-chance-success .effect-scene-backdrop,
.scene-one-chance-fail .effect-scene-backdrop {
  background:
    radial-gradient(circle at var(--scene-origin-x) var(--scene-origin-y), rgba(255,247,214,0.28), transparent 16%),
    conic-gradient(from 0deg at var(--scene-origin-x) var(--scene-origin-y), rgba(231,76,60,0.34), rgba(247,220,111,0.22), rgba(72,13,18,0.32), rgba(231,76,60,0.34)),
    radial-gradient(circle at var(--scene-origin-x) var(--scene-origin-y), rgba(0,0,0,0.10), rgba(0,0,0,0.66) 82%);
}

.scene-one-chance-fail .effect-scene-backdrop {
  background:
    radial-gradient(circle at var(--scene-origin-x) var(--scene-origin-y), rgba(149,165,166,0.24), transparent 18%),
    conic-gradient(from 0deg at var(--scene-origin-x) var(--scene-origin-y), rgba(44,62,80,0.34), rgba(149,165,166,0.20), rgba(72,13,18,0.20), rgba(44,62,80,0.34)),
    radial-gradient(circle at var(--scene-origin-x) var(--scene-origin-y), rgba(0,0,0,0.10), rgba(0,0,0,0.72) 82%);
}

.scene-one-chance .effect-scene-core,
.scene-one-chance-success .effect-scene-core,
.scene-one-chance-fail .effect-scene-core {
  width: min(28vw, 190px);
  height: min(39vw, 260px);
  border-radius: 12px;
  animation-name: effect-core-one-chance;
}

.scene-one-chance .effect-scene-core::before,
.scene-one-chance-success .effect-scene-core::before,
.scene-one-chance-fail .effect-scene-core::before {
  content: '';
  position: absolute;
  inset: -34%;
  border: 5px dotted currentColor;
  border-radius: 50%;
  opacity: 0.72;
  animation: one-chance-wheel-spin 1.04s ease-out forwards;
}

.scene-one-chance .effect-scene-core::after,
.scene-one-chance-success .effect-scene-core::after {
  content: '?  ?  A  ?';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 190%;
  translate: -50% -50%;
  color: rgba(255,255,255,0.82);
  font-size: clamp(1rem, 4vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.32em;
  text-shadow: 0 0 16px currentColor;
  animation: one-chance-orbit-labels 1.02s ease-out forwards;
}

.scene-one-chance-success .effect-scene-core {
  box-shadow:
    0 0 22px currentColor,
    0 0 86px currentColor,
    inset 0 0 42px rgba(255,247,214,0.32);
}

.scene-one-chance-fail .effect-scene-core {
  filter: saturate(0.42);
}

.scene-one-chance-fail .effect-scene-core::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -11%;
  width: 8px;
  height: 122%;
  translate: -50% 0;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, #fff 18%, currentColor 48%, #263238 62%, transparent);
  box-shadow: 0 0 14px rgba(255,255,255,0.72), 0 0 26px currentColor;
  transform: rotate(-20deg) scaleY(0);
  animation: one-chance-crack 0.74s 0.24s ease-out forwards;
}

.scene-one-chance .effect-scene-ring,
.scene-one-chance-success .effect-scene-ring,
.scene-one-chance-fail .effect-scene-ring {
  border-style: dotted;
  animation-name: effect-ring-expand;
}

.scene-cut .effect-scene-core::before {
  --slash-angle: -32deg;
  content: '';
  position: absolute;
  left: -44vw;
  width: 88vw;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #fff 46%, currentColor 52%, transparent);
  box-shadow: 0 0 12px #fff, 0 0 30px currentColor;
  transform: rotate(var(--slash-angle)) scaleX(0);
  animation: effect-slash 0.78s 0.08s ease-out forwards;
}

.scene-reverse .effect-scene-core {
  animation-name: effect-core-reverse;
}

.scene-reverse .effect-scene-ring {
  border-style: dashed;
}

.scene-lock .effect-scene-core {
  border-radius: 24%;
  animation-name: effect-core-lock;
}

.scene-lock .effect-scene-ring {
  border-style: double;
  border-width: 6px;
}

.scene-skip .effect-scene-core::after,
.scene-deal .effect-scene-core::after {
  position: absolute;
  color: #fff;
  font-size: clamp(2rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.25em;
  text-shadow: 0 0 18px currentColor;
  white-space: nowrap;
  animation: effect-side-sweep 0.92s ease-out forwards;
}

.scene-skip .effect-scene-core::after { content: '» » »'; }
.scene-deal .effect-scene-core::after { content: '◆ ◆ ◆'; }

.scene-fall .effect-scene-core {
  animation-name: effect-core-fall;
}

.scene-nullify {
  filter: saturate(0.58);
}

.scene-nullify .effect-scene-ring {
  border-style: dashed;
}

.scene-void .effect-scene-backdrop {
  background: radial-gradient(circle at var(--scene-origin-x) var(--scene-origin-y), rgba(85,20,110,0.08) 0 12%, rgba(0,0,0,0.92) 46%, rgba(0,0,0,0.24));
}

.scene-void .effect-scene-ring {
  animation-name: effect-ring-collapse;
}

.scene-void .effect-scene-particle {
  animation-name: effect-particle-collapse;
}

.scene-revive .effect-scene-particle,
.scene-rank .effect-scene-particle,
.scene-finale .effect-scene-particle {
  animation-name: effect-particle-rise;
}

.scene-asura .effect-scene-glyph {
  animation: effect-glyph-asura 1.12s ease-out forwards;
}

.scene-asura .effect-scene-core::before,
.scene-asura .effect-scene-core::after {
  content: '9';
  position: absolute;
  color: currentColor;
  font-size: clamp(4rem, 13vw, 8rem);
  font-weight: 900;
  opacity: 0;
  text-shadow: 0 0 24px currentColor;
  animation: effect-asura-shadow 0.96s ease-out forwards;
}

.scene-asura .effect-scene-core::before { --shadow-x: -150%; }
.scene-asura .effect-scene-core::after { --shadow-x: 150%; }

.scene-finale .effect-scene-backdrop {
  background:
    radial-gradient(circle at var(--scene-origin-x) var(--scene-origin-y), rgba(255,248,196,0.46), transparent 18%),
    radial-gradient(circle at var(--scene-origin-x) var(--scene-origin-y), rgba(241,196,15,0.24), rgba(0,0,0,0.76) 74%);
}

@keyframes effect-scene-fade {
  0%   { opacity: 0; }
  8%   { opacity: 1; }
  76%  { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes effect-backdrop-pulse {
  0%   { opacity: 0; transform: scale(0.86); }
  18%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.16); }
}

@keyframes effect-core-burst {
  0%   { opacity: 0; transform: scale(0.16) rotate(-14deg); }
  18%  { opacity: 1; transform: scale(1.16) rotate(2deg); }
  42%  { transform: scale(0.98) rotate(0); }
  100% { opacity: 0; transform: scale(1.08); }
}

@keyframes effect-core-reverse {
  0%   { opacity: 0; transform: scale(0.2) rotate(320deg); }
  24%  { opacity: 1; transform: scale(1.1) rotate(-18deg); }
  58%  { transform: scale(1) rotate(12deg); }
  100% { opacity: 0; transform: scale(1.08) rotate(-8deg); }
}

@keyframes effect-core-lock {
  0%   { opacity: 0; transform: scale(1.5); }
  28%  { opacity: 1; transform: scale(0.92); }
  45%  { transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1); }
}

@keyframes effect-core-fall {
  0%   { opacity: 0; transform: translateY(-52vh) rotate(-8deg); }
  26%  { opacity: 1; transform: translateY(4vh) rotate(2deg); }
  42%  { transform: translateY(0); }
  100% { opacity: 0; transform: translateY(22vh) scale(0.9); }
}

@keyframes effect-core-one-chance {
  0%   { opacity: 0; transform: scale(0.18) rotateY(88deg) rotate(-8deg); }
  20%  { opacity: 1; transform: scale(1.16) rotateY(12deg) rotate(2deg); }
  42%  { transform: scale(0.98) rotateY(0) rotate(0); }
  72%  { opacity: 1; transform: scale(1.04) rotateY(0); }
  100% { opacity: 0; transform: scale(1.08) rotateY(-10deg); }
}

@keyframes effect-ring-expand {
  0%   { opacity: 0.9; transform: scale(0.32); }
  100% { opacity: 0; transform: scale(var(--ring-scale)); }
}

@keyframes one-chance-wheel-spin {
  0%   { opacity: 0; transform: rotate(-160deg) scale(0.58); }
  18%  { opacity: 0.78; }
  72%  { opacity: 0.78; transform: rotate(240deg) scale(1); }
  100% { opacity: 0; transform: rotate(310deg) scale(1.06); }
}

@keyframes one-chance-orbit-labels {
  0%   { opacity: 0; transform: rotate(-18deg) scale(0.72); }
  22%  { opacity: 0.84; }
  68%  { opacity: 0.84; transform: rotate(10deg) scale(1); }
  100% { opacity: 0; transform: rotate(18deg) scale(1.04); }
}

@keyframes one-chance-crack {
  0%   { opacity: 0; transform: rotate(-20deg) scaleY(0); }
  18%  { opacity: 1; transform: rotate(-20deg) scaleY(1.08); }
  68%  { opacity: 1; transform: rotate(-20deg) scaleY(1); }
  100% { opacity: 0; transform: rotate(-20deg) scaleY(1); }
}

@keyframes effect-ring-collapse {
  0%   { opacity: 0; transform: scale(var(--ring-start-scale)); }
  36%  { opacity: 0.94; }
  100% { opacity: 0; transform: scale(0.16); }
}

@keyframes effect-ray-burst {
  0%   { opacity: 0; transform: translate(-50%, -100%) rotate(var(--angle)) scaleY(0.06); }
  22%  { opacity: 0.8; }
  100% { opacity: 0; transform: translate(-50%, -100%) rotate(var(--angle)) scaleY(1); }
}

@keyframes effect-particle-burst {
  0%   { opacity: 0; transform: translate(-50%, -50%) rotate(var(--angle)) translateX(2vmin) scale(0.2); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--distance)) scale(1.3); }
}

@keyframes effect-particle-collapse {
  0%   { opacity: 0; transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--distance)) scale(1.2); }
  32%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) scale(0.12); }
}

@keyframes effect-particle-rise {
  0%   { opacity: 0; transform: translate(calc(-50% + var(--spread)), 30vh) rotate(var(--angle)) scale(0.4); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--spread)), -58vh) rotate(var(--angle)) scale(1.25); }
}

@keyframes effect-glyph-revolution {
  0%   { transform: rotate(-12deg) skewX(0deg) scale(0.4); }
  28%  { transform: rotate(-6deg) skewX(-10deg) scale(1.22); }
  52%  { transform: rotate(8deg) skewX(12deg) scale(1.04); }
  76%  { transform: rotate(-5deg) skewX(-7deg) scale(1.08); }
  100% { transform: rotate(-3deg) skewX(0deg) scale(1); }
}

@keyframes effect-glyph-asura {
  0%   { transform: scale(0.2); }
  28%  { transform: scale(1.3); }
  46%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}

@keyframes effect-asura-shadow {
  0%   { opacity: 0; transform: translateX(0) scale(0.3); }
  24%  { opacity: 0.86; }
  100% { opacity: 0; transform: translateX(var(--shadow-x)) scale(1.22); }
}

@keyframes effect-slash {
  0%   { opacity: 0; transform: rotate(var(--slash-angle)) scaleX(0); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--slash-angle)) scaleX(1); }
}

@keyframes effect-side-sweep {
  0%   { opacity: 0; transform: translateX(-46vw) scale(0.7); }
  28%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(46vw) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .effect-scene { display: none; }
}

/* アニメーション中のカードクローン */
.anim-card {
  position: fixed;
  margin: 0;
  pointer-events: none;
  will-change: left, top, transform;
}

/* ═══════════════════════════════════════════
   スマホ対応レイアウト (max-width: 640px)
═══════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── フォームスクリーン ── */
  .screen-overlay {
    align-items: flex-start;
    min-height: 100dvh;
    padding: 12px;
    overflow-y: auto;
  }

  .form-box {
    padding: 24px 16px;
    gap: 12px;
    border-radius: 12px;
  }

  .create-box {
    max-height: none;
    overflow-y: visible;
  }

  .form-box h1 { font-size: 1.8rem; letter-spacing: 2px; }
  .form-box h2 { font-size: 1.2rem; }

  .solo-home-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .solo-title-progress-card {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .solo-title-logo-wrap {
    width: 70px;
  }

  .solo-title-progress-mini-line {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .solo-title-progress-mini-line span:last-child {
    grid-column: 2;
    text-align: right;
  }

  .home-action-grid {
    grid-template-columns: 1fr;
  }

  #solo-roadmap-modal {
    width: calc(100% - 20px);
    max-height: 88vh;
    padding: 18px 14px;
  }

  .solo-roadmap-summary-card,
  .solo-roadmap-milestone-head {
    grid-template-columns: 1fr;
  }

  .solo-roadmap-score-block {
    text-align: left;
  }

  .solo-roadmap-ascent {
    min-height: max(var(--ascent-height, 1290px), 1290px);
    padding: 22px 6px;
  }

  .solo-ascent-rail,
  .solo-ascent-fill {
    left: 22px;
  }

  .solo-ascent-current {
    left: 5px;
    width: 44px;
  }

  .solo-ascent-node {
    left: 48px;
    right: 4px;
  }

  .solo-ascent-node-card {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 7px;
    padding: 8px;
  }

  .solo-ascent-logo {
    width: 74px;
  }

  .solo-title-ceremony-overlay {
    padding: 10px;
  }

  .solo-title-ceremony-modal {
    padding: 22px 14px 16px;
  }

  .solo-title-ceremony-logo-frame {
    width: min(250px, 78vw);
  }

  .solo-title-ceremony-meta {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .solo-title-ceremony-actions {
    grid-template-columns: 1fr;
  }

  .solo-ascent-node-title-row {
    display: grid;
    gap: 2px;
  }

  .solo-progress-line {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .solo-progress-line span:last-child {
    grid-column: 2;
    text-align: right;
  }

  .solo-result-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .solo-result-stats div {
    padding: 6px 4px;
  }

  .solo-result-stats b {
    font-size: 0.78rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .solo-league-section,
  .intro-section {
    grid-template-columns: 1fr;
  }

  .solo-league-board {
    padding: 14px;
  }

  #rules-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .rule-btn {
    min-height: 42px;
  }

  /* ── ゲームボード全体: スクロール可能に ── */
  #game-board {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* ── ヘッダー: コンパクト ── */
  #header {
    flex-wrap: wrap;
    gap: 4px;
    padding: 5px 8px;
  }

  #game-title { font-size: 0.95rem; letter-spacing: 1px; flex: none; }

  #zen-mode-badge, #revolution-badge, #j-back-badge,
  #suit-lock-badge, #six-strongest-badge,
  #effect-nullified-badge, #ten-nullified-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .header-btn, #new-game-btn {
    font-size: 0.68rem;
    padding: 4px 8px;
  }

  /* ── ゲームコンテンツ: 縦積み ── */
  #game-content {
    flex-direction: column;
    overflow: visible;
    height: auto;
  }

  #main-content {
    overflow: visible;
    padding: 6px;
    gap: 6px;
    flex: none;
  }

  /* ── テーブルラッパー: 卓を囲むラジアル配置（上3席＋左右席で場を囲む） ── */
  /* 6カラムGrid: 上段=3席（各2col）/ 中段=左右席（各1col）＋場（4col）。 */
  /* 横スクロールを廃止し、最大5人でも全席を常時表示する。 */
  /* minmax(0,1fr) で席の中身が増えても場（4col）の幅を不変に保つ。 */
  #table-wrapper {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "tl  tl  top top tr  tr"
      "lft tbl tbl tbl tbl rgt";
    gap: 4px;
    flex: none;
    min-height: 0;
  }

  /* opp-row はモバイルでも display:contents でスロットを直接グリッドへ参加させる */
  #opp-row { display: contents; }

  /* opp-slot: グリッドセル内でボックスを収める（席ごとの寄せは基本ルールを継承） */
  .opp-slot { min-width: 0; }

  /* 空のスロットは非表示（グリッドトラックは維持され配置は崩れない） */
  .opp-slot:empty { display: none; }

  /* table-area は中央セル */
  #table-area {
    width: 100%;
    padding: 8px;
    min-height: 200px;
    grid-template-rows: auto auto minmax(58px, auto) auto auto;
    gap: 5px;
  }

  #table-state-chips {
    min-height: 20px;
    gap: 4px;
  }

  .table-state-chip {
    min-height: 20px;
    padding: 1px 7px;
    font-size: 0.63rem;
  }

  #table-cards {
    min-height: 64px;
    gap: 4px;
  }

  .card.table-card {
    width: 46px;
    height: 66px;
  }

  #table-hint {
    font-size: 0.72rem;
    min-height: 16px;
  }

  /* 対戦相手ボックス: 卓を囲む席用にコンパクト化（裏向きカードの扇は廃止し残枚数で代替） */
  .cpu-player {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 4px 5px;
    font-size: 0.74rem;
    text-align: center;
  }

  /* 上3席も左右席と同じ幅に統一する。 */
  /* 上段セルは2col幅なので、ボックスを50%(=1col=左右席幅)に絞り中央寄せ。 */
  #opp-top-left,
  #opp-top,
  #opp-top-right { justify-content: center; }
  #opp-top-left .cpu-player,
  #opp-top .cpu-player,
  #opp-top-right .cpu-player {
    width: 100%;
    max-width: 50%;
    padding: 5px 3px;
  }

  /* 左右席: 細い縦長ボックス（場の左右に密着） */
  #opp-left .cpu-player,
  #opp-right .cpu-player {
    width: 100%;
    max-width: 100%;
    padding: 5px 3px;
  }

  /* 席内のカード: 5枚を重ねて表示（手札5枚未満ならその枚数だけ表示）。 */
  /* markup は min(hand_count, maxBacks) 枚を生成するため、6枚目以降をCSSで隠せば */
  /* 表示は min(hand_count, 5) 枚となり、5枚未満は自動で実数が反映される。 */
  .cpu-cards {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0;
    max-height: none;
    overflow: visible;
    margin-bottom: 3px;
  }
  .cpu-cards .card-back {
    width: 16px;
    height: 22px;
    border-radius: 2px;
    margin-left: -10px;
    flex: none;
  }
  .cpu-cards .card-back:first-child { margin-left: 0; }
  .cpu-cards .card-back:nth-child(n + 6) { display: none; }

  /* 残枚数: 重ねカードの下に正確な枚数を併記 */
  .cpu-count {
    margin-top: 1px;
    font-size: 0.72rem;
    font-weight: bold;
    color: #bfe6bf;
  }

  /* 名前・バッジ: 席に合わせて省スペース化 */
  .cpu-name { margin-bottom: 2px; max-width: 100%; }
  .cpu-rank-badge { margin-bottom: 2px; font-size: 0.64rem; padding: 0 6px; }
  .player-presence-badge { margin: 0 0 2px; font-size: 0.6rem; min-height: 16px; padding: 1px 5px; }

  /* カード: やや小さく */
  .card {
    width: 42px;
    height: 60px;
    font-size: 0.78rem;
    padding: 2px 3px;
  }

  .card .rank-top, .card .rank-bottom { font-size: 0.72rem; }
  .card .suit-center { font-size: 1.2rem; }

  /* ── プレイヤーエリア ── */
  #player-area {
    padding: 8px 10px;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  #player-hand {
    gap: 4px;
    min-height: 60px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  #player-hand .card { flex-shrink: 0; }

  /* ── アクションボタン（固定フッター） ── */
  #action-area {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 50;
    background: rgba(7, 15, 7, 0.97);
    border-top: 2px solid var(--border-color);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  #play-btn, #pass-btn {
    padding: 12px 0;
    font-size: 1rem;
    flex: 1;
    min-width: 80px;
    border-radius: 10px;
  }

  #one-chance-btn, #one-chance-skip-btn {
    font-size: 0.82rem;
    padding: 8px 14px;
    width: 100%;
  }

  #selected-info {
    font-size: 0.74rem;
  }

  #selected-effect-preview {
    max-width: 100%;
    font-size: 0.72rem;
    min-height: 22px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* フッター分のスクロール余白（#log-toggle-btn/#log-area がフッターに隠れないよう） */
  #game-content {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  /* ── ログトグルボタン（モバイルのみ表示） ── */
  #log-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 7px 12px;
    background: var(--bg-deep);
    border: none;
    border-top: 2px solid var(--border-muted);
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
  }

  /* ── ログエリア: トグル式 ── */
  #log-area {
    width: 100%;
    border-left: none;
    flex-shrink: 0;
    max-height: 0 !important;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  #log-area.log-expanded {
    max-height: 200px !important;
    border-top: 2px solid var(--border-muted);
  }

  #log-scroll { max-height: 180px; }

  .log-item { font-size: 0.75rem; }

  /* ── ミニログ / ターン状態バー: モバイルサイズ ── */
  #mini-log { padding: 2px 10px; }
  #turn-status-bar { padding: 5px 10px; font-size: 0.75rem; }

  /* ── 捨て札 / 受取 / 渡すエリア ── */
  #discard-area, #pickup-area, #give-area {
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 8px;
  }

  /* ── ゲーム終了モーダル ── */
  #end-overlay {
    padding: 12px;
  }

  #end-modal {
    padding: 20px 16px;
    min-width: 0;
    width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: 12px;
  }

  #end-modal h2 { font-size: 1.2rem; margin-bottom: 14px; }

  .result-rank { min-width: 60px; font-size: 0.88rem; }
  .result-name { font-size: 0.88rem; }

  /* ── エフェクトバナー ── */
  #effect-text {
    font-size: 1.8rem;
    letter-spacing: 2px;
    padding: 10px 18px;
  }

  /* ── チュートリアル ── */
  .tutorial-coach {
    left: 10px;
    right: 10px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    transform: none;
    width: auto;
    max-height: 42vh;
    overflow-y: auto;
    padding: 12px;
    border-radius: 10px;
  }

  .tutorial-coach h3 {
    font-size: 0.95rem;
  }

  .tutorial-coach p {
    font-size: 0.8rem;
  }

  .tutorial-actions {
    flex-wrap: wrap;
  }

  .tutorial-actions .btn-primary,
  .tutorial-actions .btn-ghost {
    flex: 1;
    min-width: 120px;
  }

  /* ── ルール / カード効果モーダル ── */
  #card-rules-modal, #rules-modal {
    max-height: 88vh;
    padding: 16px 14px;
    width: 96vw;
  }

  /* ── 捨て札 / 除外カードパイル ── */
  #zen-piles {
    flex-direction: row;
    gap: 8px;
    justify-content: center;
    margin-top: 0;
  }

  /* ── カード確認モーダル ── */
  #confirm-modal {
    padding: 20px 16px;
    width: 94vw;
  }
}

/* ── 認証ウィジェット ───────────────────────────────── */
.auth-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.auth-display-name {
  color: #c8e6c8;
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-nav-link {
  position: relative;
  color: #c8e6c8;
  font-size: 0.82rem;
  text-decoration: none;
  white-space: nowrap;
}

.friend-pending-badge {
  position: absolute;
  top: -10px;
  right: -14px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e74c3c;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

.btn-ghost-sm {
  background: transparent;
  border: 1px solid #4a7c4a;
  border-radius: 6px;
  color: #a8d5a8;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 4px 10px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-ghost-sm:hover {
  background: #2e6b2e;
  color: #e0f0e0;
}

/* ── 認証モーダル ───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 400;
  overflow-y: auto;
  padding: 24px 16px;
}

.auth-modal-box {
  max-width: 420px;
  width: 90%;
  padding: 32px 28px;
}

.form-title {
  font-size: 1.4rem;
  font-weight: bold;
  text-align: center;
  letter-spacing: 1px;
}

.auth-modal-desc {
  color: #a0c8a0;
  font-size: 0.85rem;
  margin: -8px 0 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-label {
  font-size: 0.85rem;
  color: #9fcf9f;
}

.form-input {
  padding: 11px 14px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #4a8a4a;
  background: #0d2b0d;
  color: #f0f0f0;
  outline: none;
  width: 100%;
}
.form-input:focus { border-color: #7dca7d; }

.auth-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.form-hint {
  color: #7aaa7a;
  font-size: 0.78rem;
  margin: 4px 0 0;
}

.form-error {
  color: #ff8a8a;
  font-size: 0.85rem;
  min-height: 1.2em;
}

.required {
  color: #ff8a8a;
}

/* ── アバター選択グリッド ── */
.avatar-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.avatar-opt {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid #2e5a2e;
  background: #0d2b0d;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  padding: 0;
  color: #e8f8e8;
}

.avatar-opt:hover {
  border-color: #4ab84a;
  background: #1a4d1a;
}

.avatar-opt.selected {
  border-color: #f1c40f;
  background: #1a4d1a;
  box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.35);
}

/* ── 認証ウィジェット（アバター小） ── */
.auth-avatar-sm {
  font-size: 1.1rem;
  line-height: 1;
}

/* ── フォーム補助 ── */
.form-textarea {
  resize: vertical;
  min-height: 72px;
  font-family: inherit;
  line-height: 1.6;
}

.form-input-gap {
  margin-top: 6px;
  display: block;
}

/* ── 危険操作ボタン ── */
.btn-danger {
  background: #8b1a1a;
  border: 1px solid #c0392b;
  color: #f0f0f0;
  padding: 8px 20px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid #6b1a1a;
  color: #ff8a8a;
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s, border-color 0.15s;
  width: 100%;
}

.btn-danger-outline:hover {
  background: rgba(139, 26, 26, 0.2);
  border-color: #c0392b;
}

/* ── モーダル区切り・削除警告 ── */
.modal-divider {
  border: none;
  border-top: 1px solid #2e5a2e;
  margin: 16px 0 14px;
}

.delete-title {
  color: #ff8a8a;
}

.delete-warning {
  background: rgba(139, 26, 26, 0.15);
  border: 1px solid #6b1a1a;
  border-radius: 8px;
  padding: 12px 14px;
  color: #ff8a8a;
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* ── フレンド機能 ─────────────────────────────────── */
.friend-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -10px 0 24px;
}

.friend-action-btn {
  width: auto;
}

.friend-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(74, 184, 74, 0.16);
  border: 1px solid #4ab84a;
  color: #c8f0c8;
  font-size: 0.84rem;
}

.friends-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.friends-main {
  flex: 1;
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 60px;
}

.friends-hero {
  margin-bottom: 22px;
}

.friends-hero h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.friends-hero p {
  color: #a8c8a8;
}

.friends-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
}

.friends-panel {
  background: #1a4d1a;
  border: 2px solid #2e8b2e;
  border-radius: 14px;
  padding: 22px;
}

.friends-panel h2 {
  font-size: 1.08rem;
  margin-bottom: 14px;
}

.friend-request-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.friend-request-form .form-input {
  flex: 1;
}

.friend-list,
.pending-list,
.sent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.friends-subsection-title {
  margin-top: 22px;
}

.friend-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0d2b0d;
  border: 1px solid #2e5a2e;
  border-radius: 10px;
  padding: 12px;
}

.friend-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1a4d1a;
  border: 1px solid #2e8b2e;
}

.friend-card-main {
  flex: 1;
  min-width: 0;
}

.friend-card-name {
  color: #e8f8e8;
  font-weight: 700;
  text-decoration: none;
}

.friend-card-meta {
  color: #8cb78c;
  font-size: 0.78rem;
  margin-top: 3px;
}

.friend-roadmap-progress {
  margin-top: 9px;
  display: grid;
  gap: 5px;
  padding: 8px;
  background: rgba(4, 14, 6, 0.55);
  border: 1px solid rgba(255, 212, 154, 0.18);
  border-radius: 8px;
}

.friend-roadmap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #ffd49a;
  font-size: 0.72rem;
  font-weight: 900;
}

.friend-roadmap-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}

.friend-roadmap-title img {
  width: 42px;
  aspect-ratio: 20 / 11;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(241,196,15,0.3));
}

.friend-roadmap-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-roadmap-track {
  height: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.35);
}

.friend-roadmap-fill {
  width: var(--progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, #58d68d, #f1c40f, #b56dff);
  border-radius: inherit;
  box-shadow: 0 0 8px rgba(241,196,15,0.42);
}

.friend-roadmap-next {
  color: #a9cfa9;
  font-size: 0.7rem;
  line-height: 1.35;
}

.online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #556655;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.06);
}

.online-dot.is-online {
  background: #2ecc71;
  box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.18);
}

.friend-card-actions {
  display: flex;
  gap: 8px;
}

.friends-empty,
.friends-message {
  color: #9fcf9f;
  font-size: 0.88rem;
}

.friends-message.error {
  color: #ff8a8a;
}

.friend-invite-context {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.friend-invite-context .section-kicker {
  margin-bottom: 4px;
}

.friend-return-link {
  width: auto;
  text-decoration: none;
  white-space: nowrap;
}

.invite-link-btn {
  margin: 0 auto 14px;
}

.notifications-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.notifications-main {
  flex: 1;
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 60px;
}

.notifications-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.notifications-header-row h2 {
  margin-bottom: 0;
}

.notification-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.pwa-notification-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pwa-notification-panel.hidden {
  display: none;
}

.pwa-notification-panel .btn-ghost.is-enabled {
  border-color: #4ab84a;
  color: #d9ffd9;
  opacity: 1;
}

.pwa-notification-status {
  color: #b8d8b8;
  font-size: 0.82rem;
  white-space: nowrap;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 10px;
  border: 1px solid #2e5a2e;
  background: #0d2b0d;
  padding: 14px;
}

.notification-card.is-unread {
  border-color: #4ab84a;
  box-shadow: inset 3px 0 0 #4ab84a;
}

.notification-card.is-read {
  opacity: 0.78;
}

.notification-card-main {
  flex: 1;
  min-width: 0;
}

.notification-title {
  color: #e8f8e8;
  font-weight: 700;
}

.notification-body {
  color: #b8d8b8;
  font-size: 0.9rem;
  margin-top: 5px;
}

.notification-meta {
  color: #8cb78c;
  font-size: 0.78rem;
  margin-top: 5px;
}

.notification-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* モーダルが長くなったときにスクロール可能にする */
.auth-modal-box {
  max-height: 90vh;
  overflow-y: auto;
}

/* ─────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .home-screen {
    align-items: stretch;
    padding: 0;
    overflow-y: visible;
  }

  .site-nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .site-nav nav {
    justify-content: flex-start;
    font-size: 0.8rem;
    gap: 8px 12px;
    margin-left: 0;
  }

  .auth-widget {
    margin-left: 0;
    flex-wrap: wrap;
  }

  .home-stage {
    min-height: auto;
    padding: 14px 12px 26px;
  }

  .home-content,
  .site-footer,
  .static-main {
    width: calc(100% - 24px);
  }

  .home-content {
    padding: 20px 0 28px;
  }

  .content-section,
  .static-section {
    padding: 20px 16px;
  }

  .intro-section,
  .guide-grid,
  .rule-summary,
  .guide-link-grid {
    grid-template-columns: 1fr;
  }

  .card-preview {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .content-section h2,
  .static-hero h1 {
    font-size: 1.35rem;
  }

  .static-main {
    padding: 28px 0 52px;
  }

  .friends-main {
    width: calc(100% - 24px);
    padding: 20px 0 42px;
  }

  .notifications-main {
    width: calc(100% - 24px);
    padding: 20px 0 42px;
  }

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

  .friend-request-form,
  .friend-card,
  .friend-invite-context {
    flex-direction: column;
    align-items: stretch;
  }

  .friend-card-actions {
    width: 100%;
  }

  .friend-card-actions button {
    flex: 1;
  }

  .notifications-header-row,
  .notification-card {
    flex-direction: column;
    align-items: stretch;
  }

  .notification-toolbar,
  .pwa-notification-panel {
    justify-content: flex-start;
  }

  .notification-card-actions button {
    flex: 1;
  }
}

/* ══════════════════════════════════════════════════════════════
   対戦中チャット / スタンプ
   ══════════════════════════════════════════════════════════════ */
#chat-bubble-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 300;
}

.chat-bubble {
  position: fixed;
  max-width: min(220px, 60vw);
  padding: 6px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: #1a1a1a;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  border: 2px solid var(--border-color);
  opacity: 0;
  transform: translateY(6px) scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  pointer-events: none;
}

.chat-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chat-bubble.is-stamp {
  font-size: 1.7rem;
  padding: 4px 12px;
}

.chat-bubble.is-self {
  border-color: var(--accent-gold);
  background: #fff8e1;
}

/* 吹き出しのしっぽ（既定は席の上に出るので下向き） */
.chat-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.96);
}

/* 席の下に出る場合（相手席など）はしっぽを上向きに */
.chat-bubble.below::after {
  top: -8px;
  bottom: auto;
  border-top-color: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.96);
}

#chat-dock {
  position: fixed;
  right: 14px;
  bottom: 96px;
  z-index: 320;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

#chat-dock.hidden {
  display: none;
}

#chat-toggle-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s ease, background 0.12s ease;
}

#chat-toggle-btn:hover {
  background: #246b24;
}

#chat-toggle-btn:active {
  transform: scale(0.92);
}

#chat-palette {
  width: 248px;
  max-width: calc(100vw - 28px);
  padding: 12px;
  border-radius: var(--radius-panel);
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#chat-palette.hidden {
  display: none;
}

.chat-palette-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.chat-palette-row {
  display: grid;
  gap: 6px;
}

#chat-emoji-row {
  grid-template-columns: repeat(4, 1fr);
}

#chat-phrase-row {
  grid-template-columns: repeat(2, 1fr);
}

.chat-stamp-btn,
.chat-phrase-btn {
  border: 1px solid var(--border-muted);
  background: var(--bg-base);
  color: var(--text-primary);
  border-radius: var(--radius-btn);
  cursor: pointer;
  padding: 8px 4px;
  transition: background 0.12s ease, transform 0.1s ease;
}

.chat-stamp-btn {
  font-size: 1.5rem;
  line-height: 1;
}

.chat-phrase-btn {
  font-size: 0.85rem;
  font-weight: 600;
}

.chat-stamp-btn:hover,
.chat-phrase-btn:hover {
  background: #246b24;
}

.chat-stamp-btn:active,
.chat-phrase-btn:active {
  transform: scale(0.94);
}

@media (max-width: 640px) {
  #chat-dock {
    right: 10px;
    bottom: 78px;
  }
  #chat-toggle-btn {
    width: 46px;
    height: 46px;
    font-size: 1.3rem;
  }
}
