:root {
  --paper: #f8fbf8;
  --mist: #e8f7f2;
  --sky: #d7eef8;
  --ink: #183143;
  --muted: #667986;
  --line: rgba(28, 73, 96, 0.16);
  --blue: #1b9bd1;
  --green: #3ab98a;
  --gold: #f2b84b;
  --red: #e96f5f;
  --violet: #7a77d9;
  --panel: rgba(255, 255, 255, 0.78);
  --shadow: 0 18px 42px rgba(32, 86, 110, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--ink);
  font-family: "Trebuchet MS", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background:
    linear-gradient(120deg, rgba(216, 245, 235, 0.88), rgba(214, 235, 248, 0.92)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.32) 0 1px, transparent 1px 30px);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.danger-soft {
  color: #9e382c;
  background: #fff0ec;
  border: 1px solid rgba(233, 111, 95, 0.38);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.setup-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.setup-card {
  width: min(1120px, 100%);
  display: grid;
  gap: 24px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.room-landing { width: min(1120px, 100%); max-width: 100%; min-width: 0; }
.room-card { width: 100%; }
.room-entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.room-entry-grid .setup-form, .room-members, .room-wait { display: grid; gap: 12px; padding: 20px; background: rgba(246, 251, 253, .8); border: 1px solid var(--line); }
.setup-key-visual {
  position: relative;
  min-height: clamp(300px, 48vw, 560px);
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 30px;
  background: #d8ecfa;
  box-shadow: 0 24px 64px rgba(40, 100, 145, 0.24);
}
.setup-key-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 32%, rgba(8, 31, 54, 0.18) 58%, rgba(7, 25, 43, 0.82));
}
.setup-key-visual img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}
.setup-key-visual figcaption {
  position: absolute;
  z-index: 1;
  inset: auto clamp(20px, 5vw, 56px) clamp(20px, 5vw, 48px);
  display: grid;
  gap: 8px;
  color: white;
  text-shadow: 0 3px 18px rgba(0, 18, 38, 0.8);
}
.setup-key-visual figcaption p {
  color: #ffec9c;
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.setup-key-visual figcaption h1 {
  font-size: clamp(2.3rem, 7vw, 5.8rem);
  letter-spacing: 0.08em;
  line-height: 1;
}
.setup-key-visual figcaption span {
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  line-height: 1.65;
}
.solo-entry-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border: 1px solid rgba(53, 151, 203, 0.28);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(230, 247, 255, 0.96), rgba(255, 248, 218, 0.96));
  box-shadow: 0 16px 38px rgba(54, 125, 171, 0.12);
}
.solo-entry-card > div {
  display: grid;
  gap: 6px;
}
.solo-entry-card span,
.solo-setup-form > div > span {
  color: var(--muted);
}
.solo-start-button {
  min-width: min(280px, 100%);
  color: #102d46;
  border: 1px solid rgba(234, 178, 52, 0.52);
  background: linear-gradient(135deg, #fff4aa, #8ee4ff);
  box-shadow: 0 12px 28px rgba(75, 160, 202, 0.2);
}
.solo-setup-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(53, 151, 203, 0.26);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(245, 252, 255, 0.96), rgba(255, 250, 228, 0.96));
}
.solo-setup-form > div:first-child,
.solo-setup-actions {
  grid-column: 1 / -1;
}
.solo-setup-form > div:first-child {
  display: grid;
  gap: 7px;
}
.solo-setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.audio-setting-options {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 14px 16px;
  border: 1px solid rgba(53, 151, 203, 0.24);
  border-radius: 16px;
  background: rgba(238, 248, 255, 0.72);
}
.audio-setting-options legend {
  padding: 0 7px;
  color: var(--ink);
  font-weight: 900;
}
.audio-setting-options .check-line {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.audio-setting-options input[type="checkbox"],
.menu-audio-option input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-height: 0;
  padding: 0;
}
.room-audio-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.room-audio-summary span {
  padding: 7px 11px;
  color: #24516a;
  border: 1px solid rgba(53, 151, 203, 0.2);
  border-radius: 999px;
  background: #eef8ff;
  font-size: 0.82rem;
  font-weight: 900;
}
.room-members ul, .day-event-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.room-members li, .day-event-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px; background: white; border: 1px solid var(--line); }
.room-members li span { color: var(--muted); font-size: .8rem; }
.day-event-list li span { color: var(--muted); }
.random-job-setting {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  gap: 16px;
  padding: 18px;
  background: linear-gradient(135deg, #eef8ff, #effbf5);
  border: 1px solid var(--line);
}
.random-job-setting > div {
  display: grid;
  align-content: center;
  gap: 7px;
}
.random-job-setting > div > span {
  color: var(--muted);
  line-height: 1.55;
}
.random-job-setting ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.random-job-setting li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  background: white;
  border: 1px solid var(--line);
}
.random-job-setting li span {
  color: #247152;
  font-size: 0.78rem;
  font-weight: 900;
}

.job-selection-list {
  display: grid;
  gap: 8px;
}

.job-selection-list label {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(130px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 11px;
  background: white;
  border: 1px solid var(--line);
}
.day-event-player {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink) !important;
}
.day-event-player img {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--mist);
}
.day-event-result {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 0;
  text-align: right;
  line-height: 1.5;
}
.day-event-result small {
  font-size: 0.7rem;
  font-weight: 900;
}
.day-event-result small.ready { color: #16734f; }
.day-event-result small.pending { color: #91681c; }
.review-ready-wait {
  display: grid;
  gap: 5px;
  padding: 16px;
  text-align: center;
  color: #176b4e;
  background: #e8f8f0;
  border: 1px solid rgba(58, 185, 138, 0.4);
}
.review-ready-wait span {
  color: var(--muted);
  font-size: 0.85rem;
}
.action-waiting-panel,
.day-review-panel {
  width: min(760px, 100%);
  display: grid;
  gap: 18px;
  justify-self: center;
  padding: clamp(22px, 4vw, 38px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.action-waiting-panel {
  text-align: center;
}
.action-waiting-panel > div:not(.waiting-orb) {
  display: grid;
  gap: 9px;
}
.action-waiting-panel > div p:last-child,
.waiting-poll-note {
  color: var(--muted);
  line-height: 1.6;
}
.waiting-count {
  color: #176b4e;
  font-size: clamp(1.15rem, 3vw, 1.7rem);
}
.player-wait-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}
.player-wait-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.player-wait-list li.done span { color: #16734f; font-weight: 900; }
.player-wait-list li.pending span { color: #91681c; }
.waiting-orb {
  position: relative;
  width: 72px;
  height: 72px;
  justify-self: center;
}
.waiting-orb span {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: slowSpin 1.8s linear infinite;
}
.waiting-orb span:nth-child(2) {
  inset: 10px;
  border-top-color: var(--green);
  animation-direction: reverse;
  animation-duration: 1.3s;
}
.waiting-orb span:nth-child(3) {
  inset: 23px;
  border-color: var(--gold);
  animation: none;
}
.next-day-action {
  min-height: 50px;
  font-size: 1rem;
}
.game-shell { display: block; }
.game-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px clamp(16px, 4vw, 48px); background: rgba(255,255,255,.86); border-bottom: 1px solid var(--line); }
.game-brand { display: grid; gap: 1px; color: var(--ink); text-decoration: none; }
.game-brand strong { font-weight: 900; letter-spacing: .08em; }
.game-brand small { color: var(--muted); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
.game-header-menu { position: relative; }
.game-header-menu summary { padding: 6px 10px; list-style: none; cursor: pointer; color: var(--ink); background: white; border: 1px solid var(--line); font-size: 1.2rem; }
.game-header-menu summary::-webkit-details-marker { display: none; }
.game-header-menu > div { position: absolute; right: 0; z-index: 100; display: grid; min-width: 150px; padding: 8px; background: white; border: 1px solid var(--line); box-shadow: var(--shadow); }
.game-header-menu button { padding: 9px 10px; text-align: left; color: var(--ink); background: transparent; border: 0; }
.game-header-menu button:hover { background: var(--mist); }
.game-header-menu .menu-section-label { margin: 2px 8px 4px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.menu-audio-option { display: flex; gap: 9px; align-items: center; padding: 8px 10px; color: var(--ink); cursor: pointer; }
.menu-audio-option:hover { background: var(--mist); }
.menu-audio-option input { margin: 0; accent-color: var(--blue); }
.menu-audio-option span { font-weight: 700; }
.setup-rules-link { display: block; width: min(100%, 360px); margin: 24px auto 0; }
.setup-rules-page { align-items: flex-start; }
.setup-rules-page .rules-panel { width: min(100%, 1100px); margin-inline: auto; }
@media (max-width: 680px) {
  .room-entry-grid,
  .solo-setup-form { grid-template-columns: 1fr; }
  .room-members li,
  .day-event-list li { align-items: flex-start; flex-direction: column; }
  .setup-card { padding: 14px; }
  .setup-key-visual { min-height: 390px; }
  .setup-key-visual img { object-position: 43% center; }
  .solo-entry-card { align-items: stretch; flex-direction: column; }
  .solo-start-button { width: 100%; }
  .solo-setup-actions { flex-direction: column-reverse; }
}

.setup-title h1 {
  font-size: clamp(2rem, 6vw, 4.5rem);
}

.eyebrow,
.setup-title p,
.turn-strip p {
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
}

.setup-form,
.setup-options {
  display: grid;
  gap: 16px;
}

.setup-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

fieldset {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.check-line {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--ink);
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: white;
}

.setup-footer {
  display: grid;
  grid-template-columns: minmax(180px, 300px) auto;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.game-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: rgba(250, 254, 252, 0.9);
}

.sidebar.collapsed {
  width: 84px;
}

.sidebar.collapsed .brand-row div,
.sidebar.collapsed .side-panel,
.sidebar.collapsed .side-actions button {
  display: none;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-row h1 {
  font-size: 1.32rem;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: white;
}

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

.side-actions button,
.battle-actions button,
.inventory button,
.primary,
.secondary,
.action-card,
.game-card button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.primary {
  border-color: transparent;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.item-slot-actions {
  display: grid;
  gap: 7px;
}

.secondary {
  background: #eef5f7;
}

.side-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.feed {
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.feed p {
  padding: 10px;
  background: white;
  border: 1px solid var(--line);
}

.play-area {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  padding: 20px;
}

.top-summary,
.stage {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.top-summary {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.turn-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.turn-strip>div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
}

.turn-strip .mode-overview {
  color: white;
  background: linear-gradient(135deg, #27688d, #318f72);
  border-color: transparent;
}

.turn-strip .mode-overview p {
  color: rgba(255, 255, 255, 0.78);
}

.turn-strip .mode-difficulty {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.76rem;
  font-weight: 700;
}

.turn-strip strong {
  display: block;
  text-align: right;
  font-size: 1.35rem;
}

.turn-strip span {
  color: var(--muted);
  font-size: 0.9rem;
}

.player-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.player-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: white;
}

.profile-action-state {
  position: absolute;
  top: 10px;
  right: 52px;
  z-index: 2;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
}

.profile-action-state.done {
  color: #116342;
  background: #e4f8ee;
  border-color: rgba(58, 185, 138, 0.4);
}

.profile-action-state.pending {
  color: #775314;
  background: #fff6da;
  border-color: rgba(242, 184, 75, 0.5);
}

.player-card.self {
  animation: activePulse 1.25s ease-in-out infinite;
}

.player-head {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
}

.player-head img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--mist);
}

.player-head h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
}

.self-profile-label {
  padding: 2px 6px;
  color: #136849;
  background: #ddf7eb;
  border: 1px solid rgba(58, 185, 138, 0.42);
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 900;
}

.player-head p,
.mini-line,
.muted {
  color: var(--muted);
  font-size: 0.86rem;
}

.rank {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 34px;
  padding: 5px 8px;
  color: white;
  background: var(--blue);
  text-align: center;
  font-weight: 900;
}

.rank-a,
.rank-s {
  background: linear-gradient(135deg, var(--gold), #fff0a3);
  color: #6d4700;
  box-shadow: 0 0 22px rgba(242, 184, 75, 0.45);
}

.stage {
  min-height: 560px;
  padding: 20px;
}

.hero-band,
.spotlight,
.view-title,
.equipment-bar,
.inventory,
.material-board,
.result-panel,
.final-panel {
  margin-bottom: 18px;
}

.hero-band {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.hero-band img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: white;
  border: 1px solid var(--line);
}

.hero-band h2,
.view-title h2,
.result-panel h2,
.final-panel h2 {
  font-size: clamp(1.7rem, 4vw, 3rem);
}

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

.hub-forge-preview {
  display: grid;
  gap: 12px;
  margin-top: 36px;
  padding: 18px;
  border: 1px solid rgba(27, 155, 209, 0.2);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(234, 248, 255, 0.88));
  box-shadow: 0 14px 28px rgba(43, 104, 132, 0.09);
}

.hub-forge-preview-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.hub-forge-preview-title h3,
.hub-forge-preview-title p {
  margin: 0;
}

.hub-forge-preview-title h3 {
  font-size: 1.12rem;
}

.hub-forge-preview-title > span {
  color: var(--muted);
  font-size: 0.8rem;
}

.hub-forge-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hub-forge-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(27, 155, 209, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.hub-forge-list li.with-image {
  justify-content: start;
}

.hub-forge-list li.with-image > img {
  width: 38px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--mist);
}

.hub-forge-list li.with-image .hub-forge-materials {
  margin-left: auto;
}

.hub-forge-list .detail-token > small {
  display: none;
}

.hub-forge-list .detail-token {
  min-width: 0;
  background: white;
}

.hub-forge-materials {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 4px;
}

.hub-forge-materials .material-chip {
  min-height: 25px;
  padding: 3px 5px;
  font-size: 0.7rem;
}

.hub-forge-materials .material-chip span {
  display: none;
}

.hub-forge-materials .material-chip b {
  width: 20px;
  height: 20px;
  font-size: 0.76rem;
}

.campaign-ribbon {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  color: #704600;
  background: linear-gradient(135deg, #fff3b7, #dffcff);
  border: 1px solid rgba(240, 186, 64, 0.42);
  box-shadow: 0 10px 22px rgba(234, 177, 52, 0.16);
  animation: campaignPulse 1.8s ease-in-out infinite;
}

.campaign-ribbon b {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.campaign-ribbon span {
  font-size: 0.75rem;
}

.campaign-rank-up-thumb {
  width: 100%;
  height: 72px;
  margin-bottom: 5px;
  border-radius: 10px;
  object-fit: cover;
  object-position: center 48%;
}

.action-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 250px;
  padding: 16px;
  text-align: left;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.action-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.action-card img {
  width: 100%;
  aspect-ratio: 1.25;
  object-fit: contain;
  background: var(--mist);
  border: 1px solid var(--line);
}

.action-card span {
  font-size: 1.25rem;
}

.action-card small {
  color: var(--muted);
  line-height: 1.5;
}

.spotlight {
  padding: 14px;
  border-left: 5px solid var(--gold);
  background: rgba(255, 255, 255, 0.78);
}

.forge-spotlight {
  margin-top: 22px;
}

.quest-forge-spotlight>h3,
.quest-forge-spotlight>p {
  display: none;
}

.spotlight-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.spotlight-head h3,
.spotlight-head p {
  margin: 0;
}

.secondary.compact {
  min-width: 120px;
  padding: 8px 12px;
  font-size: 0.86rem;
}

.split {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(280px, 1fr);
  gap: 18px;
}

.feature-panel,
.list-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.deck-stack {
  position: relative;
  height: 170px;
}

.deck-stack span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 120px;
  height: 160px;
  color: white;
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  border: 4px solid white;
  box-shadow: var(--shadow);
}

.deck-stack span:nth-child(2) {
  left: 28px;
  transform: rotate(5deg);
}

.deck-stack span:nth-child(3) {
  left: 56px;
  transform: rotate(10deg);
}

.mini-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  background: white;
}

.mini-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.quest-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.quest-card,
.game-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  background: white;
}

.shop-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.shop-note strong {
  color: var(--ink);
}

.shop-card.can-buy {
  border-color: rgba(58, 185, 138, 0.5);
  background:
    radial-gradient(circle at 88% 8%, rgba(58, 185, 138, 0.16), transparent 28%),
    white;
  box-shadow: 0 14px 30px rgba(58, 185, 138, 0.12);
}

.shop-card.open-equipment-slot {
  border-color: rgba(45, 134, 214, 0.82);
  box-shadow:
    0 0 0 3px rgba(45, 134, 214, 0.14),
    0 14px 30px rgba(45, 134, 214, 0.16);
}

.shop-open-slot-note,
.shop-stat-delta {
  margin: -4px 0 0;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

.shop-open-slot-note {
  width: fit-content;
  color: #1f5f9a;
  background: rgba(222, 241, 255, 0.92);
  border: 1px solid rgba(45, 134, 214, 0.28);
}

.shop-stat-delta {
  color: #166949;
  background: rgba(225, 249, 238, 0.92);
  border: 1px solid rgba(58, 185, 138, 0.28);
}

.shop-card.cannot-buy {
  filter: saturate(0.72);
}

.quest-card img,
.game-card>img {
  width: 100%;
  aspect-ratio: 1.6;
  object-fit: cover;
  background: var(--mist);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.05);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.quest-card h3,
.game-card h3 {
  font-size: 1.15rem;
}

.quest-rank-badge {
  display: inline-grid;
  place-items: center;
  min-width: 74px;
  padding: 4px 9px;
  border-radius: 999px;
  color: white;
  background: #8fa3b3;
  box-shadow: 0 8px 18px rgba(32, 86, 110, 0.12);
}

.quest-rank-badge.rank-f {
  background: #8fa3b3;
}

.quest-rank-badge.rank-e {
  background: #4aa6c8;
}

.quest-rank-badge.rank-d {
  background: #3ab98a;
}

.quest-rank-badge.rank-c {
  background: #d99b32;
}

.quest-rank-badge.rank-b {
  background: #e97857;
}

.quest-rank-badge.rank-a,
.quest-rank-badge.rank-s {
  color: #653d00;
  background: linear-gradient(135deg, #fff6b8, #ffc94b, #fff4a3);
  box-shadow: 0 0 18px rgba(255, 204, 68, 0.45);
  animation: badgeGlow 1.8s ease-in-out infinite;
}

.quest-card.higher-rank {
  border-color: rgba(242, 184, 75, 0.58);
  background:
    radial-gradient(circle at 88% 8%, rgba(242, 184, 75, 0.18), transparent 28%),
    white;
  box-shadow: 0 18px 42px rgba(196, 137, 23, 0.13);
}

.quest-card.rare-encounter {
  border-color: rgba(111, 225, 255, 0.9);
  background:
    radial-gradient(circle at 15% 8%, rgba(255, 255, 255, 0.95), transparent 20%),
    radial-gradient(circle at 88% 16%, rgba(185, 127, 255, 0.28), transparent 32%),
    linear-gradient(145deg, rgba(236, 254, 255, 0.98), rgba(249, 240, 255, 0.98));
  box-shadow:
    0 0 0 3px rgba(111, 225, 255, 0.14),
    0 18px 42px rgba(91, 123, 215, 0.2);
  animation: rareQuestGlow 2.2s ease-in-out infinite;
}

.quest-card.rare-encounter .card-top > span {
  color: #5b3298;
  font-weight: 900;
  letter-spacing: 0.08em;
}

@keyframes rareQuestGlow {
  50% {
    box-shadow:
      0 0 0 4px rgba(184, 116, 255, 0.18),
      0 20px 48px rgba(71, 190, 230, 0.28);
  }
}

.quest-rank-note {
  padding: 8px 10px;
  border: 1px solid rgba(73, 155, 203, 0.15);
  border-radius: 14px;
  background: rgba(232, 247, 242, 0.64);
  color: var(--muted);
  font-size: 0.88rem;
}

.quest-rank-note b {
  color: #a65f00;
}

.quest-card p,
.game-card li,
.result-lines,
.final-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.game-card ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.rarity-rare {
  border-top: 5px solid var(--blue);
  box-shadow: 0 4px 12px rgba(27, 155, 209, 0.1);
}

.rarity-legend {
  border-top: 5px solid var(--green);
  box-shadow: 0 4px 12px rgba(58, 185, 138, 0.15);
}

.rarity-legendary {
  border-top: 5px solid var(--gold);
  box-shadow: 0 0 20px rgba(242, 184, 75, 0.2);
  background: linear-gradient(to bottom, #fff, #fff9f0);
}

.rarity-novice {
  border-top: 5px solid var(--green);
}

.rarity-advanced {
  border-top: 5px solid var(--blue);
}

.rarity-expert {
  border-top: 5px solid var(--red);
}

.reward-list,
.recipe,
.material-board {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gold,
.drop,
.material-chip,
.equipment-bar span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 9px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}

.gold {
  background: #fff3cf;
  color: #765300;
}

.material-chip b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: white;
  background: var(--blue);
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1rem;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.material-chip .material-icon {
  overflow: hidden;
  flex: 0 0 auto;
  padding: 2px;
}

.material-chip .material-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.material-chip.ok b {
  background: var(--green);
}

.material-chip.lack b {
  background: var(--red);
}

.material-chip em,
.drop em {
  color: var(--muted);
  font-style: normal;
}

.equipment-bar {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.equipment-bar div,
.inventory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inventory {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.inventory article {
  display: grid;
  gap: 8px;
  min-width: 210px;
  padding: 10px;
  background: white;
  border: 1px solid var(--line);
}

.inventory article div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.battle-scene {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(260px, 1fr) minmax(170px, 0.8fr);
  gap: 16px;
  align-items: stretch;
}

.combatant,
.battle-center {
  min-width: 0;
  overflow: hidden;
}

.battle-center h2 {
  overflow-wrap: anywhere;
}

.dice-row {
  max-width: 100%;
  overflow: hidden;
}

.battle-log {
  max-width: 100%;
  overflow: hidden;
}

.battle-log p {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.battle-log-line {
  min-width: 0;
}

.battle-log-line>span,
.battle-log-line strong {
  min-width: 0;
}

.battle-log-target,
.battle-log-dice,
.battle-log-hp {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1180px) {
  .battle-log-line {
    grid-template-columns: 1fr 1fr;
  }

  .battle-log-line strong {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .battle-log-line {
    grid-template-columns: 1fr;
  }
}

.combatant,
.battle-center {
  display: grid;
  gap: 12px;
  align-content: center;
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
}

.combatant-art {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  overflow: hidden;
  min-height: 220px;
  border: 1px solid var(--line);
  background: var(--mist);
}

.combatant img {
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 280px;
  object-fit: contain;
  object-position: center center;
}

.enemy .combatant-art {
  background: #eef6fb;
}

.combatant-nameplate {
  position: relative;
  grid-row: 2;
  z-index: 4;
  display: grid;
  justify-self: stretch;
  gap: 5px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 0;
  color: white;
  background: linear-gradient(180deg, rgba(7, 25, 43, 0.66), rgba(7, 25, 43, 0.9));
  backdrop-filter: blur(5px);
  box-shadow: 0 10px 24px rgba(5, 22, 37, 0.24);
}

.combatant-nameplate h3 {
  margin: 0;
  overflow: hidden;
  font-size: 1.06rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combatant-nameplate .hp {
  gap: 4px;
}

.combatant-nameplate .hp div {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
}

.combatant-nameplate .hp::after {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.2);
}

.battle-art-statuses,
.battle-impact-chips {
  position: absolute;
  top: 8px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: calc(55% - 12px);
  pointer-events: none;
}

.battle-art-statuses {
  left: 8px;
}

.battle-impact-chips {
  right: 8px;
  justify-content: flex-end;
}

.battle-art-statuses span,
.battle-impact-chips span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: white;
  background: rgba(16, 58, 79, 0.88);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.15;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.38);
  box-shadow: 0 7px 16px rgba(5, 24, 38, 0.24);
  backdrop-filter: blur(4px);
}

.battle-impact-chips span.critical {
  color: #4f2700;
  border-color: rgba(255, 248, 184, 0.94);
  background: linear-gradient(135deg, #fff7a3, #ffba43);
  text-shadow: none;
}

.battle-impact-chips span.skill {
  background: rgba(93, 44, 149, 0.9);
}

.battle-impact-chips span.effect {
  background: rgba(17, 115, 109, 0.9);
}

.battle-impact-chips span.evade {
  background: rgba(21, 118, 169, 0.92);
}

.battle-impact-chips i {
  font-size: 0.85rem;
  font-style: normal;
}

.damage-pop {
  position: absolute;
  left: 50%;
  bottom: 82px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  max-width: calc(100% - 20px);
  padding: 5px 11px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  color: white;
  text-shadow: 0 3px 0 rgba(18, 57, 82, 0.34), 0 0 14px rgba(255, 255, 255, 0.7);
  transform: translateX(-50%);
  pointer-events: none;
  animation: damagePop 0.72s cubic-bezier(0.18, 0.88, 0.28, 1.14) both;
  box-shadow: 0 10px 22px rgba(31, 128, 190, 0.24);
}

.damage-pop em,
.damage-pop span,
.damage-pop small {
  display: none;
}

.damage-pop strong {
  font-size: clamp(1.25rem, 2.8vw, 2rem);
  line-height: 0.95;
  letter-spacing: 0.03em;
}

.damage-pop.outgoing {
  background: linear-gradient(135deg, rgba(48, 159, 214, 0.96), rgba(72, 197, 170, 0.96));
}

.damage-pop.incoming {
  background: linear-gradient(135deg, rgba(48, 159, 214, 0.96), rgba(72, 197, 170, 0.96));
}

.damage-pop.critical {
  border-color: rgba(255, 244, 174, 0.98);
  background: radial-gradient(circle at 35% 25%, #fff9b1, #ff9f2f 42%, #ef4b36 100%);
  box-shadow: 0 0 0 6px rgba(255, 213, 75, 0.18), 0 18px 42px rgba(215, 100, 22, 0.34);
  animation-name: criticalDamagePop;
}

.hit-shake .combatant-art {
  animation: hitShake 0.42s ease-out both;
}

.battle-review-scene {
  position: relative;
}

.battle-review-banner {
  padding: 11px 14px;
  border: 1px solid rgba(242, 184, 75, 0.48);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 248, 209, 0.96), rgba(232, 249, 255, 0.94));
  color: #705012;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(242, 184, 75, 0.15);
}

.hp {
  display: grid;
  gap: 6px;
}

.hp div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.hp {
  position: relative;
}

.hp::after {
  content: "";
  display: block;
  height: 10px;
  background: #e4eef1;
  border: 1px solid var(--line);
}

.hp i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 10px;
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.dice-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 8px 0;
}

.die {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 2px solid var(--line);
  background: white;
  box-shadow: 0 8px 0 rgba(28, 73, 96, 0.08);
  font-size: 1.55rem;
  font-weight: 900;
}

.die.rolling {
  animation: roll 0.18s linear infinite;
}

.battle-log {
  display: grid;
  gap: 8px;
  min-height: 86px;
}

.battle-log p {
  padding: 9px;
  background: var(--paper);
  color: var(--muted);
}

.battle-log>p:not(.battle-log-line) {
  display: none;
}

.battle-log-line {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(100px, 1fr) minmax(110px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 8px;
  border-left: 4px solid var(--sky);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(73, 155, 203, 0.12);
  font-size: 0.94rem;
  line-height: 1.4;
}

.battle-log-line.incoming {
  border-left-color: var(--red);
  background: linear-gradient(90deg, rgba(255, 239, 236, 0.96), var(--paper));
}

.battle-log-line.outgoing {
  border-left-color: var(--blue);
  background: linear-gradient(90deg, rgba(231, 247, 255, 0.96), var(--paper));
}

.battle-log-line strong {
  color: #b53b2f;
  font-size: 1.14rem;
  white-space: nowrap;
}

.battle-log-target {
  color: var(--ink);
  font-weight: 900;
}

.battle-log-dice,
.battle-log-hp {
  color: var(--muted);
  font-size: 0.96rem;
}

.battle-calculation-details {
  overflow: hidden;
  border: 1px solid rgba(27, 155, 209, 0.24);
  border-radius: 14px;
  background: rgba(244, 251, 255, 0.9);
}

.battle-roll-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.battle-calculation-toggle {
  display: grid;
  grid-template-columns: auto;
  gap: 3px;
  justify-items: center;
  min-width: 66px;
  min-height: 0;
  padding: 6px 8px;
  border: 1px solid rgba(27, 155, 209, 0.3);
  border-radius: 12px;
  color: #416577;
  background: #edf8fc;
  box-shadow: none;
}

.battle-calculation-toggle > span {
  position: relative;
  display: block;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #aebfc7;
  transition: background 0.18s ease;
}

.battle-calculation-toggle > span i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(16, 51, 69, 0.3);
  transition: transform 0.18s ease;
}

.battle-calculation-toggle.is-on > span {
  background: var(--blue);
}

.battle-calculation-toggle.is-on > span i {
  transform: translateX(16px);
}

.battle-calculation-toggle small {
  color: inherit;
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.battle-calculation-details header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  color: #17566f;
  font-size: 0.94rem;
  font-weight: 900;
}

.battle-calculation-details header small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.battle-calculation-details .battle-log {
  padding: 0 10px 10px;
}

.battle-calculation-outside {
  margin-top: 12px;
}

.battle-calculation-outside:empty {
  display: none;
}

.battle-log-line>span,
.battle-log-line strong {
  min-width: 0;
}

.battle-log-target,
.battle-log-dice,
.battle-log-hp {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1180px) {
  .battle-log-line {
    grid-template-columns: 1fr 1fr;
  }

  .battle-log-line strong {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .battle-log-line {
    grid-template-columns: 1fr;
  }
}

.battle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.battle-turn-waiting {
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid rgba(27, 155, 209, 0.28);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(235, 249, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.battle-turn-waiting div {
  display: grid;
  gap: 3px;
}

.battle-turn-waiting strong {
  color: #075b7f;
}

.battle-turn-waiting small {
  color: var(--muted);
}

.battle-turn-waiting-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 0 rgba(27, 155, 209, 0.42);
  animation: battleTurnWaitingPulse 1.5s ease-out infinite;
}

.arena-panel {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid rgba(120, 82, 190, 0.22);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(250, 247, 255, 0.98), rgba(238, 249, 255, 0.98));
}

.arena-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.arena-heading > strong {
  padding: 8px 14px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #7650c4, #298eb6);
}

.arena-speed-order {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.arena-speed-order > span {
  display: grid;
  grid-template-columns: auto 44px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.arena-speed-order > span > b {
  grid-row: 1 / 3;
  font-size: 1.25rem;
}

.arena-speed-order img {
  grid-row: 1 / 3;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
}

.arena-speed-order em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.arena-combatants > span.active {
  border-color: #7650c4;
  box-shadow: 0 0 0 3px rgba(118, 80, 196, 0.13);
}

.arena-combatants > span.defeated {
  opacity: 0.42;
  filter: grayscale(1);
}

.arena-controls {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.arena-controls > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.arena-controls h3 {
  width: 100%;
}

.arena-targets {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.arena-targets h3 {
  grid-column: 1 / -1;
}

.arena-target {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
}

.arena-target img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
}

.arena-target span {
  display: grid;
}

.arena-last-attack {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(118, 80, 196, 0.09);
}

.arena-winner {
  justify-items: center;
  text-align: center;
}

.arena-winner > img,
.arena-champion-profile > img {
  width: min(220px, 55vw);
  aspect-ratio: 1;
  border-radius: 26px;
  object-fit: cover;
}

.arena-champion-result {
  position: relative;
  overflow: hidden;
  border-color: rgba(220, 164, 38, 0.48);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 239, 154, 0.68), transparent 32%),
    linear-gradient(145deg, rgba(255, 253, 241, 0.98), rgba(235, 246, 255, 0.98));
  box-shadow: 0 30px 80px rgba(156, 104, 20, 0.22);
}

.arena-champion-visual {
  position: relative;
  width: 100%;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  border: 1px solid rgba(222, 172, 52, 0.42);
}

.arena-champion-visual > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.arena-champion-visual figcaption {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 3px;
  padding: 24px 18px 16px;
  color: #fff;
  background: linear-gradient(transparent, rgba(20, 30, 58, 0.88));
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}

.arena-champion-visual figcaption span {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.arena-champion-visual figcaption strong {
  font-size: clamp(1.35rem, 4vw, 2.45rem);
}

.arena-champion-profile {
  position: relative;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  width: min(720px, 100%);
  padding: 16px;
  border: 1px solid rgba(222, 172, 52, 0.42);
  border-radius: 24px;
  text-align: left;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 46px rgba(127, 86, 14, 0.16);
}

.arena-champion-profile > img {
  width: 116px;
  border-radius: 22px;
}

.arena-champion-profile h2,
.arena-champion-profile p {
  margin: 0;
}

.arena-champion-crown {
  position: absolute;
  z-index: 2;
  left: 50px;
  top: -24px;
  color: #e2a91f;
  font-size: 2.6rem;
  filter: drop-shadow(0 4px 5px rgba(83, 55, 0, 0.24));
}

.arena-final-standings {
  display: grid;
  gap: 12px;
  width: min(760px, 100%);
  padding: 18px;
  border: 1px solid rgba(118, 80, 196, 0.22);
  border-radius: 20px;
  text-align: left;
  background: rgba(255, 255, 255, 0.82);
}

.arena-final-standings ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.arena-final-standings li {
  display: grid;
  grid-template-columns: 58px 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.arena-final-standings li.champion {
  border-color: rgba(222, 172, 52, 0.56);
  background: linear-gradient(135deg, #fffbe7, #fff2b9);
}

.arena-final-standings li > b {
  color: #7650c4;
  font-size: 1.05rem;
}

.arena-final-standings li > img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}

.arena-final-standings li > span {
  display: grid;
}

.arena-final-standings small {
  color: var(--muted);
}

.arena-match-finish {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 7px;
  width: min(680px, 100%);
  margin-inline: auto;
  padding: 16px;
  border: 1px solid rgba(222, 172, 52, 0.46);
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 251, 229, 0.98), rgba(238, 248, 255, 0.98));
}

.arena-match-finish h3,
.arena-match-finish p {
  margin: 0;
}

.arena-result-confirm {
  margin-top: 8px;
}

.arena-bracket {
  display: grid;
  gap: 12px;
  padding: clamp(14px, 3vw, 22px);
  border: 1px solid rgba(118, 80, 196, 0.24);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(244, 241, 255, 0.9));
}

.arena-bracket-title h3,
.arena-bracket-title p {
  margin: 0;
}

.arena-seeds,
.arena-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 9px;
}

.arena-seeds > span,
.arena-results > span {
  display: grid;
  grid-template-columns: auto 38px minmax(0, 1fr);
  gap: 2px 9px;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.arena-seeds img {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
}

.arena-seeds > span > b {
  grid-row: 1 / 3;
  color: #7650c4;
}

.arena-seeds small {
  color: var(--muted);
}

.arena-results > span {
  grid-template-columns: 1fr;
}

.arena-results small,
.arena-results em {
  color: var(--muted);
  font-style: normal;
}

.arena-initiative {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  text-align: center;
}

.arena-initiative > span {
  font-weight: 800;
  color: #7650c4;
}

.arena-initiative small {
  color: var(--muted);
}

.arena-battle-actions {
  margin-top: 14px;
}

.shared-party-hp-lane {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.shared-party-hp-lane article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(73, 155, 203, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
}

.shared-party-hp-lane article.active {
  border-color: rgba(27, 155, 209, 0.62);
  box-shadow: 0 0 0 3px rgba(27, 155, 209, 0.12);
}

.shared-party-hp-lane article.down {
  opacity: 0.68;
  filter: grayscale(0.55);
}

.shared-party-hp-lane img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
}

.shared-party-hp-lane div {
  display: grid;
  gap: 3px;
}

.shared-party-hp-lane small {
  color: var(--muted);
}

.shared-party-hp-lane span {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(36, 81, 106, 0.14);
}

.shared-party-hp-lane i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2ec4b6, #7bd88f);
}

.demon-damage-report {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(194, 54, 46, 0.28);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 244, 241, 0.98), rgba(255, 250, 245, 0.98));
}

.demon-damage-targets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.demon-damage-targets article {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(194, 54, 46, 0.2);
  border-radius: 12px;
  background: white;
}

.demon-damage-targets img {
  grid-row: 1 / 3;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}

.demon-damage-targets article > div {
  display: grid;
}

.demon-damage-targets article > div span {
  color: #b3362e;
  font-weight: 900;
}

.demon-damage-targets article > em {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.demon-damage-targets article > b {
  color: #b3362e;
  font-size: 0.72rem;
}

.demon-damage-targets article.defeated {
  border-color: rgba(94, 36, 32, 0.42);
  background: #f3e8e6;
}

@keyframes battleTurnWaitingPulse {
  70% {
    box-shadow: 0 0 0 10px rgba(27, 155, 209, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(27, 155, 209, 0);
  }
}

.combat-condition-lane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(27, 155, 209, 0.25);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(235, 249, 255, 0.94), rgba(255, 250, 235, 0.94));
}

.combat-condition-lane > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  align-items: center;
  font-size: 0.86rem;
}

.combat-condition-lane > div:last-child {
  justify-content: end;
  text-align: right;
}

.combat-condition-lane strong {
  padding: 5px 8px;
  border-radius: 999px;
  color: #765000;
  background: #fff2ba;
  font-size: 0.82rem;
  white-space: nowrap;
}

.combat-condition-lane em {
  color: var(--muted);
  font-style: normal;
}

.rules-panel {
  display: grid;
  gap: 16px;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.rules-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
}

.rules-grid h3,
.rules-grid p {
  margin: 0;
}

.rules-grid p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.battle-actions button {
  min-width: 130px;
  font-size: 1rem;
}

.battle-review-next {
  min-width: min(360px, 100%);
  margin-inline: auto;
  padding-block: 14px;
  font-size: 1.05rem;
  box-shadow: 0 18px 36px rgba(27, 155, 209, 0.2);
}

.battle-skill-button {
  position: relative;
  overflow: visible;
  display: grid;
  gap: 2px;
  text-align: left;
}

.battle-skill-name {
  font-weight: 900;
}

.battle-skill-use {
  color: inherit;
  font-size: 0.72rem;
  opacity: 0.78;
}

.battle-skill-button em {
  max-width: 210px;
  overflow: hidden;
  color: inherit;
  font-size: 0.8rem;
  font-style: normal;
  opacity: 0.8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-skill-button .detail-token {
  background: transparent;
  border-color: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.battle-skill-button .detail-token small {
  display: none;
}

.battle-skill-button .detail-popover {
  text-align: left;
}

.battle-actions button[data-battle-action="flee"] {
  border-color: rgba(233, 111, 95, 0.55);
  color: #9d2d22;
  background: linear-gradient(180deg, #fff1ef, #ffd9d3);
  box-shadow: 0 10px 22px rgba(233, 111, 95, 0.18);
}

.battle-actions button[data-battle-action="flee"] {
  font-size: 0;
}

.battle-actions button[data-battle-action="flee"]::after {
  content: "逃走";
  font-size: 1rem;
  font-weight: 900;
}

.battle-actions button[data-battle-action="flee"]:hover {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(233, 111, 95, 0.16);
}

.battle-actions.final-boss-actions button[data-battle-action="flee"] {
  display: none;
}

.result-panel,
.final-panel {
  display: grid;
  gap: 18px;
  max-width: 820px;
}

.result-player-summary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  padding: 10px 14px;
  background: white;
  border: 1px solid var(--line);
}

.result-player-summary img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--mist);
}

.result-player-summary div {
  display: grid;
  gap: 2px;
}

.result-player-summary span {
  color: var(--muted);
  font-size: 0.72rem;
}

.result-player-summary strong {
  font-size: 1rem;
}

.final-panel pre {
  overflow: auto;
  max-height: 320px;
  padding: 12px;
  background: #102333;
  color: #dff8ef;
}

.ending-panel {
  position: relative;
  display: grid;
  gap: 24px;
  width: min(1120px, 100%);
  overflow: hidden;
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid rgba(242, 184, 75, 0.42);
  border-radius: 34px;
  background:
    radial-gradient(circle at 20% 8%, rgba(255, 246, 185, 0.95), transparent 28%),
    radial-gradient(circle at 86% 10%, rgba(139, 221, 255, 0.58), transparent 26%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(232, 249, 255, 0.9) 45%, rgba(255, 241, 196, 0.92));
  box-shadow: 0 34px 90px rgba(56, 112, 152, 0.24);
}

.demon-clear::before {
  content: "";
  position: absolute;
  inset: -28% -12% auto;
  height: 360px;
  background: conic-gradient(from 180deg, rgba(255, 210, 88, 0.32), rgba(85, 190, 224, 0.18), rgba(255, 255, 255, 0), rgba(255, 210, 88, 0.32));
  filter: blur(8px);
  animation: slowSpin 14s linear infinite;
}

.demon-clear {
  background:
    radial-gradient(circle at 50% 2%, rgba(255, 255, 225, 0.98), transparent 24%),
    radial-gradient(circle at 20% 8%, rgba(255, 246, 185, 0.95), transparent 28%),
    radial-gradient(circle at 86% 10%, rgba(139, 221, 255, 0.62), transparent 26%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(226, 250, 255, 0.9) 45%, rgba(255, 242, 195, 0.94));
}

.world-clear-sigil {
  position: absolute;
  inset: 16px 0 auto;
  z-index: 0;
  display: grid;
  place-items: center;
  height: 240px;
  pointer-events: none;
}

.world-clear-sigil span {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(242, 184, 75, 0.42);
  box-shadow: 0 0 36px rgba(255, 213, 77, 0.22);
  animation: slowSpin 18s linear infinite;
}

.world-clear-sigil span:nth-child(1) {
  width: 180px;
  height: 180px;
}

.world-clear-sigil span:nth-child(2) {
  width: 250px;
  height: 86px;
  animation-duration: 13s;
}

.world-clear-sigil span:nth-child(3) {
  width: 310px;
  height: 112px;
  border-color: rgba(73, 155, 209, 0.28);
  animation-direction: reverse;
}

.clear-epilogue {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  justify-self: center;
  width: min(720px, 100%);
  padding: 18px 22px;
  border: 1px solid rgba(242, 184, 75, 0.34);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
  color: #5d6e76;
  text-align: center;
  box-shadow: 0 18px 42px rgba(242, 184, 75, 0.16);
}

.clear-epilogue b {
  color: #a65f00;
  font-size: 1.15rem;
}

.ending-hero,
.ending-score,
.ending-party,
.ending-timeline,
.ending-roll,
.ending-panel>button {
  position: relative;
  z-index: 1;
}

.ending-peace-visual {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 3 / 1.55;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  background: #dff4ff;
  box-shadow: 0 22px 54px rgba(55, 133, 175, 0.2);
}

.ending-peace-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ending-hero {
  display: grid;
  gap: 10px;
  text-align: center;
}

.ending-hero h2 {
  font-size: clamp(2.2rem, 7vw, 5.4rem);
  letter-spacing: 0.08em;
  color: #b56c00;
  text-shadow: 0 4px 0 rgba(255, 255, 255, 0.86), 0 18px 32px rgba(197, 119, 0, 0.2);
}

.ending-hero p {
  max-width: 780px;
  margin: 0 auto;
  color: #486473;
  font-size: 1.05rem;
  line-height: 1.85;
}

.ending-score {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
}

.ending-score span,
.ending-stat-grid span {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(73, 155, 203, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}

.ending-score b,
.ending-stat-grid b {
  color: var(--ink);
  font-size: 1.1rem;
}

.ending-party {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 16px;
}

.ending-adventurer {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(73, 155, 203, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 40px rgba(52, 103, 139, 0.13);
}

.ending-adventurer-head {
  display: flex;
  align-items: center;
  gap: 13px;
}

.ending-adventurer-head img {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  background: linear-gradient(145deg, #e6fbff, #fff1bc);
  box-shadow: inset 0 0 0 1px rgba(73, 155, 203, 0.18);
}

.rank-badge {
  display: inline-grid;
  min-width: 32px;
  place-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  color: white;
  background: #8fa3b3;
  font-weight: 900;
}

.rank-badge.rank-a,
.rank-badge.rank-s {
  color: #653d00;
  background: linear-gradient(135deg, #fff6b8, #ffc94b, #fff4a3);
  box-shadow: 0 0 18px rgba(255, 204, 68, 0.65);
  animation: badgeGlow 1.8s ease-in-out infinite;
}

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

.ending-loadout {
  display: grid;
  gap: 6px;
}

.ending-loadout p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ending-record {
  color: var(--muted);
  font-weight: 800;
}

.ending-timeline {
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(16, 35, 51, 0.86);
  color: #ecfbff;
  box-shadow: 0 22px 45px rgba(16, 35, 51, 0.18);
}

.ending-timeline h3 {
  font-size: 1.45rem;
}

.ending-timeline p {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.ending-timeline span {
  color: #c9eaf3;
  text-align: right;
}

.ending-roll {
  display: grid;
  gap: 8px;
  min-height: 170px;
  place-items: center;
  overflow: hidden;
  color: #5b7180;
  text-align: center;
}

.ending-roll p {
  margin-top: 14px;
  color: #a65f00;
  font-weight: 1000;
  letter-spacing: 0.22em;
}

.ending-roll span {
  animation: creditRise 7s ease-in-out infinite alternate;
}

.defeat-panel {
  border-color: rgba(60, 73, 88, 0.25);
  background: linear-gradient(145deg, #f8fbff, #e9eef6);
}

.demon-arrival {
  position: relative;
  display: grid;
  gap: 24px;
  place-items: center;
  min-height: 680px;
  overflow: hidden;
  padding: clamp(24px, 5vw, 56px);
  border: 1px solid rgba(70, 35, 80, 0.38);
  border-radius: 34px;
  color: #f6fbff;
  text-align: center;
  background:
    radial-gradient(circle at 50% 12%, rgba(220, 77, 255, 0.32), transparent 26%),
    radial-gradient(circle at 50% 52%, rgba(255, 84, 84, 0.22), transparent 32%),
    linear-gradient(145deg, #111927, #1c1d35 48%, #32182f);
  box-shadow: 0 36px 90px rgba(24, 20, 39, 0.42);
}

.final-campfire {
  display: grid;
  gap: 22px;
  padding: clamp(18px, 4vw, 42px);
  overflow: hidden;
  border: 1px solid rgba(234, 166, 91, 0.38);
  border-radius: 32px;
  color: #fff7e8;
  background:
    radial-gradient(circle at 50% 22%, rgba(233, 113, 49, 0.2), transparent 35%),
    linear-gradient(145deg, #111827, #201a24 55%, #291811);
  box-shadow: 0 30px 80px rgba(16, 12, 16, 0.42);
}

.final-campfire-visual {
  position: relative;
  width: min(980px, 100%);
  margin: 0 auto;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  border: 1px solid rgba(255, 197, 126, 0.48);
  border-radius: 26px;
  background: #120e13;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.46), 0 0 42px rgba(255, 118, 45, 0.16);
}

.final-campfire-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.final-campfire-visual figcaption {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 3px;
  padding: 34px 22px 18px;
  color: white;
  text-align: center;
  background: linear-gradient(transparent, rgba(11, 8, 12, 0.88));
}

.final-campfire-visual figcaption span {
  color: #ffc879;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.final-campfire-visual figcaption strong { font-size: clamp(1.45rem, 4vw, 2.4rem); }
.final-campfire-copy { display: grid; gap: 10px; max-width: 780px; margin: 0 auto; text-align: center; }
.final-campfire-copy .eyebrow { color: #ffc879; }
.final-campfire-copy h2 { color: #fff1d7; font-size: clamp(1.6rem, 5vw, 2.8rem); }
.final-campfire-copy p { color: #d9d2ca; line-height: 1.75; }

.campfire-party-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.campfire-party-status article {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.campfire-party-status article.ready { border-color: rgba(112, 226, 167, 0.5); background: rgba(54, 151, 103, 0.14); }
.campfire-party-status img { width: 52px; height: 52px; object-fit: cover; border-radius: 14px; }
.campfire-party-status span { display: grid; gap: 2px; }
.campfire-party-status small { color: #c7bfb6; }
.campfire-party-status .ready small { color: #8ce0b4; }

.campfire-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.campfire-actions button {
  display: grid;
  gap: 7px;
  min-height: 112px;
  padding: 20px;
  color: #fff4df;
  border: 1px solid rgba(255, 190, 105, 0.42);
  background: linear-gradient(145deg, rgba(126, 67, 38, 0.56), rgba(64, 46, 55, 0.78));
}

.campfire-actions span { font-size: 1.15rem; font-weight: 900; }
.campfire-actions small { color: #dacfc4; line-height: 1.5; }
.campfire-action-grid { width: 100%; }
.campfire-action-grid .action-card { text-align: left; }
.campfire-action-grid .action-card small { color: var(--muted); }
.campfire-resources { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.campfire-resources > b { padding: 7px 12px; color: #ffdb8b; border-radius: 999px; background: rgba(255, 201, 102, 0.12); }
.campfire-resources .material-chip,
.campfire-resources .material-chip span,
.campfire-resources .material-chip em { color: #172033; text-shadow: none; }
.campfire-ready-button { justify-self: center; min-width: min(360px, 100%); }

.party-event-panel {
  display: grid;
  gap: 20px;
  padding: clamp(16px, 4vw, 34px);
  overflow: hidden;
  border: 1px solid rgba(65, 132, 163, 0.36);
  border-radius: 30px;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 211, 107, 0.22), transparent 30%),
    linear-gradient(145deg, #eff9ff, #f7f2e6 58%, #e7f4ef);
  box-shadow: 0 28px 70px rgba(24, 83, 104, 0.2);
}

.party-event-visual {
  position: relative;
  width: min(980px, 100%);
  margin: 0 auto;
  overflow: hidden;
  aspect-ratio: 16 / 7;
  border: 1px solid rgba(255, 219, 139, 0.62);
  border-radius: 24px;
  background: #163044;
  box-shadow: 0 20px 48px rgba(20, 67, 86, 0.25);
}

.party-event-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.party-event-visual figcaption {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 2px;
  padding: 34px 20px 16px;
  color: white;
  text-align: center;
  background: linear-gradient(transparent, rgba(9, 35, 51, 0.88));
}

.party-event-visual figcaption span {
  color: #ffe09a;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.party-event-visual figcaption strong {
  font-size: clamp(1.45rem, 4vw, 2.35rem);
}

.party-event-copy {
  display: grid;
  gap: 7px;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.party-event-copy h2,
.party-event-copy p {
  margin: 0;
}

.party-event-copy p:last-child {
  color: var(--muted);
  line-height: 1.7;
}

.party-quest-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.party-quest-option {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  align-content: start;
  padding: 13px;
  border: 1px solid rgba(39, 116, 151, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.party-quest-option.selected {
  border-color: #2d9e79;
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(45, 158, 121, 0.2);
}

.party-quest-option > .rank-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}

.party-quest-option > img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 14px;
  background: var(--mist);
}

.party-quest-option h3,
.party-quest-option p {
  margin: 0;
}

.party-quest-option p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.party-quest-option ul {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.78rem;
}

.party-quest-option button {
  grid-column: 1 / -1;
}

.party-quest-option > strong {
  position: absolute;
  top: 10px;
  right: 12px;
  color: #17604b;
  font-size: 0.76rem;
}

.party-vote-status {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid rgba(39, 116, 151, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.party-vote-status h3 {
  margin: 0;
}

.party-vote-status > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.party-vote-status span {
  display: grid;
  grid-template-columns: 34px auto;
  gap: 0 8px;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.party-vote-status span.done {
  border-color: rgba(45, 158, 121, 0.4);
  background: #effbf6;
}

.party-vote-status img {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
}

.party-vote-status small {
  color: var(--muted);
}

.party-event-waiting {
  justify-items: center;
  text-align: center;
}

.party-event-waiting > div {
  display: grid;
  gap: 7px;
}

.party-reward-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.party-reward-grid article {
  display: grid;
  gap: 5px;
  padding: 15px;
  border: 1px solid rgba(39, 116, 151, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
}

.party-reward-grid span,
.party-reward-grid small {
  color: var(--muted);
}

.party-loot-choice {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(224, 174, 37, 0.48);
  border-radius: 18px;
  background: rgba(255, 250, 218, 0.92);
}

.party-loot-choice > article {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.party-loot-choice > article > img {
  width: 86px;
  height: 86px;
  object-fit: contain;
  border-radius: 13px;
  background: white;
}

.party-loot-choice > article > div {
  display: grid;
  gap: 4px;
}

.party-loot-choice .loot-slot-choices {
  grid-column: 1 / -1;
}

.party-loot-equipped {
  color: #17604b;
  font-weight: 900;
}

.party-loot-keep-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.party-result-continue {
  justify-self: center;
  width: min(100%, 380px);
}

.campfire-waiting {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border: 1px solid rgba(112, 226, 167, 0.3);
  border-radius: 18px;
  color: #baf0d2;
  background: rgba(54, 151, 103, 0.12);
}

.campfire-waiting i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #79dda8;
  box-shadow: 0 0 20px #79dda8;
  animation: waitingPulse 1.4s ease-in-out infinite;
}

@keyframes waitingPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.12); }
}

.reward-list .rank-bonus {
  color: #704700;
  border-color: rgba(220, 154, 38, 0.48);
  background: linear-gradient(135deg, #fff5c9, #ffd87b);
}

.rank-bonus-images {
  display: inline-flex;
  margin-right: 2px;
}

.rank-bonus-images img {
  width: 28px;
  height: 28px;
  margin-right: -7px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(70, 42, 0, 0.24));
}

.demon-arrival::before,
.demon-arrival::after {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
}

.demon-arrival::before {
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 28px);
  animation: stormDrift 7s linear infinite;
}

.demon-arrival::after {
  background: radial-gradient(circle at 50% 50%, transparent 0 38%, rgba(0, 0, 0, 0.48) 72%);
}

.demon-rift,
.demon-arrival-visual,
.demon-arrival-copy,
.demon-party-line,
.demon-auto-start,
.demon-arrival>button {
  position: relative;
  z-index: 1;
}

.demon-arrival-visual {
  width: min(956px, calc(100% - 24px));
  margin: 0 auto;
  overflow: hidden;
  aspect-ratio: 3 / 1.7;
  border: 1px solid rgba(255, 184, 128, 0.38);
  border-radius: 28px;
  background: #160e1b;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48), 0 0 52px rgba(255, 66, 66, 0.18);
}

.demon-arrival-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demon-rift {
  width: min(420px, 80vw);
  height: 260px;
}

.rift-core,
.rift-ring,
.demon-silhouette {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.rift-core {
  width: 112px;
  height: 248px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff4c2, #ff4f6b 42%, #53205f);
  filter: blur(0.4px);
  box-shadow: 0 0 38px rgba(255, 94, 108, 0.8), 0 0 110px rgba(166, 61, 255, 0.62);
  animation: riftPulse 1.6s ease-in-out infinite;
}

.rift-ring {
  border: 2px solid rgba(255, 210, 112, 0.62);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(255, 116, 116, 0.32);
}

.ring-a {
  width: 250px;
  height: 88px;
  animation: slowSpin 10s linear infinite;
}

.ring-b {
  width: 310px;
  height: 112px;
  border-color: rgba(151, 222, 255, 0.36);
  animation: slowSpin 14s linear reverse infinite;
}

.demon-silhouette {
  top: 60%;
  width: 142px;
  height: 168px;
  border-radius: 64px 64px 22px 22px;
  background: linear-gradient(180deg, #05060b, #16101f);
  clip-path: polygon(14% 18%, 33% 30%, 39% 0, 50% 22%, 61% 0, 67% 30%, 86% 18%, 75% 50%, 82% 100%, 18% 100%, 25% 50%);
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.58);
  animation: demonRise 2.4s ease both;
}

.demon-arrival-copy {
  display: grid;
  gap: 12px;
  max-width: 820px;
}

.demon-arrival-copy .eyebrow {
  color: #ffd977;
}

.demon-arrival-copy h2 {
  font-size: clamp(3rem, 9vw, 7rem);
  letter-spacing: 0.16em;
  color: #fff1b8;
  text-shadow: 0 0 20px rgba(255, 80, 96, 0.72), 0 10px 34px rgba(0, 0, 0, 0.65);
}

.demon-arrival-copy p {
  color: #dbe8f0;
  line-height: 1.85;
}

.demon-party-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.demon-party-line span {
  display: grid;
  grid-template-columns: 52px auto;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
  min-width: 190px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  text-align: left;
}

.demon-party-line img {
  grid-row: 1 / span 2;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
}

.demon-party-line small {
  color: #bdd0dc;
}

.demon-auto-start {
  display: grid;
  gap: 8px;
  width: min(420px, 88vw);
  color: #ffdfa1;
  font-weight: 900;
}

.demon-auto-start i {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.demon-auto-start i::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffdf75, #ff6678, #b765ff);
  animation: autoStartBar 3.6s linear both;
}

.demon-defeat {
  border-color: rgba(56, 64, 86, 0.44);
  background:
    radial-gradient(circle at 50% 0%, rgba(112, 78, 170, 0.32), transparent 34%),
    linear-gradient(145deg, #eef3fa, #dce3ed 46%, #cfd6e2);
}

.demon-defeat::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 44%, rgba(54, 63, 79, 0.12) 44% 45%, transparent 45%),
    linear-gradient(68deg, transparent 0 58%, rgba(54, 63, 79, 0.14) 58% 59%, transparent 59%);
  pointer-events: none;
}

.defeat-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.72;
}

.defeat-sky span {
  position: absolute;
  width: 2px;
  height: 180px;
  background: linear-gradient(180deg, transparent, rgba(73, 84, 105, 0.72), transparent);
  animation: ashFall 3.4s linear infinite;
}

.defeat-sky span:nth-child(1) {
  left: 18%;
}

.defeat-sky span:nth-child(2) {
  left: 52%;
  animation-delay: 0.8s;
}

.defeat-sky span:nth-child(3) {
  left: 82%;
  animation-delay: 1.6s;
}

.defeat-hero h2 {
  color: #3e485b;
  text-shadow: 0 5px 0 rgba(255, 255, 255, 0.54), 0 18px 36px rgba(37, 44, 60, 0.24);
}

.defeat-score span {
  border-color: rgba(72, 83, 104, 0.2);
  background: rgba(255, 255, 255, 0.56);
}

.defeat-score b {
  color: #3e485b;
}

.defeat-party .ending-adventurer {
  filter: saturate(0.78);
}

.defeat-timeline {
  background: rgba(34, 40, 54, 0.9);
}

.daybreak-panel {
  display: grid;
  gap: 22px;
  place-items: center;
  min-height: 560px;
  padding: clamp(22px, 5vw, 56px);
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(242, 184, 75, 0.35);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 240, 163, 0.95), transparent 28%),
    linear-gradient(180deg, #e1f5ff 0%, #f8fbf8 58%, #e7f6ef 100%);
  box-shadow: var(--shadow);
}

.paper-scene {
  position: relative;
  width: min(620px, 100%);
  height: 260px;
  filter: drop-shadow(0 18px 28px rgba(32, 86, 110, 0.14));
  animation: paperSlideIn 780ms cubic-bezier(.2, .8, .2, 1) both;
}

.paper-scene span {
  position: absolute;
  display: block;
}

.paper-sun {
  top: 18px;
  left: 50%;
  width: 112px;
  height: 112px;
  border-radius: 999px;
  background: radial-gradient(circle, #fff6b8, #f2b84b);
  transform: translateX(-50%);
  box-shadow: 0 0 46px rgba(242, 184, 75, 0.38);
}

.paper-mountain {
  bottom: 42px;
  width: 58%;
  height: 138px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(145deg, #83c9bf, #3ab98a);
}

.mountain-a {
  left: 2%;
}

.mountain-b {
  right: 0;
  height: 108px;
  background: linear-gradient(145deg, #9ed8e7, #1b9bd1);
}

.paper-hero {
  right: 14%;
  bottom: 36px;
  width: 64px;
  height: 96px;
  border-radius: 28px 28px 10px 10px;
  background: linear-gradient(180deg, #ffffff, #7a77d9);
  animation: heroStep 1.4s ease-in-out infinite alternate;
}

.paper-hero::before {
  content: "";
  position: absolute;
  top: -34px;
  left: 16px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #ffd7ae;
}

.daybreak-copy {
  display: grid;
  gap: 10px;
  max-width: 720px;
  animation: fadeUp 700ms ease 180ms both;
}

.daybreak-copy h2 {
  font-size: clamp(2rem, 6vw, 4.2rem);
}

.daybreak-next {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  align-items: center;
  width: min(560px, 100%);
  padding: 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  animation: fadeUp 700ms ease 320ms both;
}

.daybreak-next img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: var(--mist);
  border: 1px solid var(--line);
}

.daybreak-next span,
.daybreak-next small {
  display: block;
  color: var(--muted);
}

.daybreak-next strong {
  display: block;
  font-size: 1.35rem;
}

.daybreak-next b {
  color: #a65f00;
  font-size: 1.25rem;
}

.reincarnation-panel {
  position: relative;
  display: grid;
  gap: 28px;
  place-items: center;
  min-height: 650px;
  overflow: hidden;
  padding: clamp(24px, 5vw, 56px);
  border: 1px solid rgba(73, 155, 203, 0.22);
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 249, 184, 0.92), transparent 24%),
    radial-gradient(circle at 12% 18%, rgba(150, 226, 255, 0.52), transparent 28%),
    radial-gradient(circle at 86% 24%, rgba(255, 211, 128, 0.45), transparent 25%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(230, 249, 255, 0.92));
  box-shadow: 0 34px 90px rgba(56, 112, 152, 0.18);
}

.reincarnation-aura {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.reincarnation-aura span {
  position: absolute;
  left: 50%;
  top: 24%;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(242, 184, 75, 0.32);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: blessingSpin 18s linear infinite;
}

.reincarnation-aura span:nth-child(2) {
  width: 420px;
  height: 120px;
  border-color: rgba(27, 155, 209, 0.24);
  animation-duration: 13s;
}

.reincarnation-aura span:nth-child(3) {
  width: 520px;
  height: 160px;
  border-color: rgba(122, 119, 217, 0.2);
  animation-direction: reverse;
}

.reincarnation-story,
.reincarnation-visual,
.reincarnation-title,
.reincarnation-grid,
.reincarnation-start {
  position: relative;
  z-index: 1;
}

.reincarnation-visual {
  width: min(100%, 980px);
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 214, 117, 0.55);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 24px 58px rgba(70, 117, 162, 0.18);
}

.reincarnation-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
}

.reincarnation-story {
  display: grid;
  gap: 10px;
  max-width: 860px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(73, 155, 203, 0.18);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  box-shadow: 0 18px 42px rgba(32, 86, 110, 0.12);
}

.reincarnation-story h2 {
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  color: #24516a;
}

.reincarnation-story p:not(.eyebrow) {
  color: #486473;
  line-height: 1.85;
}

.reincarnation-title {
  display: grid;
  gap: 10px;
  max-width: 760px;
  text-align: center;
}

.reincarnation-title h2 {
  font-size: clamp(2.2rem, 7vw, 5.2rem);
  color: #b56c00;
  text-shadow: 0 4px 0 rgba(255, 255, 255, 0.82), 0 18px 32px rgba(197, 119, 0, 0.17);
}

.reincarnation-title p:last-child {
  color: #486473;
  line-height: 1.8;
}

.reincarnation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  width: 100%;
}

.reincarnation-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(73, 155, 203, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 42px rgba(32, 86, 110, 0.13);
  animation: blessingCardIn 700ms cubic-bezier(0.2, 0.86, 0.22, 1.18) both;
  animation-delay: var(--delay);
}

.reincarnation-owner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reincarnation-owner img {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--mist);
  box-shadow: inset 0 0 0 1px rgba(73, 155, 203, 0.18);
}

.reincarnation-owner b,
.reincarnation-owner small {
  display: block;
}

.reincarnation-owner small {
  color: var(--muted);
}

.reincarnation-skill-card {
  position: relative;
  display: grid;
  gap: 9px;
  min-height: 250px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(242, 184, 75, 0.4);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 245, 177, 0.94), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 251, 255, 0.9));
}

.skill-orb {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #fff, #ffe28a 38%, #6bcaf0 72%, #7a77d9);
  box-shadow: 0 0 32px rgba(242, 184, 75, 0.45);
  animation: orbFloat 2.3s ease-in-out infinite alternate;
}

.reincarnation-skill-card p {
  color: var(--blue);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-align: center;
}

.reincarnation-skill-card h3 {
  color: var(--ink);
  font-size: 1.45rem;
  text-align: center;
}

.reincarnation-skill-card em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.55;
}

.reincarnation-skill-card ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
}

.reincarnation-start {
  min-width: min(320px, 100%);
  min-height: 52px;
  font-size: 1.08rem;
}

.job-upgrade-panel {
  position: relative;
  display: grid;
  gap: 18px;
  overflow: hidden;
  padding: 28px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.92), transparent 28%),
    radial-gradient(circle at 88% 4%, rgba(171, 232, 255, 0.58), transparent 30%),
    linear-gradient(135deg, #f7fcff, #edf8f3 58%, #fff8e8);
  border: 1px solid rgba(72, 173, 190, 0.25);
  box-shadow: var(--shadow);
}

.upgrade-constellation {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.upgrade-constellation span {
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 217, 104, 0.32), transparent 68%);
  animation: auraFloat 4.8s ease-in-out infinite;
}

.upgrade-constellation span:nth-child(1) {
  top: -42px;
  left: 8%;
}

.upgrade-constellation span:nth-child(2) {
  right: 12%;
  top: 10%;
  animation-delay: 0.8s;
}

.upgrade-constellation span:nth-child(3) {
  right: 38%;
  bottom: -64px;
  animation-delay: 1.4s;
}

.upgrade-copy,
.upgrade-current,
.upgrade-grid {
  position: relative;
  z-index: 1;
}

.upgrade-copy h2 {
  margin: 4px 0 8px;
  color: var(--ink);
  font-size: clamp(1.6rem, 4vw, 2.7rem);
}

.upgrade-current {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.upgrade-current img {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
}

.upgrade-current span,
.upgrade-current small {
  display: block;
  color: var(--muted);
}

.upgrade-current strong {
  display: block;
  color: var(--ink);
  font-size: 1.3rem;
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.upgrade-card {
  position: relative;
  display: grid;
  gap: 9px;
  min-height: 230px;
  padding: 18px;
  text-align: left;
  border-radius: 24px;
  border: 1px solid rgba(72, 173, 190, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 250, 255, 0.9));
  box-shadow: 0 18px 34px rgba(61, 111, 136, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.upgrade-trial-enemy {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(72, 173, 190, 0.2);
  border-radius: 16px;
  object-fit: cover;
  object-position: center 25%;
  background: #eaf6fb;
}

@media (min-width: 681px) {
  .trial-select-card .upgrade-trial-enemy {
    width: min(100%, 300px);
    max-height: 160px;
    justify-self: center;
  }
}

.upgrade-card:hover,
.upgrade-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(46, 154, 196, 0.54);
  box-shadow: 0 24px 42px rgba(61, 111, 136, 0.2);
}

.upgrade-card.stay {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 247, 250, 0.9));
}

.upgrade-badge {
  justify-self: start;
  padding: 5px 10px;
  border-radius: 999px;
  color: #28606d;
  background: #e8fbff;
  border: 1px solid rgba(46, 154, 196, 0.22);
  font-size: 0.78rem;
  font-weight: 800;
}

.upgrade-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.35rem;
}

.upgrade-card p,
.upgrade-card li {
  margin: 0;
  color: var(--muted);
}

.upgrade-card ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
}

.trial-campaign-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 22px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 238, 158, 0.54), transparent 28%),
    linear-gradient(135deg, rgba(246, 253, 255, 0.96), rgba(238, 249, 242, 0.96));
  border: 1px solid rgba(72, 173, 190, 0.24);
  box-shadow: var(--shadow);
}

.job-rank-up-visual {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 190px;
  max-height: 330px;
  margin: 0;
  aspect-ratio: 16 / 7;
  border: 1px solid rgba(255, 221, 112, 0.42);
  border-radius: 22px;
  background: #0b1830;
  box-shadow: 0 18px 38px rgba(25, 55, 91, 0.2);
}

.job-rank-up-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
}

.job-rank-up-visual figcaption {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: grid;
  gap: 3px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  color: white;
  background: linear-gradient(90deg, rgba(8, 25, 51, 0.88), rgba(8, 25, 51, 0.48));
  backdrop-filter: blur(4px);
}

.job-rank-up-visual figcaption span {
  color: #ffe486;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.job-rank-up-visual figcaption strong {
  font-size: clamp(1rem, 2.5vw, 1.45rem);
}

.trial-campaign-panel.trial-campaign-status {
  margin-bottom: 18px;
}

.trial-campaign-panel.trial-campaign-status .campaign-ribbon {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(72, 173, 190, 0.2);
}

.trial-campaign-panel.trial-campaign-status .campaign-ribbon b {
  font-size: 1rem;
}

.trial-campaign-panel.trial-campaign-status.unlocked .campaign-ribbon {
  background: linear-gradient(135deg, rgba(255, 247, 208, 0.95), rgba(255, 255, 255, 0.92));
}

.trial-campaign-panel.trial-campaign-status.locked .campaign-ribbon {
  background: linear-gradient(135deg, rgba(241, 247, 255, 0.94), rgba(255, 255, 255, 0.92));
}

.trial-campaign-head h2 {
  margin: 4px 0 8px;
  color: var(--ink);
}

.trial-campaign-head p {
  margin: 0;
  color: var(--muted);
}

.trial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.trial-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #f1fbff);
  border: 1px solid rgba(41, 160, 199, 0.24);
  box-shadow: 0 14px 26px rgba(47, 117, 139, 0.12);
}

.trial-card-art {
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #edf9ff, #dff1f7);
  border: 1px solid rgba(41, 160, 199, 0.18);
}

.trial-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.trial-card-action {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(204, 145, 0, 0.28);
  color: #6f4a00;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(135deg, #fff4b8, #ffd36a 52%, #fff1a2);
  box-shadow:
    0 14px 24px rgba(214, 158, 34, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
  text-transform: none;
  letter-spacing: 0.02em;
}

.trial-card-action:hover,
.trial-card-action:focus-visible {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 18px 30px rgba(214, 158, 34, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.trial-card-action-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 6px 14px rgba(173, 105, 0, 0.26);
}

.trial-card-action-copy {
  display: grid;
  gap: 2px;
}

.trial-card-action-copy strong {
  font-size: 1rem;
}

.trial-card-action-copy small {
  color: rgba(111, 74, 0, 0.8);
  font-size: 0.76rem;
}

.trial-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trial-card-top span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #755100;
  background: #fff0b5;
  font-size: 0.72rem;
  font-weight: 800;
}

.trial-card-top b {
  color: #236070;
}

.trial-card h3 {
  margin: 0;
  color: var(--ink);
}

.trial-card p,
.trial-card li {
  margin: 0;
  color: var(--muted);
}

.trial-card ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

@keyframes campaignPulse {
  0%,
  100% {
    transform: translateY(0);
    filter: brightness(1);
  }
  50% {
    transform: translateY(-2px);
    filter: brightness(1.05);
  }
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 16px;
  color: white;
  background: #183143;
  box-shadow: var(--shadow);
}

.busy button {
  pointer-events: none;
}

@keyframes activePulse {

  0%,
  100% {
    border-color: var(--line);
    box-shadow: none;
  }

  50% {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(27, 155, 209, 0.14);
  }
}

@keyframes roll {
  0% {
    transform: rotate(0deg) translateY(0);
  }

  50% {
    transform: rotate(8deg) translateY(-4px);
  }

  100% {
    transform: rotate(0deg) translateY(0);
  }
}

@keyframes damagePop {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.72) rotate(-4deg);
  }

  18% {
    opacity: 1;
    transform: translate(-50%, -3px) scale(1.08) rotate(2deg);
  }

  72% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1) rotate(0);
  }

  100% {
    opacity: 0.92;
    transform: translate(-50%, 0) scale(0.98);
  }
}

@keyframes criticalDamagePop {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.68) rotate(-8deg);
    filter: brightness(1);
  }

  22% {
    opacity: 1;
    transform: translate(-50%, -5px) scale(1.16) rotate(4deg);
    filter: brightness(1.3);
  }

  70% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.04) rotate(-1deg);
  }

  100% {
    opacity: 0.95;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes hitShake {
  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-7px) rotate(-1deg);
  }

  45% {
    transform: translateX(7px) rotate(1deg);
  }

  70% {
    transform: translateX(-3px);
  }
}

@keyframes paperSlideIn {
  from {
    opacity: 0;
    transform: translateX(36px) rotate(1deg);
  }

  to {
    opacity: 1;
    transform: translateX(0) rotate(0);
  }
}

@keyframes heroStep {
  from {
    transform: translateY(0) rotate(-1deg);
  }

  to {
    transform: translateY(-8px) rotate(1deg);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

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

@keyframes blessingSpin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes blessingCardIn {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.92) rotate(-1deg);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

@keyframes orbFloat {
  from {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }

  to {
    transform: translateY(-8px) scale(1.04);
    filter: brightness(1.16);
  }
}

@keyframes statusGlow {
  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.08);
  }
}

@keyframes stormDrift {
  from {
    transform: translateX(-5%) translateY(-3%);
  }

  to {
    transform: translateX(5%) translateY(3%);
  }
}

@keyframes riftPulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scaleX(0.88);
    filter: brightness(1) blur(0.4px);
  }

  50% {
    transform: translate(-50%, -50%) scaleX(1.08);
    filter: brightness(1.25) blur(0);
  }
}

@keyframes demonRise {
  from {
    opacity: 0;
    transform: translate(-50%, -28%) scale(0.78);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes autoStartBar {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes ashFall {
  from {
    transform: translateY(-220px) rotate(8deg);
    opacity: 0;
  }

  25% {
    opacity: 1;
  }

  to {
    transform: translateY(820px) rotate(-8deg);
    opacity: 0;
  }
}

@media (max-width: 1100px) {
  .game-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .setup-options,
  .action-grid,
  .battle-scene,
  .ending-score,
  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {

  .setup-screen,
  .play-area,
  .stage {
    padding: 12px;
  }

  .setup-card {
    padding: 18px;
  }

  .setup-footer,
  .turn-strip,
  .hero-band,
  .daybreak-next {
    grid-template-columns: 1fr;
  }

  .hero-band img {
    width: 86px;
    height: 86px;
  }

  .die {
    width: 48px;
    height: 48px;
  }

  .battle-log-line {
    grid-template-columns: 1fr;
  }

  .ending-panel {
    padding: 18px;
    border-radius: 24px;
  }

  .ending-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ending-timeline p {
    display: grid;
  }

  .ending-timeline span {
    text-align: left;
  }
}

.forge-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.forge-preview-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(27, 155, 209, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 20px rgba(43, 104, 132, 0.08);
}

.forge-preview-card>img {
  width: 58px;
  height: 76px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--mist);
}

.forge-preview-card>div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.forge-preview strong {
  font-size: 0.84rem;
}

.forge-preview span {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.forge-preview .material-chip {
  min-height: 26px;
  padding: 4px 6px;
  font-size: 0.72rem;
}

.forge-preview .material-chip span {
  display: none;
}

.forge-preview .material-chip b {
  width: 22px;
  height: 22px;
  font-size: 0.86rem;
}

.forge-preview .detail-token {
  justify-self: start;
  max-width: 100%;
  background: white;
}

.forge-preview .detail-token>small {
  display: none;
}

.forge-preview .detail-popover {
  text-align: left;
}

.material-board-rich {
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.material-beast_fang {
  background: #fff7df;
  border-color: rgba(199, 139, 42, 0.38);
}

.material-beast_fang b {
  background: linear-gradient(135deg, #d79838, #fff1b7);
}

.material-flame_stone {
  background: #fff0ec;
  border-color: rgba(221, 91, 65, 0.42);
}

.material-flame_stone b {
  background: linear-gradient(135deg, #ff5c38, #ffc05a);
}

.material-dragon_scale {
  background: #eef6ff;
  border-color: rgba(43, 111, 196, 0.4);
}

.material-dragon_scale b {
  background: linear-gradient(135deg, #3579d4, #9ee7ff);
}

.material-shadow_ink {
  background: #f1efff;
  border-color: rgba(100, 83, 175, 0.38);
}

.material-shadow_ink b {
  background: linear-gradient(135deg, #30295f, #8c7bff);
}

.material-star_fragment {
  background: #fff9d7;
  border-color: rgba(224, 174, 37, 0.5);
}

.material-star_fragment b {
  background: linear-gradient(135deg, #e8af25, #fff6a8);
}

.material-chip.lack {
  filter: saturate(0.72);
}

.material-chip.lack b {
  box-shadow: inset 0 0 0 999px rgba(20, 25, 35, 0.24);
}

.view-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.action-view-title {
  padding: 14px;
  border: 1px solid rgba(27, 155, 209, 0.18);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(241, 251, 255, 0.92), rgba(255, 255, 255, 0.78));
}

.action-title-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.action-back-button {
  min-width: 170px;
  padding: 11px 16px;
  border: 1px solid rgba(27, 155, 209, 0.44);
  border-radius: 999px;
  color: #155f78;
  background: linear-gradient(180deg, #f4fcff, #dff6ff);
  box-shadow: 0 12px 26px rgba(27, 155, 209, 0.16);
  font-weight: 900;
}

.action-back-button:hover,
.action-back-button:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(27, 155, 209, 0.14), 0 16px 30px rgba(27, 155, 209, 0.18);
  transform: translateY(-1px);
}

.floating-action-back {
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 80;
  display: flex;
  place-items: center;
  justify-content: center;
  gap: 7px;
  width: 108px;
  min-width: 108px;
  height: 54px;
  padding: 0 16px 0 13px;
  border-width: 2px;
  border-radius: 999px;
  color: #073f5e;
  background: linear-gradient(135deg, #fff7c8, #d8f5ff 52%, #9be5ff);
  font-size: 25px;
  line-height: 1;
  box-shadow: 0 16px 38px rgba(12, 86, 117, 0.34), 0 0 0 4px rgba(255, 255, 255, 0.72);
  isolation: isolate;
}

.floating-action-back span {
  transform: translateY(-1px);
}

.floating-action-back strong {
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.victory-result {
  position: relative;
  overflow: hidden;
  border-color: rgba(242, 184, 75, 0.58);
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 248, 189, 0.95), transparent 28%),
    radial-gradient(circle at 85% 22%, rgba(175, 235, 255, 0.8), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 246, 214, 0.86));
  box-shadow: 0 26px 70px rgba(193, 132, 22, 0.22);
}

.victory-result h2 {
  color: #a65f00;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
}

.victory-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.victory-burst span {
  position: absolute;
  width: 14px;
  height: 34px;
  border-radius: 999px;
  background: var(--gold);
  animation: confettiFall 1800ms ease-out infinite;
}

.victory-burst span:nth-child(1) {
  left: 12%;
  top: -12px;
  background: var(--blue);
}

.victory-burst span:nth-child(2) {
  left: 31%;
  top: -28px;
  background: var(--green);
  animation-delay: 220ms;
}

.victory-burst span:nth-child(3) {
  left: 52%;
  top: -8px;
  background: var(--gold);
  animation-delay: 90ms;
}

.victory-burst span:nth-child(4) {
  left: 72%;
  top: -34px;
  background: var(--red);
  animation-delay: 340ms;
}

.victory-burst span:nth-child(5) {
  left: 88%;
  top: -18px;
  background: var(--violet);
  animation-delay: 520ms;
}

.victory-copy,
.victory-rewards {
  position: relative;
  z-index: 1;
}

.victory-copy {
  display: grid;
  gap: 8px;
}

.victory-copy h3 {
  font-size: clamp(1.4rem, 3vw, 2.25rem);
}

.victory-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.victory-rewards {
  display: grid;
  gap: 14px;
}

.reward-gold {
  display: inline-grid;
  width: max-content;
  min-width: 180px;
  gap: 3px;
  padding: 16px 20px;
  color: #7a4a00;
  background: linear-gradient(135deg, #fff4c7, #ffd56c);
  border: 1px solid rgba(194, 126, 0, 0.24);
  box-shadow: 0 12px 26px rgba(198, 130, 16, 0.18);
}

.reward-gold span {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.reward-gold strong {
  font-size: 2rem;
}

.reward-materials,
.reward-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reward-card {
  display: grid;
  grid-template-columns: 74px minmax(120px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(32, 86, 110, 0.12);
}

.reward-card img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  background: var(--mist);
}

.reward-card div {
  display: grid;
  gap: 4px;
}

.reward-card span {
  color: var(--muted);
}

.reward-card-frame {
  display: grid;
  place-items: center;
  width: min(280px, 100%);
  margin: 0 auto;
}

.reward-trading-card {
  display: grid;
  grid-template-rows: auto 150px auto minmax(42px, auto) 1fr;
  gap: 10px;
  width: 260px;
  min-height: 390px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 250, 0.95)),
    var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 18px 42px rgba(32, 86, 110, 0.18);
}

.reward-trading-card>img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: var(--sky);
  border: 1px solid var(--line);
}

.reward-trading-card h3 {
  font-size: 1.12rem;
  line-height: 1.25;
}

.reward-trading-card p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.reward-trading-card ul {
  display: grid;
  align-content: start;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.35;
}

.reward-trading-card.rarity-legendary {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 244, 176, 0.9), transparent 32%),
    linear-gradient(180deg, #fffdf3, #fff5d7);
  box-shadow: 0 22px 54px rgba(196, 137, 23, 0.26);
}

.reward-trading-card.rarity-legend {
  background:
    radial-gradient(circle at 18% 0%, rgba(210, 245, 235, 0.95), transparent 34%),
    linear-gradient(180deg, #fbfffd, #eaf9f5);
}

.reward-trading-card.rarity-rare {
  background:
    radial-gradient(circle at 18% 0%, rgba(218, 241, 255, 0.95), transparent 34%),
    linear-gradient(180deg, #fbfdff, #eef8ff);
}

.training-growth-card {
  grid-template-rows: auto 150px auto 1fr;
}

.result-panel>.reward-card-frame {
  justify-self: center;
}

.reward-cards .reward-card-frame {
  margin: 0;
}

.profile-loadout {
  display: grid;
  gap: 7px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.76rem;
}

.profile-stats>span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #315468;
  background: rgba(236, 248, 255, 0.84);
  border: 1px solid rgba(85, 180, 220, 0.24);
}

.stat-value {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.stat-value b {
  color: var(--ink);
  font-size: 0.86rem;
}

.stat-value em {
  color: #14875f;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
}

.stat-token.magic {
  color: #594097;
  background: linear-gradient(135deg, #f4efff, #e9fbff);
  border-color: rgba(128, 106, 217, 0.28);
  cursor: help;
}

.stat-token.attack,
.stat-token.defense {
  cursor: help;
}

.stat-token.attack {
  color: #8a4a15;
  background: linear-gradient(135deg, #fff7ea, #fff1db);
  border-color: rgba(210, 145, 64, 0.28);
}

.stat-token.defense {
  color: #23597a;
  background: linear-gradient(135deg, #edf8ff, #e3f1fb);
  border-color: rgba(63, 149, 196, 0.28);
}

.stat-token:hover .detail-popover,
.stat-token:focus-visible .detail-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-8px, -100%) translateY(-8px) scale(1);
}

.profile-loadout>div {
  display: grid;
  gap: 5px;
}

.profile-equipment {
  --token-bg: #eef9ff;
  --token-border: rgba(27, 155, 209, 0.34);
  --token-color: #24516a;
}

.profile-skills {
  --token-bg: #fff7df;
  --token-border: rgba(242, 184, 75, 0.46);
  --token-color: #7a4a00;
}

.profile-reincarnation {
  --token-bg: #f4efff;
  --token-border: rgba(128, 106, 217, 0.36);
  --token-color: #594097;
}

.profile-battle-skills {
  --token-bg: #fff7df;
  --token-border: rgba(242, 184, 75, 0.46);
  --token-color: #7a4a00;
}

.profile-relics {
  --token-bg: #fff1f8;
  --token-border: rgba(219, 88, 148, 0.42);
  --token-color: #8a275f;
}

.profile-loadout b {
  color: var(--ink);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.profile-loadout>div>span {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.profile-loadout em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.78rem;
}

.profile-statuses {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid rgba(58, 185, 138, 0.18);
  background: rgba(238, 249, 244, 0.7);
}

.profile-statuses>b {
  color: var(--ink);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.profile-statuses>span,
.battle-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-materials {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.profile-materials b {
  color: var(--ink);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.profile-materials>span {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.profile-materials .material-chip {
  min-height: 28px;
  padding: 4px 6px;
  font-size: 0.72rem;
}

.profile-materials .material-chip b {
  width: 22px;
  height: 22px;
  font-size: 0.86rem;
  letter-spacing: 0;
}

.profile-materials .material-chip em {
  font-size: 0.72rem;
}

.detail-token {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 7px;
  color: var(--token-color, #24516a);
  background: var(--token-bg, #eef9ff);
  border: 1px solid var(--token-border, rgba(27, 155, 209, 0.28));
  font-size: 0.75rem;
  font-weight: 800;
  outline: none;
}

.detail-token.item-token {
  --token-bg: #eef9ff;
  --token-border: rgba(27, 155, 209, 0.34);
  --token-color: #24516a;
}

.detail-token.skill-token {
  --token-bg: #fff7df;
  --token-border: rgba(242, 184, 75, 0.46);
  --token-color: #7a4a00;
}

.profile-relics .detail-token.item-token {
  --token-bg: #fff1f8;
  --token-border: rgba(219, 88, 148, 0.42);
  --token-color: #8a275f;
}

.job-token {
  position: relative;
  display: inline-flex;
  color: #285575;
  font-weight: 900;
  cursor: help;
  outline: none;
}

.job-token:hover .detail-popover,
.job-token:focus-visible .detail-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-8px, -100%) translateY(-8px) scale(1);
}

.job-popover {
  color: var(--ink);
}

.status-token {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid rgba(58, 185, 138, 0.38);
  border-radius: 999px;
  color: #126240;
  background: linear-gradient(180deg, #effff8, #dff8ec);
  font-size: 0.75rem;
  font-weight: 900;
  box-shadow: 0 0 0 3px rgba(58, 185, 138, 0.08);
  outline: none;
  animation: statusGlow 1.9s ease-in-out infinite;
}

.status-token.debuff {
  color: #8d2d25;
  border-color: rgba(233, 111, 95, 0.42);
  background: linear-gradient(180deg, #fff1ef, #ffdcd7);
  box-shadow: 0 0 0 3px rgba(233, 111, 95, 0.08);
}

.status-token small {
  color: inherit;
  opacity: 0.72;
  font-size: 0.66rem;
}

.status-token:hover,
.status-token:focus-visible {
  z-index: 60;
  box-shadow: 0 0 0 4px rgba(58, 185, 138, 0.16);
}

.status-token.debuff:hover,
.status-token.debuff:focus-visible {
  box-shadow: 0 0 0 4px rgba(233, 111, 95, 0.16);
}

.status-token:hover .detail-popover,
.status-token:focus-visible .detail-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.status-popover {
  grid-template-columns: minmax(300px, 440px);
}

.battle-status-row {
  justify-content: center;
}

.detail-token small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
}

.detail-token:hover,
.detail-token:focus-visible {
  z-index: 50;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(27, 155, 209, 0.12);
}

.detail-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 60;
  display: grid;
  grid-template-columns: 140px minmax(280px, 386px);
  gap: 12px 16px;
  width: max-content;
  max-width: min(580px, calc(100vw - 24px));
  padding: 18px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 18px 42px rgba(32, 86, 110, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  pointer-events: none;
}

.detail-popover.stat-popover,
.detail-popover.job-popover,
.detail-popover.status-popover {
  grid-template-columns: minmax(300px, 440px);
}

.detail-token:hover .detail-popover,
.detail-token:focus-visible .detail-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.detail-token,
.stat-token,
.job-token,
.status-token {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-skip-ink: none;
  cursor: help;
}

.detail-token.popover-open .detail-popover,
.stat-token.popover-open .detail-popover,
.job-token.popover-open .detail-popover,
.status-token.popover-open .detail-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.stat-token.popover-open .detail-popover,
.job-token.popover-open .detail-popover {
  transform: translate(-8px, -100%) translateY(-8px) scale(1);
}

.profile-stats .stat-token .detail-popover {
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  transform: translateY(-4px);
}

.profile-stats .stat-token:hover,
.profile-stats .stat-token:focus-within,
.profile-stats .stat-token.popover-open {
  z-index: 100;
}

.profile-stats .stat-token:hover .detail-popover,
.profile-stats .stat-token:focus-visible .detail-popover,
.profile-stats .stat-token.popover-open .detail-popover {
  transform: translateY(0);
}

.detail-popover img {
  grid-row: 1 / span 4;
  width: 140px;
  height: 140px;
  object-fit: contain;
  background: var(--mist);
  border: 1px solid var(--line);
}

.detail-popover strong {
  font-size: 1.1rem;
}

.detail-popover em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.detail-popover p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.detail-popover .popover-copy {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.detail-popover .popover-list {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.5;
}

.detail-popover .popover-list > span {
  display: block;
}

.loot-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 35, 48, 0.62);
  backdrop-filter: blur(5px);
}

.loot-dialog {
  width: min(620px, 100%);
  display: grid;
  gap: 16px;
  padding: 26px;
  color: var(--ink);
  background: linear-gradient(145deg, #fffdf5, #eef9ff);
  border: 2px solid rgba(242, 184, 75, 0.7);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.loot-dialog h2 { font-size: clamp(1.35rem, 4vw, 2rem); }

.loot-dialog-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.loot-dialog-item img { width: 78px; height: 78px; object-fit: contain; }
.loot-dialog-item div { display: grid; gap: 5px; }
.loot-dialog-item strong { font-size: 1.05rem; }
.loot-dialog-item span, .loot-dialog > p { color: var(--muted); line-height: 1.55; }

.loot-slot-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 9px; }

.loot-slot-choice {
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: left;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}

.loot-slot-choice:hover { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27, 155, 209, 0.12); }
.loot-slot-choice span { color: var(--muted); font-size: 0.74rem; }
.loot-slot-choice em { color: #16734f; font-size: 0.78rem; font-style: normal; font-weight: 900; }

.danger-lite {
  color: #8b1e24;
  border-color: rgba(196, 67, 75, 0.42);
  background: #fff3f2;
}

.danger-lite:hover {
  border-color: rgba(196, 67, 75, 0.78);
  box-shadow: 0 0 0 3px rgba(196, 67, 75, 0.12);
}

.rulebook { display: grid; gap: 18px; }

.rulebook-cover {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: clamp(20px, 4vw, 38px);
  color: #fff;
  background: linear-gradient(125deg, #1d4f6e, #39749a 58%, #3a9275);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: var(--shadow);
}

.rulebook-cover h3 { margin: 4px 0 8px; font-size: clamp(1.45rem, 4vw, 2.4rem); }
.rulebook-cover p:last-child { max-width: 760px; line-height: 1.65; opacity: 0.92; }

.rulebook-seal {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  color: #66450a;
  background: radial-gradient(circle at 35% 30%, #fff8ca, #e4a92f);
  border: 4px double rgba(105, 71, 7, 0.7);
  border-radius: 50%;
  font-size: 1.8rem;
  font-weight: 900;
}

.rulebook-section { display: grid; gap: 15px; padding: clamp(18px, 3vw, 28px); background: rgba(255, 255, 255, 0.72); border: 1px solid var(--line); }
.rulebook-heading { display: flex; gap: 12px; align-items: center; }
.rulebook-heading > b { display: grid; width: 34px; height: 34px; place-items: center; color: white; background: var(--blue); border-radius: 50%; }
.rulebook-heading h3 { margin-top: 2px; font-size: 1.3rem; }

.rule-steps { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: steps; }
.rule-steps li { display: grid; gap: 6px; padding: 14px; background: #f6fbfd; border-left: 3px solid var(--green); }
.rule-steps b { color: #1c5877; }
.rule-steps span, .rulebook-final p { color: var(--muted); font-size: 0.88rem; line-height: 1.55; }

.battle-formula { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; justify-content: center; padding: 16px; color: #164e6b; background: linear-gradient(90deg, #e8f7f2, #eef7ff); border: 1px dashed rgba(27, 155, 209, 0.45); font-weight: 900; }
.battle-formula span, .battle-formula strong { padding: 7px 10px; background: white; border: 1px solid var(--line); }
.battle-formula strong { color: #a15d00; background: #fff7df; }

.rulebook-final { border-left: 5px solid var(--gold); }

@media (max-width: 760px) {
  .rule-steps { grid-template-columns: 1fr; }
  .rulebook-cover { grid-template-columns: 1fr; }
}

.detail-popover ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* 画面幅にかかわらず、卓設定とゲーム盤を無理なく操作できるようにする。 */
.play-area,
.stage,
.top-summary,
.setup-card,
.room-card {
  min-width: 0;
  max-width: 100%;
}

img {
  max-width: 100%;
}

.game-shell *,
.setup-screen * {
  min-inline-size: 0;
}

.stage,
.top-summary,
.setup-card,
.room-card,
.detail-popover {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .setup-card,
  .room-card {
    width: 100%;
  }

  .setup-options,
  .setup-footer,
  .room-entry-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .game-header {
    padding: 10px 12px;
  }

  .demon-arrival {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: auto;
    gap: 18px;
    padding: 16px;
    border-radius: 24px;
  }

  .final-campfire {
    gap: 16px;
    padding: 14px;
    border-radius: 22px;
  }

  .final-campfire-visual { border-radius: 16px; }
  .campfire-actions { grid-template-columns: 1fr; }
  .campfire-actions button { min-height: 92px; }
  .party-event-panel { gap: 14px; padding: 12px; border-radius: 22px; }
  .party-event-visual { aspect-ratio: 16 / 9; border-radius: 17px; }
  .party-quest-options,
  .party-reward-grid { grid-template-columns: 1fr; }
  .party-quest-option { grid-template-columns: 72px minmax(0, 1fr); }
  .party-quest-option > img { width: 72px; height: 72px; }
  .party-vote-status > div { display: grid; grid-template-columns: 1fr 1fr; }
  .party-loot-choice > article { grid-template-columns: 72px minmax(0, 1fr); }
  .party-loot-choice > article > img { width: 72px; height: 72px; }

  .demon-arrival-visual {
    width: 100%;
    max-width: 100%;
    height: 390px;
    min-height: 390px;
    margin-left: auto;
    margin-right: auto;
    justify-self: center;
    box-sizing: border-box;
    aspect-ratio: auto;
    overflow: hidden;
    border-radius: 18px;
    clip-path: inset(0 round 18px);
    transform: translateZ(0);
  }

  .floating-action-back {
    left: max(12px, env(safe-area-inset-left));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: 102px;
    min-width: 102px;
    height: 50px;
    padding-inline: 12px 14px;
    font-size: 24px;
  }

  .demon-arrival-visual img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: inherit;
    clip-path: inset(0 round 18px);
  }

  .random-job-setting {
    grid-template-columns: 1fr;
  }

  .day-event-result {
    justify-items: start;
    text-align: left;
  }

  .stage,
  .top-summary {
    padding-left: 10px;
    padding-right: 10px;
  }

  .action-grid,
  .reincarnation-grid,
  .rules-grid,
  .ending-party {
    grid-template-columns: 1fr;
  }

  .hero-band,
  .view-title-row,
  .spotlight-head,
  .action-title-controls {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .action-card,
  button,
  select,
  input {
    min-height: 44px;
  }

  .profile-stats,
  .profile-loadout > div > span,
  .profile-materials > span {
    gap: 8px;
  }

  .detail-popover {
    position: fixed;
    inset: auto 10px 10px;
    z-index: 300;
    grid-template-columns: 108px minmax(0, 1fr);
    width: auto;
    max-width: none;
    max-height: min(72vh, 520px);
    overflow: auto;
    transform: translateY(8px);
  }

  .detail-popover.stat-popover,
  .detail-popover.job-popover,
  .detail-popover.status-popover {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-popover img {
    width: 108px;
    height: 108px;
  }

  .stat-token:hover .detail-popover,
  .stat-token:focus-visible .detail-popover,
  .job-token:hover .detail-popover,
  .job-token:focus-visible .detail-popover,
  .stat-token.popover-open .detail-popover,
  .job-token.popover-open .detail-popover,
  .detail-token.popover-open .detail-popover,
  .status-token.popover-open .detail-popover {
    transform: translateY(0);
  }
}

@keyframes confettiFall {
  0% {
    transform: translateY(-40px) rotate(0deg);
    opacity: 0;
  }

  15% {
    opacity: 1;
  }

  100% {
    transform: translateY(560px) rotate(420deg);
    opacity: 0;
  }
}

@keyframes slowSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes badgeGlow {

  0%,
  100% {
    filter: brightness(1);
    transform: translateY(0);
  }

  50% {
    filter: brightness(1.18);
    transform: translateY(-1px);
  }
}

@keyframes creditRise {
  from {
    transform: translateY(10px);
  }

  to {
    transform: translateY(-12px);
  }
}

/* モバイル戦闘は画像を横幅いっぱいに使い、計算詳細を閉じて両者と行動選択を優先する。 */
@media (max-width: 680px) {
  .stage:has(.battle-scene) {
    min-height: 0;
    padding: 6px 0 12px;
  }

  .combat-condition-lane {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 5px 9px;
    margin: 0 8px 6px;
    padding: 6px 9px;
    border-radius: 11px;
  }

  .combat-condition-lane > strong {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    padding: 3px 8px;
    font-size: 0.75rem;
  }

  .combat-condition-lane > div {
    display: grid;
    gap: 1px;
    align-content: start;
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .combat-condition-lane > div:last-child {
    justify-content: stretch;
  }

  .battle-scene {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    width: 100%;
    align-items: start;
  }

  .battle-scene > .combatant {
    grid-column: 1;
    min-height: 0;
    padding: 0;
    border-width: 0;
    border-radius: 0;
    background: transparent;
  }

  .battle-scene > .combatant.enemy {
    grid-row: 1;
  }

  .battle-scene > .battle-center {
    grid-column: 1;
    grid-row: 2;
    gap: 4px;
    padding: 6px 10px;
    border-width: 0;
    border-radius: 0;
    background: linear-gradient(90deg, rgba(235, 249, 255, 0.96), rgba(255, 250, 235, 0.96));
  }

  .battle-scene > .combatant:first-child {
    grid-row: 3;
  }

  .combatant-art {
    width: 100%;
    height: clamp(247px, 39dvh, 364px);
    min-height: 247px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .combatant img {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    object-position: center center;
  }

  .combatant.enemy img {
    object-position: center center;
  }

  .combatant-nameplate {
    right: auto;
    bottom: auto;
    left: auto;
    gap: 3px;
    width: 100%;
    padding: 6px 9px;
    border-radius: 0;
  }

  .combatant-nameplate h3 {
    font-size: 0.94rem;
  }

  .combatant-nameplate .hp {
    gap: 2px;
  }

  .combatant-nameplate .hp div {
    font-size: 0.75rem;
  }

  .combatant-nameplate .hp::after,
  .combatant-nameplate .hp i {
    height: 6px;
  }

  .battle-art-statuses,
  .battle-impact-chips {
    top: 6px;
    gap: 4px;
    max-width: calc(62% - 10px);
  }

  .battle-art-statuses {
    left: 7px;
  }

  .battle-impact-chips {
    right: 7px;
  }

  .battle-art-statuses span,
  .battle-impact-chips span {
    padding: 4px 7px;
    font-size: 0.72rem;
  }

  .battle-impact-chips i {
    font-size: 0.78rem;
  }

  .damage-pop {
    bottom: 70px;
    padding: 5px 12px;
  }

  .damage-pop strong {
    font-size: 1.45rem;
  }

  .battle-center .eyebrow {
    margin: 0;
    font-size: 0.7rem;
  }

  .battle-center h2 {
    display: none;
  }

  .battle-center .dice-row {
    gap: 7px;
    margin: 1px 0 3px;
  }

  .battle-center .die {
    width: 40px;
    height: 40px;
    min-height: 0;
    font-size: 1.15rem;
    box-shadow: 0 4px 0 rgba(28, 73, 96, 0.08);
  }

  .battle-calculation-details {
    border-radius: 10px;
  }

  .battle-calculation-outside {
    margin: 10px 8px 0;
  }

  .battle-roll-controls {
    grid-template-columns: minmax(0, 1fr) 62px;
    gap: 4px;
  }

  .battle-calculation-toggle {
    min-width: 62px;
    padding: 5px 6px;
  }

  .battle-calculation-details header {
    min-height: 36px;
    padding: 6px 9px;
    font-size: 0.88rem;
  }

  .battle-calculation-details header small {
    font-size: 0.72rem;
  }

  .battle-calculation-details .battle-log {
    grid-template-columns: 1fr;
    gap: 6px;
    min-height: 0;
    padding: 2px 7px 8px;
  }

  .battle-log-line {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 7px;
    padding: 8px;
    border-left-width: 3px;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.3;
    box-shadow: none;
  }

  .battle-log-line > span:first-child {
    grid-column: 1 / -1;
  }

  .battle-log-target {
    font-size: 0.78rem;
  }

  .battle-log-dice {
    grid-column: 1;
    font-size: 0.82rem;
  }

  .battle-log-line strong {
    grid-column: 2;
    justify-self: end;
    font-size: 0.94rem;
  }

  .battle-log-hp {
    grid-column: 1 / -1;
    font-size: 0.78rem;
  }

  .arena-initiative {
    padding: 5px 8px;
    font-size: 0.76rem;
  }

  .battle-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 7px 8px 0;
  }

  .battle-actions button {
    min-width: 0;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 0.94rem;
  }

  .battle-actions:has(.battle-review-next) {
    grid-template-columns: minmax(0, 1fr);
  }

  .battle-review-next {
    justify-self: center;
    width: min(280px, calc(100% - 24px));
    min-width: 0;
    margin-inline: auto;
  }

  .battle-skill-button em {
    max-width: 100%;
    font-size: 0.76rem;
  }

  .battle-turn-waiting {
    grid-column: 1 / -1;
    padding: 10px 12px;
  }
}

@media (max-width: 680px) {
  .arena-champion-result {
    padding: 14px;
    border-radius: 18px;
  }

  .arena-champion-visual {
    border-radius: 16px;
  }

  .arena-champion-profile {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
  }

  .arena-champion-profile > img {
    width: 82px;
    border-radius: 16px;
  }

  .arena-champion-crown {
    left: 32px;
    top: -19px;
    font-size: 2.1rem;
  }

  .arena-final-standings {
    padding: 12px;
  }

  .arena-final-standings li {
    grid-template-columns: 45px 42px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .arena-final-standings li > img {
    width: 42px;
    height: 42px;
  }
}

/* Android release 1.1.14: details live in the dialog top layer to avoid clipping. */
.game-detail-dialog { width: min(540px, calc(100vw - 24px)); max-height: 80dvh; overflow: auto; padding: 20px; border: 1px solid #bbd4de; border-radius: 18px; color: #183143; background: #fff; box-shadow: 0 16px 48px #07132355; }
.game-detail-dialog::backdrop { background: #07132399; }
.game-detail-content { display: grid; gap: 12px; text-decoration: none; }
.game-detail-content img { width: 110px; max-width: 100%; }
.game-detail-content strong { font-size: 1.2rem; }
.game-detail-content ul { padding-left: 20px; }
.game-detail-dialog > button { width: 100%; margin-top: 16px; min-height: 44px; }
.battle-dice-display { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.battle-dice-owner { color: #506b7b; font-size: .75rem; }
.battle-fixed-dice { max-width: 270px; padding: 8px; color: #195777; font-size: .85rem; text-align: center; }
.battle-log-line > .battle-log-formula { grid-column: 1 / -1; font-size: .8rem; line-height: 1.6; overflow-wrap: anywhere; }

.tutorial-guide, .tutorial-setup {
  margin: 10px 0 16px;
  padding: 12px 16px;
  border: 1px solid #bdd9e5;
  border-radius: 14px;
  background: #f2f9fc;
  color: #234759;
  overflow-wrap: anywhere;
}
.tutorial-guide[hidden], #tutorialCopy[hidden] { display: none; }
.tutorial-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.tutorial-heading > strong { font-size: 13px; }
.tutorial-heading > button { min-height: 44px; padding: 8px 12px; border: 1px solid #bdd9e5; border-radius: 10px; color: #286580; background: white; font-size: 13px; cursor: pointer; }
.tutorial-guide h2 { margin: 8px 0 5px; font-size: 17px; color: #234759; }
.tutorial-guide p, .tutorial-setup p { margin: 0; font-size: 14px; line-height: 1.7; }
.tutorial-setup summary { min-height: 44px; align-content: center; cursor: pointer; font-weight: 700; }
.room-entry-grid > .tutorial-setup { grid-column: 1 / -1; }
