:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  background: #f2dfb9;
  color: #341d12;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(178, 35, 35, 0.16), transparent 28rem),
    linear-gradient(180deg, #f5e7c9 0%, #e8c98d 100%);
}

button,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.app-root {
  width: 100%;
  min-height: 100vh;
}

.screen {
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.centered-screen,
.title-screen {
  display: grid;
  place-items: center;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.subtitle,
.muted {
  color: #775f42;
}

.seal {
  margin-bottom: 8px;
  color: #8f1d1d;
  font-weight: 800;
  letter-spacing: 0;
}

.toast {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #b98243;
  border-radius: 8px;
  background: rgba(255, 246, 218, 0.82);
  color: #6b321f;
}

.top-nav,
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.date-label {
  margin-bottom: 4px;
  color: #8f1d1d;
  font-size: 1.25rem;
  font-weight: 800;
}

.meta-line {
  margin: 0;
  color: #6b5137;
  font-size: 0.92rem;
}

.game-screen,
.response-screen,
.ending-screen {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
}

.response-screen {
  grid-template-rows: minmax(0, 1fr) auto;
}

.game-body {
  display: grid;
  gap: 14px;
  align-content: start;
}

.hero-panel,
.paper-panel,
.event-card,
.response-panel,
.scroll-panel,
.era-card {
  border: 1px solid rgba(104, 60, 28, 0.35);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 228, 0.92), rgba(241, 213, 158, 0.92)),
    #f4dfad;
  box-shadow: 0 16px 50px rgba(75, 37, 16, 0.18);
}

.hero-panel {
  width: min(100%, 520px);
  padding: 34px 26px;
  text-align: center;
}

.website-screen {
  width: min(100%, 1200px);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  color: #6d2a19;
}

.site-brand {
  display: grid;
  gap: 2px;
}

.site-brand b {
  color: #8f1d1d;
  font-size: 2rem;
  line-height: 1;
}

.site-brand span {
  color: #4b2510;
  font-size: 0.9rem;
  font-weight: 800;
}

.site-nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  flex: 1;
  color: #35180c;
  font-weight: 900;
}

.site-nav-links span,
.site-nav-links a {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

.site-nav-links a {
  min-height: 36px;
  padding: 6px 2px;
}

.site-nav-links .active {
  color: #8f1d1d;
  box-shadow: 0 3px 0 #8f1d1d;
}

.site-nav-cta {
  min-width: 144px;
}

.site-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  align-items: center;
  gap: 22px;
  min-height: 500px;
}

.site-copy h1 {
  max-width: 760px;
  font-size: clamp(3.2rem, 6vw, 5.6rem);
}

.site-copy .subtitle {
  max-width: 660px;
  color: #5c3d26;
  font-size: 1.08rem;
  line-height: 1.75;
}

.site-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.site-visual {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 2px solid rgba(104, 60, 28, 0.42);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 246, 218, 0.78), transparent 16rem),
    linear-gradient(180deg, rgba(143, 29, 29, 0.18), transparent 38%),
    linear-gradient(135deg, #f8d487, #c48639);
  box-shadow: 0 20px 70px rgba(75, 37, 16, 0.22);
}

.preview-ribbon {
  position: absolute;
  left: 26px;
  top: 24px;
  z-index: 2;
  padding: 10px 15px;
  border-radius: 8px;
  background: #a82b24;
  color: #fff6dd;
  font-size: 1.1rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(75, 37, 16, 0.22);
}

.palace-roof {
  position: absolute;
  left: 9%;
  right: 9%;
  top: 72px;
  height: 86px;
  background:
    linear-gradient(135deg, transparent 20%, #7b211b 21% 38%, transparent 39%),
    linear-gradient(225deg, transparent 20%, #9b2b20 21% 38%, transparent 39%),
    #b98243;
  border: 1px solid rgba(69, 28, 13, 0.22);
  border-radius: 8px 8px 0 0;
}

.court-stage {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 142px;
  height: 220px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 28px;
}

.emperor-avatar,
.official {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(69, 28, 13, 0.28);
  box-shadow: 0 12px 28px rgba(75, 37, 16, 0.24);
}

.emperor-avatar {
  width: 132px;
  height: 132px;
  border-radius: 48% 48% 42% 42%;
  background:
    radial-gradient(circle at 50% 24%, #f6d471 0 16%, transparent 17%),
    linear-gradient(180deg, #f5c35d, #b57928);
  color: #7b211b;
  font-size: 2.6rem;
  font-weight: 900;
}

.official {
  width: 72px;
  height: 92px;
  border-radius: 38% 38% 14px 14px;
  background: linear-gradient(180deg, #2d251f 0 28%, #584135 29% 100%);
}

.official-left {
  transform: rotate(-7deg);
}

.official-right {
  transform: rotate(7deg);
}

.preview-caption {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 154px;
  display: grid;
  gap: 5px;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(255, 246, 218, 0.78);
  color: #4b2510;
  text-align: center;
}

.preview-caption b {
  font-size: 1.7rem;
  color: #35180c;
}

.preview-caption span {
  color: #8f1d1d;
  font-weight: 800;
}

.throne-card {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 18px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 2px solid rgba(104, 60, 28, 0.42);
  border-radius: 8px;
  background: rgba(255, 246, 218, 0.92);
  color: #4b2510;
  font-weight: 900;
}

.throne-card span {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(185, 130, 67, 0.16);
  text-align: center;
}

.throne-card b {
  color: #8f1d1d;
}

.mini-edict {
  position: absolute;
  right: 6%;
  top: 226px;
  width: 106px;
  min-height: 118px;
  padding: 14px 10px;
  border: 1px solid rgba(104, 60, 28, 0.35);
  border-radius: 8px;
  background: #fff6da;
  color: #8f1d1d;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 12px 28px rgba(75, 37, 16, 0.18);
}

.site-feature-grid,
.site-gameplay {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.site-feature-grid article,
.site-gameplay article,
.site-strip {
  border: 1px solid rgba(104, 60, 28, 0.22);
  border-radius: 8px;
  background: rgba(255, 246, 218, 0.72);
}

.site-feature-grid article,
.site-gameplay article {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.site-feature-grid b,
.site-gameplay b {
  color: #8f1d1d;
}

.site-feature-grid span,
.site-gameplay span {
  color: #5c3d26;
  line-height: 1.45;
}

.site-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
  padding: 10px;
  color: #6d2a19;
  font-weight: 800;
}

.title-actions,
.compact-actions {
  display: grid;
  gap: 10px;
}

.compact-actions {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.btn {
  min-height: 44px;
  padding: 11px 15px;
  border: 1px solid #8b5728;
  border-radius: 8px;
  background: #fff1c9;
  color: #4b2510;
  cursor: pointer;
  font-weight: 800;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.btn:hover,
.option-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(85, 39, 16, 0.18);
}

.btn.primary {
  border-color: #8f1d1d;
  background: #a82b24;
  color: #fff6dd;
}

.btn.ghost {
  background: rgba(255, 246, 218, 0.6);
}

.btn.small {
  min-height: 36px;
  padding: 8px 11px;
  font-size: 0.9rem;
}

.btn.danger {
  border-color: #8f1d1d;
  background: #fff0e8;
  color: #8f1d1d;
}

.btn[disabled],
.btn.disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

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

.era-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.era-card p {
  margin-bottom: 0;
  color: #66482e;
}

.era-effects,
.tag-row,
.change-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.era-effects span,
.tag-row span,
.change-list span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(143, 29, 29, 0.09);
  color: #6d2a19;
  font-size: 0.85rem;
  font-weight: 800;
}

.event-card {
  padding: 18px;
}

.play-surface {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  gap: 8px;
}

.mobile-card-carousel {
  display: flex;
  min-width: 0;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 29, 29, 0.45) rgba(255, 246, 218, 0.58);
}

.mobile-card-carousel::-webkit-scrollbar {
  height: 7px;
}

.mobile-card-carousel::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 246, 218, 0.58);
}

.mobile-card-carousel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(143, 29, 29, 0.45);
}

.carousel-slide {
  display: grid;
  flex: 0 0 100%;
  min-width: 0;
  min-height: 0;
  align-content: start;
  gap: 7px;
  overflow-y: auto;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.carousel-label {
  width: fit-content;
  margin: 0;
  padding: 4px 9px;
  border: 1px solid rgba(143, 29, 29, 0.18);
  border-radius: 999px;
  background: rgba(255, 246, 218, 0.86);
  color: #8f1d1d;
  font-size: 0.78rem;
  font-weight: 900;
}

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

.card-dots span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(143, 29, 29, 0.16);
  color: #6d2a19;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.main-column {
  display: grid;
  gap: 12px;
}

.long-term-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(104, 60, 28, 0.28);
  border-radius: 8px;
  background: rgba(255, 246, 218, 0.78);
}

.long-term-panel h2 {
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.long-term-panel p {
  margin-bottom: 0;
}

.panel-label {
  margin-bottom: 4px;
  color: #8f1d1d;
  font-size: 0.78rem;
  font-weight: 900;
}

.success-text {
  display: inline-block;
  margin-top: 6px;
  color: #237447;
}

.decree-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.decree-chips span,
.decree-meta {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(185, 130, 67, 0.18);
  color: #6d2a19;
  font-size: 0.82rem;
  font-weight: 800;
}

.mini-chronicle,
.ending-chronicle ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: #5c3d26;
  font-size: 0.88rem;
  line-height: 1.5;
}

.event-card h2 {
  font-size: clamp(1.6rem, 5vw, 2.5rem);
}

.event-kicker,
.speaker {
  color: #8f1d1d;
  font-weight: 800;
}

.speaker::before {
  content: "奏曰：";
}

.event-text,
.big-quote {
  color: #452717;
  font-size: 1.1rem;
  line-height: 1.75;
}

.bomb-card {
  border: 2px solid #b51f1b;
  background:
    linear-gradient(135deg, rgba(255, 235, 218, 0.95), rgba(239, 183, 137, 0.95)),
    #f1c28d;
}

.imperial-choice-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  gap: 9px;
  padding: 12px;
  border: 2px solid rgba(143, 29, 29, 0.52);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(117, 31, 24, 0.98), rgba(82, 33, 19, 0.98)),
    #6f2019;
  box-shadow: 0 14px 36px rgba(75, 22, 13, 0.24);
}

.choice-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: #fff4d3;
}

.choice-panel-head span {
  font-size: 1rem;
  font-weight: 900;
}

.choice-panel-head small {
  color: rgba(255, 244, 211, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
}

.option-list {
  display: grid;
  gap: 10px;
}

.option-btn {
  width: 100%;
  min-height: 54px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 238, 185, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fff8df, #f3dba3),
    #fff0bf;
  color: #35180c;
  cursor: pointer;
  font-weight: 800;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(77, 31, 11, 0.08), 0 5px 12px rgba(37, 14, 6, 0.18);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(104, 60, 28, 0.28);
  border-radius: 8px;
  background: rgba(255, 246, 218, 0.86);
}

.stat-head {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 5px;
  font-size: 0.83rem;
  font-weight: 800;
}

.stat-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(93, 54, 24, 0.16);
}

.stat-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #b98243;
}

.stat-desc {
  display: none;
  margin: 0;
}

.stat-row.strong .stat-track span {
  background: #237447;
}

.stat-row.danger .stat-track span {
  background: #b51f1b;
}

.response-panel,
.scroll-panel,
.paper-panel {
  padding: 20px;
}

.response-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  gap: 12px;
}

.response-pages {
  display: flex;
  min-width: 0;
  min-height: 0;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 29, 29, 0.45) rgba(255, 246, 218, 0.58);
}

.response-pages::-webkit-scrollbar {
  height: 7px;
}

.response-pages::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 246, 218, 0.58);
}

.response-pages::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(143, 29, 29, 0.45);
}

.response-page {
  flex: 0 0 100%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.response-dots {
  margin-top: -2px;
}

.chosen {
  padding: 12px;
  border-left: 4px solid #8f1d1d;
  background: rgba(255, 246, 218, 0.65);
  font-weight: 800;
}

.change-list {
  margin: 16px 0;
}

.change-list h2 {
  width: 100%;
  margin: 0;
}

.change-list span.up {
  background: rgba(35, 116, 71, 0.12);
  color: #1e633d;
}

.change-list span.down {
  background: rgba(181, 31, 27, 0.12);
  color: #8f1d1d;
}

.achievement-pop {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #b98243;
  border-radius: 8px;
  background: #fff3c5;
}

.ambition-grid,
.decree-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ambition-card,
.decree-card {
  display: grid;
  gap: 10px;
}

.decree-card {
  padding: 14px;
  border: 1px solid rgba(104, 60, 28, 0.28);
  border-radius: 8px;
  background: rgba(255, 250, 229, 0.72);
}

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

.quick-param-group {
  display: grid;
  gap: 12px;
  border-width: 2px;
}

.quick-param-group p {
  margin-bottom: 0;
}

.quick-param-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-param-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 10px;
  min-height: 100px;
  padding: 13px;
  border: 2px solid rgba(185, 130, 67, 0.24);
  border-radius: 8px;
  background: rgba(255, 250, 229, 0.82);
  color: #4b2510;
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 246, 218, 0.42);
}

.quick-param-card.active {
  border-color: #8f1d1d;
  background: linear-gradient(135deg, rgba(168, 43, 36, 0.16), rgba(255, 246, 218, 0.88));
  box-shadow: inset 0 0 0 2px rgba(143, 29, 29, 0.14);
}

.param-icon {
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(185, 130, 67, 0.2);
  color: #8f1d1d;
  font-weight: 900;
}

.quick-param-card b {
  color: #8f1d1d;
}

.quick-param-card span {
  color: #5c3d26;
  font-size: 0.86rem;
  line-height: 1.42;
}

.quick-start-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}

.quick-setup-actions {
  display: grid;
  grid-template-columns: minmax(160px, 240px);
  gap: 8px;
  align-items: center;
  justify-content: end;
}

.quick-mobile-meta,
.quick-page-link {
  display: none;
}

.quick-start-panel p {
  margin: 0;
  color: #5c3d26;
  line-height: 1.55;
}

.quick-play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  grid-template-areas:
    "event choices"
    "log choices";
  gap: 14px;
}

.quick-event-card {
  grid-area: event;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  min-height: 250px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 250, 228, 0.95), rgba(241, 213, 158, 0.72)),
    #f4dfad;
}

.quick-event-copy {
  align-self: center;
}

.quick-event-illustration {
  display: grid;
  place-items: center;
  min-height: 210px;
  border-left: 1px solid rgba(104, 60, 28, 0.16);
  background:
    radial-gradient(circle at 52% 42%, rgba(255, 246, 218, 0.72), transparent 5rem),
    linear-gradient(180deg, rgba(143, 29, 29, 0.08), rgba(185, 130, 67, 0.16));
}

.quick-event-illustration span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 104px;
  border: 3px solid rgba(143, 29, 29, 0.45);
  border-radius: 50%;
  background: #fff6da;
  color: #8f1d1d;
  font-size: 3.2rem;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(75, 37, 16, 0.18);
}

.quick-choice-panel {
  grid-area: choices;
  border-color: rgba(143, 29, 29, 0.78);
  background:
    linear-gradient(180deg, rgba(129, 28, 21, 0.98), rgba(83, 26, 17, 0.98)),
    #6f2019;
}

.quick-log-panel {
  grid-area: log;
  min-height: 138px;
  background:
    linear-gradient(135deg, rgba(255, 250, 228, 0.94), rgba(241, 213, 158, 0.82)),
    #f4dfad;
}

.quick-log {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.quick-log li {
  color: #5c3d26;
  line-height: 1.45;
}

.quick-log b,
.quick-log span {
  display: block;
}

.quick-log b {
  color: #8f1d1d;
}

.quick-last-choice {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border-left: 4px solid #8f1d1d;
  background: rgba(255, 246, 218, 0.68);
}

.quick-last-choice .change-list {
  margin: 0;
}

.quick-choice-panel .option-btn {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 12px;
}

.quick-choice-panel .option-btn small {
  grid-column: 2;
}

.option-icon {
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(185, 130, 67, 0.18);
  color: #8f1d1d;
  font-weight: 900;
}

.quick-final-strip {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.quick-ending-screen {
  grid-template-rows: auto auto;
}

.small-quote {
  font-size: 1rem;
}

.ending-scroll {
  text-align: center;
}

.record-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 18px 0;
  text-align: left;
}

.record-grid dt {
  color: #775f42;
  font-weight: 800;
}

.record-grid dd {
  margin: 0;
  font-weight: 800;
}

.posthumous {
  color: #8f1d1d;
  font-size: 1.3rem;
  font-weight: 900;
}

.archive-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.archive-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.archive-layout .paper-panel:last-child {
  grid-column: 1 / -1;
}

.history-list,
.achievement-list {
  display: grid;
  gap: 10px;
}

.achievement-list {
  padding: 0;
  list-style: none;
}

.achievement,
.record-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(104, 60, 28, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 229, 0.72);
}

.achievement.locked {
  opacity: 0.58;
}

.achievement b,
.record-card b {
  color: #8f1d1d;
}

.option-btn {
  display: grid;
  gap: 6px;
}

.option-btn small {
  color: #7a6040;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
}

.tiny-note {
  margin-top: 6px;
  color: #7a6040;
  font-size: 0.82rem;
}

.risk-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(104, 60, 28, 0.28);
  border-radius: 8px;
  background: rgba(255, 250, 229, 0.74);
}

.risk-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.risk-header span {
  color: #7a6040;
  font-size: 0.78rem;
}

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

.risk {
  display: grid;
  gap: 3px;
  min-height: 48px;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(185, 130, 67, 0.14);
  color: #5c3d26;
  font-size: 0.82rem;
  line-height: 1.35;
}

.risk b {
  color: #8f1d1d;
}

.risk.high {
  border: 1px solid rgba(181, 31, 27, 0.34);
  background: rgba(181, 31, 27, 0.12);
}

.risk.mid {
  border: 1px solid rgba(185, 130, 67, 0.34);
}

.risk.calm {
  grid-column: 1 / -1;
  min-height: 0;
}

.archive-layout-rich {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: start;
}

.archive-screen .paper-panel {
  min-width: 0;
}

.archive-wide {
  grid-column: 1 / -1;
}

.archive-detail {
  min-height: 360px;
}

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

.panel-title-row h2 {
  margin: 0;
}

.pager {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.pager span {
  min-width: 42px;
  color: #6c5134;
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
}

.pager .btn[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.record-button {
  width: 100%;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.record-button.active {
  border-color: #8f1d1d;
  box-shadow: 0 0 0 2px rgba(143, 29, 29, 0.12);
}

.record-detail-card {
  border: 0;
  background: transparent;
  padding: 0;
}

.compact-record-grid {
  grid-template-columns: auto 1fr;
}

.final-stat-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.final-stat-strip span {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(143, 29, 29, 0.08);
  color: #5c3d26;
  text-align: center;
}

.final-stat-strip b {
  color: #8f1d1d;
}

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

.codex-summary span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(104, 60, 28, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 229, 0.72);
  color: #5c3d26;
}

.codex-summary b {
  color: #8f1d1d;
}

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

.codex-item {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 10px;
  border: 1px solid rgba(104, 60, 28, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 229, 0.64);
}

.codex-item b {
  color: #8f1d1d;
}

.codex-item span,
.codex-item small {
  color: #6c5134;
  line-height: 1.35;
}

.codex-item.unknown {
  opacity: 0.68;
}

.codex-item.found {
  box-shadow: inset 3px 0 0 rgba(35, 116, 71, 0.55);
}

@media (max-width: 720px) {
  html,
  body,
  #app,
  .app-root {
    min-height: 100%;
    height: 100%;
  }

  .screen {
    padding: 8px;
  }

  .website-screen {
    width: 100%;
  }

  .site-nav {
    align-items: center;
    margin-bottom: 10px;
  }

  .site-brand b {
    font-size: 1.45rem;
  }

  .site-brand span,
  .site-nav-links span.active {
    display: none;
  }

  .site-nav-links {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
  }

  .site-nav-links a {
    min-width: auto;
    min-height: 36px;
    padding: 10px 8px;
    font-size: 0.76rem;
    line-height: 1.1;
  }

  .site-nav-links a {
    border: 1px solid rgba(143, 29, 29, 0.35);
    border-radius: 8px;
    background: rgba(255, 246, 218, 0.72);
  }

  .site-hero {
    min-height: 0;
    gap: 12px;
  }

  .site-copy h1 {
    font-size: 2.25rem;
  }

  .site-copy .subtitle {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .site-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 12px;
  }

  .site-visual {
    min-height: 292px;
  }

  .preview-ribbon {
    left: 12px;
    top: 12px;
    padding: 7px 10px;
    font-size: 0.82rem;
  }

  .palace-roof {
    left: 7%;
    right: 7%;
    top: 50px;
    height: 58px;
  }

  .court-stage {
    left: 6%;
    right: 6%;
    top: 95px;
    height: 128px;
    gap: 14px;
  }

  .emperor-avatar {
    width: 78px;
    height: 78px;
    font-size: 1.7rem;
  }

  .official {
    width: 42px;
    height: 56px;
  }

  .preview-caption {
    left: 5%;
    right: 5%;
    top: 112px;
    padding: 8px 10px;
  }

  .preview-caption b {
    font-size: 1rem;
  }

  .preview-caption span {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .throne-card {
    left: 4%;
    right: 4%;
    bottom: 8px;
    padding: 7px;
    gap: 4px;
    font-size: 0.68rem;
  }

  .throne-card span {
    padding: 5px 3px;
  }

  .mini-edict {
    right: 6%;
    top: 174px;
    width: 64px;
    min-height: 68px;
    padding: 8px 6px;
    font-size: 0.72rem;
  }

  .game-screen {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    gap: 7px;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .response-screen {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    gap: 7px;
    overflow: hidden;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .era-grid,
  .archive-layout,
  .archive-layout-rich,
  .ambition-grid,
  .decree-grid,
  .quick-setup-grid,
  .quick-param-options,
  .quick-play-layout,
  .site-hero,
  .site-feature-grid,
  .site-gameplay {
    grid-template-columns: 1fr;
  }

  .risk-list,
  .final-stat-strip,
  .codex-grid {
    grid-template-columns: 1fr;
  }

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

  .stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    padding: 6px;
  }

  .response-screen .stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-self: end;
    width: 100%;
    min-height: 54px;
  }

  .stat-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
    min-width: 0;
  }

  .stat-head {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.1;
  }

  .stat-track {
    height: 6px;
  }

  .top-nav,
  .game-header {
    align-items: flex-start;
  }

  .game-header {
    margin-bottom: 0;
  }

  .date-label {
    margin-bottom: 2px;
    font-size: 1.02rem;
    line-height: 1.15;
  }

  .meta-line {
    font-size: 0.74rem;
    line-height: 1.25;
  }

  .game-body {
    min-height: 0;
    gap: 8px;
    overflow: hidden;
    grid-template-rows: clamp(210px, 34dvh, 310px) minmax(0, 1fr);
  }

  .play-surface,
  .mobile-card-carousel,
  .carousel-slide {
    min-height: 0;
  }

  .mobile-card-carousel {
    height: 100%;
    gap: 8px;
  }

  .carousel-slide {
    padding-bottom: 2px;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .carousel-slide > .event-card,
  .carousel-slide > .long-term-panel,
  .carousel-slide > .risk-panel {
    height: 100%;
    min-height: 100%;
  }

  .carousel-label {
    padding: 3px 8px;
    font-size: 0.7rem;
  }

  .card-dots span {
    min-width: 34px;
    padding: 2px 6px;
    font-size: 0.66rem;
  }

  .event-card,
  .long-term-panel,
  .risk-panel {
    padding: 10px;
  }

  .event-card h2 {
    margin-bottom: 5px;
    font-size: 1.28rem;
    line-height: 1.15;
  }

  .event-text,
  .big-quote {
    margin-bottom: 0;
    font-size: 0.92rem;
    line-height: 1.48;
  }

  .response-panel {
    min-height: 0;
    padding: 10px;
    gap: 7px;
    grid-template-rows: minmax(0, 1fr) auto auto;
  }

  .response-pages {
    height: 100%;
    gap: 8px;
  }

  .response-page {
    padding: 2px;
  }

  .response-panel h1 {
    margin-bottom: 6px;
    font-size: 1.45rem;
    line-height: 1.12;
  }

  .response-panel .seal {
    margin-bottom: 4px;
    font-size: 0.78rem;
  }

  .response-panel .chosen {
    padding: 9px;
    margin-bottom: 8px;
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .response-panel .change-list {
    margin: 0;
    gap: 6px;
  }

  .response-panel .change-list h2 {
    font-size: 1rem;
  }

  .response-panel .change-list span {
    padding: 5px 7px;
    font-size: 0.76rem;
  }

  .response-panel .achievement-pop {
    margin: 8px 0 0;
    padding: 9px;
    font-size: 0.8rem;
  }

  .response-panel > .btn {
    min-height: 42px;
  }

  .quick-screen h1 {
    font-size: 1.7rem;
    line-height: 1.05;
  }

  .quick-screen .top-nav {
    margin-bottom: 8px;
    gap: 8px;
  }

  .quick-screen .top-nav .btn {
    min-width: 74px;
    padding-inline: 8px;
  }

  .quick-param-group {
    min-width: 0;
    padding: 10px;
    gap: 8px;
    overflow-y: auto;
  }

  .quick-param-group:not(.active) {
    display: none;
  }

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

  .quick-param-card {
    min-height: 70px;
    padding: 8px;
    gap: 3px 7px;
  }

  .quick-param-card span {
    font-size: 0.72rem;
    line-height: 1.28;
  }

  .param-icon {
    width: 30px;
    height: 30px;
    font-size: 0.82rem;
  }

  .quick-start-panel {
    display: grid;
    gap: 8px;
    margin-top: 0;
    padding: 11px;
  }

  .quick-start-panel h2 {
    margin-bottom: 3px;
    font-size: 1.05rem;
  }

  .quick-start-panel p {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .quick-setup-actions {
    grid-template-columns: 1fr 1.5fr 1fr;
    justify-content: stretch;
  }

  .quick-setup-actions .btn {
    min-width: 0;
    padding-inline: 8px;
  }

  .quick-mobile-meta,
  .quick-page-link {
    display: inline-flex;
  }

  .quick-screen {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .quick-setup-grid {
    min-height: 0;
    overflow: hidden;
  }

  .quick-play-screen {
    display: grid;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .quick-play-layout {
    grid-template-areas:
      "event"
      "choices"
      "log";
    grid-template-rows: minmax(126px, 0.76fr) minmax(176px, 1fr) minmax(86px, 0.38fr);
    gap: 8px;
    min-height: 0;
    overflow: hidden;
  }

  .quick-event-card {
    grid-template-columns: minmax(0, 1fr) 72px;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
  }

  .quick-event-copy {
    align-self: start;
  }

  .quick-event-illustration {
    min-height: 96px;
    border-left: 0;
    border-radius: 8px;
  }

  .quick-event-illustration span {
    width: 52px;
    height: 52px;
    font-size: 1.6rem;
    border-width: 2px;
  }

  .quick-event-card h2 {
    font-size: 1.18rem;
  }

  .quick-event-card .event-text {
    font-size: 0.82rem;
    line-height: 1.38;
  }

  .quick-event-card .quick-last-choice {
    margin-top: 8px;
    padding: 8px;
    gap: 5px;
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .quick-choice-panel {
    min-height: 0;
    overflow: hidden;
  }

  .quick-choice-panel .option-list {
    overflow-y: auto;
  }

  .quick-choice-panel .option-btn {
    min-height: 0;
    grid-template-columns: auto 1fr;
    padding: 8px;
  }

  .quick-choice-panel .option-btn small {
    font-size: 0.63rem;
  }

  .option-icon {
    width: 34px;
    height: 34px;
    font-size: 0.82rem;
  }

  .quick-log-panel {
    min-height: 0;
    max-height: none;
    padding: 10px;
    overflow-y: auto;
  }

  .quick-log-panel h2 {
    margin-bottom: 6px;
    font-size: 0.98rem;
  }

  .quick-log {
    gap: 5px;
    padding-left: 16px;
  }

  .quick-log li {
    font-size: 0.72rem;
    line-height: 1.3;
  }

  .quick-play-screen > .stat-grid {
    align-self: end;
  }

  .compact-actions {
    grid-template-columns: 1fr;
  }

  .quick-ending-screen {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .quick-ending-screen .ending-scroll {
    min-height: 0;
    overflow-y: auto;
  }

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

  .archive-screen .panel-title-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .archive-screen .pager {
    width: 100%;
    justify-content: space-between;
  }

  .archive-detail {
    min-height: 220px;
  }

  .archive-tabs {
    gap: 6px;
  }

  .archive-tabs .btn {
    min-height: 40px;
    padding: 8px 6px;
  }

  .archive-screen .paper-panel {
    padding: 14px;
  }

  .archive-screen .codex-summary span {
    min-height: 58px;
    padding: 8px;
  }

  .panel-label {
    margin-bottom: 2px;
    font-size: 0.68rem;
  }

  .long-term-panel {
    gap: 8px;
  }

  .long-term-panel h2 {
    font-size: 0.98rem;
  }

  .long-term-panel p,
  .mini-chronicle,
  .risk {
    font-size: 0.76rem;
    line-height: 1.35;
  }

  .risk-panel {
    gap: 7px;
  }

  .risk-header {
    display: block;
  }

  .risk-header span {
    display: block;
    font-size: 0.68rem;
  }

  .risk-list {
    gap: 6px;
  }

  .risk {
    min-height: 42px;
    padding: 7px 8px;
  }

  .imperial-choice-panel {
    max-height: none;
    padding: 9px;
    gap: 7px;
    overflow-y: auto;
    align-content: start;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .choice-panel-head {
    gap: 6px;
  }

  .choice-panel-head span {
    font-size: 0.9rem;
  }

  .choice-panel-head small {
    font-size: 0.68rem;
  }

  .option-list {
    gap: 7px;
    min-height: 0;
  }

  .imperial-choice-panel .option-list {
    height: 100%;
    grid-auto-rows: minmax(58px, 1fr);
  }

  .option-btn {
    min-height: 46px;
    padding: 9px 10px;
    gap: 3px;
    align-content: center;
    font-size: 0.86rem;
    line-height: 1.25;
  }

  .option-btn small {
    font-size: 0.68rem;
    line-height: 1.25;
  }
}

@media (min-width: 860px) {
  .game-screen {
    width: min(100%, 1360px);
    min-height: 100vh;
    padding: 18px 28px 24px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 16px;
    align-content: start;
  }

  .game-screen .game-header {
    margin-bottom: 0;
  }

  .game-screen > .stat-grid {
    align-self: start;
  }

  .game-body {
    display: grid;
    grid-template-columns: minmax(430px, 1.08fr) minmax(300px, 0.8fr) minmax(400px, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(132px, 0.38fr);
    grid-template-areas:
      "event policy choices"
      "event risk choices";
    gap: 14px;
    height: clamp(500px, calc(100vh - 246px), 610px);
    min-height: 0;
    align-items: stretch;
  }

  .play-surface {
    display: contents;
    min-width: 0;
    min-height: 0;
  }

  .mobile-card-carousel {
    display: contents;
    max-height: none;
    overflow: visible;
    scroll-snap-type: none;
  }

  .game-screen .event-card {
    min-height: 0;
    height: 100%;
    padding: 28px;
    overflow-y: auto;
  }

  .game-screen .long-term-panel,
  .game-screen .risk-panel {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
  }

  .game-screen .imperial-choice-panel {
    min-height: 0;
    height: calc(100% - 32px);
    padding: 18px;
    align-self: end;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .carousel-slide {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    flex: initial;
    overflow: hidden;
    scroll-snap-align: none;
  }

  .carousel-slide.event-slide {
    grid-area: event;
  }

  .carousel-slide:nth-child(2) {
    grid-area: policy;
  }

  .carousel-slide:nth-child(3) {
    grid-area: risk;
  }

  .game-body > .imperial-choice-panel {
    grid-area: choices;
    position: static;
  }

  .play-surface > .card-dots {
    display: none;
  }

  .game-screen .event-card h2 {
    font-size: clamp(2.4rem, 3vw, 3.6rem);
  }

  .game-screen .event-text {
    max-width: 720px;
    font-size: 1.16rem;
  }

  .game-screen .option-list {
    gap: 14px;
    height: 100%;
    align-content: space-evenly;
    grid-auto-rows: minmax(82px, max-content);
    min-height: 0;
    overflow-y: auto;
  }

  .game-screen .option-btn {
    min-height: 82px;
    padding: 17px 18px;
  }

  .game-screen > .stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
  }

  .game-screen .stat-row {
    display: grid;
    grid-template-rows: auto auto minmax(38px, 1fr);
    gap: 7px;
    min-height: 112px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 250, 229, 0.72);
  }

  .game-screen .stat-track {
    height: 10px;
  }

  .game-screen .stat-desc {
    display: block;
    color: #6c5134;
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .response-panel {
    grid-template-rows: auto auto;
    align-content: start;
  }

  .response-pages {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    overflow: visible;
  }

  .response-page {
    flex: initial;
    overflow: visible;
  }

  .response-panel > .btn {
    min-height: 48px;
    align-self: start;
  }

  .response-dots {
    display: none;
  }
}
