:root {
  --r1-font-color: #000;
  --r1-background-color: #e9ff70;

  --r2-font-color: #000;
  --r2-background-color: #ffd670;

  --r3-font-color: #000;
  --r3-background-color: #ff9770;

  --r4-font-color: #000;
  --r4-background-color: #ff70a6;

  --r5-font-color: #000;
  --r5-background-color: #70d6ff;

  --not-member-font-color: #fff;
  --not-member-background-color: red;
}

.hidden {
  visibility: hidden !important;
  max-height: 0 !important;
}

body {
  min-height: 100vh;
}

.rotation-card {
  max-width: 640px;
  border: 1px solid #2b3b4d;
  border-radius: 12px;
  box-shadow: none;
}

.rotation-title {
  letter-spacing: 0.03em;
}

.rotation-row {
  min-height: 54px;
  border: 1px solid #1f2e3e;
  border-radius: 6px;
  color: #f5f7fa;
}

.rotation-index {
  width: 2rem;
  color: #9fc2e6;
  font-size: 0.9rem;
}

.rotation-actions {
  gap: 1.25rem;
}

.icon-button {
  background: transparent;
  border: 0;
  color: #f5f7fa;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.icon-button:hover {
  color: #ffb020;
}

.divider {
  border-top: 1px solid #2b3b4d;
}

.rotation-input {
  background: #101b28;
  border-color: #34465b;
  color: #e5eef8;
}

.rotation-input::placeholder {
  color: #9fbce0;
}

.rotation-input:focus {
  border-color: #ffb020;
  box-shadow: 0 0 0 0.125em rgba(255, 176, 32, 0.2);
}

.rotation-player-select {
  min-width: 300px;
}

.is-r1-tag {
  color: var(--r1-font-color);
  background-color: var(--r1-background-color);
}

.is-r2-tag {
  color: var(--r2-font-color);
  background-color: var(--r2-background-color);
}

.is-r3-tag {
  color: var(--r3-font-color);
  background-color: var(--r3-background-color);
}

.is-r4-tag {
  color: var(--r4-font-color);
  background-color: var(--r4-background-color);
}

.is-r5-tag {
  color: var(--r5-font-color);
  background-color: var(--r5-background-color);
}

.is-not-member-tag {
  color: var(--not-member-font-color);
  background-color: var(--not-member-background-color);
  font-weight: bold;
}

.rotation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.rotation-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
}


.dashboard-stat-card {
  min-height: 130px;
}

.dashboard-stat-card .heading {
  letter-spacing: 0.06em;
}

.rank-progress-track {
  height: 0.65rem;
  overflow: hidden;
  border-radius: 999px;
  background: #1f2e3e;
}

.rank-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: #70d6ff;
}

.rotation-preview-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #2b3b4d;
}

.rotation-preview-row:last-child {
  border-bottom: 0;
}

.movement-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #2b3b4d;
}

.movement-row:last-child {
  border-bottom: 0;
}


.player-search-results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.player-search-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  color: inherit;
  border: 1px solid #2b3b4d;
  box-shadow: none;
}

.player-search-card:hover {
  border-color: #70d6ff;
}

.player-search-card-main {
  min-width: 0;
  flex: 1;
}

.player-search-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.player-search-card-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f5f7fa;
}

.player-search-card-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  color: #b8c7d9;
}

.player-search-card-action {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .player-search-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .player-search-card-action {
    width: 100%;
  }

  .player-search-card-action .tag {
    width: 100%;
    justify-content: center;
  }
}


.comment-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.comment-image img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 0.5rem;
}

.comment-image-preview-wrapper {
  margin-top: 1rem;
}

.comment-image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.comment-image-preview-item {
  border: 1px solid var(--bulma-border, #dbdbdb);
  border-radius: 0.5rem;
  padding: 0.5rem;
}

.comment-image-preview-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 0.375rem;
}

.comment-image-preview-item .help {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-image-preview-item .button {
  margin-bottom: 0.25rem;
}


.comment-image-lightbox-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.comment-image-lightbox-trigger:focus-visible {
  outline: 3px solid #70d6ff;
  outline-offset: 3px;
  border-radius: 0.5rem;
}

.comment-image-lightbox-content {
  width: min(96vw, 1200px);
  max-height: 90vh;
}

.comment-image-lightbox-content img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 0.5rem;
}

.audit-page {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.audit-header,
.audit-filter {
  box-shadow: none;
}

.audit-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.audit-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--bulma-border);
  border-left-width: 0.25rem;
  border-radius: var(--bulma-radius-large);
  background: var(--bulma-scheme-main);
  color: var(--bulma-text);
}

.audit-card-created {
  border-left-color: var(--bulma-success);
}

.audit-card-updated {
  border-left-color: var(--bulma-info);
}

.audit-card-deleted {
  border-left-color: var(--bulma-danger);
}

.audit-card-main {
  min-width: 0;
}

.audit-card-topline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}

.audit-card-time,
.audit-card-actor {
  color: var(--bulma-text-weak);
  font-size: 0.78rem;
}

.audit-card-content {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}

.audit-card-object {
  flex: 0 0 auto;
  color: var(--bulma-text-strong);
  font-size: 0.92rem;
}

.audit-card-summary {
  min-width: 0;
  overflow: hidden;
  color: var(--bulma-text);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-card-actions {
  display: flex;
  justify-content: flex-end;
}

.audit-modal-card {
  width: min(900px, 96vw);
  max-height: 92vh;
}

.audit-modal-head {
  background: var(--bulma-scheme-main);
  border-bottom: 1px solid var(--bulma-border);
}

.audit-modal-title {
  color: var(--bulma-text-strong);
  font-weight: 700;
}

.audit-modal-subtitle {
  margin-top: 0.2rem;
  color: var(--bulma-text-weak);
  font-size: 0.85rem;
}

.audit-modal-body {
  background: var(--bulma-scheme-main);
  color: var(--bulma-text);
}

.audit-modal-foot {
  background: var(--bulma-scheme-main);
  border-top: 1px solid var(--bulma-border);
}

.audit-message {
  margin-bottom: 1rem;
}

.audit-change-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.audit-change-card {
  overflow: hidden;
  border: 1px solid var(--bulma-border);
  border-radius: var(--bulma-radius-large);
  background: var(--bulma-scheme-main-bis);
}

.audit-change-field {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--bulma-border);
  background: var(--bulma-scheme-main-ter);
  color: var(--bulma-text-strong);
  font-size: 0.9rem;
  font-weight: 700;
}

.audit-change-values {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.6rem;
  align-items: stretch;
  padding: 0.65rem;
}

.audit-change-value {
  min-width: 0;
  padding: 0.65rem;
  border-radius: var(--bulma-radius);
  overflow-wrap: anywhere;
}

.audit-change-old {
  border: 1px solid color-mix(in srgb, var(--bulma-danger) 45%, transparent);
  background: color-mix(in srgb, var(--bulma-danger) 12%, var(--bulma-scheme-main));
  color: var(--bulma-text);
}

.audit-change-new {
  border: 1px solid color-mix(in srgb, var(--bulma-success) 45%, transparent);
  background: color-mix(in srgb, var(--bulma-success) 12%, var(--bulma-scheme-main));
  color: var(--bulma-text);
}

.audit-change-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--bulma-text-weak);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.audit-change-value pre {
  max-height: 16rem;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--bulma-text);
  background: transparent;
  font-size: 0.78rem;
}

.audit-change-arrow {
  display: grid;
  place-items: center;
  color: var(--bulma-text-weak);
}

@media screen and (max-width: 768px) {
  .audit-card {
    grid-template-columns: 1fr;
  }

  .audit-card-actions {
    justify-content: stretch;
  }

  .audit-card-actions .button {
    width: 100%;
  }

  .audit-card-content {
    display: block;
  }

  .audit-card-summary {
    display: block;
    margin-top: 0.15rem;
  }

  .audit-change-values {
    grid-template-columns: 1fr;
  }

  .audit-change-arrow {
    transform: rotate(90deg);
  }
}

.player-overview-table {
  table-layout: auto;
}

.player-overview-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.player-overview-rank {
  flex: 0 0 auto;
}

.player-overview-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.player-overview-actions {
  white-space: nowrap;
}

.player-overview-action + .player-overview-action {
  margin-left: 0.35rem;
}

@media (max-width: 768px) {
  .tabs {
    overflow-x: auto;
    overflow-y: hidden;
  }

  .tabs ul {
    flex-wrap: nowrap;
    min-width: max-content;
  }

  .player-overview-table {
    border-collapse: separate;
    border-spacing: 0 0.75rem;
    background: transparent;
  }

  .player-overview-table thead {
    display: none;
  }

  .player-overview-table tbody,
  .player-overview-table tr,
  .player-overview-table td {
    display: block;
  }

  .player-overview-table tr {
    overflow: hidden;
    border: 1px solid var(--bulma-border);
    border-radius: var(--bulma-radius-large);
    background: var(--bulma-scheme-main);
  }

  .player-overview-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.8rem;
    border: 0;
    border-bottom: 1px solid var(--bulma-border);
  }

  .player-overview-table td:last-child {
    border-bottom: 0;
  }

  .player-overview-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--bulma-text-weak);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .player-overview-table .player-overview-name-cell {
    display: block;
    padding: 0.85rem 0.8rem;
    background: var(--bulma-scheme-main-bis);
  }

  .player-overview-table .player-overview-name-cell::before {
    display: none;
  }

  .player-overview-player {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .player-overview-name {
    font-size: 1.05rem;
  }

  .player-overview-actions {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    gap: 0.5rem;
    white-space: normal;
  }

  .player-overview-actions::before {
    display: none;
  }

  .player-overview-action {
    flex: 1 1 0;
  }

  .player-overview-action .tag {
    width: 100%;
    justify-content: center;
  }
}
