﻿/* css/game_app.css */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Noto Sans TC", "Segoe UI", "Microsoft JhengHei", "PingFang TC", sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  background: #f7f4ed;
  color: #111827;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

.game-app {
  --talk-input-offset: 96px;
  --talk-input-clearance: 5px;
  --mobile-overlay-top: 72px;
  --mobile-action-hud-height: 42px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--game-bg-day, floralwhite);
  color: var(--game-text-day, #111827);
}

.game-app[data-phase="beforegame"] {
  background: var(--game-bg-beforegame, seashell);
  color: var(--game-text-beforegame, #111827);
}

.game-app[data-phase="aftergame"] {
  background: var(--game-bg-aftergame, aliceblue);
  color: var(--game-text-aftergame, #111827);
}

.game-app[data-phase="day"] {
  background: var(--game-bg-day, floralwhite);
  color: var(--game-text-day, #111827);
}

.game-app[data-phase="night"] {
  background: var(--game-bg-night, #000030);
  color: var(--game-text-night, snow);
}

/* Top Bar */

.game-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.game-app[data-phase="night"] .game-topbar {
  background: rgba(0, 0, 48, 0.76);
  border-bottom-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

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

.room-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  row-gap: 2px;
}

.room-size-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--room-size-bg, rgba(37, 99, 235, 0.12));
  border: 1px solid var(--room-size-border, rgba(37, 99, 235, 0.20));
  color: var(--room-size-color, #1e3a8a);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0;
}

.game-app[data-phase="night"] .room-size-badge {
  background: var(--room-size-night-bg, rgba(147, 197, 253, 0.16));
  border-color: var(--room-size-night-border, rgba(147, 197, 253, 0.28));
  color: #ffffff;
}

.room-title {
  font-weight: 900;
  font-size: 16px;
  line-height: 1.25;
  word-break: break-word;
}

.room-sub {
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.75;
  word-break: break-word;
}

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

.mini-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.mini-btn:hover {
  background: rgba(255, 255, 255, 0.95);
}

.game-app[data-phase="night"] .mini-btn {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
}

.game-app[data-phase="night"] .mini-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Static History Pages */

.history-page .game-main {
  padding-bottom: 24px;
}

.history-panel {
  margin-top: 8px;
}

.history-tools {
  margin: 2px 0 8px;
}

.history-tools.is-talk-tools .history-filter-form {
  display: none;
}

.history-scope-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 1px 7px;
  scrollbar-width: thin;
}

.history-scope-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 30px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #111827;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.history-scope-btn:hover {
  background: #fff;
  border-color: rgba(37, 99, 235, 0.36);
}

.history-scope-btn.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.game-app[data-phase="night"] .history-scope-btn {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(255, 255, 255, 0.16);
  color: #e5e7eb;
}

.game-app[data-phase="night"] .history-scope-btn:hover {
  background: rgba(30, 41, 59, 0.96);
  border-color: rgba(147, 197, 253, 0.38);
}

.game-app[data-phase="night"] .history-scope-btn.is-active {
  background: #60a5fa;
  border-color: #93c5fd;
  color: #0f172a;
}

.history-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  font-size: 13px;
}

.history-filter-form label {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  font-weight: 900;
}

.history-filter-form select,
.history-filter-form button {
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.88);
  color: #111827;
  padding: 0 10px;
  font-weight: 900;
}

.history-filter-form button {
  border-color: transparent;
  background: #2563eb;
  color: white;
}

.game-app[data-phase="night"] .history-filter-form select {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(255, 255, 255, 0.16);
  color: snow;
}

.history-talk-log {
  max-height: none;
  min-height: 0;
  overflow: visible;
}

.history-lastwords-list {
  margin: 0;
}

/* Main */

.game-main {
  width: min(1120px, 100%);
  min-height: calc(100vh - var(--talk-input-offset, 96px));
  margin: 0 auto;
  padding: 4px 10px calc(var(--talk-input-offset, 96px) + var(--talk-input-clearance, 5px));
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}

.section-head strong {
  font-weight: 900;
}

.section-note {
  font-size: 12px;
  opacity: 0.7;
}

.section-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.panel-toggle-btn {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.panel-toggle-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.95);
}

.game-app[data-phase="night"] .panel-toggle-btn {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
}

.mobile-panel-head,
.mobile-panel-backdrop,
.mobile-player-fab {
  display: none;
}

.mobile-panel-toggle {
  appearance: none;
  width: 100%;
  min-height: 31px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.mobile-panel-toggle strong {
  font-size: 13px;
  font-weight: 900;
}

.mobile-panel-toggle .section-note {
  margin-left: auto;
}

.mobile-panel-toggle-text {
  flex: 0 0 auto;
  min-width: 38px;
  text-align: right;
  font-size: 12px;
  font-weight: 900;
  opacity: 0.74;
}


/* Shared Panels */

.login-box,
.village-options-panel,
.log-filter-panel,
.player-panel,
.ability-panel,
.status-panel,
.talk-panel,
.heaven-panel {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  padding: 8px;
  margin-bottom: 7px;
}

.game-app[data-phase="night"] .login-box,
.game-app[data-phase="night"] .village-options-panel,
.game-app[data-phase="night"] .log-filter-panel,
.game-app[data-phase="night"] .player-panel,
.game-app[data-phase="night"] .ability-panel,
.game-app[data-phase="night"] .status-panel,
.game-app[data-phase="night"] .talk-panel,
.game-app[data-phase="night"] .heaven-panel {
  background: rgba(15, 23, 42, 0.62);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.25);
}

/* Login */

.login-title {
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 2px;
}

.login-note {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 8px;
}

.login-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  width: 100%;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  font-weight: 800;
}

.login-form input {
  height: 30px;
  min-width: 150px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.88);
  padding: 0 8px;
}

.login-btn,
.register-link {
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  border: 0;
  background: #2563eb;
  color: white;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.register-link {
  margin-left: auto;
  background: #f97316;
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.24);
}

.register-link:hover {
  background: #ea580c;
}

.game-app[data-phase="night"] .register-link {
  background: #fb923c;
  color: #1f1308;
}

/* Village Options */

.village-options-title,
.log-filter-title {
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 6px;
}

.village-options-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.village-options-compact .village-options-title {
  flex: 0 0 auto;
  margin-bottom: 0;
  white-space: nowrap;
}

.village-options-body {
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
}

.village-options-compact .village-options-body {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding-bottom: 1px;
}

.village-options-body img {
  vertical-align: middle;
  margin: 0 0px;
  width: auto;
  height: 16px;
  max-width: none;
  max-height: 16px;
  flex: 0 0 auto;
}

.village-options-empty {
  opacity: 0.62;
}

/* Log Filter */

.log-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.log-filter-form select,
.log-filter-form button {
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  padding: 0 10px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.88);
}

.log-filter-form button {
  background: #2563eb;
  color: white;
  border-color: transparent;
}

.log-filter-note {
  opacity: 0.72;
  font-size: 12px;
}

/* Ability / private role panel */

.ability-panel {
  position: relative;
}

.ability-panel-actions {
  position: absolute;
  top: 7px;
  right: 8px;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.ability-lastwords-btn {
  appearance: none;
  min-height: 28px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.92);
  color: #1d4ed8;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  pointer-events: auto;
}

.ability-lastwords-btn:hover,
.ability-lastwords-btn.is-open {
  background: rgba(219, 234, 254, 0.98);
  border-color: rgba(37, 99, 235, 0.44);
}

.ability-lastwords-btn.is-empty {
  background: rgba(254, 226, 226, 0.92);
  border-color: rgba(220, 38, 38, 0.30);
  color: #dc2626;
  box-shadow: none;
}

.ability-lastwords-btn:disabled {
  cursor: default;
}

.ability-lastwords-btn[hidden] {
  display: none !important;
}

.ability-panel.has-self-lastwords .ability-self-info {
  padding-right: 106px;
}

.game-app[data-phase="night"] .ability-lastwords-btn {
  background: rgba(30, 64, 175, 0.82);
  border-color: rgba(147, 197, 253, 0.35);
  color: #dbeafe;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.game-app[data-phase="night"] .ability-lastwords-btn:hover,
.game-app[data-phase="night"] .ability-lastwords-btn.is-open {
  background: rgba(37, 99, 235, 0.92);
  border-color: rgba(191, 219, 254, 0.52);
}

.game-app[data-phase="night"] .ability-lastwords-btn.is-empty {
  background: rgba(127, 29, 29, 0.82);
  border-color: rgba(248, 113, 113, 0.34);
  color: #fecaca;
}

.no-copy,
.no-copy *,
.role-description-no-copy,
.role-description-no-copy * {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

.ability-copyable,
.ability-copyable * {
  user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
}

.ability-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ability-self-info {
  margin-bottom: 5px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: rgba(31, 41, 55, 0.86);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.ability-self-info[hidden] {
  display: none !important;
}

.ability-panel.is-identity-only .ability-self-info {
  margin-bottom: 0;
}

.game-app[data-phase="night"] .ability-self-info {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(248, 250, 252, 0.92);
}

.ability-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 900;
}

.ability-self-name {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
}

.ability-live {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
}

.game-app[data-phase="night"] .ability-self-name,
.game-app[data-phase="night"] .ability-live {
  background: rgba(255, 255, 255, 0.12);
}

.ability-main-role-card {
  --role-accent: #8b93a7;
  --role-ink: #1f2937;
  --role-border: rgba(179, 151, 91, 0.52);
  --role-glow: rgba(153, 153, 255, 0.24);
  --role-card-bg:
    radial-gradient(circle at 12% 18%, rgba(153, 153, 255, 0.14), transparent 30%),
    linear-gradient(135deg, rgba(247, 244, 237, 0.96), rgba(238, 242, 247, 0.88));
  width: 100%;
  border: 1px solid var(--role-border);
  border-radius: 8px;
  background: var(--role-card-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.46), 0 1px 4px rgba(15, 23, 42, 0.08);
  color: #1f2937;
  overflow: hidden;
}

.ability-main-role-card summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  cursor: pointer;
  list-style: none;
  font-weight: 900;
}

.ability-main-role-card summary::-webkit-details-marker {
  display: none;
}

.ability-main-role-card summary::before {
  content: "";
  flex: 0 0 auto;
  width: 3px;
  align-self: stretch;
  min-height: 36px;
  border-radius: 999px;
  background: var(--role-accent);
  box-shadow: 0 0 10px var(--role-glow);
}

.ability-main-role-card summary::after {
  content: "＋";
  margin-left: auto;
  color: rgba(31, 41, 55, 0.62);
  font-size: 14px;
  line-height: 1;
}

.ability-main-role-card[open] summary::after {
  content: "－";
}

.ability-main-role-card.is-static summary {
  cursor: default;
}

.ability-main-role-card.is-static summary::after,
.ability-main-role-card.is-static[open] summary::after {
  content: "";
}

.ability-main-role-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.ability-main-role-icon img {
  width: auto;
  height: 34px;
  max-width: 36px;
  object-fit: contain;
  pointer-events: none;
}

.ability-main-role-body {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ability-main-role-top {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.ability-main-role-name {
  min-width: 0;
  flex: 0 1 auto;
  color: var(--role-ink);
  font-size: 16px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.70);
}

.ability-main-role-live {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 11px;
  line-height: 1.2;
}

.ability-subrole-stickers {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.ability-subrole-sticker {
  --role-accent: #b38b22;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 2px 7px 2px 5px;
  border: 1px solid rgba(166, 132, 74, 0.34);
  border-left: 3px solid var(--role-accent);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.90);
  color: rgba(31, 41, 55, 0.90);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.ability-subrole-sticker span {
  color: var(--role-accent);
}

.ability-subrole-sticker img {
  width: auto;
  height: 18px;
  max-width: 20px;
  object-fit: contain;
  pointer-events: none;
}

.ability-main-role-hint {
  color: rgba(31, 41, 55, 0.68);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.ability-main-role-card.role-gm {
  --role-accent: #ff8000;
  --role-ink: #ff8000;
  --role-border: rgba(255, 128, 0, 0.42);
  --role-glow: rgba(255, 128, 0, 0.26);
  --role-card-bg: linear-gradient(135deg, rgba(255, 247, 237, 0.98), rgba(255, 237, 213, 0.84));
}

.ability-main-role-card.role-human,
.ability-main-role-card.role-noble,
.ability-main-role-card.role-slave {
  --role-accent: #111827;
  --role-ink: #111827;
  --role-border: rgba(17, 24, 39, 0.18);
}

.ability-main-role-card.role-wolf,
.ability-main-role-card.role-wfbig,
.ability-main-role-card.role-mad,
.ability-main-role-card.role-spy {
  --role-accent: #ff0000;
  --role-ink: #ff0000;
  --role-border: rgba(255, 0, 0, 0.34);
  --role-glow: rgba(255, 0, 0, 0.22);
  --role-card-bg: linear-gradient(135deg, rgba(255, 245, 245, 0.98), rgba(254, 226, 226, 0.78));
}

.ability-main-role-card.role-bskwolf {
  --role-accent: #d00000;
  --role-ink: #d00000;
  --role-border: rgba(208, 0, 0, 0.36);
  --role-glow: rgba(208, 0, 0, 0.24);
}

.ability-main-role-card.role-asmwolf,
.ability-main-role-card.role-wndwolf,
.ability-main-role-card.role-wndwolf_lock {
  --role-accent: #ff3000;
  --role-ink: #ff3000;
  --role-border: rgba(255, 48, 0, 0.38);
  --role-glow: rgba(255, 48, 0, 0.24);
  --role-card-bg: linear-gradient(135deg, rgba(255, 247, 237, 0.98), rgba(255, 237, 213, 0.80));
}

.ability-main-role-card.role-wtrwolf {
  --role-accent: #ccffff;
  --role-ink: #006b75;
  --role-border: rgba(0, 107, 117, 0.36);
  --role-glow: rgba(0, 107, 117, 0.18);
  --role-card-bg: linear-gradient(135deg, rgba(236, 254, 255, 0.98), rgba(207, 250, 254, 0.78));
}

.ability-main-role-card.role-mage {
  --role-accent: #9933ff;
  --role-ink: #9933ff;
  --role-border: rgba(153, 51, 255, 0.36);
  --role-glow: rgba(153, 51, 255, 0.24);
  --role-card-bg: linear-gradient(135deg, rgba(250, 245, 255, 0.98), rgba(233, 213, 255, 0.76));
}

.ability-main-role-card.role-necromancer {
  --role-accent: #009900;
  --role-ink: #009900;
  --role-border: rgba(0, 153, 0, 0.36);
  --role-glow: rgba(0, 153, 0, 0.22);
  --role-card-bg: linear-gradient(135deg, rgba(240, 253, 244, 0.98), rgba(220, 252, 231, 0.78));
}

.ability-main-role-card.role-common {
  --role-accent: #cc9966;
  --role-ink: #b27a43;
  --role-border: rgba(204, 153, 102, 0.44);
  --role-glow: rgba(204, 153, 102, 0.22);
  --role-card-bg: linear-gradient(135deg, rgba(255, 251, 235, 0.98), rgba(254, 243, 199, 0.76));
}

.ability-main-role-card.role-guard {
  --role-accent: #3399ff;
  --role-ink: #1675d1;
  --role-border: rgba(51, 153, 255, 0.38);
  --role-glow: rgba(51, 153, 255, 0.24);
  --role-card-bg: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(219, 234, 254, 0.78));
}

.ability-main-role-card.role-fox,
.ability-main-role-card.role-fosi,
.ability-main-role-card.role-betr,
.ability-main-role-card.role-fxism {
  --role-accent: #cc0099;
  --role-ink: #cc0099;
  --role-border: rgba(204, 0, 153, 0.36);
  --role-glow: rgba(204, 0, 153, 0.22);
  --role-card-bg: linear-gradient(135deg, rgba(253, 242, 248, 0.98), rgba(252, 231, 243, 0.78));
}

.ability-main-role-card.role-poison,
.ability-main-role-card.role-cat {
  --role-accent: #006633;
  --role-ink: #006633;
  --role-border: rgba(0, 102, 51, 0.38);
  --role-glow: rgba(0, 102, 51, 0.22);
  --role-card-bg: linear-gradient(135deg, rgba(240, 253, 244, 0.98), rgba(220, 252, 231, 0.78));
}

.ability-main-role-card.role-mytho,
.ability-main-role-card.role-mimic {
  --role-accent: #ff8000;
  --role-ink: #ff8000;
  --role-border: rgba(255, 128, 0, 0.40);
  --role-glow: rgba(255, 128, 0, 0.24);
  --role-card-bg: linear-gradient(135deg, rgba(255, 247, 237, 0.98), rgba(255, 237, 213, 0.80));
}

.ability-main-role-card.role-owlman {
  --role-accent: #000080;
  --role-ink: #000080;
  --role-border: rgba(0, 0, 128, 0.36);
  --role-glow: rgba(0, 0, 128, 0.22);
  --role-card-bg: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(219, 234, 254, 0.78));
}

.ability-main-role-card.role-pengu {
  --role-accent: #ff9933;
  --role-ink: #ff9933;
  --role-border: rgba(255, 153, 51, 0.42);
  --role-glow: rgba(255, 153, 51, 0.24);
  --role-card-bg: linear-gradient(135deg, rgba(255, 251, 235, 0.98), rgba(254, 243, 199, 0.78));
}

.ability-role-detail {
  padding: 0 13px 11px 27px;
  color: rgba(31, 41, 55, 0.82);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  user-select: none;
  -webkit-user-select: none;
}

.ability-role-detail-sub {
  display: flex;
  gap: 7px;
  padding-top: 0;
  color: rgba(31, 41, 55, 0.74);
}

.ability-role-detail-sub strong {
  flex: 0 0 auto;
  color: rgba(31, 41, 55, 0.88);
}

.ability-role-detail-sub span {
  min-width: 0;
}

.ability-subroles {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
}

.ability-subrole-label {
  flex: 0 0 auto;
  padding-top: 3px;
  color: rgba(31, 41, 55, 0.62);
  font-size: 12px;
  font-weight: 900;
}

.ability-subrole-list {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ability-subrole-chip {
  --role-accent: #b38b22;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 3px 8px;
  border: 1px solid rgba(166, 132, 74, 0.34);
  border-left: 3px solid var(--role-accent);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.92), rgba(238, 242, 247, 0.74));
  color: rgba(31, 41, 55, 0.90);
  font-size: 12px;
  font-weight: 900;
}

.ability-subrole-chip img {
  width: auto;
  height: 18px;
  max-width: 22px;
  object-fit: contain;
  pointer-events: none;
}

.game-app[data-phase="night"] .ability-main-role-card {
  background:
    radial-gradient(circle at 16% 18%, rgba(153, 153, 255, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.72));
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(248, 250, 252, 0.94);
}

.game-app[data-phase="night"] .ability-main-role-name {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.game-app[data-phase="night"] .ability-main-role-card.role-human .ability-main-role-name,
.game-app[data-phase="night"] .ability-main-role-card.role-noble .ability-main-role-name,
.game-app[data-phase="night"] .ability-main-role-card.role-slave .ability-main-role-name,
.game-app[data-phase="night"] .ability-main-role-card.role-owlman .ability-main-role-name {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  text-shadow: none;
}

.game-app[data-phase="night"] .ability-main-role-card summary::after {
  color: rgba(248, 250, 252, 0.60);
}

.game-app[data-phase="night"] .ability-main-role-icon {
  background: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.game-app[data-phase="night"] .ability-main-role-live {
  background: rgba(255, 255, 255, 0.12);
}

.game-app[data-phase="night"] .ability-subrole-sticker {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(248, 250, 252, 0.92);
}

.game-app[data-phase="night"] .ability-main-role-hint {
  color: rgba(248, 250, 252, 0.68);
}

.game-app[data-phase="night"] .ability-role-detail {
  color: rgba(248, 250, 252, 0.76);
}

.game-app[data-phase="night"] .ability-role-detail-sub {
  color: rgba(248, 250, 252, 0.70);
}

.game-app[data-phase="night"] .ability-role-detail-sub strong {
  color: rgba(248, 250, 252, 0.88);
}

.game-app[data-phase="night"] .ability-subroles {
  background: rgba(15, 23, 42, 0.38);
  border-color: rgba(255, 255, 255, 0.10);
}

.game-app[data-phase="night"] .ability-subrole-label {
  color: rgba(248, 250, 252, 0.66);
}

.game-app[data-phase="night"] .ability-subrole-chip {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(248, 250, 252, 0.92);
}

.ability-note,
.ability-empty {
  font-size: 12px;
  opacity: 0.72;
  line-height: 1.45;
}

.ability-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ability-subpanel,
.ability-result,
.ability-action {
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.56);
  border-radius: 8px;
  padding: 7px 8px;
}

.game-app[data-phase="night"] .ability-subpanel,
.game-app[data-phase="night"] .ability-result,
.game-app[data-phase="night"] .ability-action {
  background: rgba(15, 23, 42, 0.52);
  border-color: rgba(255, 255, 255, 0.12);
}

.ability-subtitle {
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
}

.ability-partner-group {
  padding-top: 6px;
  padding-bottom: 6px;
}

.ability-partner-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
}

.ability-partner-title {
  flex: 0 0 auto;
  margin-bottom: 0;
  white-space: nowrap;
}

.ability-partner-line .ability-chip-row {
  flex-wrap: nowrap;
  overflow-x: auto;
}

.ability-line {
  font-size: 13px;
  line-height: 1.45;
}

.ability-line.is-muted {
  opacity: 0.72;
}

.ability-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.ability-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.ability-chip small {
  font-size: 11px;
  opacity: 0.70;
}

.game-app[data-phase="night"] .ability-chip {
  background: rgba(255, 255, 255, 0.12);
}

.ability-result {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ability-result img {
  flex: 0 0 auto;
  width: auto;
  height: 26px;
  max-width: 44px;
  object-fit: contain;
  pointer-events: none;
}

.ability-result-body {
  min-width: 0;
}

.ability-result-judgement {
  min-height: 36px;
}

.ability-result-line {
  font-size: 13px;
  line-height: 1.45;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

.ability-result-prefix,
.ability-result-tail,
.ability-result-verdict {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

.ability-result-prefix {
  font-weight: 900;
}

.ability-result-target {
  font-weight: 900;
  user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
}

.ability-result-target.is-danger,
.ability-result-verdict.is-danger {
  color: #dc2626;
}

.game-app[data-phase="night"] .ability-result-target.is-danger,
.game-app[data-phase="night"] .ability-result-verdict.is-danger {
  color: #f87171;
}

.ability-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ability-action-title {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
}

.ability-action-text {
  min-width: 0;
  text-align: right;
  font-size: 13px;
  line-height: 1.35;
}

.ability-action.is-pending {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(254, 226, 226, 0.46);
}

.game-app[data-phase="night"] .ability-action.is-pending {
  border-color: rgba(248, 113, 113, 0.30);
  background: rgba(127, 29, 29, 0.30);
}

/* Players */

.player-panel.is-pinned {
  position: sticky;
  top: 58px;
  z-index: 20;
}

.player-panel.is-collapsed .section-head {
  margin-bottom: 0;
}

.player-panel.is-collapsed .player-grid {
  display: none;
}

.player-panel.is-pinned .player-grid {
  display: grid;
}


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

.player-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.10);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.player-card:hover {
  transform: translateY(-1px);
}

.game-app[data-phase="night"] .player-card {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(255, 255, 255, 0.13);
}

.player-card.is-self {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 1px;
}

.player-card.is-dead {
  background: rgba(107, 114, 128, 0.18);
  color: inherit;
  border-color: rgba(107, 114, 128, 0.32);
}

.game-app[data-phase="night"] .player-card.is-dead {
  background: rgba(71, 85, 105, 0.72);
  color: #f8fafc;
  border-color: rgba(203, 213, 225, 0.22);
}

.player-card.is-started {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.30);
}

.game-app[data-phase="night"] .player-card.is-started {
  background: rgba(22, 163, 74, 0.24);
  border-color: rgba(74, 222, 128, 0.42);
}

.player-card.is-acted {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(14, 165, 233, 0.42);
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.26);
}

.game-app[data-phase="day"] .player-card.is-acted {
  background: rgba(208, 255, 255, 0.75);
  border-color: rgba(14, 165, 233, 0.42);
}

.game-app[data-phase="night"] .player-card.is-acted {
  background: rgba(0, 64, 0, 0.72);
  border-color: rgba(74, 222, 128, 0.38);
}

.player-card.is-dead.is-acted {
  background: rgba(107, 114, 128, 0.18);
  border-color: rgba(107, 114, 128, 0.32);
  box-shadow: none;
}

.game-app[data-phase="night"] .player-card.is-dead.is-acted {
  background: rgba(71, 85, 105, 0.72);
  border-color: rgba(203, 213, 225, 0.22);
}

.player-card.is-sudden-death-1,
.player-card.is-dead.is-acted.is-sudden-death-1,
.game-app[data-phase="night"] .player-card.is-sudden-death-1,
.game-app[data-phase="night"] .player-card.is-dead.is-acted.is-sudden-death-1 {
  color: #111827;
  border-color: rgba(100, 100, 255, 0.50);
  background: linear-gradient(180deg, #c7d2fe 0%, #8080ff 100%);
  box-shadow:
    0 1px 2px rgba(80, 80, 200, 0.18),
    0 0 14px rgba(120, 120, 255, 0.32);
}

.player-card.is-sudden-death-2,
.player-card.is-dead.is-acted.is-sudden-death-2,
.game-app[data-phase="night"] .player-card.is-sudden-death-2,
.game-app[data-phase="night"] .player-card.is-dead.is-acted.is-sudden-death-2 {
  color: #111827;
  border-color: rgba(255, 120, 120, 0.50);
  background: linear-gradient(180deg, #fecaca 0%, #ff8080 100%);
  box-shadow:
    0 1px 2px rgba(200, 60, 60, 0.18),
    0 0 14px rgba(255, 120, 120, 0.35);
}

.player-card.is-manager:not(.is-gm):not(.is-pregame-gm) {
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.45);
}

.player-card.is-red-name .player-name {
  color: #dc2626;
}

.game-app[data-phase="night"] .player-card.is-red-name .player-name {
  color: #ff8080;
}

.player-card.is-pregame-gm {
  box-shadow: inset 0 0 0 2px rgba(220, 38, 38, 0.38);
}

.player-card.is-gm {
  border-color: rgba(220, 38, 38, 0.60);
  background: rgba(220, 38, 38, 0.10);
}

.game-app[data-phase="night"] .player-card.is-gm {
  background: rgba(127, 29, 29, 0.38);
  border-color: rgba(248, 113, 113, 0.42);
}

.player-card.is-marked {
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.65);
}

.player-avatar-wrap {
  flex: 0 0 46px;
  height: 46px;
  display: grid;
  place-items: center;
}

.player-avatar-score-link {
  display: grid;
  place-items: center;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
}

.player-avatar-score-link:hover .player-avatar,
.player-avatar-score-link:focus .player-avatar {
  box-shadow:
    0 0 0 2px rgba(59, 130, 246, 0.45),
    0 0 12px rgba(59, 130, 246, 0.28);
}

.player-avatar {
  object-fit: contain;
  border: 2px solid;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.40);
  max-width: 46px;
  max-height: 46px;
}

.player-info {
  min-width: 0;
  flex: 1;
}

.player-name {
  font-size: 13.5px;
  font-weight: 900;
  line-height: 1.2;
  word-break: break-word;
}

.player-dot {
  margin-right: 2px;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 15px;
  padding: 0 5px;
  margin-right: 3px;
  border: 1px solid rgba(96, 125, 166, 0.42);
  border-radius: 4px;
  background: linear-gradient(180deg, #ffffff 0%, #e5ebf3 100%);
  color: #1d5fbf;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  vertical-align: 1px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.player-trip {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.15;
  word-break: break-all;
  opacity: 0.88;
}

.player-trip a {
  color: inherit;
  text-decoration: none;
}

.player-trip a:hover {
  text-decoration: underline;
}

.player-meta {
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 3px;
  font-size: 11px;
  opacity: 1;
}

.player-badge {
  display: inline-flex;
  align-items: center;
  min-height: 16px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.game-app[data-phase="night"] .player-badge:not(.role) {
  background: rgba(255, 255, 255, 0.12);
}

.player-badge.gm {
  color: #dc2626;
  font-weight: 900;
}

.game-app[data-phase="night"] .player-badge.gm {
  color: #ff8080;
}

.player-badge.manager {
  color: #d97706;
  font-weight: 900;
}

.player-badge.marked {
  color: #b45309;
}

.player-badge.self {
  color: #2563eb;
}

.player-badge.role {
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  min-height: 18px;
  padding: 2px 6px;
  font-size: 11px;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.16);
  text-shadow: none;
}

.player-badge.role-GM {
  background: rgba(255, 128, 0, 0.14);
  color: #ff8000;
  box-shadow: inset 0 0 0 1px rgba(255, 128, 0, 0.35);
}

.player-badge.role-human {
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.18);
}

.player-badge.role-wolf,
.player-badge.role-wfbig,
.player-badge.role-mad {
  background: rgba(255, 0, 0, 0.10);
  color: #ff0000;
  box-shadow: inset 0 0 0 1px rgba(255, 0, 0, 0.32);
}

.player-badge.role-wfbsk {
  background: rgba(208, 0, 0, 0.12);
  color: #d00000;
  box-shadow: inset 0 0 0 1px rgba(208, 0, 0, 0.34);
}

.player-badge.role-wfasm,
.player-badge.role-wfpdt {
  background: rgba(255, 48, 0, 0.13);
  color: #ff3000;
  box-shadow: inset 0 0 0 1px rgba(255, 48, 0, 0.34);
}

.player-badge.role-wfwtr {
  background: #111827;
  color: #ccffff;
  box-shadow: inset 0 0 0 1px rgba(204, 255, 255, 0.65);
}

.player-badge.role-mage {
  background: rgba(153, 51, 255, 0.12);
  color: #9933ff;
  box-shadow: inset 0 0 0 1px rgba(153, 51, 255, 0.32);
}

.player-badge.role-necromancer {
  background: rgba(0, 153, 0, 0.12);
  color: #009900;
  box-shadow: inset 0 0 0 1px rgba(0, 153, 0, 0.34);
}

.player-badge.role-common {
  background: rgba(204, 153, 102, 0.16);
  color: #cc9966;
  box-shadow: inset 0 0 0 1px rgba(204, 153, 102, 0.42);
}

.player-badge.role-guard {
  background: rgba(51, 153, 255, 0.13);
  color: #3399ff;
  box-shadow: inset 0 0 0 1px rgba(51, 153, 255, 0.36);
}

.player-badge.role-fox,
.player-badge.role-fosi,
.player-badge.role-betr,
.player-badge.role-foxism,
.player-badge.role-fxism {
  background: rgba(204, 0, 153, 0.12);
  color: #cc0099;
  box-shadow: inset 0 0 0 1px rgba(204, 0, 153, 0.34);
}

.player-badge.role-poison,
.player-badge.role-cat {
  background: rgba(0, 102, 51, 0.13);
  color: #006633;
  box-shadow: inset 0 0 0 1px rgba(0, 102, 51, 0.36);
}

.player-badge.role-mytho,
.player-badge.role-mimic {
  background: rgba(255, 128, 0, 0.14);
  color: #ff8000;
  box-shadow: inset 0 0 0 1px rgba(255, 128, 0, 0.36);
}

.player-badge.role-owlman {
  background: rgba(255, 255, 255, 0.94);
  color: #000080;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 128, 0.36);
}

.player-badge.role-pengu {
  background: rgba(255, 153, 51, 0.16);
  color: #ff9933;
  box-shadow: inset 0 0 0 1px rgba(255, 153, 51, 0.40);
}

.player-badge.role-lovers {
  background: rgba(60, 0, 60, 0.84);
  color: #ff80ff;
  box-shadow: inset 0 0 0 1px rgba(255, 128, 255, 0.60);
}

.player-badge.role-authority,
.player-badge.role-decide {
  background: rgba(15, 23, 42, 0.86);
  color: #999999;
  box-shadow: inset 0 0 0 1px rgba(153, 153, 153, 0.55);
}

/* Compact Players */

.game-app.compact-players .player-card {
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  min-height: 82px;
}

.game-app.compact-players .player-avatar-wrap {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.game-app.compact-players .player-avatar {
  max-width: 36px;
  max-height: 36px;
}

.game-app.compact-players .player-name {
  width: 100%;
  text-align: center;
  font-size: 11px;
  line-height: 1.15;
  max-height: 2.3em;
  overflow: hidden;
}

.game-app.compact-players .player-trip,
.game-app.compact-players .player-meta {
  display: none;
}

.game-app.compact-players .player-meta {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 1px;
}

.game-app.compact-players .player-live-label,
.game-app.compact-players .player-badge:not(.role) {
  display: none;
}

.game-app.compact-players .player-badge.role {
  max-width: 100%;
  min-height: 17px;
  padding: 2px 5px;
  font-size: 10.5px;
  white-space: nowrap;
}

/* Status */

.status-panel {
  position: sticky;
  top: var(--mobile-overlay-top, 72px);
  z-index: 28;
  width: fit-content;
  max-width: calc(100% - 12px);
  margin: 0 auto 7px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(15, 23, 42, 0.10);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.status-panel[hidden] {
  display: none !important;
}

.game-app[data-phase="night"] .status-panel {
  background: rgba(15, 23, 42, 0.74);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.refresh-mini-btn {
  color: inherit;
}

.sound-toggle-btn {
  min-width: 36px;
  font-size: 16px;
  line-height: 1;
}

.objection-action-btn {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.35);
  color: #1d4ed8;
}

.roomend-action-btn {
  background: rgba(127, 29, 29, 0.92);
  border-color: rgba(127, 29, 29, 0.86);
  color: #ffffff;
}

.game-app[data-phase="night"] .objection-action-btn {
  background: rgba(96, 165, 250, 0.22);
  border-color: rgba(147, 197, 253, 0.38);
  color: #dbeafe;
}

.game-app[data-phase="night"] .roomend-action-btn {
  background: #dc2626;
  border-color: rgba(248, 113, 113, 0.70);
  color: #ffffff;
}

.action-area {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.action-btn {
  appearance: none;
  min-height: 30px;
  padding: 0 13px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  font-size: 12px;
  font-weight: 900;
}

.action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.95);
}

.mobile-more-toggle-btn,
.mobile-more-hud {
  display: none;
}

.mobile-more-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#voteBtn {
  background: #2563eb;
  border-color: rgba(37, 99, 235, 0.78);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.20);
}

.game-app[data-phase="day"] #voteBtn {
  background: #dc2626;
  border-color: rgba(220, 38, 38, 0.82);
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.20);
}

.game-app[data-phase="night"] #voteBtn {
  background: #7c3aed;
  border-color: rgba(124, 58, 237, 0.84);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.24);
}

#voteBtn:hover:not(:disabled),
.game-app[data-phase="night"] #voteBtn:hover:not(:disabled) {
  filter: brightness(1.06);
}

#refreshBtn {
  background: rgba(255, 255, 255, 0.70);
}

.game-app[data-phase="night"] .action-btn {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
}

.game-app[data-phase="night"] #refreshBtn {
  background: rgba(255, 255, 255, 0.10);
}

#gameResetVoteBtn {
  background: #b91c1c;
  border-color: rgba(185, 28, 28, 0.84);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(185, 28, 28, 0.22);
}

#gameResetVoteBtn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.game-app[data-phase="night"] #gameResetVoteBtn {
  background: #ef4444;
  border-color: rgba(248, 113, 113, 0.70);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(248, 113, 113, 0.20);
}

#gameAbortBtn {
  background: #7f1d1d;
  border-color: rgba(127, 29, 29, 0.86);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(127, 29, 29, 0.22);
}

#gameAbortBtn:hover:not(:disabled),
.roomend-action-btn:hover:not(:disabled),
.objection-action-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.game-app[data-phase="night"] #gameAbortBtn {
  background: #dc2626;
  border-color: rgba(248, 113, 113, 0.70);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(248, 113, 113, 0.20);
}

#gameSelfDeleteBtn {
  background: #f8fafc;
  border-color: rgba(100, 116, 139, 0.42);
  color: #334155;
}

#gameSelfDeleteBtn:hover:not(:disabled) {
  background: #ffffff;
  border-color: rgba(71, 85, 105, 0.58);
}

/* Talk Log */

.talk-log {
  max-height: calc(100vh - 330px);
  min-height: 360px;
  overflow: auto;
  padding: 4px;
  scroll-behavior: smooth;
}

.talk-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 7px 0;
}

.talk-row.is-self {
  flex-direction: row-reverse;
}

.talk-avatar-wrap {
  width: 48px;
  min-width: 48px;
  display: grid;
  place-items: start center;
}

.talk-avatar {
  object-fit: contain;
  border: 2px solid;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
  max-width: 45px;
  max-height: 45px;
}

.talk-avatar-empty {
  width: 36px;
  height: 36px;
  border: 1px dashed rgba(148, 163, 184, 0.5);
}

.talk-bubble {
  max-width: min(760px, calc(100% - 56px));
  border-radius: 15px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.05);
}

.game-app[data-phase="night"] .talk-bubble {
  background: rgba(30, 41, 59, 0.86);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.22);
}

.talk-head {
  display: flex;
  gap: 6px;
  align-items: baseline;
  margin-bottom: 2px;
  font-size: 12px;
  opacity: 0.88;
}

.talk-name {
  font-weight: 900;
}

.talk-channel-label {
  font-weight: 800;
  opacity: 0.9;
}

.talk-channel-self_talk {
  font-weight: 700;
  opacity: 0.78;
}

.talk-row.talk-style-gm-broadcast .talk-bubble {
  background: rgba(254, 226, 226, 0.96);
  border-color: rgba(220, 38, 38, 0.34);
  box-shadow: 0 8px 20px rgba(127, 29, 29, 0.12);
}

.talk-row.talk-style-gm-broadcast .talk-name,
.talk-row.talk-style-gm-broadcast .talk-body {
  color: #b91c1c;
}

.talk-row.talk-style-gm-channel .talk-bubble {
  background: rgba(209, 250, 229, 0.9);
  border-color: rgba(5, 150, 105, 0.34);
  box-shadow: 0 8px 20px rgba(6, 78, 59, 0.12);
}

.talk-row.talk-style-gm-channel .talk-name {
  color: #dc2626;
}

.talk-row.talk-style-gm-channel .talk-body {
  color: #064e3b;
}

.game-app[data-phase="night"] .talk-row.talk-style-gm-broadcast .talk-bubble {
  background: rgba(127, 29, 29, 0.78);
  border-color: rgba(248, 113, 113, 0.45);
}

.game-app[data-phase="night"] .talk-row.talk-style-gm-broadcast .talk-name,
.game-app[data-phase="night"] .talk-row.talk-style-gm-broadcast .talk-body {
  color: #fee2e2;
}

.game-app[data-phase="night"] .talk-row.talk-style-gm-channel .talk-bubble {
  background: rgba(6, 78, 59, 0.82);
  border-color: rgba(52, 211, 153, 0.42);
}

.game-app[data-phase="night"] .talk-row.talk-style-gm-channel .talk-name {
  color: #fca5a5;
}

.game-app[data-phase="night"] .talk-row.talk-style-gm-channel .talk-body {
  color: #d1fae5;
}

.talk-time {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.7;
}

.talk-body {
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.talk-body img {
  max-width: none;
  vertical-align: middle;
}

.talk-body.font-strong {
  font-size: 18px;
  font-weight: 900;
}

.talk-body.font-normal {
  font-size: 14px;
}

.talk-body.font-weak {
  font-size: 12px;
  opacity: 0.82;
}

/* Event Summary */

.event-summary-panel {
  display: grid;
  gap: 6px;
  margin: 3px 2px 7px;
}

.event-summary-panel[hidden],
.event-block[hidden] {
  display: none !important;
}

.event-block {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(248, 250, 252, 0.82);
}

.game-app[data-phase="night"] .event-block {
  background: rgba(15, 23, 42, 0.64);
  border-color: rgba(255, 255, 255, 0.12);
}

.event-block-title {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  background: rgba(226, 232, 240, 0.72);
  color: #111827;
}

button.event-block-title {
  appearance: none;
  width: 100%;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  cursor: default;
}

.event-toggle-note {
  flex: 0 0 auto;
  font-size: 12px;
  opacity: 0.68;
}

.game-app[data-phase="night"] .event-block-title {
  background: rgba(30, 41, 59, 0.82);
  color: #e5e7eb;
}

.event-list {
  display: grid;
  gap: 1px;
}

.event-block.is-collapsed .event-list {
  display: none;
}

.event-block-votes .event-block-title {
  cursor: pointer;
}

.event-block-votes .event-block-title::before {
  content: "▾";
  flex: 0 0 auto;
  font-size: 12px;
  opacity: 0.62;
}

.event-block-votes.is-collapsed .event-block-title::before {
  content: "▸";
}

.event-line {
  display: grid;
  gap: 7px;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1.38;
  background: rgba(255, 255, 255, 0.58);
}

.game-app[data-phase="night"] .event-line {
  background: rgba(30, 41, 59, 0.58);
}

.event-block-victory {
  border-color: transparent;
}

.victory-banner {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  color: #fff;
  background: #111827;
}

.victory-main {
  display: grid;
  gap: 3px;
  text-align: center;
}

.victory-main strong {
  font-size: 17px;
  line-height: 1.25;
}

.victory-main span {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.45;
}

.victory-personal {
  justify-self: center;
  min-width: min(260px, 100%);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  text-align: center;
  font-size: 13px;
  font-weight: 900;
}

.victory-wolf {
  background: #b91c1c;
}

.victory-fox {
  background: #7e22ce;
}

.victory-human {
  background: #f8fafc;
  color: #111827;
  border: 1px solid rgba(15, 23, 42, 0.14);
}

.victory-human .victory-personal {
  background: rgba(234, 179, 8, 0.24);
}

.victory-lover {
  background: #db2777;
}

.victory-draw {
  background: #111827;
}

.victory-custo {
  background: #047857;
}

.victory-night {
  background: #020617;
}

.victory-banner.personal-lose .victory-personal {
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
}

.victory-banner.personal-win .victory-personal {
  background: rgba(255, 255, 255, 0.22);
}

.vote-revote-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
  background: rgba(254, 226, 226, 0.88);
  color: #991b1b;
  font-size: 13px;
  line-height: 1.35;
}

.vote-revote-alert span {
  font-size: 12px;
  font-weight: 900;
}

.vote-revote-alert.needs-vote {
  background: #dc2626;
  color: #fff;
}

.game-app[data-phase="night"] .vote-revote-alert {
  background: rgba(127, 29, 29, 0.52);
  color: #fecaca;
}

.vote-summary-section {
  display: grid;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.58);
}

.game-app[data-phase="night"] .vote-summary-section {
  background: rgba(30, 41, 59, 0.58);
}

.vote-summary-section-title,
.vote-round-title {
  font-size: 12px;
  font-weight: 900;
}

.vote-round {
  overflow-x: auto;
}

.vote-summary-table {
  width: auto;
  max-width: 100%;
  min-width: 360px;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.35;
}

.vote-summary-table td {
  padding: 5px 6px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.56);
}

.game-app[data-phase="night"] .vote-summary-table td {
  background: rgba(15, 23, 42, 0.42);
  border-color: rgba(255, 255, 255, 0.12);
}

.vote-voter,
.vote-target {
  font-weight: 900;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.vote-voter {
  width: 7em;
}

.vote-target {
  min-width: 8em;
}

.vote-received,
.vote-power {
  white-space: nowrap;
  text-align: center;
}

.vote-received {
  width: 4em;
}

.vote-power {
  width: 8.6em;
}

.night-action-line {
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  color: #1f2937;
}

.game-app[data-phase="night"] .night-action-line {
  color: #e5e7eb;
}

.night-action-line .event-text {
  min-width: 0;
  word-break: break-word;
}

.night-action-line .event-mark {
  background: #475569;
}

.night-action-wolf .event-mark {
  background: #dc2626;
}

.night-action-mage .event-mark,
.night-action-fosi .event-mark {
  background: #9333ea;
}

.night-action-guard .event-mark {
  background: #0284c7;
}

.night-action-cat .event-mark {
  background: #16a34a;
}

.night-action-mytho .event-mark,
.night-action-mimic .event-mark,
.night-action-pengu .event-mark {
  background: #d97706;
}

.night-action-owlman .event-mark {
  background: #312e81;
}

.death-line {
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  font-weight: 900;
  color: #7f1d1d;
}

.game-app[data-phase="night"] .death-line {
  color: #fecaca;
}

.event-block-pengu {
  border: 0;
  background: transparent;
  border-radius: 0;
}

.game-app[data-phase="night"] .event-block-pengu {
  background: transparent;
}

.event-line.pengu-line {
  justify-content: center;
  background: transparent;
  margin: 0;
  padding: 0 6px;
}

.game-app[data-phase="night"] .event-line.pengu-line {
  background: transparent;
}

.event-block-pengu .pengu-line .system-pill {
  width: 100%;
  max-width: none;
  border-radius: 8px;
  padding: 4px 10px;
  background: rgba(219, 234, 254, 0.92);
  border-color: rgba(129, 140, 248, 0.72);
  color: #0033cc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.event-mark {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #991b1b;
}

.death-executed .event-mark,
.death-sudden .event-mark {
  background: #a16207;
}

.death-resurrected .event-mark,
.death-special .event-mark {
  background: #2563eb;
}

.event-detail {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 800;
  color: #374151;
}

.game-app[data-phase="night"] .event-detail {
  color: #cbd5e1;
}

.lastword-line {
  grid-template-columns: minmax(110px, 150px) minmax(0, 1fr);
  align-items: start;
}

.lastword-name {
  font-weight: 900;
  color: #1d4ed8;
}

.game-app[data-phase="night"] .lastword-name {
  color: #bfdbfe;
}

.lastword-body {
  min-width: 0;
  color: #111827;
  word-break: break-word;
}

.game-app[data-phase="night"] .lastword-body {
  color: #e5e7eb;
}

.lastword-line.is-masked .lastword-body {
  color: #6b7280;
  font-style: italic;
}

.game-app[data-phase="night"] .lastword-line.is-masked .lastword-body {
  color: #cbd5e1;
}

/* System Messages */

.system-row {
  display: flex;
  justify-content: center;
  margin: 7px 0;
  padding: 0 6px;
}

.system-pill {
  max-width: min(860px, 100%);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.26);
  color: inherit;
  text-align: center;
  word-break: break-word;
}

.system-info .system-pill,
.system-phase .system-pill {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.28);
}

.system-night-common-hint {
  margin: 3px 0;
}

.system-night-common-hint .system-pill {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.78;
  background: rgba(0, 153, 255, 0.10);
  border-color: rgba(0, 153, 255, 0.22);
}

.system-night-wolf-hint {
  margin: 6px 0;
}

.system-night-wolf-hint .system-pill {
  padding: 5px 14px;
  font-size: 15px;
  font-weight: 900;
  color: #dc2626;
  background: rgba(254, 226, 226, 0.92);
  border-color: rgba(220, 38, 38, 0.42);
  box-shadow: 0 6px 16px rgba(127, 29, 29, 0.12);
}

.game-app[data-phase="night"] .system-night-wolf-hint .system-pill {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.72);
  border-color: rgba(248, 113, 113, 0.50);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
}

.system-warning .system-pill {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.32);
}

.system-danger .system-pill {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(220, 38, 38, 0.36);
  color: #991b1b;
}

.system-success .system-pill {
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(22, 163, 74, 0.34);
}

.system-vote-kick .system-pill,
.message-vote .system-pill {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(99, 102, 241, 0.34);
}

.system-vote-day .system-pill {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.34);
}

.system-wolf .system-pill {
  background: rgba(204, 0, 0, 0.22);
  border-color: rgba(204, 0, 0, 0.46);
}

.system-mage .system-pill {
  background: rgba(153, 0, 153, 0.18);
  border-color: rgba(153, 0, 153, 0.38);
}

.system-fosi .system-pill {
  background: rgba(130, 0, 130, 0.18);
  border-color: rgba(130, 0, 130, 0.36);
}

.system-guard .system-pill {
  background: rgba(0, 153, 255, 0.18);
  border-color: rgba(0, 153, 255, 0.38);
}

.system-cat .system-pill {
  background: rgba(0, 102, 51, 0.18);
  border-color: rgba(0, 102, 51, 0.38);
}

.system-mytho .system-pill,
.system-mimic .system-pill {
  background: rgba(255, 128, 0, 0.18);
  border-color: rgba(255, 128, 0, 0.40);
}

.system-owlman .system-pill {
  background: rgba(0, 0, 128, 0.22);
  border-color: rgba(0, 0, 128, 0.42);
}

.system-pengu .system-pill {
  background: rgba(219, 234, 254, 0.72);
  border-color: rgba(129, 140, 248, 0.58);
  color: #0033cc;
}

.system-objection-male .system-pill {
  background: #336699;
  border-color: rgba(255, 255, 255, 0.25);
  color: snow;
}

.system-objection-female .system-pill {
  background: #ff0099;
  border-color: rgba(255, 255, 255, 0.25);
  color: snow;
}

.game-app[data-phase="night"] .system-danger .system-pill {
  color: #fecaca;
}

/* Self last words floating panel */

.self-lastwords-float {
  position: fixed;
  left: 50%;
  bottom: calc(var(--talk-input-offset, 96px) + 8px);
  z-index: 39;
  width: min(720px, calc(100vw - 20px));
  max-height: min(32vh, 240px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 14px;
  background: rgba(239, 246, 255, 0.96);
  color: #111827;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.20);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.self-lastwords-float[hidden] {
  display: none !important;
}

.self-lastwords-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  padding: 6px 9px;
  border-bottom: 1px solid rgba(37, 99, 235, 0.14);
  background: rgba(219, 234, 254, 0.76);
}

.self-lastwords-head strong {
  font-size: 13px;
  font-weight: 900;
}

.self-lastwords-close-btn {
  appearance: none;
  border: 1px solid rgba(37, 99, 235, 0.20);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #1d4ed8;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 900;
}

.self-lastwords-close-btn:hover {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.42);
}

.self-lastwords-body {
  flex: 1 1 auto;
  min-height: 44px;
  overflow: auto;
  padding: 8px 10px;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
}

.game-app[data-phase="night"] .self-lastwords-float {
  border-color: rgba(147, 197, 253, 0.24);
  background: rgba(15, 23, 42, 0.96);
  color: snow;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
}

.game-app[data-phase="night"] .self-lastwords-head {
  border-bottom-color: rgba(147, 197, 253, 0.16);
  background: rgba(30, 64, 175, 0.36);
}

.game-app[data-phase="night"] .self-lastwords-close-btn {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(191, 219, 254, 0.24);
  color: #dbeafe;
}

.game-app[data-phase="night"] .self-lastwords-close-btn:hover {
  background: rgba(37, 99, 235, 0.36);
  border-color: rgba(191, 219, 254, 0.44);
}

.game-app[data-phase="night"] .self-lastwords-body {
  color: snow;
}

/* Talk Input */

.talk-input-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.82);
  border-top: 1px solid rgba(0, 0, 0, 0.10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.game-app[data-phase="night"] .talk-input-bar {
  background: rgba(0, 0, 48, 0.86);
  border-top-color: rgba(255, 255, 255, 0.14);
}

.talk-form {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.talk-input-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: stretch;
}

#sayInput {
  width: 100%;
  resize: none;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.90);
  color: #111827;
  padding: 9px 10px;
  line-height: 1.4;
}

.game-app[data-phase="night"] #sayInput {
  background: rgba(15, 23, 42, 0.92);
  color: snow;
  border-color: rgba(255, 255, 255, 0.16);
}

.smile-toggle-btn {
  appearance: none;
  width: 42px;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.88);
  color: inherit;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.smile-toggle-btn img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.smile-toggle-btn:hover,
.smile-toggle-btn.is-active {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
}

.game-app[data-phase="night"] .smile-toggle-btn {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(255, 255, 255, 0.16);
}

.game-app[data-phase="night"] .smile-toggle-btn:hover,
.game-app[data-phase="night"] .smile-toggle-btn.is-active {
  background: rgba(59, 130, 246, 0.24);
  border-color: rgba(147, 197, 253, 0.38);
}

.talk-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#fontType,
.send-btn {
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  padding: 0 10px;
  font-weight: 900;
}

#fontType {
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
}

.send-btn {
  background: #2563eb;
  border-color: transparent;
  color: white;
}

.send-btn:hover:not(:disabled) {
  background: #1d4ed8;
}

/* Smile Picker */

.smile-picker-panel {
  width: min(1120px, 100%);
  margin: 8px auto 0;
  border-radius: 18px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.12);
  max-height: min(34vh, 260px);
  overflow: auto;
}

.game-app[data-phase="night"] .smile-picker-panel {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.32);
}

.smile-picker-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 13px;
}

.smile-picker-head strong {
  font-weight: 900;
}

.smile-picker-head span {
  font-size: 12px;
  opacity: 0.65;
}

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

.smile-picker-item {
  appearance: none;
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
  color: inherit;
  padding: 6px 4px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  place-items: center;
}

.smile-picker-item:hover {
  background: rgba(37, 99, 235, 0.10);
  border-color: rgba(37, 99, 235, 0.32);
  transform: translateY(-1px);
}

.game-app[data-phase="night"] .smile-picker-item {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
}

.game-app[data-phase="night"] .smile-picker-item:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(147, 197, 253, 0.36);
}

.smile-picker-pic {
  width: 100%;
  height: 38px;
  display: grid;
  place-items: center;
}

.smile-picker-pic img {
  max-width: 90px;
  max-height: 38px;
  object-fit: contain;
}

.smile-picker-code {
  width: 100%;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  text-align: center;
  word-break: break-all;
  opacity: 0.82;
}

.smile-picker-empty {
  grid-column: 1 / -1;
  padding: 14px;
  text-align: center;
  font-size: 13px;
  opacity: 0.68;
}

/* Heaven talk */

.heaven-panel {
  padding: 0;
  overflow: hidden;
}

.heaven-panel-head {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}

.heaven-panel-head strong {
  font-size: 13px;
  font-weight: 900;
}

.heaven-panel-head::before {
  content: "▾";
  font-size: 12px;
  opacity: 0.62;
}

.heaven-panel.is-collapsed .heaven-panel-head::before {
  content: "▸";
}

.heaven-body {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding: 6px 10px 8px;
  max-height: 260px;
  overflow: auto;
  font-family: "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  font-size: 12px;
  line-height: 1.35;
}

.game-app[data-phase="night"] .heaven-body {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.heaven-panel.is-collapsed .heaven-body {
  display: none;
}

.heaven-line {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 5px;
  align-items: baseline;
  padding: 2px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.22);
}

.heaven-line:last-child {
  border-bottom: 0;
}

.heaven-line.is-self {
  background: rgba(59, 130, 246, 0.07);
}

.heaven-time {
  opacity: 0.62;
  font-size: 11px;
  white-space: nowrap;
}

.heaven-name {
  font-weight: 900;
  white-space: nowrap;
}

.heaven-text {
  min-width: 0;
  word-break: break-word;
}

.heaven-text img {
  vertical-align: middle;
  max-width: none;
}

.heaven-line.font-strong .heaven-text {
  font-weight: 900;
  font-size: 13px;
}

.heaven-line.font-weak .heaven-text {
  opacity: 0.78;
  font-size: 11px;
}

.heaven-line.heaven-style-gm-broadcast {
  margin: 2px 0;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(254, 226, 226, 0.95);
  border-bottom-color: rgba(220, 38, 38, 0.18);
}

.heaven-line.heaven-style-gm-broadcast .heaven-name,
.heaven-line.heaven-style-gm-broadcast .heaven-text {
  color: #b91c1c;
  font-weight: 800;
}

.game-app[data-phase="night"] .heaven-line.heaven-style-gm-broadcast {
  background: rgba(127, 29, 29, 0.78);
  border-bottom-color: rgba(248, 113, 113, 0.26);
}

.game-app[data-phase="night"] .heaven-line.heaven-style-gm-broadcast .heaven-name,
.game-app[data-phase="night"] .heaven-line.heaven-style-gm-broadcast .heaven-text {
  color: #fee2e2;
}

.heaven-empty {
  padding: 8px 0;
  text-align: center;
  opacity: 0.65;
}

@media (min-width: 621px) {
  .heaven-panel {
    margin-top: -2px;
  }
}

@media (max-width: 620px) {
  .heaven-body {
    max-height: 220px;
  }

  .heaven-line {
    display: block;
  }

  .heaven-time,
  .heaven-name,
  .heaven-text {
    display: inline;
  }

  .heaven-time::after,
  .heaven-name::after {
    content: " ";
  }

  .heaven-text {
    overflow-wrap: anywhere;
  }
}

/* Empty */

.empty-state {
  grid-column: 1 / -1;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  opacity: 0.68;
}

/* Responsive */

@media (max-width: 720px) {
  .game-topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    max-width: 48%;
  }

  .mini-btn {
    padding: 5px 8px;
  }

  .status-panel {
    align-items: center;
  }

  .action-area {
    justify-content: center;
  }
}

@media (max-width: 620px) {
  .game-app {
    --talk-input-offset: 156px;
  }

  .game-main {
    padding-left: 6px;
    padding-right: 6px;
  }

  .mobile-panel-head {
    display: block;
    margin-bottom: 4px;
  }

  .event-block.is-mobile-collapsed .event-list {
    display: none;
  }

  .event-toggle-title {
    cursor: pointer;
  }

  .event-block.is-mobile-collapsed {
    padding-bottom: 0;
  }

  .event-block.is-mobile-collapsed .event-block-title {
    border-radius: 8px;
  }

  .mobile-panel-backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 44;
    display: block;
    pointer-events: none;
    background: transparent;
  }

  .mobile-player-fab:not([hidden]) {
    position: fixed;
    top: calc(2px + env(safe-area-inset-top));
    z-index: 61;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 1px solid rgba(37, 99, 235, 0.35);
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.96);
    color: #ffffff;
    padding: 0 13px;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.30);
  }

  .mobile-player-fab:not([hidden]) {
    right: 8px;
  }

  .game-app[data-phase="night"] .mobile-player-fab:not([hidden]) {
    background: rgba(96, 165, 250, 0.96);
    border-color: rgba(147, 197, 253, 0.55);
    color: #0f172a;
  }

  .player-panel.is-collapsed {
    display: none;
  }

  .player-panel:not(.is-collapsed) {
    position: fixed;
    left: 8px;
    right: 8px;
    top: 0;
    z-index: 46;
    margin: 0;
    padding: 7px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    max-height: min(76vh, calc(100vh - var(--talk-input-offset, 156px) - 10px));
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .game-app[data-phase="night"] .player-panel:not(.is-collapsed) {
    background: rgba(15, 23, 42, 0.74);
  }

  .player-panel:not(.is-collapsed) .player-card:not(.is-dead):not(.is-started):not(.is-acted):not(.is-sudden-death-1):not(.is-sudden-death-2):not(.is-gm):not(.is-pregame-gm) {
    background: rgba(255, 255, 255, 0.82);
  }

  .game-app[data-phase="night"] .player-panel:not(.is-collapsed) .player-card:not(.is-dead):not(.is-started):not(.is-acted):not(.is-sudden-death-1):not(.is-sudden-death-2):not(.is-gm):not(.is-pregame-gm) {
    background: rgba(15, 23, 42, 0.86);
  }

  .player-panel:not(.is-collapsed) .player-panel-head {
    flex: 0 0 auto;
  }

  .player-panel:not(.is-collapsed) .player-grid {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding-right: 2px;
  }

  .game-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    display: none;
  }

  .history-page .topbar-actions {
    display: flex;
    max-width: none;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .history-page .topbar-actions .mini-btn {
    flex: 0 0 auto;
  }

  #togglePinBtn {
    display: none;
  }

  .mobile-more-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: 999;
    background: rgba(15, 23, 42, 0.08);
    color: inherit;
  }

  .game-app[data-phase="night"] .mobile-more-toggle-btn {
    background: rgba(255, 255, 255, 0.12);
  }

  .mobile-more-hud:not([hidden]) {
    display: flex;
    top: calc(var(--mobile-overlay-top, 72px) + var(--mobile-action-hud-height, 42px) + 1px);
    z-index: 27;
    margin-top: -6px;
    max-width: calc(100% - 12px);
  }

  .mobile-more-actions .mini-btn {
    min-height: 30px;
  }

  .room-title-line {
    gap: 6px;
  }

  .login-form label {
    flex: 1 1 140px;
  }

  .login-form input {
    width: 100%;
    min-width: 0;
  }

  .register-link {
    margin-left: 0;
  }

  .login-btn,
  .register-link {
    flex: 1 1 auto;
  }

  .village-options-compact {
    align-items: flex-start;
  }

  .player-grid {
    gap: 3px;
  }

  .player-card,
  .game-app.compact-players .player-card {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
    min-height: 82px;
  }

  .player-card.has-no-extra-info,
  .game-app.compact-players .player-card.has-no-extra-info {
    min-height: 62px;
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .vote-summary-section {
    padding: 6px;
  }

  .vote-summary-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 11px;
  }

  .vote-summary-table td {
    padding: 4px 3px;
  }

  .vote-voter {
    width: 4.8em;
  }

  .vote-received {
    width: 3.1em;
  }

  .vote-power {
    width: 9.4em;
    white-space: nowrap;
    word-break: keep-all;
  }

  .vote-target {
    min-width: 0;
  }

  .player-avatar-wrap,
  .game-app.compact-players .player-avatar-wrap {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .player-avatar,
  .game-app.compact-players .player-avatar {
    max-width: 36px;
    max-height: 36px;
  }

  .player-name,
  .game-app.compact-players .player-name {
    width: 100%;
    text-align: center;
    font-size: 11px;
    line-height: 1.15;
    max-height: 2.3em;
    overflow: hidden;
  }

  .player-trip,
  .player-meta,
  .game-app.compact-players .player-trip,
  .game-app.compact-players .player-meta {
    display: none;
  }

  .talk-log {
    height: var(--mobile-talk-log-height, 300px);
    max-height: var(--mobile-talk-log-height, 300px);
    min-height: 240px;
  }

  .history-talk-log {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
  }

  .talk-row {
    gap: 6px;
  }

  .talk-avatar-wrap {
    width: 42px;
    min-width: 42px;
  }

  .talk-bubble {
    max-width: calc(100% - 48px);
  }

  .event-summary-panel {
    margin-left: 0;
    margin-right: 0;
  }

  .event-block-title {
    padding: 6px 8px;
    font-size: 12px;
  }

  .event-line {
    padding: 6px 8px;
    font-size: 12px;
  }

  .vote-summary-section {
    gap: 5px;
    padding: 7px 6px;
  }

  .vote-round {
    overflow-x: visible;
    width: 100%;
  }

  .vote-summary-table {
    min-width: 0;
    table-layout: fixed;
    font-size: 11px;
  }

  .vote-summary-table td {
    padding: 4px 3px;
  }

  .vote-received {
    width: 34px;
  }

  .vote-power {
    width: 96px;
    white-space: nowrap;
    word-break: keep-all;
  }

  .ability-main-role-card summary {
    min-height: 54px;
    gap: 7px;
    padding: 7px 8px;
  }

  .ability-main-role-icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .ability-main-role-icon img {
    height: 32px;
    max-width: 34px;
  }

  .ability-main-role-name {
    font-size: 16px;
  }

  .ability-main-role-hint {
    font-size: 11px;
  }

  .ability-panel-actions {
    top: 6px;
    right: 6px;
  }

  .ability-lastwords-btn {
    min-height: 26px;
    padding: 0 8px;
    font-size: 11px;
  }

  .ability-panel.has-self-lastwords .ability-self-info {
    padding-right: 92px;
  }

  .self-lastwords-float {
    bottom: calc(var(--talk-input-offset, 156px) + 6px);
    width: calc(100vw - 12px);
    max-height: min(30vh, 210px);
    border-radius: 12px;
  }

  .self-lastwords-body {
    padding: 7px 9px;
    font-size: 13px;
  }

  .ability-subroles {
    flex-direction: column;
    gap: 5px;
  }

  .ability-subrole-label {
    padding-top: 0;
  }

  .lastword-line {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .talk-form {
    grid-template-columns: 1fr;
  }

  .talk-tools {
    flex-direction: row;
  }

  #fontType {
    flex: 1;
  }

  .send-btn {
    min-width: 88px;
  }

  .log-filter-form {
    align-items: stretch;
  }

  .log-filter-form select,
  .log-filter-form button {
    flex: 1 1 auto;
  }

  .smile-picker-panel {
    max-height: 38vh;
    border-radius: 18px 18px 0 0;
  }

  .smile-picker-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .smile-picker-pic {
    height: 34px;
  }

  .smile-picker-pic img {
    max-width: 78px;
    max-height: 34px;
  }

  .smile-picker-code {
    font-size: 10px;
  }
}

/* 音效開關 */

.sound-toggle-btn.is-on {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.45);
  color: #166534;
}

.game-app[data-phase="night"] .sound-toggle-btn.is-on {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(74, 222, 128, 0.46);
  color: #bbf7d0;
}

/* 死亡頭像：預設墓碑，hover 顯示原頭像 */

.player-avatar-wrap {
  position: relative;
}

.player-avatar-stack {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
}

.player-avatar-stack .player-avatar {
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.player-avatar-stack .avatar-real {
  position: absolute;
  left: 50%;
  top: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.96);
}

.player-avatar-stack:hover .avatar-ghost {
  opacity: 0;
  transform: scale(0.96);
}

.player-avatar-stack:hover .avatar-real {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
/* Phase timer */
.time-status {
  min-width: 178px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  padding: 4px 9px;
  line-height: 1.25;
}

.game-app[data-phase="night"] .time-status {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
}

.time-status-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
}

.time-status-main strong {
  font-size: 16px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.time-status-sub {
  margin-top: 1px;
  font-size: 11px;
  opacity: 0.78;
}

.time-status-sub:empty {
  display: none;
}

.time-status.is-grace {
  border-color: rgba(220, 38, 38, 0.36);
  background: rgba(254, 226, 226, 0.88);
}

.game-app[data-phase="night"] .time-status.is-grace {
  background: rgba(127, 29, 29, 0.42);
  border-color: rgba(248, 113, 113, 0.42);
}

.time-status.is-deadline {
  opacity: 0.82;
  filter: grayscale(0.35);
}

@media (max-width: 620px) {
  .player-meta,
  .game-app.compact-players .player-meta {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 1px;
  }

  .player-live-label,
  .player-badge:not(.role),
  .game-app.compact-players .player-live-label,
  .game-app.compact-players .player-badge:not(.role) {
    display: none;
  }

  .player-badge.role,
  .game-app.compact-players .player-badge.role {
    max-width: 100%;
    min-height: 17px;
    padding: 2px 5px;
    font-size: 10.5px;
    white-space: nowrap;
  }
}

/* Chat Village Member List */

.game-app.chat-village .player-panel {
  padding-bottom: 7px;
}

.game-app.chat-village .player-grid {
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 6px;
  max-height: min(42vh, 380px);
  overflow: auto;
  padding-right: 2px;
}

.game-app.chat-village .player-card,
.game-app.chat-village.compact-players .player-card,
.game-app.chat-village .player-card.has-no-extra-info,
.game-app.chat-village.compact-players .player-card.has-no-extra-info {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(15, 23, 42, 0.10);
  box-shadow: none;
}

.game-app.chat-village[data-phase="night"] .player-card,
.game-app.chat-village[data-phase="night"].compact-players .player-card,
.game-app.chat-village[data-phase="night"] .player-card.has-no-extra-info {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(255, 255, 255, 0.12);
}

.game-app.chat-village .player-card.is-started,
.game-app.chat-village .player-card.is-acted,
.game-app.chat-village[data-phase="day"] .player-card.is-acted,
.game-app.chat-village[data-phase="night"] .player-card.is-started,
.game-app.chat-village[data-phase="night"] .player-card.is-acted {
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(15, 23, 42, 0.10);
  box-shadow: none;
}

.game-app.chat-village[data-phase="night"] .player-card.is-started,
.game-app.chat-village[data-phase="night"] .player-card.is-acted {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(255, 255, 255, 0.12);
}

.game-app.chat-village .player-card.is-dead {
  opacity: 0.62;
  filter: grayscale(0.35);
}

.game-app.chat-village .player-card:hover {
  transform: none;
  border-color: rgba(37, 99, 235, 0.28);
}

.game-app.chat-village .player-avatar-wrap,
.game-app.chat-village.compact-players .player-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  flex-basis: 38px;
}

.game-app.chat-village .player-avatar-wrap::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  border: 2px solid rgba(255, 255, 255, 0.95);
}

.game-app.chat-village .player-card.is-dead .player-avatar-wrap::after {
  background: #94a3b8;
}

.game-app.chat-village[data-phase="night"] .player-avatar-wrap::after {
  border-color: rgba(15, 23, 42, 0.95);
}

.game-app.chat-village .player-avatar,
.game-app.chat-village.compact-players .player-avatar {
  max-width: 36px;
  max-height: 36px;
  border-radius: 999px;
}

.game-app.chat-village .player-info {
  min-width: 0;
  display: block;
}

.game-app.chat-village .player-name,
.game-app.chat-village.compact-players .player-name {
  width: 100%;
  text-align: left;
  font-size: 13px;
  line-height: 1.2;
  max-height: 1.3em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-app.chat-village .player-trip,
.game-app.chat-village.compact-players .player-trip {
  display: block;
  max-width: 100%;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.15;
  opacity: 0.62;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-app.chat-village .player-meta,
.game-app.chat-village.compact-players .player-meta {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  margin-top: 3px;
}

.game-app.chat-village .player-live-label,
.game-app.chat-village .player-badge.role,
.game-app.chat-village .player-badge.marked {
  display: none;
}

.game-app.chat-village .player-badge.gm,
.game-app.chat-village .player-badge.self {
  min-height: 16px;
  padding: 1px 6px;
  font-size: 10px;
}

@media (min-width: 980px) {
  .game-app.chat-village.players-sidebar-open .game-main {
    --chat-sidebar-top: 64px;
    --chat-sidebar-bottom-gap: calc(var(--talk-input-offset, 96px) + 24px);
    width: min(1360px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
    gap: 8px;
    align-items: start;
  }

  .game-app.chat-village.players-sidebar-open .login-box,
  .game-app.chat-village.players-sidebar-open .village-options-panel,
  .game-app.chat-village.players-sidebar-open .ability-panel,
  .game-app.chat-village.players-sidebar-open .status-panel,
  .game-app.chat-village.players-sidebar-open .talk-panel,
  .game-app.chat-village.players-sidebar-open .heaven-panel {
    grid-column: 1;
    min-width: 0;
  }

  .game-app.chat-village.players-sidebar-open .player-panel {
    grid-column: 2;
    grid-row: 1 / span 7;
    align-self: start;
    position: sticky;
    top: var(--chat-sidebar-top);
    z-index: 18;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--chat-sidebar-top) - var(--chat-sidebar-bottom-gap));
    margin-bottom: 0;
    padding: 8px;
  }

  .game-app.chat-village.players-sidebar-open .player-panel.is-pinned {
    top: var(--chat-sidebar-top);
  }

  .game-app.chat-village.players-sidebar-open .player-panel-head {
    flex: 0 0 auto;
  }

  .game-app.chat-village.players-sidebar-open .player-grid {
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 1fr);
    max-height: none;
    min-height: 0;
    padding-right: 3px;
    overflow: auto;
  }

  .game-app.chat-village.players-sidebar-open .talk-log {
    max-height: calc(100vh - 285px);
    min-height: 480px;
  }
}

@media (max-width: 620px) {
  .game-app.chat-village .player-grid {
    grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
    max-height: min(46vh, 340px);
  }

  .game-app.chat-village .player-card,
  .game-app.chat-village.compact-players .player-card,
  .game-app.chat-village .player-card.has-no-extra-info {
    min-height: 48px;
    padding: 5px 7px;
  }

  .game-app.chat-village .player-name,
  .game-app.chat-village.compact-players .player-name {
    font-size: 12px;
  }
}
