* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  background: #101827;
  color: #f8fafc;
}

.tablet-landscape-hint {
  margin: 10px auto 0;
  width: min(1180px, calc(100% - 24px));
  padding: 8px 12px;
  border: 1px solid rgba(250, 204, 21, 0.36);
  border-radius: 8px;
  background: rgba(250, 204, 21, 0.1);
  color: #fde68a;
  font-size: 13px;
  text-align: center;
}

.tablet-landscape-hint[hidden] {
  display: none;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.topbar h1 {
  margin-top: 3px;
  color: #facc15;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.16);
}

.topbar h1:empty {
  display: none;
}

.player-greeting {
  color: #f8fafc;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.join-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.join-controls input {
  width: 100px;
}

.join-controls .status {
  margin-left: 8px;
}

h1, h2, h3 {
  margin: 0;
}

h2 {
  font-size: 18px;
}

.layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 16px;
}

.panel {
  background: #172033;
  border: 1px solid rgba(234, 179, 8, 0.22);
  border-radius: 8px;
  padding: 12px;
}

.panel + .panel {
  margin-top: 10px;
}

.join-panel {
  padding: 10px 12px;
}

.status-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 210px) minmax(0, 1fr);
  grid-auto-rows: minmax(152px, auto);
  align-items: stretch;
  gap: 10px;
  margin-top: 10px;
}

.status-grid + .panel {
  margin-top: 10px;
}

.status-grid > .panel {
  min-height: 152px;
  height: auto;
  margin-top: 0;
}

.timer-panel {
  display: grid;
  align-content: center;
  min-height: 0;
  overflow: visible;
}

.timer-display {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  margin: 6px 0 5px;
}

.bp-side-panel {
  display: block;
  min-height: 0;
  overflow: visible;
  border-color: rgba(148, 163, 184, 0.22);
}

.bp-side-panel.is-mine {
  border-color: rgba(250, 204, 21, 0.95);
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.35), 0 0 18px rgba(250, 204, 21, 0.16);
}

.turn-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.turn-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.turn-title-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 28px;
  margin-left: 8px;
  padding: 0 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
  vertical-align: 2px;
}

.turn-title-action.action-ban {
  color: #fed7aa;
  background: rgba(154, 52, 18, 0.55);
  border-color: rgba(251, 146, 60, 0.85);
  box-shadow: 0 0 14px rgba(251, 146, 60, 0.18);
}

.turn-title-action.action-pick {
  color: #a5f3fc;
  background: rgba(21, 94, 117, 0.55);
  border-color: rgba(34, 211, 238, 0.85);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.18);
}

.compact-timer-display {
  display: none;
}

.turn-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.muted {
  color: #94a3b8;
}

.lineup-summary-text {
  font-size: 13px;
  line-height: 1.38;
}

.lineup-summary-line {
  display: block;
  color: #aab4c3;
}

.lineup-summary-note {
  display: block;
  margin-top: 2px;
  color: #cbd5e1;
  font-size: 13px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

label {
  color: #cbd5e1;
  font-size: 13px;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.checkline input[type="checkbox"] {
  width: auto;
  transform: scale(0.9);
}

input, textarea {
  width: 100%;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

button {
  border: 1px solid rgba(234, 179, 8, 0.35);
  background: #263245;
  color: #fef3c7;
  border-radius: 6px;
  padding: 9px 12px;
  font: inherit;
  cursor: pointer;
}

button.primary {
  background: #eab308;
  color: #111827;
  font-weight: 700;
}

button.danger {
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}

.empty-ban-button {
  border-color: rgba(148, 163, 184, 0.55);
  background: linear-gradient(180deg, #334155 0%, #111827 100%);
  color: #f8fafc;
  font-weight: 700;
}

.selected-summary-label {
  flex: 0 0 auto;
  color: #fde68a;
  font-weight: 700;
  white-space: nowrap;
}

.selected-slot-grid {
  --selected-slot-count: 2;
  display: grid;
  grid-template-columns: repeat(var(--selected-slot-count), 38px);
  gap: 5px;
  align-items: center;
}

.selected-slot {
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: rgba(15, 23, 42, 0.72);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fde68a;
}

.selected-slot.empty {
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.35);
  color: rgba(203, 213, 225, 0.68);
}

.selected-slot.filled {
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.24), 0 8px 18px rgba(0, 0, 0, 0.26);
}

.selected-slot.filled:hover {
  transform: translateY(-1px);
  border-color: rgba(250, 204, 21, 0.85);
}

.selected-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.selected-slot-initial,
.selected-slot-placeholder {
  font-size: 13px;
  font-weight: 800;
}

.selected-slot-remove {
  position: absolute;
  right: 1px;
  top: 1px;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  color: #fef3c7;
  border: 1px solid rgba(250, 204, 21, 0.55);
  font-size: 12px;
  line-height: 13px;
  font-weight: 900;
}

.selected-slot.empty-ban-choice {
  border-color: rgba(148, 163, 184, 0.75);
  background: rgba(148, 163, 184, 0.18);
}

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

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

.pin {
  background: #0f172a;
  border: 1px dashed #475569;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.pin strong {
  display: block;
  color: #facc15;
  font-size: 24px;
  margin-top: 4px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #0f172a;
  color: #cbd5e1;
  border: 1px solid #334155;
  font-size: 13px;
}

.status.ok {
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.35);
}

.status.warn {
  color: #fde68a;
  border-color: rgba(253, 230, 138, 0.35);
}

.status.bad {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(127, 29, 29, 0.4);
}

.status.blink {
  animation: playerStatusBlink 0.8s ease-in-out infinite;
}

@keyframes playerStatusBlink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 8px;
  overflow: visible;
}

.grid.pool-filter-view {
  grid-template-columns: repeat(12, 1fr);
}

.character {
  position: relative;
  min-height: 64px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.character.available {
  border-color: rgba(234, 179, 8, 0.32);
}

.character.used {
  background: linear-gradient(180deg, #334155 0%, #111827 100%) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  box-shadow: none !important;
  color: #94a3b8;
  filter: grayscale(0.9) saturate(0.12) brightness(0.78);
  opacity: 0.82;
}

.character.used .character-avatar {
  filter: grayscale(1) saturate(0.08) contrast(0.9) brightness(0.78);
}

.character.used .character-name {
  background: rgba(15, 23, 42, 0.92);
  color: #94a3b8;
}

.character.selectable {
  background: #1f2a18;
  border-color: rgba(132, 204, 22, 0.58);
}

.character.selected {
  background: #2a230f;
  border-color: #facc15;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.36), 0 0 0 2px rgba(250, 204, 21, 0.48), 0 0 22px rgba(250, 204, 21, 0.7);
  transform: scale(1.18);
  z-index: 5;
  animation: selectedCardPop 180ms ease-out;
}

.character.selected::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 2px solid rgba(255, 244, 170, 0.9);
  border-radius: 6px;
  box-shadow: inset 0 0 14px rgba(250, 204, 21, 0.45), 0 0 12px rgba(250, 204, 21, 0.42);
  pointer-events: none;
  z-index: 3;
}

@keyframes selectedCardPop {
  0% {
    transform: scale(1);
  }
  70% {
    transform: scale(1.22);
  }
  100% {
    transform: scale(1.18);
  }
}

.character strong {
  font-size: 15px;
}

.character small {
  color: #94a3b8;
}

.character-avatar {
  width: 100%;
  height: 100%;
  flex: 1;
  object-fit: contain;
}

.grid.pool-all-view .character {
  min-height: 85px;
  height: 85px;
}

.grid.pool-filter-view .character {
  min-height: 100px;
  height: 100px;
}

.grid.pool-filter-view .character-avatar {
  min-height: 0;
}

/* 角色卡片边框颜色表示稀有度 */
.character.rarity-5 {
  border-width: 1px;
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 0 7px rgba(251, 191, 36, 0.22);
}

.character.rarity-low {
  border-width: 1px;
  border-color: rgba(148, 163, 184, 0.55);
  box-shadow: 0 0 5px rgba(148, 163, 184, 0.16);
}

/* isHZ 图标 - 右上角 */
.hz-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 12px;
  background: rgba(23, 32, 51, 0.9);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #334155;
  z-index: 1;
  color: #daa520;
}

.hz-icon .fa-moon {
  color: #b0c4de;
}

/* 元素背景色 - 不透明渐变 */
.character.element-火 { background: linear-gradient(180deg, #d47070 0%, #8b2020 100%); }
.character.element-水 { background: linear-gradient(180deg, #1477be 0%, #1e4d7a 100%); }
.character.element-风 { background: linear-gradient(180deg, #40b0a8 0%, #2d6b64 100%); }
.character.element-雷 { background: linear-gradient(180deg, #a888c8 0%, #5c3d7a 100%); }
.character.element-草 { background: linear-gradient(180deg, #50a050 0%, #2d6b2d 100%); }
.character.element-冰 { background: linear-gradient(180deg, #AEE7F0 0%, #3d6b7a 100%); }
.character.element-岩 { background: linear-gradient(180deg, #d8b870 0%, #7a5c28 100%); }
.character.element-无 { background: linear-gradient(180deg, #a0a0a0 0%, #404040 100%); }

/* 筛选按钮 */
.pool-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.pool-header h2 {
  margin: 0;
  flex-shrink: 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-btn {
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
}

.filter-btn:hover {
  border-color: #64748b;
  color: #e2e8f0;
}

.filter-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
}

.public-select-panel {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(250, 204, 21, 0.32);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
}

.public-select-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #facc15;
  font-weight: 800;
}

.public-select-title small {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

.public-select-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(69px, 102px));
  gap: 8px;
}

.public-select-card {
  min-height: 77px;
}

.public-select-card .character-avatar {
  width: 100%;
  height: 100%;
}

.public-select-card.locked {
  cursor: default;
  filter: saturate(0.82);
}

.public-select-empty {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 77px;
  border: 1px dashed rgba(148, 163, 184, 0.48);
  background: rgba(15, 23, 42, 0.46);
  color: #94a3b8;
  font-size: 24px;
  font-weight: 800;
}

.public-select-empty .character-name {
  position: static;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.public-select-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  min-width: 34px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 204, 21, 0.92);
  color: #111827;
  font-size: 11px;
  font-weight: 800;
  z-index: 2;
}

.character-name {
  font-size: 11px;
  text-align: center;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.85);
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

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

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  background: #0f172a;
  border-radius: 6px;
}

.history-empty {
  padding: 8px;
  color: #94a3b8;
  background: #0f172a;
  border-radius: 6px;
}

.history-main {
  min-width: 0;
}

.history-title {
  color: #e5e7eb;
  font-weight: 700;
  font-size: 13px;
}

.history-names {
  margin-top: 2px;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.history-status {
  flex: 0 0 auto;
  max-width: 96px;
  color: #facc15;
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.bp-side {
  display: grid;
  grid-template-rows: auto minmax(0, auto) minmax(0, auto);
  gap: 5px;
  height: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  min-height: 0;
  overflow: visible;
}

.bp-side-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #cbd5e1;
}

.bp-side-title strong {
  color: #f8fafc;
}

.bp-line {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  align-items: start;
}

.bp-line > span {
  color: #facc15;
  font-size: 12px;
  font-weight: 700;
  padding-top: 5px;
}

.bp-chips {
  display: flex;
  flex-wrap: wrap;
  column-gap: 4px;
  row-gap: 2px;
  min-height: 40px;
  max-height: none;
  overflow: visible;
}

.bp-chip {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 2px;
  border-radius: 6px;
  background: #172033;
  border: 1px solid #334155;
  color: #e2e8f0;
  font-size: 12px;
  overflow: hidden;
  flex: 0 0 auto;
}

.bp-chip-break {
  flex-basis: 100%;
  width: 0;
  height: 0;
  margin-top: -2px;
}

.bp-chip.pending {
  border-color: rgba(250, 204, 21, 0.65);
  color: #fef3c7;
  background: rgba(234, 179, 8, 0.12);
}

.bp-chip.element-火 { background: linear-gradient(180deg, #d47070 0%, #8b2020 100%); }
.bp-chip.element-水 { background: linear-gradient(180deg, #1477be 0%, #1e4d7a 100%); }
.bp-chip.element-风 { background: linear-gradient(180deg, #40b0a8 0%, #2d6b64 100%); }
.bp-chip.element-雷 { background: linear-gradient(180deg, #a888c8 0%, #5c3d7a 100%); }
.bp-chip.element-草 { background: linear-gradient(180deg, #50a050 0%, #2d6b2d 100%); }
.bp-chip.element-冰 { background: linear-gradient(180deg, #AEE7F0 0%, #3d6b7a 100%); }
.bp-chip.element-岩 { background: linear-gradient(180deg, #d8b870 0%, #7a5c28 100%); }
.bp-chip.element-无 { background: linear-gradient(180deg, #a0a0a0 0%, #404040 100%); }

.bp-avatar {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 4px;
}

.bp-empty {
  color: #64748b;
  font-size: 13px;
  padding: 5px 0;
}

.selected-summary {
  flex: 0 1 auto;
  max-width: 100%;
  margin-left: auto;
  padding: 6px 8px;
  border: 1px solid rgba(250, 204, 21, 0.36);
  border-radius: 6px;
  background: rgba(250, 204, 21, 0.1);
  color: #fef3c7;
  font-size: 13px;
  line-height: 1.35;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.pool-meta {
  margin-top: 10px;
  display: grid;
  gap: 6px;
  padding: 10px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 13px;
}

.pool-meta-line {
  display: grid;
  grid-template-columns: 98px 1fr;
  gap: 8px;
}

.pool-meta-label {
  color: #facc15;
  font-weight: 700;
}

.log {
  height: 160px;
  overflow: auto;
  background: #060b14;
  border: 1px solid #253047;
  border-radius: 6px;
  padding: 8px;
  color: #cbd5e1;
  font-size: 13px;
}

.player-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.68);
}

.player-dialog-backdrop[hidden] {
  display: none;
}

.player-dialog {
  width: min(420px, 100%);
  background: #0f172a;
  border: 1px solid rgba(248, 113, 113, 0.55);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  padding: 18px;
  color: #e5e7eb;
}

.player-dialog h2 {
  margin: 0 0 8px;
  color: #fecaca;
}

.player-dialog p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.6;
}

.player-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .status-grid,
  .turn-strip {
    grid-template-columns: 1fr;
  }

  .turn-actions {
    justify-content: flex-start;
  }

  .bp-overview {
    grid-template-columns: 1fr;
  }
}

body.phone-layout {
  background: #101827;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html.phone-layout-root {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html.phone-layout-root::-webkit-scrollbar,
body.phone-layout::-webkit-scrollbar,
.phone-layout *::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.phone-layout * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.phone-layout .shell {
  width: 100%;
  max-width: none;
  padding: 12px 12px 20px;
}

.phone-layout .topbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.phone-layout .player-greeting {
  font-size: 20px;
  line-height: 1.25;
}

.phone-layout .topbar h1 {
  font-size: 12px;
  margin-top: 4px;
  max-width: 100%;
}

.phone-layout .join-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
}

.phone-layout .join-controls input {
  width: 100% !important;
  min-width: 0;
  height: 42px;
  font-size: 16px;
}

.phone-layout .join-controls button {
  min-width: 58px;
  height: 42px;
  padding: 8px 10px;
  white-space: nowrap;
}

.phone-layout .join-controls .status {
  margin-left: 0;
  min-width: 58px;
  justify-content: center;
  padding: 4px 8px;
  font-size: 12px;
}

.phone-layout .status-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.phone-layout .status-grid > .panel {
  min-height: 0;
  padding: 12px;
}

.phone-layout .timer-panel {
  display: none;
}

.phone-layout .timer-display {
  font-size: 46px;
  margin: 10px 0 6px;
}

.phone-layout .bp-side-title {
  font-size: 16px;
}

.phone-layout .bp-line {
  grid-template-columns: 42px 1fr;
}

.phone-layout .bp-chip {
  width: 32px;
  height: 32px;
  border-radius: 5px;
}

.phone-layout .bp-chips {
  min-height: 32px;
}

.phone-layout .turn-strip {
  position: sticky;
  top: 0;
  z-index: 20;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 10px -12px 10px;
  padding: 12px;
  border: 1px solid rgba(234, 179, 8, 0.28);
  border-left: 0;
  border-right: 0;
  background: rgba(23, 32, 51, 0.98);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.28);
}

.phone-layout .turn-strip h2 {
  flex: 1 1 auto;
  font-size: 20px;
  min-width: 0;
  margin: 0;
}

.phone-layout .turn-strip .muted {
  font-size: 14px;
  line-height: 1.45;
}

.phone-layout .compact-timer-display {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  padding: 0;
  color: #f8fafc;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.phone-layout .compact-timer-display.timer-idle,
.phone-layout .compact-timer-display.timer-paused {
  color: #94a3b8;
}

.phone-layout .compact-timer-display.timer-urgent {
  color: #fde68a;
}

.phone-layout .compact-timer-display.timer-expired {
  color: #fecaca;
}

.phone-layout .turn-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  justify-content: stretch;
}

.phone-layout .selected-summary {
  margin-left: 0;
  min-width: 0;
  max-width: 100%;
  justify-content: flex-start;
  overflow: hidden;
  text-align: left;
}

.phone-layout .selected-summary-label {
  font-size: 12px;
  min-width: 24px;
  text-align: center;
}

.phone-layout .selected-slot-grid {
  grid-template-columns: repeat(var(--selected-slot-count), 32px);
  gap: 3px;
}

.phone-layout .selected-slot {
  width: 32px;
  height: 32px;
}

.phone-layout .empty-ban-button,
.phone-layout #submitSelection {
  min-width: 66px;
  height: 42px;
  padding: 8px 10px;
  white-space: nowrap;
}

.phone-layout .checkline {
  justify-self: end;
  font-size: 12px;
}

.phone-layout .turn-actions.choice-count-8 .selected-summary {
  grid-column: 1 / -1;
  justify-self: end;
}

.phone-layout .turn-actions.choice-count-8 #submitSelection {
  grid-column: 3;
}

.phone-layout .turn-actions.choice-count-8 .checkline {
  grid-column: 4;
}

.phone-layout .pool-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.phone-layout .pool-header h2 {
  font-size: 24px;
}

.phone-layout .filter-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: visible;
  padding-bottom: 0;
  -webkit-overflow-scrolling: touch;
}

.phone-layout .filter-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 34px;
  font-size: 14px;
  font-weight: 900;
  padding: 5px 0;
  color: #cbd5e1;
}

.phone-layout .filter-btn i {
  display: none;
}

.phone-layout .filter-btn[data-filter="all"] {
  font-size: 0;
  color: #f8fafc;
}

.phone-layout .filter-btn[data-filter="all"]::before {
  content: "全";
  font-size: 14px;
}

.phone-layout .filter-btn[data-filter="火"] { color: #ff8a8a; }
.phone-layout .filter-btn[data-filter="水"] { color: #38bdf8; }
.phone-layout .filter-btn[data-filter="雷"] { color: #d8b4fe; }
.phone-layout .filter-btn[data-filter="冰"] { color: #a5f3fc; }
.phone-layout .filter-btn[data-filter="风"] { color: #5eead4; }
.phone-layout .filter-btn[data-filter="岩"] { color: #facc15; }
.phone-layout .filter-btn[data-filter="草"] { color: #86efac; }
.phone-layout .filter-btn[data-filter="魔"] { color: #fbbf24; }
.phone-layout .filter-btn[data-filter="月"] { color: #c7d2fe; }

.phone-layout .filter-btn.active,
.phone-layout .filter-btn[data-filter="all"].active::before {
  color: #ffffff;
}

.phone-layout .filter-btn[data-filter="all"].active { background: #2563eb; border-color: #60a5fa; }
.phone-layout .filter-btn[data-filter="火"].active { background: #8b1f1f; border-color: #f87171; }
.phone-layout .filter-btn[data-filter="水"].active { background: #075985; border-color: #38bdf8; }
.phone-layout .filter-btn[data-filter="雷"].active { background: #6b21a8; border-color: #c084fc; }
.phone-layout .filter-btn[data-filter="冰"].active { background: #0e7490; border-color: #67e8f9; }
.phone-layout .filter-btn[data-filter="风"].active { background: #0f766e; border-color: #5eead4; }
.phone-layout .filter-btn[data-filter="岩"].active { background: #854d0e; border-color: #facc15; }
.phone-layout .filter-btn[data-filter="草"].active { background: #166534; border-color: #86efac; }
.phone-layout .filter-btn[data-filter="魔"].active { background: #92400e; border-color: #fbbf24; }
.phone-layout .filter-btn[data-filter="月"].active { background: #3730a3; border-color: #a5b4fc; }

.phone-layout .grid,
.phone-layout .grid.pool-all-view,
.phone-layout .grid.pool-filter-view {
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
}

.phone-layout .character,
.phone-layout .grid.pool-all-view .character,
.phone-layout .grid.pool-filter-view .character {
  min-height: 62px;
  height: 62px;
  border-radius: 9px;
}

.phone-layout .character-avatar {
  object-fit: cover;
}

.phone-layout .character-name {
  display: none;
}

.phone-layout .character.selected {
  transform: scale(1.08);
  z-index: 6;
}

.phone-layout .character.selected::after {
  inset: 2px;
  border-radius: 7px;
}

.phone-layout .hz-icon {
  top: 3px;
  right: 3px;
}

.phone-layout .public-select-title {
  display: grid;
  gap: 2px;
}

.phone-layout .public-select-grid {
  grid-template-columns: repeat(2, minmax(56px, 70px));
}

.phone-layout .public-select-card {
  min-height: 62px;
  height: 62px;
}

.phone-layout .public-select-empty {
  min-height: 62px;
}

.phone-layout .pool-meta {
  font-size: 14px;
}

.phone-layout .pool-meta-line {
  grid-template-columns: 92px 1fr;
}

.phone-panel-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f8fafc;
  padding: 0 0 10px;
  text-align: left;
  cursor: default;
}

.phone-panel-toggle span {
  font-size: 18px;
  font-weight: 800;
}

.phone-panel-toggle small {
  display: none;
}

.phone-layout .collapsible-phone {
  padding: 0;
  overflow: hidden;
}

.phone-layout .phone-panel-toggle {
  min-height: 48px;
  padding: 12px;
  cursor: pointer;
}

.phone-layout .phone-panel-toggle span {
  font-size: 18px;
  font-weight: 800;
}

.phone-layout .phone-panel-toggle small {
  display: inline;
  color: #facc15;
  font-size: 13px;
}

.phone-layout .collapsible-phone .history,
.phone-layout .collapsible-phone .log {
  margin: 0 12px 12px;
}

.phone-layout .collapsible-phone.collapsed .history,
.phone-layout .collapsible-phone.collapsed .log {
  display: none;
}

.phone-layout .log {
  height: 220px;
}
