/* ============================================================================
   白日梦想家 · 样式
   设计基调：暖米白的纸感 + 一层薄雾般的青，衬线标题，克制的动效。
   ========================================================================== */

:root {
  --paper: #f8f3e9;
  --card: #fffcf6;
  --ink: #2a2622;
  --ink-soft: #7d7367;
  --ink-faint: #a89e91;
  --line: rgba(42, 38, 34, 0.1);
  --line-strong: rgba(42, 38, 34, 0.18);

  --accent: #c1552f;
  --real: #2f6b62;
  --dream: #5b4b8a;
  --felt: #1e2a2c;

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong",
    "SimSun", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Segoe UI", sans-serif;

  --radius: 18px;
  --shadow-card: 0 1px 2px rgba(42, 38, 34, 0.04),
    0 18px 40px -28px rgba(42, 38, 34, 0.45);
  --shadow-lift: 0 2px 6px rgba(42, 38, 34, 0.06),
    0 26px 50px -26px rgba(42, 38, 34, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* ------------------------------- 背景氛围 ------------------------------- */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(168deg, #fbf7ee 0%, #f4eee2 42%, #e7eef0 100%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
}

.glow-a {
  width: 68vmax;
  height: 68vmax;
  top: -24vmax;
  left: -20vmax;
  background: radial-gradient(circle, rgba(238, 198, 160, 0.75), transparent 68%);
  animation: drift 26s ease-in-out infinite;
}

.glow-b {
  width: 60vmax;
  height: 60vmax;
  bottom: -24vmax;
  right: -18vmax;
  background: radial-gradient(circle, rgba(158, 195, 203, 0.7), transparent 68%);
  animation: drift 32s ease-in-out infinite reverse;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(4vmax, 3vmax, 0) scale(1.08);
  }
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: radial-gradient(rgba(42, 38, 34, 0.055) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
  pointer-events: none;
}

/* -------------------------------- 计时条 -------------------------------- */

.timerbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  background: rgba(42, 38, 34, 0.07);
}

.timerbar[hidden] {
  display: none;
}

.timerbar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left center;
  transition: transform 0.25s linear, background-color 0.3s;
}

.timerbar.urgent i {
  background: #b3261e;
}

/* -------------------------------- 布局 -------------------------------- */

#app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(24px, env(safe-area-inset-top)) 18px
    calc(30px + env(safe-area-inset-bottom));
}

.screen {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: screen-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* -------------------------------- 首页 -------------------------------- */

.brand {
  padding-top: 2vh;
  text-align: center;
}

.kicker {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
}

.brand h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(38px, 12.5vw, 56px);
  line-height: 1.1;
  letter-spacing: 0.05em;
  margin: 0;
}

.brand .rule {
  width: 56px;
  height: 1px;
  margin: 18px auto 16px;
  background: var(--line-strong);
}

.lede {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.85;
}

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

.field label {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

input[type="text"],
input[type="search"],
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

input::placeholder {
  color: var(--ink-faint);
}

input:focus {
  border-color: rgba(42, 38, 34, 0.3);
  box-shadow: 0 0 0 4px rgba(42, 38, 34, 0.05);
}

/* -------------------------------- 按钮 -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 15px 22px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.2s, box-shadow 0.2s,
    opacity 0.2s;
  user-select: none;
}

.btn:active:not(:disabled) {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--ink);
  color: #fbf7ee;
  box-shadow: var(--shadow-card);
}

.btn-primary:hover:not(:disabled) {
  background: #3a3430;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(42, 38, 34, 0.04);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 11px;
}

/* ------------------------------ 房间列表 ------------------------------ */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 6px;
}

.section-head h2 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0;
}

.section-head span {
  font-size: 12px;
  color: var(--ink-faint);
}

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

.room-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s, border-color 0.2s;
}

.room-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--line-strong);
}

.room-item .avatar {
  font-size: 22px;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: rgba(42, 38, 34, 0.045);
  border-radius: 12px;
  flex: none;
}

.room-item .room-main {
  flex: 1;
  min-width: 0;
}

.room-item .room-main b {
  display: block;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-item .room-main small {
  display: block;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.room-item .tag {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--accent);
  flex: none;
}

.room-item:disabled {
  cursor: default;
  opacity: 0.55;
}

.room-item:disabled:hover {
  transform: none;
  box-shadow: none;
}

.empty-slot {
  padding: 26px 18px;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-faint);
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  line-height: 1.9;
}

.hint {
  font-size: 12px;
  color: var(--ink-faint);
  text-align: center;
  line-height: 1.9;
  margin-top: 2px;
}

.link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 玩法折叠 */
.rules {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 13px;
  color: var(--ink-soft);
}

.rules summary {
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  list-style: none;
}

.rules summary::-webkit-details-marker {
  display: none;
}

.rules summary::before {
  content: "＋ ";
}

.rules[open] summary::before {
  content: "－ ";
}

.rules ol {
  margin: 12px 0 0;
  padding-left: 20px;
  line-height: 1.95;
}

.rules b {
  color: var(--ink);
  font-weight: 500;
}

/* -------------------------------- 房间等待 -------------------------------- */

.code-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.code-card .label {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
}

.code-card strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(38px, 12vw, 50px);
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.15;
  margin: 6px 0 0;
  text-indent: 0.16em;
}

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

.seat {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 15px;
  background: var(--card);
  border: 1px solid var(--line);
}

.seat .avatar {
  font-size: 22px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: rgba(42, 38, 34, 0.05);
  border-radius: 12px;
  flex: none;
}

.seat .who {
  min-width: 0;
}

.seat .who b {
  display: block;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat .who small {
  font-size: 11px;
  color: var(--ink-faint);
}

.seat-empty {
  border-style: dashed;
  background: transparent;
  color: var(--ink-faint);
}

.seat-empty .avatar {
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--ink-faint);
  font-size: 16px;
}

.seat.offline .who b::after {
  content: " · 掉线";
  color: var(--accent);
  font-size: 11px;
}

.vs {
  font-family: var(--serif);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  flex: none;
}

.invite {
  display: flex;
  gap: 8px;
}

.invite input {
  flex: 1;
  font-size: 13px;
  padding: 11px 14px;
  color: var(--ink-soft);
  background: rgba(255, 252, 246, 0.7);
}

/* 牌面选择 */
.deck-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deck-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  font-family: inherit;
  padding: 12px 15px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.deck-option:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.deck-option b {
  font-size: 14.5px;
  font-weight: 500;
}

.deck-option small {
  font-size: 12px;
  color: var(--ink-faint);
}

.deck-option .peek {
  font-size: 11px;
  color: var(--ink-faint);
  opacity: 0.85;
  margin-top: 5px;
  line-height: 1.6;
}

.deck-option.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(193, 85, 47, 0.07);
}

.deck-option:disabled {
  cursor: default;
  opacity: 0.75;
}

/* -------------------------------- 牌桌 -------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}

.role-pill {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

.role-pill.banker {
  background: rgba(193, 85, 47, 0.12);
  color: var(--accent);
}

.role-pill.picker {
  background: rgba(47, 107, 98, 0.12);
  color: var(--real);
}

.cd {
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: right;
}

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

.hole-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(255, 252, 246, 0.55);
  border: 1px dashed var(--line-strong);
}

.hole {
  width: 56px;
  aspect-ratio: 5 / 7;
  align-self: center;
  perspective: 800px;
  flex: none;
}

.hole-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.35, 0.1, 0.2, 1);
}

.hole.is-flipped .hole-inner {
  transform: rotateY(180deg);
}

.hole-note b {
  display: block;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.hole-note span {
  font-size: 12px;
  color: var(--ink-faint);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: start; /* 缺了这条，grid 的 stretch 会盖掉 aspect-ratio，翻开的牌会变矮 */
  gap: 8px;
}

.card {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 7;
  perspective: 900px;
  cursor: default;
}

.card[data-on="0"] {
  cursor: pointer;
}

.card[data-on="0"]:hover .card-back {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -12px rgba(0, 0, 0, 0.5);
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.1, 0.2, 1);
}

.card.is-flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.card-back {
  background: linear-gradient(155deg, #33403f 0%, #1b2426 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(233, 226, 210, 0.42);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-back::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(233, 226, 210, 0.16);
  border-radius: 6px;
}

.card-back .mark {
  font-size: 18px;
  line-height: 1;
}

.card-back small {
  position: absolute;
  bottom: 8px;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: rgba(233, 226, 210, 0.55);
}

.card-front {
  transform: rotateY(180deg);
  background: #fffdf7;
  border: 1px solid rgba(42, 38, 34, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.card-front .value {
  font-family: var(--serif);
  font-weight: 600;
  text-align: center;
  padding: 5px;
  line-height: 1.25;
  word-break: break-word;
  color: var(--ink);
}

.card-front .value.big {
  font-size: clamp(15px, 4.6vw, 20px);
}

.card-front .value.small {
  font-size: clamp(10px, 2.9vw, 13px);
}

.card-front.prize {
  background: linear-gradient(170deg, #fffaf2, #fdf0e4);
  border-color: rgba(193, 85, 47, 0.45);
}

.card-front.prize .value {
  color: var(--accent);
}

/* 底牌的牌面略大一点 */
.hole .card-face {
  border-radius: 9px;
}

.hole .card-front .value {
  font-size: 13px;
}

/* -------------------------------- 候选池 -------------------------------- */

.pool {
  background: rgba(255, 252, 246, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 12px;
}

.pool-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.pool-head b {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink);
}

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

.chip {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(42, 38, 34, 0.055);
  color: var(--ink);
  line-height: 1.5;
}

.chip.prize {
  background: rgba(193, 85, 47, 0.11);
  color: var(--accent);
  font-weight: 500;
}

/* -------------------------------- 操作区 -------------------------------- */

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

.action-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
  margin: 0;
}

.action-title .big {
  font-size: 28px;
  color: var(--accent);
}

.action-sub {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.75;
  margin: -4px 0 0;
}

.action-fine {
  font-size: 11.5px;
  color: var(--ink-faint);
  text-align: center;
  margin: -2px 0 0;
  line-height: 1.7;
}

.offer-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.offer-box:focus-within {
  border-color: rgba(193, 85, 47, 0.5);
  box-shadow: 0 0 0 4px rgba(193, 85, 47, 0.06);
}

.offer-box input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 13px 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  outline: none;
  -webkit-appearance: none;
}

.offer-box input::placeholder {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-faint);
}

.offer-unit {
  font-size: 15px;
  color: var(--ink-faint);
  flex: none;
}

.quick-row {
  display: flex;
  gap: 8px;
}

.quick {
  flex: 1;
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 6px;
  border-radius: 11px;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.quick:hover {
  background: rgba(42, 38, 34, 0.04);
  color: var(--ink);
  border-color: var(--ink-faint);
}

.decide-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.decide-row .btn {
  padding: 16px 10px;
  font-size: 15px;
}

/* 报价历史 */
.offer-log {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.log-item {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(42, 38, 34, 0.05);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.log-item.accepted {
  background: rgba(47, 107, 98, 0.12);
  color: var(--real);
}

/* 结果 */
.result-head {
  text-align: center;
}

.result-tag {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  padding: 4px 13px;
  border-radius: 999px;
}

.result-tag.accept {
  background: rgba(47, 107, 98, 0.12);
  color: var(--real);
}

.result-tag.reveal {
  background: rgba(91, 75, 138, 0.12);
  color: var(--dream);
}

.result-line {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 12px 0 4px;
  animation: stamp-in 0.5s cubic-bezier(0.22, 1.3, 0.4, 1) both;
}

@keyframes stamp-in {
  0% {
    opacity: 0;
    transform: scale(1.15);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.result-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.7;
}

.scoreline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-faint);
  padding-top: 2px;
}

.scoreline b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.scoreline .dot {
  opacity: 0.5;
}

/* -------------------------------- 结算 -------------------------------- */

.stage-title {
  font-family: var(--serif);
  font-size: clamp(24px, 7vw, 30px);
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.4;
  margin: 0;
}

.stage-sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin: -10px 0 0;
  line-height: 1.8;
}

.ranking {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ranking li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.ranking li.win {
  border-color: rgba(193, 85, 47, 0.4);
  background: linear-gradient(180deg, #fffcf6, #fdf6ee);
}

.ranking .place {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink-faint);
  width: 20px;
  text-align: center;
  flex: none;
}

.ranking .avatar {
  font-size: 22px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: rgba(42, 38, 34, 0.05);
  border-radius: 12px;
  flex: none;
}

.ranking .name {
  flex: 1;
  font-size: 15px;
}

.ranking .score {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.game-log {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.log-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--card);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.log-row span:first-child {
  color: var(--ink-faint);
  min-width: 56px;
}

.log-row span:nth-child(2) {
  flex: 1;
}

.log-row b {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink);
}

/* -------------------------------- 等待 -------------------------------- */

.waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  text-align: center;
}

.pulse-dots {
  display: flex;
  gap: 7px;
  justify-content: center;
}

.pulse-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
  animation: blink 1.3s ease-in-out infinite;
}

.pulse-dots i:nth-child(2) {
  animation-delay: 0.18s;
}

.pulse-dots i:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* -------------------------------- Toast -------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translate(-50%, 14px);
  z-index: 90;
  max-width: min(88vw, 380px);
  padding: 12px 20px;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  color: #fbf7ee;
  background: rgba(42, 38, 34, 0.94);
  border-radius: 14px;
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* -------------------------------- 杂项 -------------------------------- */

.conn-flag {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  right: 14px;
  z-index: 70;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: rgba(255, 252, 246, 0.9);
  border: 1px solid rgba(193, 85, 47, 0.28);
  border-radius: 999px;
  padding: 4px 11px;
  opacity: 0;
  transition: opacity 0.3s;
}

.conn-flag.show {
  opacity: 1;
}

@media (min-width: 720px) {
  #app {
    justify-content: center;
    padding-top: 36px;
  }
  .brand {
    padding-top: 0;
  }
  .screen {
    max-width: 500px;
  }
  .hole {
    width: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
