@keyframes resourceFlash {
  0% {
    opacity: 1;
    transform: scale(1.3);
    font-weight: bold;
  }
  75% {
    opacity: 1;
    transform: scale(1) translateY(-25px);
    font-weight: bold;
  }
  100% {
    opacity: 0;
    transform: scale(1) translateY(-25px);
  }
}

.resource-diff {
  position: absolute;
  right: -30px;
  top: -5px;
  font-size: 0.85em;
  font-weight: bold;
  animation: resourceFlash 3.5s ease-out forwards;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

a:hover {
  cursor: pointer;
}

.flexcol {
  flex-direction: column;
}

.flexcolrev {
  flex-direction: column-reverse;
}

.flexrow {
  flex-direction: row;
}

.flexrowrev {
  flex-direction: row-reverse;
}

.install-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1d3557;
  color: #f1faee;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition:
    background-color 0.3s,
    transform 0.2s;
}

.install-button .icon {
  margin-right: 8px;
  font-size: 20px;
}

.install-button:hover {
  background-color: #457b9d;
}

.install-button:active {
  transform: scale(0.95);
}

#install-container {
  display: none;
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 1000;
}

.tutorial-button-container {
  display: flex;
  justify-content: space-around;
}

/* Tutorial Styles */
.tutorial-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 900px;
  margin: 20px auto;
  padding: 0 20px;
}

.tutorial-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-info {
  text-align: center;
}

.progress-text {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #a8dadc, #457b9d);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.tutorial-panel {
  padding: 40px 50px;
}

.tutorial-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 30px 0;
  color: var(--text);
  text-align: center;
}

.tutorial-image-container {
  margin: 30px 0;
  text-align: center;
  display: flex;
  justify-content: center;
}

.tutorial-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.tutorial-image:hover {
  transform: scale(1.02);
}

.tutorial-description {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  margin: 30px 0;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
}

.tutorial-nav {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 30px;
}

.tutorial-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.tutorial-btn {
  padding: 12px 30px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  display: inline-block;
  text-align: center;
}

.tutorial-btn-primary {
  background-color: #457b9d;
  color: white;
  flex: 1;
  min-width: 150px;
}

.tutorial-btn-primary:hover {
  background-color: #2c5073;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tutorial-btn-secondary {
  background-color: rgba(168, 218, 220, 0.3);
  color: var(--text);
  flex: 1;
  min-width: 150px;
  border: 1px solid var(--text);
}

.tutorial-btn-secondary:hover {
  background-color: rgba(168, 218, 220, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tutorial-btn-success {
  background: linear-gradient(135deg, #06a77d, #059a6f);
  color: white;
  width: 100%;
  margin-top: 15px;
  font-size: 1.1rem;
  padding: 14px 30px;
}

.tutorial-btn-success:hover {
  background: linear-gradient(135deg, #059a6f, #047d58);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(6, 168, 125, 0.3);
}

/* Navbar Styles */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: #1d3557;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 1000;
  font-family: "Cinzel", serif;
  font-weight: bold;
}

.navbar .logo a {
  color: #f1faee;
  text-decoration: none;
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-links a:hover {
  color: #e63946;
}

/* Burger Menu (Mobile) */
.burger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.burger span {
  background: #f1faee;
  height: 3px;
  width: 25px;
  margin: 4px 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    background-color: #1d3557;
    position: absolute;
    top: 60px;
    right: 0;
    width: 200px;
    box-shadow: -2px 4px 6px rgba(0, 0, 0, 0.3);
  }

  .nav-links.active {
    display: flex;
  }

  .burger {
    display: flex;
  }
}

.logo-icon-txt {
  display: flex;
  align-items: center;
}

.background {
  position: fixed;
  /* Sticks to the viewport */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  /* Places it behind everything */
  pointer-events: none;
  /* Prevents interference with user interactions */
}

.progress-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  position: relative;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  /* Fully visible initially */
  background: rgba(255, 255, 255, 0.9);
  /* Darkened overlay effect */
  transition: height 0.3s ease;
}

.darkened-background {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.25);
  /* Darken the background */
  z-index: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.current-turn {
  display: flex;
  justify-content: center;
  padding: 5px;
  color: var(--text);
}

.score {
  display: flex;
  justify-content: center;
  color: var(--text);
}

.discarded-txt {
  color: var(--text);
}

.castle-container {
  position: relative;
}

.last-played-card {
  position: absolute;
  top: 0;
  left: 50%;
  width: 100px;
  height: 200px;
  transform: translateX(-50%);
}

.texture {
  width: 100%;
  height: 50%;
  /* Start hidden (no height) */
  background-image: url("/assets/wallc.png");
  /* Replace with your texture image path */
  background-size: auto;
  /* Ensure the texture repeats naturally */
  background-repeat: repeat;
  /* Repeat the texture */
  background-position: top;
  /* Background alignment */
  position: absolute;
  /* Align it within the container */
  bottom: 0;
  /* Ensure growth starts at the bottom */
  transition: height 2s ease;
  /* Smooth growth animation */
}

.cloudy-round-panel {
  color: white;
  background: var(--cloud-bg);
  padding: 20px 40px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.color-picker-container {
  color: white;
  text-align: center;
  background: var(--cloud-bg);
  padding: 20px 40px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin: 10px;
}

.color-picker-h1 {
  margin-bottom: 20px;
  font-size: 1.5rem;
  color: var(--text);
}

.text {
  color: var(--text);
}

.color-picker-buttons {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.color-button {
  border: none;
  border-radius: 8px;
  padding: 15px 30px;
  font-size: 1.2rem;
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.color-button:hover {
  transform: scale(1.1);
}

.red-button {
  background-color: #e74c3c;
}

.blue-button {
  background-color: #3498db;
}

.red-button:focus,
.blue-button:focus {
  outline: none;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.cta {
  padding: 12px 24px;
  border-radius: 6px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.learn-more {
  background-color: #457b9d;
  color: white;
}

.learn-more:hover {
  background-color: #2c5073;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.learn-more:active {
  transform: translateY(0);
}

/* Game Over / Midgame Styles */
.game-over-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  padding: 20px;
}

.game-over-content {
  background: linear-gradient(135deg, rgba(30, 60, 114, 0.95) 0%, rgba(70, 123, 157, 0.95) 100%);
  border-radius: 20px;
  padding: 50px 40px;
  max-width: 700px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
              0 0 40px rgba(168, 218, 220, 0.2);
  border: 2px solid rgba(168, 218, 220, 0.3);
  animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-over-header {
  text-align: center;
  margin-bottom: 40px;
}

.winner-badge {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 15px;
  animation: pulse 1.5s ease-in-out infinite;
}

.winner-red {
  background: rgba(220, 53, 69, 0.8);
  color: white;
  border: 2px solid #dc3545;
}

.winner-blue {
  background: rgba(52, 152, 219, 0.8);
  color: white;
  border: 2px solid #3498db;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.game-over-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin: 0;
  color: var(--text);
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  letter-spacing: -1px;
}

.final-score-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin: 40px 0;
  padding: 30px 0;
  border-top: 2px solid rgba(168, 218, 220, 0.2);
  border-bottom: 2px solid rgba(168, 218, 220, 0.2);
}

.score-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 30px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  min-width: 120px;
  position: relative;
}

.red-score {
  border-color: rgba(220, 53, 69, 0.3);
  background: rgba(220, 53, 69, 0.08);
}

.blue-score {
  border-color: rgba(52, 152, 219, 0.3);
  background: rgba(52, 152, 219, 0.08);
}

.score-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-value {
  font-size: 3.2rem;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.score-badge {
  position: absolute;
  top: -10px;
  right: 8px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #333;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.score-divider {
  font-size: 2.5rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.5);
}

.finishing-card-section {
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin: 25px 0;
  border-left: 4px solid #457b9d;
}

.finishing-card-label {
  margin: 0;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.finishing-card-label strong {
  color: #a8dadc;
  font-weight: 700;
  font-size: 1.1rem;
}

.game-over-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 30px;
}

.game-over-btn {
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.restart-btn.primary {
  background: linear-gradient(135deg, #457b9d, #2c5073);
  color: white;
  box-shadow: 0 4px 12px rgba(69, 123, 157, 0.3);
}

.restart-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(69, 123, 157, 0.4);
  background: linear-gradient(135deg, #2c5073, #1e3a52);
}

.restart-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.restart-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.new-game-btn {
  background: linear-gradient(135deg, #06a77d, #059a6f);
  color: white;
  box-shadow: 0 4px 12px rgba(6, 168, 125, 0.3);
}

.new-game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(6, 168, 125, 0.4);
  background: linear-gradient(135deg, #059a6f, #047d58);
}

.home-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.home-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.card-top-left {
  display: flex;
  align-items: center;
  gap: 4px;
  position: absolute;
  top: 8px;
  left: 8px;
}

.card-top-right {
  display: flex;
  align-items: center;
  gap: 4px;
  position: absolute;
  top: 8px;
  right: 8px;
}

.card-icon {
  width: 16px;
  height: 16px;
}

.card-costs {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-cost {
  display: flex;
  flex-direction: row;
  color: white;
}

.cost-icon {
  width: 16px;
  height: 16px;
}

.card-value {
  font-size: 14px;
  font-weight: bold;
  color: white;
}

.card-name {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  /*white-space: nowrap;*/
  max-width: 80px;
  color: white;
}

.blue-hue {
  filter: hue-rotate(200deg);
}

.red-hue {
  filter: hue-rotate(290deg);
}

.efx-indicator {
  height: 50px;
}

:root {
  left: 0;
  --translate-start: -100%;
  /* Default: offscreen left */
  --translate-end: 0;
  /* Default: offscreen right */
}

@keyframes slideInOut {
  0% {
    transform: translateX(var(--translate-start));
    /* Start offscreen to the left */
    opacity: 0;
  }

  25% {
    transform: translateX(var(--translate-end));
    /* Fully visible in the center */
    opacity: 1;
  }

  75% {
    transform: translateX(var(--translate-end));
    /* Stay in place for a moment */
    opacity: 1;
  }

  100% {
    transform: translateX(var(--translate-start));
    /* Move offscreen to the right */
    opacity: 0;
    visibility: hidden;
  }
}

.played-card-anim {
  position: fixed;
  width: 130px;
  animation: slideInOut 2s ease-in-out 1 forwards;
  /*max-width: 60vw; */
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  /* Preserve aspect ratio */
  overflow: hidden;
  top: 0%;
  /*transform: translateY(-50%);*/
  /* Adjust animation duration (3s) as needed */
}

.played-card-anim.red {
  left: 0;
  --translate-start: -100%;
  /* Default: offscreen left */
  --translate-end: 0;
  /* Default: offscreen right */
}

.played-card-anim.blue {
  right: 0;
  --translate-start: 100%;
  /* Default: offscreen left */
  --translate-end: 0;
  /* Default: offscreen right */
}

@keyframes fallToFlat {
  0% {
    transform: translate(-100%, -50%) rotate(-90deg);
    /* Offscreen, vertical position */
    opacity: 0;
    /* Hidden */
  }

  30% {
    transform: translate(0, -50%) rotate(-45deg);
    /* Midway, halfway through the fall */
    opacity: 1;
    /* Visible */
  }

  60% {
    transform: translate(0, -50%) rotate(0deg);
    /* In the center, flat position */
    opacity: 1;
  }

  80% {
    transform: translate(0, -50%) rotate(0deg);
    /* In the center, flat position */
    opacity: 1;
  }

  100% {
    transform: translateX(-100%);
    /* Move offscreen to the right */
    opacity: 0;
    visibility: hidden;
  }
}

.stick {
  position: absolute;
  top: 50%;
  /* Center vertically */
  left: 50%;
  /* Center horizontally */
  transform-origin: center left;
  /* Pivot point for rotation */
  transform: translate(-100%, -50%) rotate(-90deg);
  /* Initial offscreen vertical position */
  animation: fallToFlat 2s ease-out 1 forwards;
  /* Play once */
  max-width: 100vw;
  /* Fit within viewport width */
  max-height: 100vh;
  /* Fit within viewport height */
  object-fit: contain;
  /* Maintain aspect ratio */
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.hidden {
  display: none;
}

.overlay-image {
  width: 100%;
  max-width: 90%;
  max-height: 90%;
  cursor: pointer;
  border: 2px solid white;
}

/***** MODAL DIALOG ****/
#modal {
  /* Underlay covers entire screen. */
  position: fixed;
  top: 0px;
  bottom: 0px;
  left: 0px;
  right: 0px;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;

  /* Flexbox centers the .modal-content vertically and horizontally */
  display: flex;
  flex-direction: column;
  align-items: center;

  /* Animate when opening */
  animation-name: fadeIn;
  animation-duration: 150ms;
  animation-timing-function: ease;
}

#modal > .modal-underlay {
  /* underlay takes up the entire viewport. This is only
	required if you want to click to dismiss the popup */
  position: absolute;
  z-index: -1;
  top: 0px;
  bottom: 0px;
  left: 0px;
  right: 0px;
}

#modal > .modal-content {
  /* Position visible dialog near the top of the window */
  margin-top: 10vh;

  /* Sizing for visible dialog */
  width: 80%;
  max-width: 600px;
  max-height: 80vh;

  /* Display properties for visible dialog*/
  border: solid 1px #999;
  border-radius: 8px;
  box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.3);
  background-color: var(--cloud-bg);
  padding: 20px;

  /* Animate when opening */
  animation-name: zoomIn;
  animation-duration: 150ms;
  animation-timing-function: ease;
  overflow: scroll;
}

#modal.closing {
  /* Animate when closing */
  animation-name: fadeOut;
  animation-duration: 150ms;
  animation-timing-function: ease;
}

#modal.closing > .modal-content {
  /* Animate when closing */
  animation-name: zoomOut;
  animation-duration: 150ms;
  animation-timing-function: ease;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes zoomIn {
  0% {
    transform: scale(0.9);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes zoomOut {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(0.9);
  }
}

/* Form styling */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
}

.form-group input,
.form-group button {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.games-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow: scroll;
}

.games-list li {
  display: flex;
  align-items: center;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 8px;
}

.games-list li span {
  flex: 1;
  padding: 0 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.games-list .room-name {
  flex: 2;
  /* Room name gets more space */
}

.games-list .actions {
  flex: 0 0 auto;
  /* Prevent actions from stretching */
  display: flex;
  gap: 5px;
}

.games-list .actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.games-list .actions button img {
  width: 16px;
  height: 16px;
}

.games-list .actions button:hover {
  opacity: 0.8;
}

.red {
  color: red;
}

.cloudbg2 {
  background-color: var(--cloud-bg2);
}

.info-bar-above-game {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.resource-stats {
  display: flex;
  padding: 5px 0;
}

.shield-magic-defense {
  position: absolute;
  top: 50%;
  /* Center vertically */
  left: 50%;
  /* Center horizontally */
  transform: translate(-50%, -50%);
  /* Adjust position to center the image fully */
  width: 40%;
  /* Adjust size as needed */
  height: auto;
  z-index: 10;
  /* Ensure it appears on top of other content */
}

.shield-magic-defense-glow {
  filter: blur(10px) brightness(1.5);
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: 5px;
}

.online {
  background-color: green;
}

.offline {
  background-color: red;
}

.banner-on-home {
  width: 300px;
  height: 250px;
  border: 1px solid red;
  margin-right: 10px;
}

.small-text-pane {
  width: 400px;
  margin-left: 10px;
}

.eventlog {
  display: flex;
  flex-direction: column;
  align-items: first baseline;
  align-self: baseline;
  height: 80px;
  width: 100%;
  overflow: scroll;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */

  ::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari */
  }
}

/* HEX MAP */
/* Map Container */
.map-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: center;
  width: 100%;
}

.map-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow-x: auto;
  padding: 20px 0;
}

.hex-map {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.hex-map-row {
  display: flex;
  justify-content: center;
}

/* Hexagon Styling */
.hex {
  width: 50px;
  height: 57px;
  background-color: #6b8e23;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.15);
  margin-right: 1px;
}

.hex-img {
  background-size: cover;
  background-position: center;
}

.hex:hover {
  transform: scale(1.08) translateZ(0);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.4);
}

.hex:active {
  transform: scale(0.98);
}

.hex-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hex:hover .hex-overlay {
  opacity: 1;
}

.hex-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.hex-value-txt {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 16px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.hex:hover .hex-value-txt {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}

.hex-locked {
  opacity: 0.6;
  filter: grayscale(1) brightness(0.85);
}

.hex-locked:hover {
  opacity: 0.75;
  filter: grayscale(0.8) brightness(0.95);
}

.hex-unlocked {
  filter: brightness(1) saturate(1.1);
}

.hex-map-offset {
  margin-left: 51px;
  height: 31px;
  transform: translate(0, -13px);
}

/* Map Info Section */
.map-info-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 900px;
}

.map-info-panel {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-info-placeholder {
  text-align: center;
  opacity: 0.8;
}

.map-info-placeholder i {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.map-info-placeholder p {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.map-description-panel {
  background: linear-gradient(135deg, rgba(107, 142, 35, 0.15) 0%, rgba(173, 216, 230, 0.1) 100%);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.map-description-content {
  padding: 20px 0;
}

.map-description-title {
  margin: 0 0 16px 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.map-description-text {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
}

.map-description-text:last-of-type {
  margin-bottom: 16px;
}

.play-now-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  text-decoration: none;
  font-weight: 700;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  font-size: 1rem;
}

.play-now-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
  border-color: rgba(255, 255, 255, 0.4);
}

.progbar-container {
  position: relative;
  width: 100%;
  background: #222;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 5px;
}

.progbar-bar {
  height: 8px;
  background: #4caf50;
  width: 0%;
  /* Example progress */
  transition: width 0.3s;
  /*flex-grow: 1;*/
  position: relative;
}

.progbar-hint {
  position: absolute;
  width: 100%;
  text-align: center;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: white;
  font-weight: bold;
  pointer-events: none;
}

.progbar-expand-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #4caf50;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.progbar-details {
  max-height: 0;
  overflow: hidden;
  background: #333;
  color: white;
  padding: 0 10px;
  transition:
    max-height 0.3s ease-out,
    padding 0.3s;
}

.progbar-details.active {
  max-height: 100px;
  padding: 10px;
}

/* Toast Container */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
}

/* Toast Notification */
.toast {
  background-color: #333;
  color: #fff;
  padding: 12px 20px;
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  animation:
    toastFadeIn 0.3s ease,
    toastFadeOut 0.5s ease 3s forwards;
}

/* Fade Animations */
@keyframes toastFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastFadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.fill-button {
  position: relative;
  height: 45px;
  width: 150px;
  margin: 10px 7px;
  padding: 5px 5px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2px;
  color: gray;
  border: 2px #383736 solid;
  border-radius: 4px;
  text-transform: uppercase;
  outline: 0;
  overflow: hidden;
  background: none;
  z-index: 1;
  cursor: pointer;
  transition: 0.08s ease-in;
  -o-transition: 0.08s ease-in;
  -ms-transition: 0.08s ease-in;
  -moz-transition: 0.08s ease-in;
  -webkit-transition: 0.08s ease-in;
}

.fill-button:hover {
  color: whitesmoke;
}

.fill-button:before {
  content: "";
  position: absolute;
  background: #383736;
  bottom: 0;
  left: 0;
  right: 0;
  top: var(--fill-height, 20%);
  /*top: 100%;*/
  z-index: -1;
  -webkit-transition: top 0.09s ease-in;
}

/*.fill-button:hover:before {*/
/*  top: 0;*/
/*}*/
.speech-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  /* Semi-transparent black */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10010;
}

p.bubble {
  position: relative;
  /*width: 300px;*/
  text-align: center;
  line-height: 1.4em;
  margin: 40px auto;
  background-color: #fff;
  border: 8px solid #333;
  border-radius: 30px;
  font-family: sans-serif;
  padding: 20px;
  font-size: large;
  margin-bottom: 100px;
}

p.thought {
  width: 300px;
  border-radius: 200px;
  padding: 30px;
}

p.bubble:before,
p.bubble:after {
  content: " ";
  position: absolute;
  width: 0;
  height: 0;
}

p.speech:before {
  left: 30px;
  bottom: -50px;
  border: 25px solid;
  border-color: #333 transparent transparent #333;
}

p.speech:after {
  left: 38px;
  bottom: -30px;
  border: 15px solid;
  border-color: #fff transparent transparent #fff;
}

p.thought:before,
p.thought:after {
  left: 10px;
  bottom: -30px;
  width: 40px;
  height: 40px;
  background-color: #fff;
  border: 8px solid #333;
  -webkit-border-radius: 28px;
  -moz-border-radius: 28px;
  border-radius: 28px;
}

p.thought:after {
  width: 20px;
  height: 20px;
  left: 5px;
  bottom: -40px;
  -webkit-border-radius: 18px;
  -moz-border-radius: 18px;
  border-radius: 18px;
}

.speech-image {
  position: absolute;
  bottom: 0;
  left: 0;
  /*width: 50vw; /* Half of the screen width */
  height: 50vh; /* Half of the screen height */
  object-fit: cover;
}

/* Cards Overview Grid */
.cards-overview-header {
  text-align: center;
  margin-bottom: 30px;
}

.cards-overview-header h3 {
  margin: 0 0 10px 0;
  font-size: 1.8rem;
  color: var(--text);
}

.cards-overview-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.5px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.card-grid-item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  height: 100%;
}

.card-grid-item:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.card-grid-image {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
}

.card-grid-overlay {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.card-type-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-type-offense {
  background: rgba(205, 92, 92, 0.7);
}

.card-type-magic {
  background: rgba(173, 216, 230, 0.7);
  color: #333;
}

.card-type-defense {
  background: rgba(139, 69, 19, 0.7);
}

.card-type-special {
  background: rgba(128, 128, 128, 0.7);
}

.card-type-resource {
  background: rgba(255, 228, 181, 0.7);
  color: #333;
}

.card-grid-info {
  padding: 12px 12px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-grid-title {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
  text-transform: capitalize;
}

.card-grid-costs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cost-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  font-size: 0.8rem;
  color: white;
  font-weight: 500;
}

.tutorial-nav-link {
  transition: all 0.2s ease;
  border-radius: 6px;
  padding: 8px 16px;
  display: inline-block;
  border: 1px solid transparent;
}

.tutorial-nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Card Details View */
.card-details-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 10px 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.card-back-link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card-back-link:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-4px);
}

.card-navigation-counter {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.card-details-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.card-details-image-section {
  display: flex;
  justify-content: center;
}

.card-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card-details-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.card-details-image:hover {
  transform: scale(1.02);
}

.card-type-badge-large {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 10px 16px;
  border-radius: 24px;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.card-details-info-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card-details-title-section {
  border-bottom: 3px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 16px;
}

.card-details-title {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.card-details-section-label {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-details-description-section {
  padding: 0;
}

.card-details-description {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.95);
}

.card-navigation-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.card-nav-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.card-nav-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(8px);
}

.card-nav-prev:hover {
  transform: translateX(-8px);
}

.card-nav-button span {
  flex: 1;
}

.card-nav-button i {
  font-size: 1.2rem;
}
