/* ---------- 中央 ---------- */
.center-panel {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  max-width: min(480px, 100%);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  text-align: center;
}

.center-panel.is-enter {
  animation: rise-in var(--duration-normal) var(--ease-out-expo);
}

.center-panel.compact {
  padding: var(--space-3) var(--space-4);
  background: rgba(8, 29, 24, 0.35);
}

.center-panel p {
  margin: 0;
}

.center-caption {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.center-caption.faint {
  color: var(--text-faint);
  font-size: var(--text-xs);
}

.center-caption.is-hot {
  color: var(--brass-soft);
}

.invite-label {
  color: var(--text-faint);
  font-size: var(--text-xs);
  letter-spacing: 0.3em;
}

.room-code {
  display: flex;
  gap: 8px;
}

.room-code span {
  display: grid;
  place-items: center;
  width: 1.2em;
  height: 1.6em;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-rank);
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem);
  font-weight: 700;
  box-shadow: var(--shadow-card);
}

.room-code span:nth-child(odd) {
  transform: rotate(-3deg);
}

.room-code span:nth-child(even) {
  color: var(--card-red);
  transform: rotate(2deg) translateY(3px);
}

.invite-hint {
  max-width: 28em;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.invite-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.invite-link code {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--brass-soft);
  font-size: 13px;
  word-break: break-all;
}

.level-badge {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border: 2px solid var(--brass);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, rgba(240, 211, 141, 0.25), rgba(8, 29, 24, 0.6));
  line-height: 1;
}

.level-badge small {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.2em;
}

.level-badge b {
  color: var(--brass-soft);
  font-family: var(--font-rank);
  font-size: 2.3rem;
}

.tribute-lines {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--brass-soft);
  font-size: var(--text-sm);
}

/* 结算 */
.result-kicker {
  color: var(--text-faint);
  font-size: var(--text-xs);
  letter-spacing: 0.25em;
}

.result-title {
  margin: 0;
  color: var(--brass-soft);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 1.3rem + 2vw, 2.8rem);
  font-weight: 900;
}

.mood-win .result-title {
  text-shadow: 0 0 24px rgba(240, 211, 141, 0.55);
}

.mood-win.is-enter .result-title {
  animation: boom 700ms var(--ease-spring);
}

.mood-lose .result-title {
  color: var(--text-muted);
}

.result-sub {
  color: var(--text-muted);
}

.result-rows {
  display: grid;
  width: min(320px, 100%);
  margin: var(--space-2) 0;
  padding: 0;
  list-style: none;
}

.result-rows li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-3);
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  text-align: left;
}

.result-rows span {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.result-rows em {
  min-width: 3em;
  font-family: var(--font-rank);
  font-size: 1.15rem;
  font-style: normal;
  font-weight: 700;
  text-align: right;
}

.result-rows .is-up {
  color: var(--brass-soft);
}

.result-rows .is-down {
  color: #ff9f8a;
}

/* ---------- 操作区 ---------- */
.console {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 60px;
  padding: var(--space-2) var(--space-4) 0;
}

.console-status {
  min-width: 12em;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-align: center;
}

.console-status.is-good {
  color: var(--brass-soft);
  font-weight: 600;
}

.console-status.is-bad {
  color: #ffb199;
}

.btn-play {
  min-width: 9em;
}

/* 结算面板浮在整张桌面中央，不挤占各家亮牌区 */
.phase-ended .center {
  grid-area: 1 / 1 / -1 / -1;
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.phase-ended .center-panel {
  pointer-events: auto;
  max-height: calc(100% - 16px);
  overflow: auto;
  background: linear-gradient(180deg, rgba(18, 58, 48, 0.98), rgba(8, 29, 24, 0.98));
  box-shadow: var(--shadow-float);
}

.result-rows {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-4);
  width: min(380px, 100%);
}

.result-rows li {
  grid-template-columns: minmax(0, 1fr) auto;
}

.result-rows li span {
  grid-column: 1;
  grid-row: 2;
  font-size: var(--text-xs);
}

.result-rows li em {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
}

.result-rows li b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-height: 560px) and (min-width: 721px) {
  .console {
    min-height: 48px;
  }

  .level-badge {
    width: 60px;
    height: 60px;
  }

  .level-badge b {
    font-size: 1.7rem;
  }
}
