:root {
  --bg: #160d08;
  --bg-panel: #24150d;
  --bg-card: #2e1b10;
  --ink: #f3e5cb;
  --muted: #d7bc8b;
  --line: rgba(201, 162, 39, 0.35);
  --accent: #d4a93a;
  --danger: #ef5350;
  --ok: #7bc67b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px;
  background: radial-gradient(circle at 20% 20%, rgba(212,169,58,0.08), transparent 55%), var(--bg);
  color: var(--ink);
  font-family: 'MedievalSharp', serif;
}

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

.gm-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

h1 {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  color: var(--accent);
}

.gm-link {
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.gm-auth,
.gm-toolbar,
.gm-clock-panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.gm-auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  align-items: end;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

input,
select,
textarea,
button {
  font-family: 'MedievalSharp', serif;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  padding: 7px 8px;
  border-radius: 5px;
}

button {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #3d2518, #2a1810);
  color: var(--ink);
  border-radius: 5px;
  padding: 7px 10px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

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

.gm-link-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--ink);
  font-family: 'MedievalSharp', serif;
}

.gm-link-btn:hover:not(:disabled) {
  border-color: var(--accent);
}

.gm-auth-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gm-status {
  margin-top: 8px;
  color: var(--muted);
}

.gm-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.gm-clock-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 14px;
}

.gm-clock-face-wrap {
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(201, 162, 39, 0.2));
  transform: rotate(var(--clock-angle, 0deg));
  transform-origin: 50% 50%;
  will-change: transform;
}

.gm-clock-face-img {
  width: 90px;
  height: 90px;
  display: block;
  object-fit: contain;
}

.gm-clock-face-wrap.is-spinning .gm-clock-face-img {
  animation: gm-clock-spin 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.gm-clock-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.gm-clock-section-label {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.82;
}

.gm-clock-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gm-calendar-start-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gm-calendar-start-details {
  border: 1px solid rgba(201, 162, 39, 0.28);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  padding: 4px 8px;
}

.gm-calendar-start-summary {
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  list-style: none;
  user-select: none;
}

.gm-calendar-start-summary::-webkit-details-marker {
  display: none;
}

.gm-calendar-start-details[open] .gm-calendar-start-row {
  margin-top: 8px;
}

.gm-clock-multiplier-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gm-clock-date-label {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}

#gmCalendarStartMonth {
  min-width: 130px;
}

#gmCalendarStartDay {
  width: 72px;
}

#gmCalendarStartYear {
  width: 96px;
}

#gmClockAdvanceMultiplier {
  width: 86px;
}

#gmSetCalendarStartBtn {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gm-clock-new-round-btn {
  border-color: rgba(201, 162, 39, 0.9);
  color: #f2d48b;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 12px;
}

.gm-clock-time-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
}

.gm-time-all-reverse-btn {
  border-color: rgba(239, 83, 80, 0.6);
  color: #ffd6d6;
}

.gm-clock-time-tracking {
  min-width: 320px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(22, 13, 8, 0.65), rgba(36, 21, 13, 0.9));
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gm-clock-time-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gm-clock-time-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.gm-clock-lead-display {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
}

.gm-clock-lead-label {
  font-family: 'Cinzel', serif;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.gm-clock-lead-name {
  color: var(--ink);
  font-family: 'Cinzel', serif;
  font-size: 0.84rem;
}

.gm-clock-lead-time {
  color: #f2d48b;
  font-family: 'Cinzel', serif;
  font-size: 0.74rem;
}

.gm-clock-lead-day {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.gm-clock-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(215, 188, 139, 0.45);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
}

.gm-clock-tag.is-absent {
  border-color: rgba(201, 162, 39, 0.65);
  color: #f1d38a;
}

.gm-clock-tag.is-pending {
  border-color: rgba(79, 141, 218, 0.7);
  color: #d4e7ff;
}

.gm-clock-tag.is-locked {
  border-color: rgba(239, 83, 80, 0.72);
  color: #ffdede;
}

.gm-clock-time-sync {
  color: var(--ok);
  font-size: 0.76rem;
}

.gm-clock-turn-head {
  color: var(--muted);
  font-size: 0.74rem;
}

.gm-clock-turn-pending-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gm-clock-turn-player {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.75rem;
}

.gm-clock-turn-player.is-pending .gm-clock-player-delta {
  color: #efb083;
}

.gm-clock-turn-all-done {
  color: var(--ok);
  font-size: 0.75rem;
}

.gm-clock-turn-empty {
  color: var(--muted);
  font-size: 0.74rem;
}

.gm-clock-players-behind-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gm-clock-player-behind {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

.gm-clock-player-behind.is-absent {
  opacity: 0.85;
}

.gm-clock-player-behind.is-locked {
  opacity: 0.78;
}

.gm-clock-player-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gm-clock-player-delta {
  color: #efb083;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  white-space: nowrap;
}

.gm-clock-player-tags {
  display: inline-flex;
  gap: 4px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.gm-clock-sync-btn {
  align-self: flex-start;
  border-color: rgba(201, 162, 39, 0.9);
  color: #f2d48b;
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 9px;
}

.gm-clock-pending-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px dashed rgba(201, 162, 39, 0.25);
  padding-top: 7px;
}

.gm-clock-pending-player {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.75rem;
}

.gm-clock-note-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gm-clock-note-label {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: 'Cinzel', serif;
}

.gm-clock-note-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.gm-clock-note-input {
  flex: 1;
  min-width: 0;
}

.gm-clock-note-btn {
  border-color: rgba(79, 141, 218, 0.65);
  color: #d4e7ff;
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 8px;
}

.gm-clock-history-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gm-clock-history-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gm-clock-history-title {
  color: var(--accent);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gm-clock-history-load {
  font-family: 'Cinzel', serif;
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 7px;
}

.gm-clock-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding-right: 2px;
}

.gm-clock-history-empty {
  color: var(--muted);
  font-size: 0.76rem;
}

.gm-clock-history-item {
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: 6px;
  padding: 6px 7px;
  background: rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gm-clock-history-item.is-correction {
  border-color: rgba(79, 141, 218, 0.5);
  background: rgba(22, 52, 89, 0.24);
}

.gm-clock-history-head {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 7px;
}

.gm-clock-history-type {
  color: var(--accent);
  font-family: 'Cinzel', serif;
  font-size: 0.67rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gm-clock-history-clock {
  color: #f2d48b;
  font-family: 'Cinzel', serif;
  font-size: 0.69rem;
}

.gm-clock-history-delta {
  color: #d4e7ff;
  font-family: 'Cinzel', serif;
  font-size: 0.69rem;
}

.gm-clock-history-delete-btn {
  justify-self: end;
  border-color: rgba(239, 83, 80, 0.7);
  color: #ffdede;
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 6px;
}

.gm-clock-history-delete-btn:hover:not(:disabled) {
  border-color: rgba(239, 83, 80, 0.95);
}

.gm-clock-history-delete-btn.is-confirm,
.gm-delete-message-btn.is-confirm {
  border-color: rgba(255, 179, 64, 0.9);
  background: rgba(120, 77, 22, 0.5);
  color: #fff4d8;
}

.gm-clock-history-text {
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.25;
  white-space: pre-wrap;
  word-break: break-word;
}

.gm-clock-history-meta {
  color: var(--muted);
  font-size: 0.67rem;
}

.gm-toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 4px;
}

.gm-toolbar-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: 4px;
}

.gm-inline-check {
  display: inline-flex;
  align-items: center;
  flex-direction: row;
  gap: 6px;
  font-size: 0.85rem;
}

.gm-inline-check input[type="checkbox"] {
  margin: 0;
}

.gm-sheet-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.gm-sheet-list[data-columns="1"] {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.gm-sheet-list[data-columns="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gm-sheet-list[data-columns="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gm-sheet-list[data-columns="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gm-sheet-list[data-columns="5"] {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.gm-sheet-list[data-columns="6"] {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.gm-sheet-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gm-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.gm-sheet-meta {
  display: flex;
  gap: 6px;
  align-items: center;
}

.gm-sheet-title-row {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.gm-sheet-name {
  margin: 0;
  font-family: 'Cinzel', serif;
  color: var(--accent);
  font-size: 1.02rem;
}

.gm-turn-pill {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(215, 188, 139, 0.5);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
  white-space: nowrap;
}

.gm-turn-pill.is-complete {
  border-color: rgba(123, 198, 123, 0.65);
  color: var(--ok);
  background: rgba(25, 70, 25, 0.24);
}

.gm-turn-pill.is-pending {
  border-color: rgba(227, 125, 63, 0.72);
  color: #ffd2b5;
  background: rgba(109, 54, 26, 0.35);
}

.gm-turn-pill.is-inactive {
  border-color: rgba(149, 149, 149, 0.55);
  color: #c8c8c8;
  background: rgba(0, 0, 0, 0.2);
}

.gm-presence {
  font-size: 0.75rem;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.gm-presence.online {
  color: var(--ok);
  border-color: rgba(123, 198, 123, 0.6);
}

.gm-presence.idle {
  color: var(--accent);
}

.gm-presence.offline {
  color: #bababa;
}

.gm-hidden-pill {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(215, 188, 139, 0.5);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
}

.gm-state-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(215, 188, 139, 0.5);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
}

.gm-state-badge.pre-game {
  border-color: rgba(201, 162, 39, 0.75);
  color: #f1d38a;
  background: rgba(109, 76, 15, 0.35);
}

.gm-state-badge.in-game {
  border-color: rgba(79, 141, 218, 0.75);
  color: #d4e7ff;
  background: rgba(20, 53, 97, 0.35);
}

.gm-attendance-pill {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(215, 188, 139, 0.5);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
}

.gm-attendance-pill.is-present {
  border-color: rgba(123, 198, 123, 0.65);
  color: var(--ok);
  background: rgba(25, 70, 25, 0.24);
}

.gm-attendance-pill.is-absent {
  border-color: rgba(201, 162, 39, 0.6);
  color: #f1d38a;
}

.gm-lock-indicator {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(239, 83, 80, 0.75);
  color: #ffdede;
  background: rgba(101, 22, 22, 0.5);
}

.gm-lock-note {
  color: #ffdede;
}

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

.gm-summary-item {
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 5px;
  padding: 6px;
  text-align: center;
}

.gm-summary-label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.gm-summary-value {
  color: var(--ink);
  font-size: 1.1rem;
}

.gm-summary-value-hp {
  color: var(--danger);
}

.gm-summary-value-sp {
  background: linear-gradient(270deg, #c5a3ec, #a855f7, #6d28d9, #c084fc, #7b3fbf);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gm-arcane-shimmer 6s ease infinite;
}

.gm-summary-value-move {
  color: var(--ok);
}

@keyframes gm-arcane-shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gm-awareness-diffs {
  margin-top: -2px;
  color: var(--muted);
  font-size: 0.78rem;
  border: 1px dashed rgba(201, 162, 39, 0.25);
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.15);
}

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

.gm-control-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.gm-control-row-inner {
  margin-left: 58px;
}

.gm-control-details {
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.14);
}

.gm-control-details-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
}

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

.gm-control-details-hint {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
}

.gm-control-details-body {
  border-top: 1px solid rgba(201, 162, 39, 0.2);
  padding: 8px;
}

.gm-control-title {
  min-width: 52px;
  color: var(--muted);
  font-size: 0.82rem;
}

.gm-status-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.gm-status-row-readonly {
  align-items: center;
}

.gm-readonly-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
}

.gm-readonly-chip.is-active {
  border-color: rgba(79, 141, 218, 0.75);
  color: #d4e7ff;
  background: rgba(20, 53, 97, 0.35);
}

.gm-status-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, #6f1818, #4b1111);
  border-color: rgba(239, 83, 80, 0.7);
  color: #ffe6e6;
}

.gm-defense-row {
  align-items: flex-start;
}

.gm-defense-option {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: min(640px, 100%);
  flex: 1;
}

.gm-defense-readonly-indicator {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  width: fit-content;
}

.gm-defense-readonly-indicator.is-active {
  border-color: rgba(79, 141, 218, 0.82);
  color: #d4e7ff;
  background: rgba(20, 53, 97, 0.38);
}

.gm-defense-explain {
  display: none;
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.gm-defense-explain.is-visible {
  display: block;
}

.gm-status-btn.gm-status-attention {
  position: relative;
  animation: gm-status-attention-pulse 1.15s ease-in-out infinite;
}

@keyframes gm-status-attention-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 130, 96, 0);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 6px rgba(255, 130, 96, 0.28);
  }
}

.gm-sheet-visibility-btn[data-hidden="true"] {
  border-color: rgba(215, 188, 139, 0.7);
  color: var(--muted);
}

.gm-delete-sheet-btn {
  border-color: rgba(239, 83, 80, 0.55);
  color: #ffd6d6;
}

.gm-delete-sheet-btn:hover:not(:disabled) {
  border-color: rgba(239, 83, 80, 0.9);
}

.gm-force-enter-btn {
  border-color: rgba(79, 141, 218, 0.65);
  color: #d4e7ff;
}

.gm-set-pre-game-btn {
  border-color: rgba(201, 162, 39, 0.7);
  color: #f2d48b;
}

.gm-time-reverse-btn {
  border-color: rgba(239, 83, 80, 0.6);
  color: #ffd6d6;
}

.gm-deep-rest-btn {
  border-color: rgba(123, 198, 123, 0.7);
  color: #e9ffe9;
}

.gm-deep-rest-btn:hover:not(:disabled) {
  border-color: rgba(166, 227, 166, 0.95);
}

.gm-deep-rest-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, #1f6e3d, #164f2c);
  border-color: rgba(123, 198, 123, 0.85);
  color: #e9ffe9;
}

.gm-direct-edit-btn {
  border-color: rgba(239, 83, 80, 0.6);
  color: #ffdede;
}

.gm-direct-edit-btn:hover:not(:disabled) {
  border-color: rgba(239, 83, 80, 0.85);
}

.gm-wizard-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, #1f6e3d, #164f2c);
  border-color: rgba(123, 198, 123, 0.7);
  color: #e9ffe9;
}

.gm-inline-note {
  color: var(--muted);
  font-size: 0.78rem;
}

.gm-inline-note-block {
  flex-basis: 100%;
  margin-left: 58px;
}

.gm-message-row {
  align-items: flex-start;
}

.gm-message-console {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(201, 162, 39, 0.28);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
}

.gm-message-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  padding: 7px 9px;
  min-width: 0;
}

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

.gm-message-summary-line {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  line-height: 1.2;
}

.gm-message-summary-hint {
  flex-shrink: 0;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(243, 229, 203, 0.7);
}

.gm-message-summary.from-player {
  border: 1px solid rgba(79, 141, 218, 0.7);
  background: rgba(24, 61, 109, 0.45);
  color: #d4e7ff;
}

.gm-message-summary.from-gm {
  border: 1px solid rgba(255, 149, 68, 0.55);
  background: rgba(120, 52, 20, 0.3);
  color: #fff4d8;
}

.gm-message-summary.is-empty {
  border: 1px solid rgba(201, 162, 39, 0.3);
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
}

.gm-message-console[open] .gm-message-summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.gm-message-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(201, 162, 39, 0.28);
  border-radius: 6px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.gm-player-message-banner {
  border: 1px solid rgba(255, 149, 68, 0.65);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.8rem;
  color: #fff4d8;
  background: linear-gradient(90deg, rgba(155, 55, 22, 0.62), rgba(171, 106, 26, 0.6), rgba(155, 55, 22, 0.62));
}

.gm-player-message-banner.is-empty {
  border-color: rgba(201, 162, 39, 0.3);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.18);
}

.gm-gm-message-current {
  color: var(--muted);
  font-size: 0.79rem;
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 5px;
  padding: 5px 7px;
  background: rgba(0, 0, 0, 0.16);
}

.gm-message-meta-inline {
  color: rgba(243, 229, 203, 0.75);
  font-size: 0.72rem;
}

.gm-message-compose {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gm-message-input {
  flex: 1;
  min-width: 0;
}

.gm-send-message {
  border-color: rgba(79, 141, 218, 0.65);
  color: #d4e7ff;
}

.gm-send-message:hover:not(:disabled) {
  border-color: rgba(138, 184, 240, 0.9);
}

.gm-message-history {
  border: 1px solid rgba(201, 162, 39, 0.28);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  padding: 4px 8px;
}

.gm-message-history summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gm-message-history-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 160px;
  overflow: auto;
}

.gm-message-history-item {
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 5px;
  padding: 5px 7px;
  font-size: 0.78rem;
  line-height: 1.3;
  background: rgba(0, 0, 0, 0.2);
}

.gm-message-history-body {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.gm-message-history-text {
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.gm-delete-message-btn {
  flex-shrink: 0;
  border: 1px solid rgba(239, 83, 80, 0.62);
  border-radius: 4px;
  background: rgba(146, 45, 45, 0.26);
  color: #ffdede;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  cursor: pointer;
}

.gm-delete-message-btn:hover:not(:disabled) {
  border-color: rgba(239, 83, 80, 0.9);
  background: rgba(161, 41, 41, 0.34);
}

.gm-delete-message-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gm-message-history-item.gm {
  border-color: rgba(79, 141, 218, 0.45);
  background: rgba(26, 59, 99, 0.26);
}

.gm-message-history-item.player {
  border-color: rgba(255, 149, 68, 0.4);
  background: rgba(120, 52, 20, 0.25);
}

.gm-message-history-meta {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.gm-message-history-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.gm-note-input,
.gm-wound-reason {
  flex: 1;
  min-width: 120px;
}

.gm-wound-amount {
  width: 5.5em;
}

.gm-wound-list-wrap {
  align-items: flex-start;
}

.gm-wound-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gm-wound-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 6px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.18);
}

.gm-wound-row.is-open {
  border-color: rgba(201, 162, 39, 0.5);
  background: rgba(0, 0, 0, 0.28);
}

.gm-wound-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(0, 0, 0, 0.22);
}

.gm-wound-toggle-hint {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.gm-wound-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px dashed rgba(201, 162, 39, 0.35);
  padding-top: 8px;
}

.gm-wound-editor-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gm-wound-editor-label {
  min-width: 80px;
  color: var(--muted);
  font-size: 0.78rem;
}

.gm-wound-effects-head {
  margin-top: 2px;
}

.gm-effects-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gm-effect-row,
.gm-effect-add-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 90px auto auto;
  gap: 6px;
  align-items: center;
}

.gm-effect-add-row {
  grid-template-columns: minmax(140px, 1fr) 90px auto;
}

.gm-effect-target,
.gm-effect-add-target {
  min-width: 0;
}

.gm-effect-value,
.gm-effect-add-value {
  width: 100%;
}

.gm-remove-effect,
.gm-heal-wound {
  border-color: rgba(239, 83, 80, 0.55);
  color: #ffd6d6;
}

.gm-wound-text {
  flex: 1;
  min-width: 180px;
  font-size: 0.78rem;
}

.gm-wound-duration-value {
  width: 6em;
}

.gm-wound-duration-unit {
  min-width: 94px;
}

.gm-audit {
  border-top: 1px solid rgba(201, 162, 39, 0.2);
  padding-top: 8px;
}

.gm-audit summary {
  cursor: pointer;
  color: var(--accent);
}

.gm-events {
  margin-top: 8px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 6px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.2);
}

.gm-event {
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.15);
  padding: 4px 0;
}

.gm-event:last-child {
  border-bottom: none;
}

.gm-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
}

.gm-settings-panel,
.gm-damage-panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.gm-settings-panel {
  display: none;
}

.gm-settings-header,
.gm-damage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.gm-damage-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.gm-settings-header h2,
.gm-damage-header h2 {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--accent);
}

.gm-settings-content {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gm-settings-content > .gm-auth,
.gm-settings-content > .gm-toolbar {
  margin-bottom: 0;
}

body.gm-settings-mode #gmDamagePanel,
body.gm-settings-mode .gm-clock-panel,
body.gm-settings-mode main {
  display: none;
}

body.gm-settings-mode .gm-settings-panel {
  display: block;
  margin-bottom: 0;
}

.gm-settings-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gm-settings-tab {
  font-size: 0.76rem;
  padding: 5px 11px;
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.25);
}

.gm-settings-tab.is-active {
  color: var(--ink);
  border-color: rgba(212, 169, 58, 0.9);
  background: rgba(201, 162, 39, 0.2);
}

.gm-settings-tab-panel {
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
  padding: 10px;
}

.gm-settings-tab-panel[hidden] {
  display: none;
}

.gm-calendar-settings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gm-preset-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.gm-wound-table-settings-section {
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
  padding: 10px;
  margin-bottom: 10px;
}

.gm-wound-table-settings-section h3 {
  margin: 0 0 8px 0;
  font-family: 'Cinzel', serif;
  color: var(--accent);
  font-size: 0.9rem;
}

.gm-threshold-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.gm-wound-table-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.gm-wound-table-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.gm-wound-table-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gm-preset-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 250px;
  overflow: auto;
}

.gm-preset-row {
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.gm-preset-name {
  font-family: 'Cinzel', serif;
  font-size: 0.84rem;
  color: var(--ink);
}

.gm-preset-meta {
  color: var(--muted);
  font-size: 0.74rem;
}

.gm-preset-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.gm-preset-editor {
  margin-top: 10px;
  border-top: 1px dashed rgba(201, 162, 39, 0.35);
  padding-top: 10px;
}

.gm-preset-editor h3 {
  margin: 0 0 10px 0;
  font-family: 'Cinzel', serif;
  color: var(--accent);
  font-size: 0.92rem;
}

.gm-preset-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.gm-preset-editor-duration {
  max-width: 420px;
}

.gm-preset-editor-block {
  margin-top: 8px;
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15);
  padding: 8px;
}

.gm-preset-editor-block-title {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.gm-region-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 4px 8px;
}

.gm-region-check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 0.76rem;
}

.gm-modifier-template-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.gm-modifier-template-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 88px 72px minmax(120px, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.gm-modifier-template-row .gm-modifier-dynamic-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.gm-preset-editor-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gm-damage-panel {
  position: sticky;
  top: 8px;
  z-index: 20;
  background:
    radial-gradient(circle at right top, rgba(85, 128, 192, 0.18), transparent 45%),
    var(--bg-panel);
}

.gm-damage-layout {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(340px, 1.35fr);
  gap: 10px;
}

.gm-damage-panel.is-collapsed .gm-damage-layout {
  display: none;
}

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

.gm-damage-block {
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  padding: 8px;
}

.gm-damage-inline-options {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gm-damage-suggest-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 10px;
}

.gm-damage-bypass-toggle {
  font-size: 0.76rem;
}

.gm-damage-block-title {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.gm-damage-player-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.gm-damage-target-mode {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.gm-damage-target-mode-btn {
  border-radius: 999px;
  font-size: 0.74rem;
  padding: 5px 10px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
}

.gm-damage-target-mode-btn.is-active {
  color: var(--ink);
  border-color: rgba(111, 191, 137, 0.8);
  background: rgba(47, 99, 63, 0.3);
}

.gm-damage-target-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gm-damage-target-wrap[hidden] {
  display: none;
}

.gm-damage-player-btn {
  border-radius: 999px;
  font-size: 0.74rem;
  padding: 5px 9px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
}

.gm-damage-player-btn.is-selected {
  color: var(--ink);
  border-color: rgba(111, 191, 137, 0.8);
  background: rgba(47, 99, 63, 0.3);
}

.gm-damage-npc-meta {
  border: 1px solid rgba(201, 162, 39, 0.24);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
  padding: 7px 8px;
}

.gm-damage-region-picker {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(220px, 1fr);
  gap: 8px;
  align-items: start;
}

.gm-damage-dr-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(201, 162, 39, 0.28);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  width: 100%;
  box-sizing: border-box;
}

.dashboard-mini-dr-label {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.88;
}

.armor-dr-chart-wrap {
  position: relative;
  width: min(250px, 100%);
  margin: 0;
  aspect-ratio: 2 / 3;
  border: 1px solid rgba(201, 162, 39, 0.34);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(255, 245, 214, 0.22), rgba(36, 21, 13, 0.72));
  overflow: hidden;
}

.armor-dr-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.78;
  filter: contrast(0.97) saturate(0.86);
}

.armor-dr-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.armor-dr-hotspot {
  cursor: pointer;
  fill: rgba(44, 24, 16, 0.08);
  stroke: rgba(44, 24, 16, 0.28);
  stroke-width: 4;
  transition: fill 0.16s ease, stroke 0.16s ease, stroke-width 0.16s ease;
}

.armor-dr-hotspot.is-covered {
  fill: rgba(64, 156, 86, 0.52);
  stroke: rgba(38, 110, 62, 0.9);
}

.armor-dr-hotspot.is-uncovered {
  fill: rgba(44, 24, 16, 0.07);
  stroke: rgba(44, 24, 16, 0.24);
}

.armor-dr-hotspot.is-selected {
  fill: rgba(209, 160, 40, 0.58);
  stroke: rgba(243, 217, 122, 0.98);
  stroke-width: 6;
}

.armor-dr-hotspot:hover {
  stroke-width: 5;
}

.armor-dr-hotspot:focus {
  outline: none;
  stroke: #f4d878;
  stroke-width: 6;
}

.armor-hit-markers {
  pointer-events: none;
}

.armor-hit-hotspots {
  pointer-events: auto;
}

.armor-hit-hotspot {
  cursor: pointer;
  fill: rgba(44, 24, 16, 0.015);
  stroke: rgba(201, 162, 39, 0.2);
  stroke-width: 2;
  transition: fill 0.16s ease, stroke 0.16s ease, stroke-width 0.16s ease;
}

.armor-hit-hotspot:hover {
  fill: rgba(66, 145, 84, 0.24);
  stroke: rgba(111, 191, 137, 0.95);
}

.armor-hit-hotspot:focus {
  outline: none;
  fill: rgba(66, 145, 84, 0.26);
  stroke: #f4d878;
  stroke-width: 4;
}

.armor-hit-hotspot.is-region-match {
  fill: rgba(64, 156, 86, 0.2);
  stroke: rgba(64, 156, 86, 0.84);
}

.armor-hit-hotspot.is-selected {
  fill: rgba(209, 160, 40, 0.32);
  stroke: rgba(243, 217, 122, 0.98);
  stroke-width: 4;
}

.armor-hit-marker {
  fill: rgba(120, 53, 44, 0.16);
  stroke: rgba(185, 110, 90, 0.56);
  stroke-width: 2;
}

.armor-hit-marker-small {
  fill: rgba(120, 53, 44, 0.22);
}

.armor-hit-goggles {
  pointer-events: none;
}

.armor-hit-goggle-lens {
  fill: rgba(84, 167, 191, 0.2);
  stroke: rgba(160, 231, 255, 0.9);
  stroke-width: 3;
}

.armor-hit-goggle-bridge {
  fill: rgba(84, 167, 191, 0.16);
  stroke: rgba(160, 231, 255, 0.85);
  stroke-width: 2;
}

.armor-hit-label {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  letter-spacing: 0.02em;
  fill: rgba(252, 219, 184, 0.86);
  paint-order: stroke;
  stroke: rgba(15, 8, 5, 0.7);
  stroke-width: 5;
}

.armor-hit-label-small {
  font-size: 22px;
}

.dashboard-mini-dr-summary {
  font-family: 'Cinzel', serif;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
  width: 100%;
  min-height: 1.3em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gm-damage-hit-penalty-summary {
  width: 100%;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.86;
}

.gm-damage-hit-penalty-legend {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.gm-hit-penalty-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.66rem;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
}

.gm-hit-penalty-chip.is-active {
  border-color: rgba(111, 191, 137, 0.9);
  color: var(--ink);
  background: rgba(31, 78, 47, 0.36);
}

.gm-damage-region-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: none;
  overflow: visible;
}

.gm-damage-region-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  text-align: left;
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
  padding: 6px 8px;
}

.gm-damage-region-btn.is-selected {
  border-color: rgba(111, 191, 137, 0.88);
  background: rgba(31, 78, 47, 0.35);
}

.gm-damage-region-dr {
  color: var(--muted);
  font-size: 0.76rem;
}

.gm-damage-region-check {
  color: var(--ok);
  font-weight: bold;
  opacity: 0.88;
}

.gm-damage-calculation {
  min-height: 70px;
  border: 1px solid rgba(98, 151, 224, 0.45);
  border-radius: 6px;
  background: rgba(29, 63, 104, 0.2);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gm-damage-severity {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gm-damage-severity.is-serious {
  color: #f8cf75;
}

.gm-damage-severity.is-critical {
  color: #ff8c8c;
  animation: gm-critical-pulse 1.2s ease-in-out infinite;
}

@keyframes gm-critical-pulse {
  0% { opacity: 0.85; }
  50% { opacity: 1; }
  100% { opacity: 0.85; }
}

.gm-damage-preset-options {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gm-damage-wound-types {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: 6px;
}

.gm-damage-wound-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(201, 162, 39, 0.24);
  border-radius: 6px;
  padding: 5px 7px;
  background: rgba(0, 0, 0, 0.16);
  font-size: 0.74rem;
  color: var(--ink);
}

.gm-damage-effect-summary {
  margin-top: 8px;
  border: 1px dashed rgba(201, 162, 39, 0.28);
  border-radius: 6px;
  padding: 7px 8px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.gm-damage-effect-summary strong {
  color: var(--ink);
}

.gm-damage-preset-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  border: 1px solid rgba(201, 162, 39, 0.23);
  border-radius: 6px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.18);
}

.gm-damage-preset-option.is-disabled {
  opacity: 0.45;
}

.gm-damage-preset-title {
  font-family: 'Cinzel', serif;
  font-size: 0.76rem;
  color: var(--ink);
}

.gm-damage-preset-desc {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 2px;
}

.gm-damage-duration-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(120px, 1fr);
  gap: 8px;
}

.gm-damage-bleed-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(180px, 1fr);
  gap: 8px;
  align-items: end;
}

.gm-damage-destruction-check {
  font-size: 0.78rem;
  color: #f3aaa7;
}

.gm-damage-destruction-check[hidden] {
  display: none;
}

.gm-damage-modifiers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.gm-damage-modifier-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 88px 74px minmax(130px, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.gm-damage-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

#gmDamageApplyBtn {
  border-color: rgba(111, 191, 137, 0.8);
  color: #dbffe7;
}

/* Player Accounts Panel */
.gm-players-panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.gm-players-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gm-players-header h2 {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--accent);
}

.gm-toggle-btn {
  font-size: 0.8rem;
  padding: 4px 10px;
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.gm-toggle-btn:hover {
  background: rgba(201, 162, 39, 0.1);
}

.gm-players-content {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gm-add-player-form {
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.15);
}

.gm-add-player-form h3 {
  margin: 0 0 8px 0;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: var(--muted);
}

.gm-add-player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
}

.gm-add-player-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gm-add-player-grid label span {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
}

.gm-add-player-grid input,
.gm-add-player-grid select {
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  font-family: 'MedievalSharp', serif;
  font-size: 0.9rem;
  color: var(--ink);
}

.gm-add-player-grid label.gm-add-player-attendance {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  align-self: end;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gm-add-player-actions {
  display: flex;
  gap: 8px;
}

.gm-add-player-actions button {
  padding: 6px 12px;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.gm-add-player-actions button:hover {
  background: rgba(201, 162, 39, 0.15);
}

.gm-player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gm-player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--bg-card);
}

.gm-player-info {
  flex: 1;
  min-width: 150px;
}

.gm-player-name {
  font-family: 'Cinzel', serif;
  color: var(--ink);
  font-size: 0.95rem;
}

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

.gm-player-sheet {
  color: var(--muted);
  font-size: 0.8rem;
}

.gm-attendance-toggle {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.gm-attendance-toggle:hover {
  background: rgba(201, 162, 39, 0.12);
}

.gm-attendance-toggle.is-present {
  color: var(--ok);
  border-color: rgba(123, 198, 123, 0.65);
  background: rgba(25, 70, 25, 0.24);
}

.gm-attendance-toggle.is-absent {
  color: #d9b37d;
  border-color: rgba(201, 162, 39, 0.55);
}

.gm-player-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.gm-player-actions button {
  padding: 4px 8px;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.gm-player-actions button:hover {
  background: rgba(201, 162, 39, 0.1);
}

.gm-player-actions button.gm-remove-player {
  color: #c9462f;
  border-color: rgba(201, 70, 47, 0.3);
}

.gm-player-actions button.gm-remove-player:hover {
  background: rgba(201, 70, 47, 0.1);
}

.gm-sheet-settings-section {
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gm-sheet-settings-section h3 {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: var(--muted);
}

.gm-sheet-settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gm-sheet-layout-controls {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gm-sheet-layout-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.gm-sheet-layout-controls select {
  min-width: 90px;
}

.gm-sheet-settings-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--bg-card);
}

.gm-sheet-settings-info {
  min-width: 0;
}

.gm-sheet-settings-name {
  font-family: 'Cinzel', serif;
  color: var(--ink);
  font-size: 0.9rem;
}

.gm-sheet-settings-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

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

.gm-settings-show-hidden-btn {
  margin-top: 8px;
}

.gm-npc-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  align-items: end;
}

.gm-npc-create-grid {
  margin-top: 4px;
}

.gm-npc-hide-toggle {
  align-self: center;
  margin-top: 20px;
}

.gm-npc-form-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.gm-npc-template-toolbar {
  display: flex;
  justify-content: flex-end;
}

.gm-npc-template-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gm-npc-template-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: 6px;
  background: var(--bg-card);
  padding: 8px 10px;
}

.gm-npc-template-name {
  font-family: 'Cinzel', serif;
  color: var(--ink);
  font-size: 0.9rem;
}

.gm-npc-template-meta {
  color: var(--muted);
  font-size: 0.74rem;
  margin-top: 2px;
}

.gm-npc-template-actions-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.gm-npc-template-actions-row button {
  padding: 4px 8px;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.gm-npc-template-editor {
  margin-top: 8px;
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gm-npc-template-editor h4 {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: var(--muted);
}

.gm-npc-template-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.gm-npc-template-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.gm-npc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gm-npc-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: 6px;
  background: var(--bg-card);
  padding: 8px 10px;
}

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

.gm-npc-name {
  font-family: 'Cinzel', serif;
  color: var(--ink);
  font-size: 0.9rem;
}

.gm-npc-hp {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
}

.gm-npc-hp.is-bloodied {
  border-color: rgba(239, 83, 80, 0.7);
  color: #ffd6d6;
}

.gm-npc-hp.is-down {
  border-color: rgba(239, 83, 80, 0.88);
  background: rgba(101, 22, 22, 0.45);
  color: #ffe7e7;
}

.gm-npc-meta {
  color: var(--muted);
  font-size: 0.74rem;
  margin-top: 2px;
}

.gm-npc-notes {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 4px;
}

.gm-npc-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.gm-npc-actions button {
  padding: 4px 8px;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.gm-npc-direct-btn {
  border-color: rgba(79, 141, 218, 0.6);
  color: #d4e7ff;
}

.gm-npc-delete-btn {
  border-color: rgba(239, 83, 80, 0.55);
  color: #ffd6d6;
}

.gm-npc-delete-btn:hover:not(:disabled) {
  border-color: rgba(239, 83, 80, 0.9);
}

@keyframes gm-clock-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  body {
    padding: 10px;
  }

  .gm-damage-panel {
    top: 6px;
  }

  .gm-settings-tabs {
    gap: 5px;
  }

  .gm-settings-tab {
    width: 100%;
    text-align: center;
  }

  .gm-clock-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .gm-clock-buttons {
    width: 100%;
  }

  .gm-clock-time-tracking {
    width: 100%;
    min-width: 0;
  }

  .gm-clock-buttons .gm-time-all-btn {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
  }

  .gm-clock-buttons .gm-time-all-reverse-btn {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
  }

  .gm-clock-lead-display {
    grid-template-columns: 1fr auto;
  }

  .gm-clock-player-behind {
    grid-template-columns: 1fr auto;
  }

  .gm-clock-player-tags {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .gm-clock-note-row {
    flex-direction: column;
    align-items: stretch;
  }

  .gm-clock-history-head {
    grid-template-columns: auto 1fr auto;
  }

  .gm-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gm-effect-row,
  .gm-effect-add-row,
  .gm-modifier-template-row,
  .gm-damage-modifier-row {
    grid-template-columns: 1fr;
  }

  .gm-damage-layout {
    grid-template-columns: 1fr;
  }

  .gm-damage-region-picker {
    grid-template-columns: 1fr;
  }

  .gm-damage-region-list {
    max-height: 340px;
    overflow: auto;
  }

  .armor-dr-chart-wrap {
    width: min(300px, 100%);
  }

  .gm-damage-duration-row {
    grid-template-columns: 1fr;
  }

  .gm-message-compose {
    flex-direction: column;
    align-items: stretch;
  }

  .gm-control-row-inner {
    margin-left: 0;
  }

  .gm-control-details-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .gm-control-details-hint {
    text-align: left;
  }

  .gm-wound-toggle {
    flex-direction: column;
    align-items: flex-start;
  }

  .gm-wound-toggle-hint {
    white-space: normal;
  }

  .gm-sheet-settings-row {
    grid-template-columns: 1fr;
  }

  .gm-sheet-settings-actions {
    justify-content: flex-start;
  }

  .gm-npc-card {
    grid-template-columns: 1fr;
  }

  .gm-npc-actions {
    justify-content: flex-start;
  }

  .gm-npc-template-row {
    grid-template-columns: 1fr;
  }

  .gm-npc-template-actions-row,
  .gm-npc-template-actions {
    justify-content: flex-start;
  }

  .gm-sheet-list {
    grid-template-columns: 1fr !important;
  }
}
