:root {
  color-scheme: light;
  --paper: #fffaf1;
  --paper-deep: #f2e1c7;
  --ink: #2b2520;
  --muted: #796d60;
  --line: #dec9a9;
  --rose: #b83f55;
  --rose-deep: #7f2638;
  --leaf: #4f6f46;
  --blue: #2f6473;
  --gold: #aa7a2a;
  --shadow: rgba(56, 34, 20, 0.12);
  --brush-font: "STXingkai", "华文行楷", "KaiTi", "楷体", "Kaiti SC", "FangSong", serif;
  --display-brush-font: "FZShuTi", "方正舒体", "STLiti", "华文隶书", "LiSu", "隶书", "STKaiti", "KaiTi", serif;
  --ui-font: "Noto Serif SC", "Songti SC", "SimSun", "Microsoft YaHei", serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(91, 66, 43, 0.08) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(0deg, rgba(91, 66, 43, 0.06) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(135deg, #efe2d1 0%, #dfe7dc 48%, #ead8cf 100%);
  color: var(--ink);
  font-family: var(--ui-font);
  font-size: 15px;
  letter-spacing: 0;
}

button {
  font: inherit;
}

.gameShell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 20px;
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.clubPanel,
.topbar,
.setupBand,
.toolSurface {
  border: 1px solid rgba(121, 88, 50, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.93), rgba(247, 238, 220, 0.88)),
    linear-gradient(90deg, rgba(170, 122, 42, 0.04) 1px, transparent 1px) 0 0 / 24px 24px;
  box-shadow: 0 18px 42px var(--shadow);
  backdrop-filter: blur(10px);
}

.clubPanel {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  min-height: 620px;
  overflow: auto;
  padding: 16px;
}

.clubMark {
  position: relative;
  min-height: 172px;
  padding: 18px 14px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 250, 241, 0.82) 0 42%, rgba(255, 250, 241, 0.25) 74%),
    url("/assets/club-mark-bg.png") center / cover no-repeat;
}

.clubMark img {
  display: none;
}

.clubMark span,
.eyebrow,
.smallCaps,
.label {
  color: var(--rose-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.clubMark strong {
  position: relative;
  display: block;
  margin-top: 8px;
  font-family: var(--brush-font);
  font-size: 32px;
  line-height: 1.1;
}

.sideSection {
  margin-top: 18px;
}

.sideSection h2 {
  margin: 0 0 10px;
  font-family: var(--brush-font);
  font-size: 16px;
}

.topicList,
.poemBook,
.segments,
.imageryTags,
.candidateList {
  display: grid;
  gap: 8px;
}

.topicButton,
.bookItem,
.segment,
.imageryTag,
.candidateButton,
.primaryButton,
.secondaryButton,
.ghostButton,
.tab {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  cursor: pointer;
}

.topicButton {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  text-align: left;
}

.topicButton span,
.bookItem strong,
.label,
.segment,
.imageryTag,
.customInput,
.customAdd,
.primaryButton,
.secondaryButton,
.ghostButton,
.tab {
  font-family: var(--brush-font);
}

.topicButton span {
  font-size: 19px;
  line-height: 1.1;
}

.topicButton small,
.bookItem span,
.blankPanel span,
.advisorNote span,
.pointIntro p,
.closing {
  color: var(--muted);
}

.topicButton.active,
.bookItem.active,
.tab.active {
  border-color: rgba(184, 63, 85, 0.35);
  background: #fff3f0;
  color: var(--rose-deep);
}

.segment.active,
.imageryTag.active {
  border-color: transparent;
  background: transparent;
  color: var(--rose-deep);
}

.bookItem {
  display: grid;
  gap: 5px;
  padding: 10px;
  text-align: left;
}

.bookEmpty {
  margin: 0;
  color: var(--muted);
}

.desk {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.topbar h1 {
  margin: 6px 0 0;
  font-family: var(--display-brush-font);
  font-size: clamp(27px, 4vw, 50px);
  line-height: 1.02;
  font-weight: 400;
  color: #231e1a;
}

.eyebrow {
  margin: 0;
}

.llmStatus {
  display: none;
  flex: 0 0 auto;
  max-width: 280px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.llmStatus.ok {
  border-color: rgba(79, 111, 70, 0.4);
  color: var(--leaf);
}

.llmStatus.warn {
  border-color: rgba(170, 122, 42, 0.42);
  color: #7b551c;
}

.llmStatus.loading {
  color: var(--blue);
}

.topActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.userBadge {
  display: grid;
  gap: 2px;
  min-width: 96px;
  padding: 7px 12px;
  border: 1px solid rgba(222, 201, 169, 0.75);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.64);
  text-align: center;
}

.userBadge span {
  color: var(--muted);
  font-size: 12px;
}

.userBadge strong {
  color: var(--rose-deep);
  font-family: var(--brush-font);
  font-size: 19px;
  font-weight: 400;
}

.quietButton {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(222, 201, 169, 0.75);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--brush-font);
  font-size: 17px;
}

.setupBand {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(360px, 1fr) 166px;
  align-items: start;
  gap: 16px;
  margin-top: 14px;
  padding: 14px;
}

.controlGroup {
  position: relative;
  display: grid;
  gap: 8px;
}

.controlGroup:first-child::after {
  content: "";
  position: absolute;
  top: 12px;
  right: -8px;
  bottom: 14px;
  width: 1px;
  background:
    linear-gradient(
      180deg,
      transparent,
      rgba(63, 50, 39, 0.44) 18%,
      rgba(63, 50, 39, 0.44) 82%,
      transparent
    );
}

.setupBand .label {
  justify-self: center;
  width: 100%;
  text-align: center;
  font-size: 18px;
  line-height: 1;
}

.segments {
  grid-template-columns: repeat(3, minmax(58px, 1fr));
}

.segment,
.imageryTag {
  position: relative;
  z-index: 0;
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 0 6px;
  border-color: transparent;
  background: transparent;
  line-height: 1;
  text-align: center;
  font-size: 19px;
  white-space: nowrap;
}

.segment::after,
.imageryTag::after {
  content: "";
  position: absolute;
  inset: 2px 5px;
  pointer-events: none;
  border: 2px solid rgba(127, 38, 56, 0.72);
  border-radius: 57% 43% 52% 48% / 48% 58% 42% 52%;
  transform: rotate(-4deg);
  opacity: 0;
  box-shadow:
    0 0 0 1px rgba(127, 38, 56, 0.08),
    inset 0 0 6px rgba(127, 38, 56, 0.06);
}

.segment::before,
.imageryTag::before {
  content: "";
  position: absolute;
  inset: 5px 8px 4px 6px;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 42% 48%, rgba(127, 38, 56, 0.08), transparent 62%),
    radial-gradient(circle at 64% 42%, rgba(43, 37, 32, 0.05), transparent 54%);
  border-bottom: 2px solid rgba(127, 38, 56, 0.32);
  border-radius: 50%;
  transform: rotate(3deg);
  opacity: 0;
}

.segment.active::after,
.imageryTag.active::after,
.segment:hover::after,
.imageryTag:hover::after {
  opacity: 1;
}

.segment.active::before,
.imageryTag.active::before,
.segment:hover::before,
.imageryTag:hover::before {
  opacity: 1;
}

.imageryTags {
  grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
}

.customChoice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 6px;
}

.customMood {
  grid-column: 1 / -1;
}

.customImagery {
  grid-column: span 2;
}

.draftColumn {
  display: grid;
  align-self: end;
  gap: 8px;
}

.customImageryBox .customImagery {
  grid-column: auto;
}

.customInput,
.customAdd {
  min-height: 34px;
  border: 1px solid rgba(222, 201, 169, 0.75);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.28);
  color: var(--ink);
  font-size: 17px;
  white-space: nowrap;
}

.customInput {
  padding: 0 10px;
  text-align: left;
}

.customInput::placeholder {
  color: rgba(121, 109, 96, 0.72);
  text-align: left;
}

.customAdd {
  padding: 0;
  color: var(--rose-deep);
  cursor: pointer;
  text-align: center;
}

.primaryButton,
.secondaryButton,
.ghostButton {
  min-height: 42px;
  padding: 0 16px;
  font-weight: 700;
  font-size: 20px;
}

.primaryButton {
  border-color: var(--rose);
  background: var(--rose);
  color: #fff;
  font-family: var(--display-brush-font);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.secondaryButton {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.ghostButton {
  background: rgba(255, 255, 255, 0.35);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.workGrid {
  display: grid;
  grid-template-columns: minmax(540px, 0.92fr) minmax(350px, 0.58fr);
  align-items: stretch;
  gap: 16px;
  margin-top: 14px;
}

.poemNav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  color: rgba(43, 37, 32, 0.76);
  font-family: var(--brush-font);
}

.poemNav button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  font-size: 26px;
}

.poemNav button:first-child {
  justify-self: start;
}

.poemNav button:last-child {
  justify-self: end;
}

.poemNav button:disabled {
  opacity: 0.25;
}

.poemNav span {
  color: rgba(121, 109, 96, 0.64);
  font-family: var(--ui-font);
  font-size: 13px;
}

.toolSurface {
  min-height: 780px;
  height: 100%;
  padding: 18px;
}

.poemSurface {
  position: relative;
  --paper-axis-shift: 0px;
  --paper-content-width: min(68%, 560px);
  min-height: 780px;
  overflow: hidden;
  padding: 0 0 42px;
  border: 1px solid rgba(70, 46, 31, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 250, 241, 0.04), rgba(255, 250, 241, 0.04)),
    url("/assets/ink-desk-bg.png") center / cover no-repeat;
  box-shadow:
    0 22px 50px rgba(45, 30, 20, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.poemSurface::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(43, 37, 32, 0.14), transparent 26%, transparent 82%, rgba(43, 37, 32, 0.1)),
    radial-gradient(ellipse at center, transparent 42%, rgba(43, 37, 32, 0.09) 100%);
}

.surfaceHead {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: var(--paper-content-width);
  margin: 212px auto 0;
  text-align: center;
  transform: translateX(var(--paper-axis-shift));
}

.surfaceHead > div:first-child {
  display: grid;
  justify-items: center;
}

.surfaceHead h2 {
  margin: 8px 0 0;
  font-family: var(--brush-font);
  font-size: 36px;
  line-height: 1.05;
}

.surfaceHead .smallCaps {
  font-size: 17px;
}

.inkBox {
  position: absolute;
  top: -42px;
  right: clamp(-108px, -9vw, -62px);
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 50%, rgba(31, 36, 34, 0.31) 0 28%, rgba(31, 36, 34, 0.2) 36%, transparent 68%),
    radial-gradient(circle at 31% 36%, rgba(31, 36, 34, 0.2) 0 18%, transparent 40%),
    radial-gradient(circle at 68% 66%, rgba(31, 36, 34, 0.18) 0 21%, transparent 44%);
  box-shadow: inset 0 0 22px rgba(255, 250, 241, 0.24);
  font-family: var(--ui-font);
}

.inkBox span {
  color: rgba(43, 37, 32, 0.8);
  font-size: 18px;
  font-weight: 700;
}

.inkBox strong {
  margin-top: -10px;
  font-family: var(--brush-font);
  font-size: 34px;
  color: rgba(43, 37, 32, 0.92);
}

.poemLines {
  position: relative;
  z-index: 1;
  --poem-grid-offset-y: 20px;
  --poem-row-height: 78px;
  --poem-row-gap: 0px;
  --poem-grid-row: calc(var(--poem-row-height) + var(--poem-row-gap));
  display: grid;
  justify-items: center;
  gap: var(--poem-row-gap);
  width: var(--paper-content-width);
  min-height: 300px;
  margin: 20px auto 18px;
  padding: 22px 20px 18px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(105, 80, 52, 0.08) 1px, transparent 1px) 0 var(--poem-grid-offset-y) / 40px 100%,
    linear-gradient(180deg, rgba(105, 80, 52, 0.05) 1px, transparent 1px) 0 var(--poem-grid-offset-y) / 100% var(--poem-grid-row);
  transform: translateX(var(--paper-axis-shift));
}

.poemLine {
  display: grid;
  grid-template-columns: 28px max-content;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: var(--poem-row-height);
}

.poemLine > div {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}

.lineNo {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #efe0ca;
  color: var(--muted);
  font-size: 12px;
}

.poemChar {
  position: relative;
  display: inline-grid;
  place-items: center;
  --char-width: 38px;
  min-width: var(--char-width);
  width: calc(var(--char-width) * var(--char-count, 1));
  height: 56px;
  margin-right: 3px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-family: var(--brush-font);
  font-size: 30px;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.poemChar.multi {
  width: calc(var(--char-width) * var(--char-count, 2));
  padding: 0;
}

.poemStack {
  display: grid;
  grid-template-rows: 36px 12px;
  justify-items: center;
  align-items: center;
  width: 100%;
}

.glyphRow,
.toneRow {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--char-width);
  justify-content: center;
  justify-items: center;
  align-items: center;
  width: 100%;
}

.glyphRow span {
  display: grid;
  place-items: center;
  width: var(--char-width);
}

.toneRow {
  align-self: start;
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  color: rgba(67, 61, 55, 0.34);
}

.toneRow span {
  display: grid;
  place-items: center;
  width: var(--char-width);
}

button.poemChar.point {
  border-color: transparent;
  background: transparent;
  color: var(--rose-deep);
}

button.poemChar.point::after,
button.poemChar.point::before {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

button.poemChar.point::after {
  top: 36%;
  left: calc(50% + 5px);
  width: calc(var(--char-width) * var(--char-count, 1) - 5px);
  height: 35px;
  border: 2px solid rgba(127, 38, 56, 0.7);
  border-radius: 54% 46% 58% 42% / 48% 56% 44% 52%;
  transform: translate(-50%, -50%) rotate(-6deg) scale(0.94);
}

button.poemChar.point::before {
  display: none;
  top: 36%;
  left: calc(50% + 5px);
  width: calc(var(--char-width) * var(--char-count, 1) - 10px);
  height: 26px;
  border-bottom: 2px solid rgba(43, 37, 32, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(5deg);
}

button.poemChar.point.active {
  border-color: transparent;
  box-shadow: none;
}

button.poemChar.point.active::after {
  opacity: 1;
}

button.poemChar.point.active::after {
  animation: inkCircleDraw 560ms ease-out both;
}

button.poemChar.point.used {
  border-color: transparent;
  background: transparent;
  color: var(--rose-deep);
}

@keyframes inkCircleDraw {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-16deg) scale(0.74);
  }
  62% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-4deg) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-6deg) scale(1);
  }
}

.emptyPoem,
.blankPanel {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
  color: var(--muted);
  text-align: center;
}

.emptyPoem strong,
.blankPanel strong {
  color: var(--ink);
  font-size: 22px;
}

.actionRow {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 10px;
  width: var(--paper-content-width);
  margin: 0 auto;
  transform: translateX(var(--paper-axis-shift));
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
}

.tab {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
  font-size: 20px;
}

.panel {
  display: none;
  padding-top: 16px;
}

.panel.active {
  display: block;
}

.pointIntro span {
  color: var(--rose-deep);
  font-weight: 700;
}

.pointIntro h3 {
  margin: 8px 0;
  font-size: 24px;
}

.candidateList {
  margin-top: 14px;
}

.restoreButton {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(170, 122, 42, 0.28);
  border-radius: 6px;
  background: rgba(255, 250, 241, 0.5);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.restoreButton strong {
  display: grid;
  place-items: center;
  min-width: 56px;
  width: 56px;
  height: 42px;
  color: var(--ink);
  font-family: var(--brush-font);
  font-size: 27px;
}

.restoreButton span {
  font-weight: 700;
}

.restoreButton:disabled {
  opacity: 0.45;
}

.candidateButton {
  display: grid;
  grid-template-columns: 84px 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 70px;
  padding: 10px;
  text-align: left;
}

.candidateButton.selected {
  border-color: rgba(127, 38, 56, 0.42);
  background: rgba(255, 243, 240, 0.5);
}

.candidateButton:hover:not(:disabled),
.topicButton:hover,
.bookItem:hover,
.ghostButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(56, 34, 20, 0.08);
}

.segment:hover,
.imageryTag:hover {
  background: transparent;
  box-shadow: none;
}

.candidateButton strong {
  display: grid;
  place-items: center;
  min-width: 56px;
  width: 56px;
  height: 48px;
  padding: 0 8px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 46%, rgba(184, 63, 85, 0.08), transparent 66%),
    #fff3f0;
  color: var(--rose-deep);
  font-family: var(--brush-font);
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.candidateButton strong.multiWord {
  width: 78px;
}

.candidateButton span {
  color: var(--blue);
  font-weight: 400;
}

.candidateButton small {
  color: var(--muted);
  line-height: 1.5;
}

.advisorNote,
.changeLog,
.sealBox {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
}

.advisorNote {
  display: grid;
  gap: 6px;
}

.compassGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compassGrid div {
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
}

.compassGrid span,
.sealBox span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.compassGrid strong {
  font-size: 18px;
  line-height: 1.5;
}

.changeLog h3 {
  margin: 0 0 8px;
}

.changeLog p {
  margin: 6px 0;
  color: var(--muted);
}

.sealBox {
  text-align: center;
}

.sealBox strong {
  color: var(--rose-deep);
  font-family: var(--display-brush-font);
  font-size: 38px;
  font-weight: 400;
}

.scoreList {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.scoreItem {
  display: grid;
  grid-template-columns: 46px 1fr 38px;
  align-items: center;
  gap: 8px;
}

.scoreItem span {
  color: var(--muted);
  font-family: var(--display-brush-font);
}

.scoreItem div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ead8bc;
}

.scoreItem i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--rose));
}

.commentList {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.commentList article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.commentList h3 {
  margin: 0 0 8px;
  font-family: var(--display-brush-font);
  font-size: 17px;
}

.commentList h3 span {
  margin-left: 8px;
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 400;
}

.commentList p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.draftOverlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(43, 37, 32, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  backdrop-filter: blur(3px);
}

.draftOverlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.draftDialog {
  width: min(520px, calc(100vw - 40px));
  overflow: hidden;
  border: 1px solid rgba(121, 88, 50, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 250, 241, 0.96), rgba(247, 238, 220, 0.92)),
    linear-gradient(90deg, rgba(170, 122, 42, 0.06) 1px, transparent 1px) 0 0 / 24px 24px;
  box-shadow: 0 24px 70px rgba(43, 37, 32, 0.28);
  text-align: center;
}

.draftDialog h2 {
  margin: 22px 0 4px;
  color: var(--rose-deep);
  font-family: var(--brush-font);
  font-size: 34px;
  font-weight: 400;
}

.loadingBrush {
  display: flex;
  justify-content: center;
  gap: 7px;
  height: 18px;
  margin-top: 7px;
  margin-bottom: 14px;
  transform: translateY(3px);
}

.loadingBrush span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(43, 37, 32, 0.55);
  animation: brushDot 1.1s ease-in-out infinite;
}

.loadingBrush span:nth-child(2) {
  animation-delay: 0.16s;
}

.loadingBrush span:nth-child(3) {
  animation-delay: 0.32s;
}

.draftDialog img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
}

.authScreen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(91, 66, 43, 0.08) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(0deg, rgba(91, 66, 43, 0.06) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(135deg, rgba(239, 226, 209, 0.94), rgba(223, 231, 220, 0.93));
}

.authScreen.hidden {
  display: none;
}

.authPanel {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 1fr);
  gap: 26px;
  width: min(860px, calc(100vw - 36px));
  padding: 18px 20px;
  border: 1px solid rgba(121, 88, 50, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(105deg, rgba(255, 250, 241, 0.96) 0 48%, rgba(247, 238, 220, 0.92) 100%),
    url("/assets/club-mark-bg.png") -132px center / 560px auto no-repeat;
  box-shadow: 0 24px 70px rgba(43, 37, 32, 0.18);
}

.authBrand {
  min-height: 300px;
  padding: 24px 20px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 18%, rgba(184, 63, 85, 0.06), transparent 38%),
    linear-gradient(90deg, rgba(255, 250, 241, 0.9), rgba(255, 250, 241, 0.24));
}

.authBrand span {
  color: var(--rose-deep);
  font-size: 13px;
  font-weight: 700;
}

.authBrand h2 {
  margin: 16px 0 10px;
  font-family: var(--display-brush-font);
  font-size: clamp(42px, 7vw, 68px);
  font-weight: 400;
  line-height: 0.98;
}

.authBrand p {
  max-width: 14em;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.authForm {
  display: grid;
  align-content: center;
  gap: 13px;
  padding: 22px;
  border: 1px solid rgba(222, 201, 169, 0.68);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.82), rgba(255, 246, 231, 0.72)),
    linear-gradient(90deg, rgba(170, 122, 42, 0.045) 1px, transparent 1px) 0 0 / 22px 22px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 10px 28px rgba(56, 34, 20, 0.08);
}

.authTabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.44);
}

.authTab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--brush-font);
  font-size: 20px;
}

.authIcon {
  display: inline-block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  background: currentColor;
  opacity: 0.9;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.iconLogin {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4'/%3E%3Cpath d='m10 17 5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3C/svg%3E");
}

.iconRegister {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M19 8v6'/%3E%3Cpath d='M22 11h-6'/%3E%3C/svg%3E");
}

.iconPenName {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E");
}

.iconMail {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='16' x='2' y='4' rx='2'/%3E%3Cpath d='m22 7-8.97 5.7a2 2 0 0 1-2.06 0L2 7'/%3E%3C/svg%3E");
}

.iconLock {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}

.iconBrush {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9.06 11.9 8.07-8.06a2.85 2.85 0 1 1 4.03 4.03l-8.06 8.07'/%3E%3Cpath d='M7.07 14.94c-1.66 0-3 1.34-3 3 0 1.1-.9 2-2 2 2.8 1.3 5.06.5 6.93-1.37a3 3 0 0 0-1.93-3.63Z'/%3E%3C/svg%3E");
}

.authTab.active {
  background: #fff3f0;
  color: var(--rose-deep);
}

.authForm label {
  display: grid;
  gap: 6px;
}

.authForm label span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--rose-deep);
  font-size: 13px;
  font-weight: 700;
}

.authForm input {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(222, 201, 169, 0.82);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  font: inherit;
}

.authMessage {
  min-height: 20px;
  margin: 0;
  color: var(--rose-deep);
  line-height: 1.4;
}

.authMessage[data-tone="ok"] {
  color: var(--leaf);
}

.authSubmit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
}

.authSubmit .authIcon {
  width: 21px;
  height: 21px;
}

@keyframes brushDot {
  0%,
  100% {
    transform: translateY(0) scale(0.8);
    opacity: 0.38;
  }
  45% {
    transform: translateY(-5px) scale(1);
    opacity: 0.9;
  }
}

@media (max-width: 1080px) {
  .gameShell,
  .workGrid {
    grid-template-columns: 1fr;
  }

  .clubPanel {
    position: static;
    height: auto;
    min-height: 0;
  }

  .topicList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .setupBand {
    grid-template-columns: 1fr;
  }

  .controlGroup:first-child::after {
    display: none;
  }

  .primaryButton,
  .draftColumn {
    align-self: stretch;
  }

  .authPanel {
    grid-template-columns: 1fr;
  }

  .authBrand {
    min-height: 180px;
  }
}

@media (max-width: 680px) {
  .gameShell {
    width: min(100% - 20px, 1420px);
    padding-top: 10px;
  }

  .topbar,
  .surfaceHead,
  .actionRow {
    align-items: stretch;
    flex-direction: column;
  }

  .llmStatus {
    max-width: 100%;
  }

  .topActions {
    align-items: stretch;
    flex-direction: column;
  }

  .topicList,
  .segments,
  .imageryTags,
  .compassGrid {
    grid-template-columns: 1fr;
  }

  .customImagery {
    grid-column: 1 / -1;
  }

  .poemSurface,
  .toolSurface {
    min-height: 0;
    padding: 14px;
  }

  .poemSurface {
    --paper-axis-shift: 0px;
    --paper-content-width: min(88%, 560px);
  }

  .surfaceHead {
    align-items: center;
    margin-top: 172px;
  }

  .surfaceHead h2 {
    font-size: 30px;
  }

  .surfaceHead .smallCaps {
    font-size: 15px;
  }

  .inkBox {
    top: -28px;
    right: -54px;
    width: 76px;
    height: 76px;
  }

  .inkBox span {
    font-size: 15px;
  }

  .inkBox strong {
    font-size: 30px;
  }

  .poemLines {
    --poem-grid-offset-y: 14px;
    --poem-row-height: 62px;
    --poem-row-gap: 0px;
    padding: 14px 10px;
  }

  .poemLine {
    grid-template-columns: 24px max-content;
    justify-content: center;
    gap: 6px;
  }

  .poemChar {
    --char-width: 30px;
    min-width: var(--char-width);
    width: calc(var(--char-width) * var(--char-count, 1));
    height: 46px;
    margin-right: 1px;
    font-size: 23px;
  }

  .poemChar.multi {
    width: calc(var(--char-width) * var(--char-count, 2));
    padding: 0;
  }

  .poemStack {
    grid-template-rows: 28px 10px;
  }

  .toneRow {
    font-size: 9px;
  }

  button.poemChar.point::after {
    width: calc(var(--char-width) * var(--char-count, 1) - 4px);
    height: 29px;
  }

  button.poemChar.point::before {
    width: calc(var(--char-width) * var(--char-count, 1) - 8px);
    height: 22px;
  }

  .candidateButton {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .candidateButton small {
    grid-column: 1 / -1;
  }

  .poemNav {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .poemNav button:first-child,
  .poemNav button:last-child {
    justify-self: center;
  }
}
