:root {
  --primary-color: orangered;
  --primary-color-hover: rgb(255, 78, 14);
  --primary-color-click: rgb(246, 65, 0);
  --fore-color: #FFFFFF;
  --background-color: #1E1E1E;
  --fore-color-hover: #e6e6e6;
  --header-color: #191919;
  --header-color-hover: #494949;
  --valid-green: #5BC445;
  --valid-green-hover: #53b83f;
  --valid-green-click: #368227;
  --invalid-gray: #888888;
  --login-field: #ffffff;
  --score-slider: #444;
}

body.light-theme {
  --fore-color: #212121;
  --background-color: #ffffff;
  --fore-color-hover: #b5b5b5;
  --header-color: #f2f2f2;
  --header-color-hover: #c8c8c8;
  --login-field: #e7e7e7;
  --score-slider: #c2c2c2;
}

p {
  text-align: left;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  background-color: var(--background-color);
  font-family: 'Segoe UI', sans-serif;
  color: var(--fore-color);
}


.donation{
  justify-self: center;
  justify-content: center;
  align-self: center;
  align-items: center;
  margin: 0px;
}

.hidden {
  display: none;
}

/*#region account&stats */

.text-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--fore-color);
  /* Link color */
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  /* Use parent font */
}

.text-button:hover {
  color: var(--fore-color);
}

.login-text {
  text-align: center;
  font-size: 16px;
}

.log-in-field {
  background-color: var(--login-field);
  color: black;
  border: none;
  border-radius: 8px;
  height: 30px;
  width: 300px;
  font-size: 14px;
  text-align: left;
  padding-left: 10px;
  appearance: textfield;
}

.log-in-field:focus {
  outline: none;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 20px;
  margin-bottom: 20px;
}

.stat {
  text-align: center;
}

.stat .number {
  font-size: 2rem;
  font-weight: 500;
}

.stat .label {
  font-size: 0.9rem;
  color: var(--fore-color)
}

/*#endregion */

/*#region toggle-switch */

.settings-bar {
  display: flex;
  gap: 20px;
  text-align: center;
  justify-content: center;
  margin-top: 20px;
}

.settings-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  margin-top: 3px;
}

/* Hide default HTML checkbox */
.settings-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 34px;
}

input:checked+.slider {
  background-color: var(--primary-color);
}

input:focus+.slider {
  box-shadow: 0 0 0px var(--primary-color);
}

input:checked+.slider:before {
  -webkit-transform: translateX(20px);
  -ms-transform: translateX(20px);
  transform: translateX(20px);
}

/*#endregion */

/*#region Modals */

#modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  /* Darken */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#modal-overlay.hidden {
  display: none;
}

#active-modal.modal-content {
  background-color: var(--background-color);
  padding: 30px 40px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  width: 400px;
  max-width: 90%;
  text-align: center;
  color: var(--fore-color);
  font-size: 18px;
  animation: fadeIn 0.3s ease-in-out;
  gap: 20px;
}

.modal-title {
  font-size: 30px;
  font-weight: 500;
  margin: 0px;
  text-align: center;
}

.modal-text {
  font-size: 18px;
  font-weight: 500;
  margin: 0px;
  text-align: left;
}

.modal-navigation-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 18px;
  border-radius: 10px;
  padding: 15px;
  width: 150px;
  margin: auto;
  text-align: center;
}

.modal-navigation-btn:hover {
  background-color: var(--primary-color-hover);
}

/*#endregion */

/*#region Results Overlay */

#win-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  /* semi-transparent overlay */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

#win-screen.hidden {
  display: none;
}

.score-bar {
  background-color: var(--primary-color);
  color: white;
  border-radius: 18px;
  max-width: 500px;
  width: 100%;
  height: 50px;
  text-align: center;
  padding: 6px;
  font-size: 25px;
}


.win-container {
  background-color: var(--header-color);
  border-radius: 20px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  color: var(--fore-color);
  text-align: center;
  animation: fadeIn 0.5s ease-in-out;
}

.distance-label {
  pointer-events: none;
  white-space: nowrap;
  color: black;
}

.win-detail {
  margin-bottom: 12px;
  width: 100%;
  max-width: 500px;
}

.win-details {
  display: flex;
  flex-direction: column;
  gap: 0px;
  margin-top: 0px;
  width: 100%;
  max-width: 500px;
}

.win-detail label {
  font-weight: bold;
  display: block;
  margin-bottom: 2px;
  /* reduced gap */
}

.bar-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  /* tighter gap */
  max-width: 500px;
  width: 100%;
}

.bar {
  height: 12px;
  background-color: var(--score-slider);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 2px;
  max-width: 500px;
  width: 100%;
}

.fill {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 5.2s ease-in-out;
}

.bar-labels {
  display: flex;
  flex-direction: column;
  font-size: 0.92em;
  line-height: 1.2;
  white-space: nowrap;
  margin-top: -9px;
  gap: 1px;
  /* tight spacing between strong and small */
}

.bar-labels strong {
  font-weight: bold;
}

.bar-labels small {
  font-size: 0.85em;
  opacity: 0.9;
}

/*#endregion */

/*#region Header */

.header {
  width: 100%;
  background-color: var(--header-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0px 0px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.header-right {
  display: flex;
  gap: 0px;
}

.app-icon {
  width: 40px;
  height: 40px;
  border-radius: 5px;
}

.app-name {
  font-size: 20px;
  font-weight: bold;
}

.icon-button {
  background: none;
  color: white;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.icon-button img {
  width: 30px;
  height: 30px;
  color: white;
}

.navigation-container {
  width: 60px;
  height: 60px;
  align-content: center;
  justify-content: center;
  text-align: center;
}

.navigation-container:hover {
  background-color: var(--header-color-hover);

}

/*#endregion */

/*#region Map */

.map-placeholder {
  width: 100%;
  max-width: 500px;
  height: 300px;
  border-radius: 14px;
  overflow: hidden;
}

.leaflet-container {
  cursor: pointer;
}

/* While dragging the map */
.leaflet-container.leaflet-dragging {
  cursor: grabbing;
}

/* Marker default cursor (hover) */
.leaflet-marker-icon {
  cursor: grab;
}

/* Marker dragging cursor */
.leaflet-marker-icon.leaflet-marker-draggable.dragging,
.leaflet-marker-icon.leaflet-dragging {
  cursor: grabbing !important;
}

/*#endregion */

/*#region Sidebar*/

.sidebar {
  margin-top: 50px;
  width: 100%;
  max-width: 300px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 0px;
  z-index: 9999;
  justify-self: center;
  align-self: center;
  align-items: center;
}

.sidebar-header {
  background-color: var(--primary-color);
  color: white;
  border: 4px solid var(--primary-color);
  border-radius: 16px;
  padding: 10px;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  z-index: 1000;
  position: relative;
}

.sidebar-header:hover {
  background-color: var(--primary-color-hover);
  border-color: var(--primary-color-hover);
}

.sidebar-header:active {
  background-color: var(--primary-color-click);
  border-color: var(--primary-color-click);
}

.game-list {
  list-style: none;
  padding-left: 0;
  color: black;
  padding-top: 38px;
}

.sidebar-body {
  border: 4px solid var(--primary-color);
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  height: 32px;
  position: relative;
  translate: 0px -50px;
  transition: height 0.5s ease;
  top: 14px;
  width: 100%;
  z-index: 1;
  padding-top: 50;
}

.sidebar-body.active {
  height: 400px;
  /* Adjust this to fit content or max height */
}

.sidebar-body::-webkit-scrollbar {
  width: 4px;
}

.sidebar-body::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 16px;
}

.past-game-btn {
  margin-bottom: 0px;
  padding: 1px;
  font-size: 14px;
  background-color: white;
  text-align: left;
  padding-left: 10px;
  padding-right: 10px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: var(--fore-color);
}

.past-game-btn:hover {
  background-color: var(--fore-color-hover);


}


/*#endregion */

/*#region Main Content*/
.layout{
  padding: 20px;
  position: relative;
  background-color: var(--background-color);
}

.main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  gap: 40px;
}

.center-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 0px;
  max-width: 500px;
  width: 100%;
}

.explanation {
  font-size: 18px;
  font-weight: 500;
  margin: 0px;
  text-align: center;
}

.prompt {
  font-size: 30px;
  font-weight: 500;
  margin: 10px;
  margin-bottom: 50px;
  text-align: center;
}

.year-selector {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  width: 100%;
  gap: 10px;
  align-items: stretch;
}

.year-display {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  width: 100%;
  height: 50px;
  font-size: 18px;
  text-align: center;
  appearance: textfield;
  grid-column: span 2;
}

/* Remove spinner buttons in Chrome/Safari */
.year-display::-webkit-inner-spin-button,
.year-display::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.year-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 18px;
  border-radius: 10px;
  grid-column: span 1;
}

.year-btn:hover {
  background-color: var(--primary-color-hover);
  /* slightly lighter or more vibrant orange */
}

.year-btn:active {
  background-color: var(--primary-color-click);
  /* darker orange on click */
}

.year-display {
  background-color: var(--primary-color);
  color: white;
}

.year-display:focus {
  outline: none;
  box-shadow: 0 0 0 1px var(--fore-color);
  /* or a soft glow */
}

/* Input */
.person-input input {
  padding: 12px;
  display: flex;
  border-radius: 10px;
  border: 4px solid var(--primary-color);
  font-size: 14px;
  width: 100%;
  height: 50px;
  max-width: 500px;
  text-align: center;
}

.person-input{
  width: 100%;
}

.person-input input:focus {
  outline: none;
  box-shadow: 0 0 0 1px var(--fore-color);
  /* or a soft glow */
}

.guess-button .guess {
  padding: 10px 40px;
  font-size: 18px;
  width: 100%;
  height: 50px;
  background-color: var(--valid-green);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.guess-button {
  width: 100%;
}

.guess-button .guess:active {
  background-color: var(--valid-green-click);
}

.guess-button .guess:hover {
  background-color: var(--valid-green-hover);
}

.guess-button .guess.disabled {
  padding: 10px 40px;
  font-size: 18px;
  width: 100%;
  max-width: 500px;
  height: 50px;
  color: white;
  background-color: var(--invalid-gray);
  border: none;
  border-radius: 8px;
  cursor: not-allowed;
}

/*#endregion */

/*#region Animations*/

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-10px);
  }

  40%,
  80% {
    transform: translateX(10px);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

.shake {
  animation: shake 0.5s ease;
}

/*#endregion */

/* ✅ PLAY AGAIN BUTTON */
#play-again-btn {
  margin-top: 10px;
  background-color: var(--primary-color);
  border: none;
  padding: 10px 25px;
  border-radius: 10px;
  font-size: 1em;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#play-again-btn:hover {
  background-color: #ff6a00;
  /* Slightly lighter orange */
}

@media (max-width: 900px){
  .bar {
    display: flex;
    max-width: 500px;
    width: 100%;
    height: 12px;
    background-color: var(--score-slider);
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 100;
    margin-top: 2px;
  }
  .sidebar {
    margin-left: 23px;
  }
  .donation{
    margin-left: 23px;
  }

}

@media (max-width: 350px){
   .app-name {
  font-size: 12px;
  font-weight: bold;
  padding-bottom: 3px;
}
.app-icon {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  margin-bottom: 15px;
  margin-right: 10px;
}
.icon-button {
  background: none;
  color: white;
  border: none;
  cursor: pointer;
  padding: 0px;
}

.icon-button img {
  width: 30px;
  height: 30px;
  color: white;
}

.header-right {
  padding: 0px;
}
.navigation-container {
  width: 40px;
  height: 40px;
  margin-right: 8px;
  align-content: center;
  justify-content: center;
  text-align: center;
}
}

.donation-button{
  all: unset;            /* Remove all default button styles */
  text-decoration: underline;
  color: inherit;        /* Inherit text color from parent */
  cursor: pointer;       /* Pointer cursor on hover */
  font: inherit;         /* Inherit font styles from parent */
  display: inline;       /* Inline to sit with text */
}