body {
  background: var(--primary-bg, #6dd3e7);
  padding: 0;
  overflow-x: hidden;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.welcome_container {
  display: flex;
}

.welcome_info {
  flex: 1;
}
.hidden-mobile {
  display: none; /* Hide on small screens */
}

.icon-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--icon-number, #f0f0f0);
  border-radius: 25%;
}

.icon {
  background-color: var(--icon-bg, #fff);
  padding: 2px;
  border-radius: 25%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  font-size: 12px; /* Adjust icon size */
}

.image-container {
  position: relative;
  width: 128px; /* Adjust based on your image size */
  height: 83px; /* Match the width for a square image */
  overflow: hidden;
}

.texture-container {
  width: 32px; /* Set the desired width */
  height: 83px; /* Set the desired height */
  /*background-color: #000; /* Optional: Background color * / */
  overflow: hidden; /* Ensures only the visible part of the texture is shown */
  position: relative; /* Ensure proper stacking context */
}

.number {
  /*background-color: #ccc;*/
  padding: 3px 6px;
  border-radius: 12px;
  color: var(--number, #ccc);
  font-weight: bold;
  font-size: 12px;
}

.icon-img {
  width: 20px;
}

.hands {
  display: flex;
}

.hand-container {
  flex: 1;
}

.hand {
  display: flex;
  max-width: 650px;
  background: #eee0;
  padding: 1px;
  box-sizing: border-box;
  margin-bottom: 10px;
  position: relative;
}

.spy-icon {
  width: 32px;
  opacity: 100%;
  animation: pulse 2s infinite;
}

.pregame {
  display: flex;
  flex-direction: column;
}

.pregame .cloudy-round-panel {
  margin: 10px;
}

.pregame p {
  max-height: 200px;
  overflow: scroll;
  color: var(--text);
}

.cloudy-round-panel button {
  margin: 10px;
}

.howtocard {
  display: flex;
  flex-direction: column-reverse;
}

.feature-card-img {
  max-height: 60vh;
  width: 100%;
}

.room-btns {
  display: flex;
  flex-direction: column;
}

.against-ai-btn {
  width: 160px;
  align-self: center;
}

.nav-links li {
  margin-left: 20px;
  margin: 8px;
}

.nav-links a {
  color: #a8dadc;
  text-decoration: none;
  font-size: 1.3rem;
  transition: color 0.3s;
}

.coins-on-narrow-view {
  display: flex;
  margin-left: auto;
  margin-right: 15px;
}

/* Default: Show the full text */
.game-name::before {
  content: attr(data-full);
}

.castle-and-resources {
  display: flex;
  flex-direction: column;
}

@media (max-height: 600px) {
  .logo {
    display: flex;
    align-items: center;
  }
  .logo small {
    padding-left: 10px;
  }
  .logo a img {
    height: 25px;
  }
  .game-name {
    font-size: 1.1rem;
  }
  .nav-links li {
    margin: 0;
  }
  .castle-and-resources {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .castle-and-wall {
    order: -1;
    position: absolute;
    z-index: -1;
  }
  .resource-stats {
    padding: 0;
    opacity: 0.75;
  }
  .number {
    padding: 0;
  }
  .last-played-card {
    top: calc(100% - 225px);
    height: 100%;
  }
  .body {
    padding: 0;
  }
  :root {
    --toggle-height: 20px;
  }
}

@media (max-width: 440px) {
  .banner-on-home {
    display: none;
  }
}

@media (min-width: 868px) and (max-height: 600px) {
  .wide-short-castle-and-wall-indicator-rightside {
    order: -1;
    align-self: baseline;
  }
}

@media (max-height: 600px) {
  .short-castle-and-wall-indicator-rightside {
    order: -1;
    align-self: baseline;
  }
}

@media (max-width: 868px) and (max-height: 600px) {
  .wide-row-tight-col {
    flex-direction: column;
    /*border: 1px solid #f00;*/
  }
  .dbg {
    /*border: 1px solid #f00;*/
  }
}

@media screen and (max-width: 1148px) {
  .game-name::before {
    content: attr(data-short);
  }
}

@media screen and (max-width: 1030px) {
  .game-name::before {
    content: attr(data-shorter);
  }
}

@media (min-width: 768px) and (min-height: 601px) {
  body {
    /*background: #6dd3e7;*/
    padding-right: 100px;
    padding-left: 100px;
    /*overflow-x: hidden;*/
  }
}

@media (min-width: 768px) {
  .nav-links li {
    margin-left: 10px;
  }
  .nav-links a {
    font-size: 1rem;
  }
  .pregame {
    flex-direction: row;
  }

  .pregame p {
    max-height: unset;
    overflow: unset;
  }

  .howtocard {
    display: flex;
    flex-direction: row;
  }

  .feature-card-img {
    width: auto;
  }
  .icon {
    padding: 10px;
    border-radius: 25%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 20px; /* Adjust icon size */
  }

  .icon-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 25%;
  }

  .number {
    /*background-color: #ccc;*/
    padding: 6px 12px;
    border-radius: 12px;
    /*color: #333;*/
    font-weight: bold;
    font-size: 16px;
  }

  .icon-img {
    width: 30px;
  }

  .image-container {
    position: relative;
    width: 256px; /* Adjust based on your image size */
    height: 165px; /* Match the width for a square image */
    overflow: hidden;
  }

  .texture-container {
    width: 64px; /* Set the desired width */
    height: 165px; /* Set the desired height */
    /*background-color: #000; /* Optional: Background color * / */
    overflow: hidden; /* Ensures only the visible part of the texture is shown */
    position: relative; /* Ensure proper stacking context */
  }

  .hand {
    display: flex;
    max-width: 650px;
    background: #eee0;
    padding: 10px;
    box-sizing: border-box;
    margin-bottom: 10px;
    position: relative;
  }

  .hidden-mobile {
    display: block; /* Show on larger screens */
  }
  .coins-on-narrow-view {
    display: none;
  }
}

/* Wide but short viewport - compact castle/stats like narrow layout */
@media (min-width: 768px) and (min-height: 601px) and (max-height: 819px) {
  .castle-and-wall {
    order: initial;
    position: relative;
    z-index: initial;
    max-width: none;
    width: auto;
  }
  .resource-stats {
    padding: 5px 0;
    opacity: 1;
    gap: 5px;
  }
  .number {
    padding: 3px 6px;
    font-size: 12px;
  }
  .icon {
    padding: 2px;
    font-size: 12px;
  }
  .icon-img {
    width: 20px;
  }
  .image-container {
    width: 128px;
    height: 83px;
  }
  .texture-container {
    width: 32px;
    height: 83px;
  }
  .hand {
    padding: 1px;
  }
  .nav-links li {
    margin: 8px;
    margin-left: 20px;
  }
  .nav-links a {
    font-size: 1.3rem;
  }
  .hidden-mobile {
    display: none;
  }
  .coins-on-narrow-view {
    display: flex;
  }
}

/* Tutorial Responsive Styles */
@media (max-width: 768px) {
  .tutorial-container {
    margin: 15px auto;
    padding: 0 15px;
    gap: 15px;
  }

  .tutorial-panel {
    padding: 30px 25px;
  }

  .tutorial-title {
    font-size: 1.6rem;
    margin-bottom: 20px;
  }

  .tutorial-description {
    font-size: 1rem;
    margin: 20px 0;
  }

  .tutorial-image {
    max-height: 300px;
  }

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

  .tutorial-btn {
    width: 100%;
    padding: 11px 20px;
    font-size: 0.95rem;
  }

  .tutorial-btn-primary,
  .tutorial-btn-secondary {
    flex: none;
    min-width: unset;
  }

  .tutorial-btn-success {
    margin-top: 10px;
    padding: 12px 20px;
  }
}

@media (max-width: 480px) {
  .tutorial-container {
    margin: 10px auto;
    padding: 0 10px;
  }

  .tutorial-panel {
    padding: 20px 15px;
  }

  .tutorial-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
  }

  .progress-text {
    font-size: 0.8rem;
  }

  .progress-bar {
    height: 5px;
  }

  .tutorial-description {
    font-size: 0.95rem;
    margin: 15px 0;
    line-height: 1.6;
  }

  .tutorial-image {
    max-height: 250px;
  }

  .tutorial-image-container {
    margin: 20px 0;
  }

  .tutorial-buttons {
    gap: 8px;
  }

  .tutorial-btn {
    padding: 10px 15px;
    font-size: 0.9rem;
  }

  .tutorial-btn-success {
    margin-top: 8px;
    padding: 11px 15px;
    font-size: 1rem;
  }
}

@keyframes pulse {
  0% {
    opacity: 55%;
  }

  70% {
    opacity: 100%;
  }

  100% {
    opacity: 55%;
  }
}

/* Game Over Page Responsive */
@media (max-width: 768px) {
  .game-over-content {
    padding: 30px 25px;
  }

  .game-over-title {
    font-size: 2.5rem;
  }

  .final-score-section {
    gap: 20px;
    padding: 20px 0;
    margin: 30px 0;
  }

  .score-card {
    min-width: 100px;
    padding: 15px 20px;
  }

  .score-value {
    font-size: 2.5rem;
  }

  .score-divider {
    font-size: 2rem;
  }

  .finishing-card-label {
    font-size: 0.9rem;
  }

  .game-over-btn {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .game-over-container {
    padding: 15px;
  }

  .game-over-content {
    padding: 25px 20px;
    border-radius: 16px;
  }

  .game-over-title {
    font-size: 2rem;
  }

  .winner-badge {
    padding: 8px 16px;
    font-size: 0.75rem;
    margin-bottom: 12px;
  }

  .final-score-section {
    gap: 15px;
    padding: 15px 0;
    margin: 25px 0;
  }

  .score-card {
    min-width: 80px;
    padding: 12px 15px;
    gap: 8px;
  }

  .score-label {
    font-size: 0.8rem;
  }

  .score-value {
    font-size: 2rem;
  }

  .score-badge {
    padding: 3px 8px;
    font-size: 0.65rem;
  }

  .score-divider {
    font-size: 1.5rem;
  }

  .finishing-card-section {
    padding: 15px;
    margin: 20px 0;
    border-left-width: 3px;
  }

  .finishing-card-label {
    font-size: 0.85rem;
  }

  .finishing-card-label strong {
    font-size: 1rem;
  }

  .game-over-buttons {
    gap: 10px;
  }

  .game-over-btn {
    padding: 11px 20px;
    font-size: 0.9rem;
    border-radius: 6px;
  }
}

/* Cards Overview Responsive */
@media (max-width: 768px) {
  .cards-overview-header {
    margin-bottom: 20px;
  }

  .cards-overview-header h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
  }

  .cards-overview-subtitle {
    font-size: 0.9rem;
  }

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

  .card-grid-item {
    border-radius: 8px;
  }

  .card-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .card-grid-image {
    aspect-ratio: 3 / 4;
    padding-bottom: 8px;
  }

  .card-grid-info {
    padding: 10px;
  }

  .card-grid-title {
    font-size: 0.85rem;
    margin-bottom: 6px;
  }

  .cost-badge {
    padding: 3px 6px;
    font-size: 0.7rem;
  }

  .tutorial-nav-link {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .cards-overview-header h3 {
    font-size: 1.2rem;
  }

  .cards-overview-subtitle {
    font-size: 0.85rem;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .card-grid-title {
    font-size: 0.8rem;
  }

  .card-type-badge {
    padding: 5px 10px;
    font-size: 0.65rem;
  }

  .cost-badge {
    padding: 2px 5px;
    font-size: 0.65rem;
    gap: 2px;
  }
}

@media (min-width: 769px) {
  .cards-overview-header {
    margin-bottom: 30px;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* Card Details Responsive */
@media (max-width: 1024px) {
  .card-details-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .card-image-wrapper {
    max-width: 350px;
    margin: 0 auto;
  }

  .card-details-title {
    font-size: 1.8rem;
  }

  .card-details-description {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .card-details-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .card-navigation-counter {
    width: 100%;
    text-align: right;
  }

  .card-details-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .card-image-wrapper {
    max-width: 100%;
  }

  .card-details-title {
    font-size: 1.6rem;
  }

  .card-details-section-label {
    font-size: 0.85rem;
  }

  .card-details-description {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .card-navigation-buttons {
    gap: 10px;
  }

  .card-nav-button {
    padding: 14px 16px;
    font-size: 0.9rem;
  }

  .card-nav-button:hover {
    transform: translateX(6px);
  }

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

@media (max-width: 480px) {
  .card-details-container {
    gap: 15px;
  }

  .card-details-header {
    padding-bottom: 8px;
  }

  .card-back-link {
    font-size: 0.85rem;
    padding: 6px 10px;
  }

  .card-navigation-counter {
    font-size: 0.8rem;
  }

  .card-image-wrapper {
    max-width: 100%;
  }

  .card-details-title {
    font-size: 1.4rem;
  }

  .card-details-section-label {
    font-size: 0.75rem;
    margin-bottom: 10px;
  }

  .card-details-description {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .card-nav-button {
    padding: 12px 14px;
    font-size: 0.85rem;
    gap: 8px;
  }

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

/* Map Responsive Styles */
@media (max-width: 768px) {
  .map-container {
    gap: 20px;
    padding: 0 15px;
  }

  .map-wrapper {
    padding: 15px 0;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.1);
    padding-left: 10px;
    padding-right: 10px;
  }

  .hex:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  }

  .map-info-section {
    max-width: 100%;
    padding: 0;
  }

  .map-info-panel {
    min-height: 180px;
    border-radius: 10px;
  }

  .map-description-panel {
    border-radius: 10px;
  }

  .map-description-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
  }

  .map-description-text {
    font-size: 0.9rem;
    margin-bottom: 10px;
  }

  .play-now-btn {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .map-container {
    gap: 15px;
    padding: 0 10px;
  }

  .map-wrapper {
    padding: 10px;
    border-radius: 8px;
  }

  .hex:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  }

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

  .map-info-panel {
    min-height: 150px;
    padding: 15px;
    border-radius: 8px;
  }

  .map-info-placeholder i {
    font-size: 2rem;
    margin-bottom: 8px;
  }

  .map-info-placeholder p {
    font-size: 0.9rem;
  }

  .map-description-panel {
    border-radius: 8px;
    padding: 15px;
  }

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

  .map-description-title {
    font-size: 1rem;
    margin-bottom: 10px;
  }

  .map-description-text {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 8px;
  }

  .play-now-btn {
    padding: 11px 20px;
    font-size: 0.9rem;
    width: 100%;
    justify-content: center;
  }
}
