@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

:root {
  --textcolor: #353849;
  --drupal-navy: #12285F;
  --drupal-blue: #009CDE;
  --drupal-purple: #CCBAF4;
  --drupal-light-blue: #CCEDF9;
  --drupal-blue-medium: #7AC3E0;
  --drupal-yellow: #FFC423;
  --drupal-white: #FFFFFF;
  --drupal-rec: #F46351;
  --drupal-rec-dark: #8a2d23;
  --drupal-green: #4E9B20;
  --drupal-green-dark: #275210;
  font-size: 100%;
}

* {
  -webkit-user-select: none; 
  -moz-user-select: none; 
  -ms-user-select: none;    
  user-select: none; 
}

body {
  background-color: var(--drupal-light-blue);
  color: white;
  font-family: "Noto Sans", sans-serif;
  text-align: center;
  margin: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.timeline-game__container {
  position: relative;
  padding: 1.25rem;
  min-height: 100vh;
  flex: 1;
}

.timeline-game__container h1 {
  margin-block: 5.5rem 3.2rem;
  font-weight: 700;
  letter-spacing: 0.125rem;
  font-size: 2.1rem;
  color: var(--drupal-navy);
  text-transform: uppercase;
}

@media (min-width:40rem) {
  .timeline-game__container h1 {
    font-size: 2.5rem; 
    margin-top: 1.25rem; 
  }
}

#timeline-wrapper {
  position: relative;
  min-height: 11.25rem; 
  margin-bottom: 2.5rem;
  margin-right: 1.8rem;
}

#timeline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 1.25rem;
  padding: 0.625rem 2rem;
  margin-top: 3rem;
}

#timeline-line {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  right: 0.75rem;
  height: 1rem;
  background-color: var(--drupal-blue-medium); 
  border-radius: 0.5rem;
  z-index: 0;
}

#timeline-line::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -1.25rem;
  transform: translateY(-50%);
  width: 4rem;
  height: 4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M5 5 L5 25 L25 15 Z' fill='%237AC3E0' stroke='%237AC3E0' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 1;
}

.card {
  background: var(--drupal-white);
  color: black;
  padding: 0.9375rem 0.625rem;
  width: 6.875rem;
  height: 9.375rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: default;
  user-select: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: transform 0.8s ease, opacity 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  border-radius: 0.5rem;
  box-shadow: var(--drupal-navy) 0.625rem 0.625rem 0 -0.1875rem, var(--drupal-navy) 0.625rem 0.625rem;
  border: 0.1875rem solid var(--drupal-navy);
  word-break: break-word;
}

.card strong {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.card div {
  font-size: 0.875rem;
  color: var(--drupal-navy);
}

.card.correct {
  box-shadow: var(--drupal-green-dark) 0.625rem 0.625rem 0 -0.1875rem, var(--drupal-green-dark) 0.625rem 0.625rem;
  border: 0.1875rem solid var(--drupal-green-dark);
  background-color: white;
  color: black;
}

.card.wrong {
  box-shadow: var(--drupal-rec-dark) 0.625rem 0.625rem 0 -0.1875rem, var(--drupal-rec-dark) 0.625rem 0.625rem;
  border: 0.1875rem solid var(--drupal-rec-dark);
  background-color: white;
  color: black;
}

.card-status-icon svg {
  width: 30px;
  height: 30px;
}

.ghost-card {
  border: 0.1875rem dashed #999;
  background-color: #f0f0f0;
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ghost-card .plus-symbol {
  font-size: 2rem;
  font-weight: bold;
  color: var(--drupal-navy);
  pointer-events: none;
  user-select: none;
}

.active-card__container {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  justify-content: center;
  height: 12.5rem;
}

#active-card .card {
  opacity: 0;
  width: 6.875rem;
  height: 9.375rem;
  cursor: grab;
  background-color: white;
  color: var(--drupal-navy);
  font-size: 1.125rem; 
  border: 0.1875rem solid var(--drupal-navy);
  position: relative;
  z-index: inherit;
  box-shadow: none;
}

.top-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;
  justify-content: center;
  width: fit-content; 
  margin: auto;
  margin-bottom: 2rem;
}

@media (min-width:30rem) {
  .top-container {
    flex-wrap: nowrap;
  }
}

#lives {
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  background-color: rgba(255, 255, 255, 0.5);
  border: 0.1875rem solid var(--drupal-blue-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  margin-inline: auto;
}

.lives-text {
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--drupal-navy);
  text-transform: uppercase;
}

.lives-label {
  height: 1.75rem;
}

.timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  max-width: 640px;
  margin: 1.25rem auto;
}

#timer-container {
  height: 0.6rem;
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  padding: 0.3rem;
  border: 3px solid var(--drupal-green-dark);
  background-color: rgba(39, 82, 16, 0.1);
  transition: border-color 0.2s, background-color 0.2s;
}

#timer-bar {
  height: 100%;
  width: 100%;
  border-radius: 0.7rem;
  transition: width 0.1s, background-color 0.2s;
}

#reset-btn {
  background-color: rgba(255, 255, 255, 0.5);
  color: var(--drupal-navy);
  padding: 0.3rem 1rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.25s ease;
  border: 0.1875rem solid var(--drupal-blue-medium);
  position: absolute;
  cursor: pointer;
  left: 1.125rem;
  top: 1.125rem;
}

@media (min-width:40rem) {
  #reset-btn{
    left: 1.5rem;
    padding: 0.5rem 1.5rem;
    top: 1.5rem;
  }
}

#view-rules-btn, #view-history-start-btn {
  background-color: white;
  color: var(--drupal-navy);
  padding: 0.75rem 1.875rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.25s ease;
  border: 0.125rem solid var(--drupal-navy);
  cursor: pointer;
}

.history-start-btn {
  background-color:white;
  color: var(--drupal-navy);
  padding: 0.75rem 1.875rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.25s ease;
  border: 0.125rem solid var(--drupal-navy);
  cursor: pointer;
}

#reset-btn:hover, 
#view-rules-btn:hover, 
.history-start-btn:hover, 
#view-history-start-btn:hover {
  background-color: var(--drupal-navy);
  color: white;
}

.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal-content {
  background-color: white;
  padding: 2rem 4rem;
  border-radius: 0.5rem;
  text-align: center;
  color: var(--drupal-navy);
  margin-inline: 2rem;
  box-shadow: var(--drupal-blue) 0.625rem 0.625rem 0 -0.1875rem, var(--drupal-blue) 0.625rem 0.625rem;
  border: 0.1875rem solid var(--drupal-navy);
  width: 100%;
  max-width: 50rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.modal-form {
  width: 100%;
  max-width: 24rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-form input {
  width: 100%;
}

.modal-content button {
  padding: 0.75rem 1.875rem;
  border: 0.125rem solid var(--drupal-blue);
  background-color: var(--drupal-blue);
  color: white;
  font-weight: 700;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.25s ease;
}

.modal-content button:hover {
  background-color: white;
  color: var(--drupal-blue);
}

.close-btn {
  position: absolute;
  top: 0.75rem;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px!important;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  transition: color 0.2s ease;
}

#close-history-bottom-btn {
  background-color: white;
  color: var(--drupal-navy);
  padding: 0.75rem 1.875rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  border: 0.125rem solid var(--drupal-navy);
  cursor: pointer;
  transition: all 0.25s ease;
}

#close-history-bottom-btn:hover {
  background-color: var(--drupal-navy);
  color: white;
}

.lost-lives svg {
  fill: grey;
  opacity: 0.5;
}

.drop-indicator {
  height: 4px;
  background: #009cde;
  margin: 5px 0;
  border-radius: 2px;
  transition: all 0.2s ease;
}

#score-container {
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  background-color: rgba(255, 255, 255, 0.5);
  border: 0.1875rem solid var(--drupal-blue-medium);
  margin-inline: auto;
  width: fit-content;
  text-align: left;
}

#score-container div {
  color: var(--drupal-navy);
  font-size: 1rem;
}

#score-container span {
  font-weight: bold;
}

#high-score {
  font-weight: bold;
  color: var(--drupal-navy)
}

.card-description-container {
  text-align: center;
  border: 3px solid var(--drupal-blue-medium);
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.5);
  width: 600px;         
  max-width: 90%; 
  margin: 50px auto;
  box-shadow: var(--drupal-blue-medium) 10px 10px 0px -3px, var(--drupal-blue-medium) 10px 10px;
}

.card-description-container p {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--drupal-navy);
  max-width: 100%;
  margin: 0 auto;
  line-height: 1.4;
  padding: 1rem;
}

.card.animate-fly {
  z-index: 50;
  transition: transform 0.3s ease-in-out;
  pointer-events: none;
}

.card.shift-right {
  transform: translateX(7.5rem);
  transition: transform 0.3s ease;
}

.player-input-wrapper {
  display: flex;
  flex-direction: column;
  align-items: baseline;
  gap: 0.5rem;
  text-align: left;
}

.player-input-wrapper input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 0.125rem solid var(--drupal-navy);
  border-radius: 0.5rem;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 0.25rem 0.375rem rgba(0,0,0,0.1);
  display: block;
}

.player-input-wrapper label {
  text-align: center;
}

.player-input-wrapper input:focus {
  border-color: var(--drupal-blue);
  box-shadow: 0 0 0.625rem var(--drupal-blue);
}

.newsletter-checkbox {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.newsletter-checkbox label {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  margin-top: 8px;
}

.newsletter-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--drupal-blue);
}

#start-game-btn {
  padding: 0.75rem 1.875rem;
  border: 0.125rem solid var(--drupal-blue);
  background-color: var(--drupal-blue);
  color: white;
  font-weight: 700;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.25s ease, transform 0.2s ease;
}

#start-game-btn:hover {
  background-color: var(--drupal-navy);
  transform: scale(1.05);
}

#start-rules-container ul {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-width: 30rem;
}

#start-game-btn:not(:disabled):hover {
  background-color: white;
  color: var(--drupal-blue);

}

#start-game-btn:disabled {
  background-color: #cccccc;
  border: 0.125rem solid #cccccc;
  color: #666666;
  cursor: not-allowed;
  opacity: 0.7;
}

@keyframes correctPlacement {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.card.correct.just-placed, 
.card.wrong.just-placed  {
  animation: correctPlacement 0.5s ease;
}

footer.footer {
  background-color: var(--drupal-navy);
  color: white;
  text-align: center;
  padding: 1rem;
  font-size: 1rem;
}

.footer a {
  color: var(--drupal-light-blue);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  transition: all 0.2s ease-out;
}

/* History button styling */
.history-btn {
  background-color: white;
  color: var(--drupal-navy);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 0.25s ease;
  border: 0.125rem solid var(--drupal-navy);
  cursor: pointer;
  margin-top: 0.5rem;
}

.history-btn:hover {
  background-color: var(--drupal-navy);
  color: white;
}

/* History table styling */
.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.history-table thead {
  background-color: var(--drupal-navy);
  color: white;
}

.history-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 700;
}

.history-table td {
  border-bottom: 1px solid #ddd;
  color: var(--drupal-navy);
  text-align: left;
  padding: 0.75rem;
}

.history-table tbody tr:hover {
  background-color: var(--drupal-light-blue);
}

/* Badge styling */
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.5rem;
}

.badge-today {
  background-color: var(--drupal-blue);
  color: white;
}

.badge-alltime {
  background-color: var(--drupal-yellow);
  color: var(--drupal-navy);
}

#history-list {
  max-height: 31.25rem;
  overflow-y: auto;
  width: 100%;
  padding-right: 0.5rem;
}

/* Custom scrollbar styling */
#history-list::-webkit-scrollbar {
  width: 8px;
}

#history-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#history-list::-webkit-scrollbar-thumb {
  background: var(--drupal-blue);
  border-radius: 10px;
}

#history-list::-webkit-scrollbar-thumb:hover {
  background: var(--drupal-navy);
}

/* History date section */
.history-date-section {
  margin-bottom: 2rem;
}

.history-date-section h3 {
  color: var(--drupal-navy);
  margin-bottom: 0.5rem;
  text-align: left;
  font-size: 1.1rem;
}

.badge-first {
  background-color: var(--drupal-purple);
  color: var(--drupal-navy);
}

.history-modal-button {
  width: 100%;
  max-width: 24rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  #history-list {
    min-width: 300px;
  }

  .history-table {
    font-size: 0.85rem;
  }

  .history-table th,
  .history-table td {
    padding: 0.5rem;
  }
}

#active-card.dragging {
  opacity: 0.5; 
  border: 0.1875rem dashed #999;
  box-shadow: none !important;
  border-radius: 0.5rem;
}

#active-card.dragging .card  {
  border: none !important;
  background-color: #f0f0f0;
}

#timeline-line::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 0;
  height: 1rem;
  background-color: var(--drupal-blue-medium);
  border-radius: 0.5rem;
  transform: translateY(-50%);
  animation: arrowExpand 1.8s ease forwards;
}

@keyframes arrowExpand {
  0% { width: 0; }
  100% { width: 100%; }
}

.card.first-card {
  animation: cardPopUp 0.6s ease forwards;
}

@keyframes cardPopUp {
  0% { transform: scale(0.8); }
  100% { transform: scale(1); }
}

.timeline-label {
  position: absolute;
  top: 2rem;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--drupal-navy);
  text-transform: uppercase;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-label.first-card {
  opacity: 1;
  transform: scale(1);
}

.timeline-label.start {
  left: 0;
}

.timeline-label.end {
  right: 0;
}

#active-card-container {
  position: relative;
  margin-right: 1.8rem;
}

#active-card {
  position: relative;
  z-index: 10;
}

.card-stack {
  position: absolute;
  padding: 0.9375rem 0.625rem;
  width: 6.875rem;
  height: 9.375rem;
  border-radius: 0.5rem;
  border: 0.1875rem solid var(--drupal-navy);
  background-color: white;
  opacity: 0;
  bottom: calc((4 - var(--stack-index)) * -6px);
  right: calc((4 - var(--stack-index)) * -6px);
  z-index: var(--stack-index);
}

@keyframes stackFly {
  0% { 
    transform: translate(200px, 300px);
    opacity: 0;
  }
  100% { 
    transform: translate(0, 0);
    opacity: 1;
  }
}

#active-card-container.draw-stack #active-card .card {
  animation: stackFly 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 0s;
}

#active-card-container.draw-stack .card-stack {
  animation: stackFly 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc((5 - var(--stack-index)) * 0.08s);
}

/* update mobile first !!! */

@media (max-width: 480px) {
  #timeline-wrapper {
    padding-bottom: 2rem;
    margin-bottom: 4rem;
  }

  #timeline-line {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;          
    height: 100%;         
    border-radius: 5px;
    background-color: var(--drupal-blue-medium);
    min-height: 200px;
  }

  #timeline-line::after {
    top: auto;
    bottom: 0;
    left: 50%;
    right: auto;
    transform: translateX(-50%) rotate(90deg);
    bottom: -40px !important;
  }

  #timeline {
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    margin-top: 2rem;
  }

  #timeline-line::before {
    display: none;
    animation: none !important;
  }

  #timeline-line {
    animation: none!important;
  }

  
  .timeline-label.end {
    bottom: 0;
    top: unset;
    left: 0;
    width: fit-content;
  }
}

.email-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

#reveal-email-btn {
  padding: 0.5rem;
  border: none;
  background-color: transparent;
  color: var(--drupal-navy);
  cursor: pointer;
  font-size: 0.8rem;
}

.newsletter-icon {
  text-align: center;
}

.newsletter-icon svg {
  width: 24px;
  height: 24px;
}

.start-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 24px;
}

.start-modal-secondary-buttons {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;  
}

.start-modal-secondary-buttons button {
  flex: 1;    
  min-width: 0; 
}

#history-modal {
  background: none!important;
}

.modal-msg-text {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 0.75rem;
}

.modal-score {
  font-size: 1.3rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.modal-score .label {
  font-weight: 500;
  color: var(--drupal-navy);
}

.modal-score .value {
  font-weight: bold;
  color: var(--drupal-blue);
}

.drag-helper {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.drag-helper.over-deck {
  transform: scale(1) rotate(0deg) !important;
  opacity: 0.4 !important;
}

.card.over-deck {
  transition: none !important;
  transform: none !important;
}

.thank-you-subscribe {
  font-size: 1.3rem;
  font-weight: bold;
  margin-top: 20px;
}