.timeline_game_skin {
  --timeline-game-card-width: 200px;
  --timeline-game-card-min-height: 260px;
  --timeline-game-card-padding: 6px;
  --timeline-game-main-blue: #418fde;
  min-height: 640px;
  padding: 20px 0 20px 0;
  border-top: 1px solid #e4e9f0;
  border-bottom: 1px solid #e4e9f0;
  border-radius: 0px;
  background: #f7f9fc;
  color: #172033;
  box-sizing: border-box;
}

.timeline_game_header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 0 20px;
}

.timeline_game_status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.timeline_game_tag_picker { position: relative; }
.timeline_game_tag_button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 13px;
  border: 0; border-radius: 999px; background: #fff; color: #27364a;
  box-shadow: 0 1px 8px rgba(28, 43, 64, .08); font-size: 13px; font-weight: 800; cursor: pointer;
}
.timeline_game_tag_button > .fa-tag { color: var(--timeline-game-main-blue); }
.timeline_game_tag_button:hover, .timeline_game_tag_button:focus-visible,
.timeline_game_tag_button[aria-expanded="true"] { background: #edf5ff; outline: none; }
.timeline_game_tag_chevron { color: #8491a3; font-size: 10px; transition: transform .18s ease; }
.timeline_game_tag_button[aria-expanded="true"] .timeline_game_tag_chevron { transform: rotate(180deg); }
.timeline_game_tag_menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; display: flex; flex-direction: column;
  gap: 4px; width: max-content; min-width: 180px; max-width: min(280px, calc(100vw - 40px)); max-height: 280px;
  padding: 8px; overflow-y: auto; border: 1px solid #dce4ed; border-radius: 14px; background: #fff;
  box-shadow: 0 12px 30px rgba(28, 43, 64, .16);
}
.timeline_game_tag_menu[hidden] { display: none; }
.timeline_game_tag_option {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; padding: 7px 10px;
  border: 0; border-radius: 9px; background: transparent; color: #344156; font-size: 13px; font-weight: 700;
  text-align: left; cursor: pointer;
}
.timeline_game_tag_option:hover, .timeline_game_tag_option:focus-visible,
.timeline_game_tag_option.is_selected { background: #edf5ff; color: #195d9f; outline: none; }
.timeline_game_tag_option[hidden] { display: none; }
.timeline_game_tag_color { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; }
.timeline_game_tag_selected_color { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; }
.timeline_game_tag_selected_color[hidden] { display: none; }
.timeline_game_tag_count {
  display: inline-block;
  align-self: center;
  margin: 0 0 0 -4px;
  padding: 0;
  background: transparent;
  color: #94a2b6;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}
.timeline_game_tag_option.is_selected .timeline_game_tag_count { color: #195d9f; }

.timeline_game_score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 8px rgba(28, 43, 64, 0.08);
  font-size: 14px;
  font-weight: 800;
}

.timeline_game_score strong {
  color: #418fde;
  font-size: 18px;
}

.timeline_game_hearts {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 8px rgba(28, 43, 64, 0.08);
}

.timeline_game_history_button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #418fde;
  box-shadow: 0 1px 8px rgba(28, 43, 64, 0.08);
  cursor: pointer;
}

.timeline_game_history_button:hover,
.timeline_game_history_button:focus-visible {
  background: #edf5ff;
  outline: none;
}

.timeline_game_heart {
  color: #f04f69;
  font-size: 15px;
  line-height: 1;
}

.timeline_game_heart.is_lost {
  color: #ccd4df;
}

.timeline_game_restart,
.timeline_game_modal_restart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: #418fde;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.timeline_game_restart {
  padding: 0 14px;
}

.timeline_game_restart:hover,
.timeline_game_modal_restart:hover {
  background: #195d9f;
}

.timeline_game_play_area {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: stretch;
}

.timeline_game_draw_area,
.timeline_game_board_area {
  min-width: 0;
}

.timeline_game_draw_area {
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
}

.timeline_game_draw_inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 28px;
}

.timeline_game_current_wrap {
  flex: 0 0 auto;
}

.timeline_game_instruction {
  position: absolute;
  left: calc(50% + ((var(--timeline-game-card-width) + 28px) / 2) + 30px);
  top: 50%;
  transform: translateY(-50%);
  min-width: 190px;
  color: #8a9ab0;
}

.timeline_game_instruction h3 {
  margin: 0 0 8px;
  color: #6f839d;
  font-size: 18px;
  font-weight: 900;
}

.timeline_game_instruction p {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.timeline_game_board_area {
  padding: 8px 0 10px;
  overflow: hidden;
}

.timeline_game_area_label {
  margin: 0 0 12px;
  color: #66758a;
  font-size: 13px;
  font-weight: 900;
}

.timeline_game_current_wrap {
  position: relative;
  width: min(calc(var(--timeline-game-card-width) + 28px), 100%);
  min-height: calc(var(--timeline-game-card-min-height) + 28px);
}

.timeline_game_progress {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--timeline-game-main-blue);
  box-shadow: none;
  font-size: 18px;
  font-weight: 900;
  box-sizing: border-box;
  pointer-events: none;
}

.timeline_game_complete_message {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.timeline_game_complete_message .timeline_game_progress {
  position: static;
  inset: auto;
}

.timeline_game_feedback {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--timeline-game-main-blue);
  font-weight: 900;
  text-align: center;
  animation: timeline-game-feedback-pop 0.28s ease-out;
}

.timeline_game_feedback strong {
  font-size: 28px;
  line-height: 1;
}

.timeline_game_feedback span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  line-height: 1;
}

.timeline_game_feedback small {
  margin-top: 4px;
  color: #8a9ab0;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.timeline_game_feedback_bonus {
  color: #418fde;
  color: #418fde;
  font-size: 18px !important;
}

.timeline_game_feedback.is_bad {
  color: #f04f69;
}

@keyframes timeline-game-feedback-pop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.94);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.timeline_game_current_slot {
  position: relative;
  width: 100%;
  height: calc(var(--timeline-game-card-min-height) + 28px);
  min-height: calc(var(--timeline-game-card-min-height) + 28px);
  display: grid;
  place-items: center;
  padding: 10px;
  border: 2px dashed #b9c8da;
  border-radius: 10px;
  background: #f9fbfe;
  box-sizing: border-box;
}

.timeline_game_current_slot::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 8px;
  background: rgba(65, 143, 222, 0.04);
  pointer-events: none;
  z-index: 0;
}

.timeline_game_card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: var(--timeline-game-card-width);
  height: var(--timeline-game-card-min-height);
  min-height: var(--timeline-game-card-min-height);
  flex: 0 0 var(--timeline-game-card-width);
  border: 1px solid #dde5ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(26, 40, 62, 0.08);
  overflow: hidden;
  padding: var(--timeline-game-card-padding);
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.timeline_game_board_card {
  cursor: grab;
}

.timeline_game_card.is_current {
  width: 100%;
  min-height: var(--timeline-game-card-min-height);
  cursor: grab;
  touch-action: none;
}

.timeline_game_card:focus-visible {
  outline: 3px solid rgba(65, 143, 222, 0.28);
  outline-offset: 3px;
}

.timeline_game_card.is_dragging {
  position: fixed;
  z-index: 2400;
  width: min(320px, calc(100vw - 32px));
  pointer-events: none;
  opacity: 0.94;
  transform: translate(-50%, -50%) rotate(-1deg);
}

.timeline_game_card.is_wrong {
  animation: timeline-game-card-shake 0.38s ease-in-out;
}

@keyframes timeline-game-card-shake {
  0%,
  100% {
    transform: translateX(0);
  }

  18% {
    transform: translateX(-8px) rotate(-1deg);
  }

  36% {
    transform: translateX(8px) rotate(1deg);
  }

  54% {
    transform: translateX(-6px) rotate(-0.8deg);
  }

  72% {
    transform: translateX(6px) rotate(0.8deg);
  }
}

.timeline_game_card_media {
  height: calc(var(--timeline-game-card-width) - (var(--timeline-game-card-padding) * 2));
  background: #eef2f7;
  border-radius: 6px;
  overflow: hidden;
}

.timeline_game_card_media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

.timeline_game_card_body {
  flex: 1 1 auto;
  padding: 10px 8px 8px;
}

.timeline_game_card_date {
  margin: 0 0 5px;
  color: var(--timeline-game-main-blue);
  font-size: 12px;
  font-weight: 900;
}

.timeline_game_card_title {
  margin: 0;
  color: #172033;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.timeline_game_card_desc {
  margin: 7px 0 0;
  color: #5f6f83;
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline_game_card_tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.timeline_game_card_tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-height: 18px;
  padding: 0 8px 0 6px;
  border-radius: 999px;
  background: #f2f5f9;
  color: #66758a;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.timeline_game_card_tag_color {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
}

.timeline_game_board {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 250px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 18px 18px;
  scroll-padding-inline: 24px;
  cursor: grab;
  user-select: none;
  -webkit-overflow-scrolling: touch;
}

.timeline_game_board.is_panning {
  cursor: grabbing;
}

.timeline_game_board.is_panning .timeline_game_board_card {
  cursor: grabbing;
}

.timeline_game_board.is_overflowing {
  justify-content: flex-start;
}

.timeline_game_drop_zone {
  align-self: stretch;
  width: 6px;
  min-width: 6px;
  margin: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: transparent;
  cursor: default;
  padding: 0;
  transition: width 0.18s ease, min-width 0.18s ease, background-color 0.18s ease;
}

.timeline_game_drop_zone.is_over {
  width: 96px;
  min-width: 96px;
  background: repeating-linear-gradient(
    135deg,
    rgba(31, 140, 114, 0.13),
    rgba(31, 140, 114, 0.13) 8px,
    rgba(31, 140, 114, 0.23) 8px,
    rgba(31, 140, 114, 0.23) 16px
  );
}

.timeline_game_board_card {
  height: auto;
  min-height: var(--timeline-game-card-min-height);
}

.timeline_game_empty {
  margin: 18px 0 0;
  padding: 18px;
  border-radius: 8px;
  background: #ffffff;
  color: #69788c;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.timeline_game_complete_message .timeline_game_empty {
  margin: 0;
}

.timeline_game_empty[hidden],
.timeline_game_modal[hidden] {
  display: none !important;
}

.timeline_game_modal {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: grid;
  place-items: center;
  padding: 20px;
}

.timeline_game_modal_backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 21, 32, 0.58);
}

.timeline_game_modal_dialog {
  position: relative;
  width: min(360px, 100%);
  border-radius: 8px;
  background: #ffffff;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(7, 12, 20, 0.26);
  text-align: center;
}

.timeline_game_modal_close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f0f3f7;
  color: #536275;
  cursor: pointer;
}

.timeline_game_modal_kicker {
  margin: 0 0 5px;
  color: #f04f69;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.timeline_game_modal_title {
  margin: 0;
  color: #172033;
  font-size: 24px;
  font-weight: 800;
}

.timeline_game_modal_score {
  margin: 12px 0 20px;
  color: #172033;
  font-size: 20px;
  font-weight: 600;
}

.timeline_game_modal_score strong {
  color: #418fde;
  font-size: 30px;
}

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

.timeline_game_modal_restart,
.timeline_game_modal_rank {
  width: 100%;
  padding: 0 14px;
}

.timeline_game_modal_rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid #dce6f2;
  border-radius: 999px;
  background: #ffffff;
  color: #418fde;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.timeline_game_modal_rank:hover,
.timeline_game_modal_rank:focus-visible {
  background: #edf5ff;
  outline: none;
}

.timeline_game_modal_rank i {
  line-height: 1;
}

.timeline_game_modal_rank i {
  font-size: 14px;
}

.timeline_game_history_dialog {
  width: min(620px, 100%);
  text-align: left;
}

.timeline_game_history_dialog .timeline_game_modal_title,
.timeline_game_history_dialog .timeline_game_modal_kicker {
  text-align: center;
}

.timeline_game_history_list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.timeline_game_history_item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid #e4e9f0;
  border-radius: 8px;
  background: #ffffff;
  color: #26374a;
  font-size: 14px;
  box-shadow: 0 1px 8px rgba(28, 43, 64, 0.06);
  box-sizing: border-box;
}

.timeline_game_history_result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  min-height: 32px;
  padding: 0 0px;
  border-radius: 999px;
  background: #f0f3f7;
  color: #536275;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.timeline_game_history_result.is_clear {
  background: #edf5ff;
  color: #418fde;
}

.timeline_game_history_result.is_over {
  background: #fff0f3;
  color: #f04f69;
}

.timeline_game_history_player {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.timeline_game_history_player strong {
  display: block;
  color: #172033;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
}

.timeline_game_history_score_group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.timeline_game_history_tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid #ccd7e4;
  border-radius: 999px;
  color: #536275;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.timeline_game_history_tag > i { color: #8290a2; font-size: 10px; }
.timeline_game_history_tag_color { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; }

.timeline_game_history_date {
  color: #66758a;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.timeline_game_history_empty {
  margin: 18px 0 0;
  padding: 18px 10px;
  border-radius: 8px;
  background: #f6f9fd;
  color: #66758a;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.timeline_game_history_pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.timeline_game_history_pagination button {
  width: 30px;
  height: 30px;
  border: 1px solid #dce6f2;
  border-radius: 50%;
  background: #ffffff;
  color: #66758a;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.timeline_game_history_pagination button.is_active {
  border-color: #418fde;
  background: #418fde;
  color: #ffffff;
}

@media (max-width: 860px) {
  .timeline_game_skin {
    padding: 16px 0;
  }
}

@media (max-width: 560px) {
  .timeline_game_skin {
    --timeline-game-card-width: 140px;
    --timeline-game-card-min-height: 182px;
    --timeline-game-card-padding: 4px;
  }

  .timeline_game_play_area {
    gap: 18px;
  }

  .timeline_game_draw_inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column-reverse;
    gap: 12px;
  }

  .timeline_game_current_wrap {
    flex: 0 0 auto;
  }

  .timeline_game_instruction {
    position: static;
    transform: none;
    min-width: 0;
    text-align: center;
  }

  .timeline_game_instruction h3 {
    margin-bottom: 4px;
    font-size: 15px;
  }

  .timeline_game_instruction p {
    font-size: 12px;
    line-height: 1.45;
  }

  .timeline_game_current_wrap {
    width: min(calc(var(--timeline-game-card-width) + 20px), 100%);
    min-height: calc(var(--timeline-game-card-min-height) + 20px);
  }

  .timeline_game_current_slot {
    height: calc(var(--timeline-game-card-min-height) + 20px);
    min-height: calc(var(--timeline-game-card-min-height) + 20px);
    padding: 8px;
  }

  .timeline_game_current_slot::before {
    inset: 8px;
  }

  .timeline_game_board {
    align-items: center;
    min-height: calc(var(--timeline-game-card-min-height) + 36px);
    padding-top: 8px;
    padding-bottom: 12px;
  }

  .timeline_game_drop_zone {
    align-self: center;
    height: var(--timeline-game-card-min-height);
  }

  .timeline_game_header {
    align-items: start;
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
    padding: 0 30px;
  }

  .timeline_game_status {
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: center;
    justify-content: start;
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
  }

  .timeline_game_hearts {
    grid-column: 1;
    grid-row: 1;
  }

  .timeline_game_score {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
  }

  .timeline_game_history_button {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .timeline_game_tag_picker {
    grid-column: 1 / 4;
    grid-row: 2;
    justify-self: start;
  }

  .timeline_game_restart {
    align-self: start;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    flex: 0 0 36px;
    padding: 0;
    border-radius: 50%;
    gap: 0;
  }

  .timeline_game_restart span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .timeline_game_drop_zone.is_over {
    width: 70px;
    min-width: 70px;
  }

  .timeline_game_history_dialog {
    padding: 24px 16px 18px;
  }

  .timeline_game_history_item {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 62px;
    padding: 9px 10px;
  }

  .timeline_game_history_result {
    justify-self: start;
  }

  .timeline_game_history_player {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .timeline_game_history_date {
    font-size: 12px;
  }
}
