.container {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(600px, 3fr) minmax(200px, 1fr);
    gap: 2rem;
    padding: 2rem;
    max-width: 1600px;
    margin: 1rem auto 0;
}

.side-column {
    background-color: rgba(243, 244, 246, 0.4);
    border-radius: 1rem;
    padding: 1rem;
    min-height: 400px;
}

.ad-space {
    text-align: center;
}

.ad-placeholder {
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 0.5rem;
}

.ad-placeholder p {
    margin-bottom: 1rem;
    color: #6b7280;
}

.ad-placeholder img {
    max-width: 100%;
    height: auto;
}

.game-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.game-container {
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-header {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stats-card {
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.stats-card.dark {
    background-color: #1f2937;
    color: white;
}

.stats-card.dark i {
    color: #60a5fa;
}

.image-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 2rem;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.image-wrapper {
    width: 100%;
    padding-top: 70.31%; /* Increased from 56.25% to make container 25% taller while maintaining responsive behavior */
    position: relative;
    background-color: rgba(243, 244, 246, 0.4);
}

.image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.word-pool {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Exactly 5 columns */
    gap: 1rem;
    margin: 2rem 0;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.word-item {
    padding: 0.75rem 1rem;
    background-color: rgba(255, 255, 255, 0.8);
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    text-align: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.word-item:hover {
    border-color: #4f46e5;
    transform: translateY(-2px);
}

.word-item.guessed {
    cursor: not-allowed;
}

.word-item.inactive {
    opacity: 0.6;
    cursor: pointer;
}

.word-item.inactive:hover {
    border-color: #4f46e5;
    opacity: 0.8;
}

.word-item.correct {
    background-color: #d1fae5;
    border-color: #059669;
    color: #065f46;
}

.word-item.incorrect {
    background-color: #fee2e2;
    border-color: #dc2626;
    color: #991b1b;
}

.word-pool-container {
    position: relative;
    margin: 2rem 0;
}

.word-pool-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    cursor: pointer;
    border-radius: 0.5rem;
}

.word-pool-overlay p {
    background-color: rgba(79, 70, 229, 0.9);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: bold;
}

.guessed-words {
    margin-top: 2rem;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.guessed-words h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1f2937;
    margin-bottom: 1rem;
}

.guessed-words i {
    color: #059669;
}

.guessed-words ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.guessed-words li {
    padding: 0.5rem 1rem;
    background-color: #d1fae5;
    border-radius: 0.25rem;
    color: #065f46;
}

.completion-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    z-index: 1000;
    max-width: 400px;
    width: 85%;
}

.completion-message h2 {
    color: #4f46e5;
    margin-bottom: 1rem;
}

.completion-message .support-message {
    margin: 1rem 0;
    padding: 0.75rem;
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    border-radius: 0.5rem;
    border: 2px solid #ff4757;
    cursor: pointer;
    transition: all 0.3s ease;
}

.completion-message .support-message:hover {
    background: linear-gradient(135deg, #ff5252, #ff7979);
    border-color: #ff3742;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
}

.completion-message .support-message p {
    margin: 0;
    color: white;
    font-weight: 600;
}

.completion-message .support-link {
    color: #ffe066 !important;
    text-decoration: none;
    font-weight: 700;
}

.completion-message .support-link:hover {
    color: #fff !important;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.completion-message .dismiss-text {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #6b7280;
    font-style: italic;
}

.daily-progress {
    margin-top: 2rem;
    text-align: center;
    color: #6b7280;
}

.daily-progress i {
    color: #4f46e5;
}

.error {
    color: #dc2626;
    text-align: center;
    padding: 1rem;
    background-color: #fee2e2;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    /* Center the content for mobile users */
    .container {
        grid-template-columns: 1fr;
        max-width: 100%;
        padding: 0;
    }
    
    /* Hide ad columns completely */
    .side-column {
        display: none;
    }
    
    /* Make game content take up full width */
    .game-content {
        width: 100%;
        max-width: 100%;
        padding: 10px;
        margin: 0 auto;
    }
    
    /* Force stats cards to stay in a single row */
    .game-header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 5px;
        margin-bottom: 15px;
    }
    
    .stats-card {
        flex: 1;
        min-width: 0;
        font-size: 0.9rem;
        padding: 12px 5px;
        text-align: center;
    }
    
    .stats-card p {
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Improve word pool for mobile */
    .word-pool {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        padding: 10px 5px;
    }
    
    .word-item {
        font-size: 0.9rem;
        padding: 8px 5px;
        margin: 0;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Make the image container better fit mobile */
    .image-container {
        padding: 10px 0;
    }
    
    .image-wrapper {
        padding-bottom: 100%; /* Make it square */
    }
}

@media (max-width: 1024px) {
    /* Essential fixes for mobile */
    .game-container {
        padding: 5px !important;
        margin-top: 25px !important; /* Move down to accommodate nav bar */
    }
    
    /* Add buffer between game-content and game-container */
    .game-content {
        margin-top: 5px !important;
    }
    
    /* Create a proper square container for the image */
    .image-container {
        margin: 5px auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Make image wrapper maintain square aspect ratio */
    .image-wrapper {
        width: 100% !important;
        padding-top: 0 !important;
        padding: 5px !important;
        position: relative !important;
        aspect-ratio: 1/1 !important; /* Force square aspect ratio */
        height: auto !important;
    }
    
    /* Make the image fit properly in square container */
    .image-wrapper img {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        display: block !important;
    }
    
    /* Word pool with 4 columns and centered last row */
    .word-pool {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important; /* 4 columns */
        gap: 5px !important;
        margin: 5px 0 !important;
        padding: 5px 0 !important; /* 5px padding only on top and bottom */
    }
    
    /* Style to center the last 2 words */
    .word-pool > :nth-last-child(1),
    .word-pool > :nth-last-child(2) {
        grid-column: 2 / span 1 !important; /* 2nd column position */
    }
    
    .word-pool > :nth-last-child(1) {
        grid-column: 3 / span 1 !important; /* 3rd column position */
    }
    
    .word-item {
        font-size: 0.8rem !important;
        padding: 5px 3px !important;
        margin: 0 !important; 
    }
    
    /* Critical fix for stats cards */
    .game-header {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        margin-bottom: 5px !important;
    }
    
    .stats-card {
        padding: 5px 3px !important;
    }
}

@media (max-width: 600px) {
    .stats-card {
        font-size: 0.8rem;
        padding: 10px 3px;
    }
    
    .stats-card i {
        margin-right: 3px;
    }
    
    /* Adjust to 4 columns for very small screens */
    .word-pool {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .word-item {
        font-size: 0.85rem;
        padding: 7px 4px;
    }
}

/* For extremely narrow screens */
@media (max-width: 360px) {
    /* Switch to 3 columns */
    .word-pool {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Update nav width to span full screen width minus 2px */
.main-nav {
    width: calc(100% - 4px); /* 2px buffer on each side */
    margin: 0 auto; /* Center the navbar */
    padding: 0 20px; /* Keep content aligned with container */
    box-sizing: border-box;
    border-radius: var(--radius-lg); /* Restore rounded corners */
    left: 50%; /* Position center */
    transform: translateX(-50%); /* Center the navbar */
}

/* Spinkit Cube Grid Loader */
.sk-cube-grid {
  width: 40px;
  height: 40px;
  margin: 100px auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
}

.sk-cube-grid .sk-cube {
  width: 33%;
  height: 33%;
  background-color: #333;
  float: left;
  -webkit-animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out;
          animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out; 
}
.sk-cube-grid .sk-cube1 {
  -webkit-animation-delay: 0.2s;
          animation-delay: 0.2s; }
.sk-cube-grid .sk-cube2 {
  -webkit-animation-delay: 0.3s;
          animation-delay: 0.3s; }
.sk-cube-grid .sk-cube3 {
  -webkit-animation-delay: 0.4s;
          animation-delay: 0.4s; }
.sk-cube-grid .sk-cube4 {
  -webkit-animation-delay: 0.1s;
          animation-delay: 0.1s; }
.sk-cube-grid .sk-cube5 {
  -webkit-animation-delay: 0.2s;
          animation-delay: 0.2s; }
.sk-cube-grid .sk-cube6 {
  -webkit-animation-delay: 0.3s;
          animation-delay: 0.3s; }
.sk-cube-grid .sk-cube7 {
  -webkit-animation-delay: 0s;
          animation-delay: 0s; }
.sk-cube-grid .sk-cube8 {
  -webkit-animation-delay: 0.1s;
          animation-delay: 0.1s; }
.sk-cube-grid .sk-cube9 {
  -webkit-animation-delay: 0.2s;
          animation-delay: 0.2s; }

@-webkit-keyframes sk-cubeGridScaleDelay {
  0%, 70%, 100% {
    -webkit-transform: scale3D(1, 1, 1);
            transform: scale3D(1, 1, 1);
  } 35% {
    -webkit-transform: scale3D(0, 0, 1);
            transform: scale3D(0, 0, 1); 
  }
}

@keyframes sk-cubeGridScaleDelay {
  0%, 70%, 100% {
    -webkit-transform: scale3D(1, 1, 1);
            transform: scale3D(1, 1, 1);
  } 35% {
    -webkit-transform: scale3D(0, 0, 1);
            transform: scale3D(0, 0, 1);
  } 
}

/* Hide spinner when not needed */
.image-wrapper img.loaded + .sk-cube-grid {
  display: none;
}

/* Add specific mobile adjustments for the completion message */
@media (max-width: 768px) {
    .completion-message {
        width: 85%;
        padding: 1rem;
    }
    
    .completion-message h2 {
        margin-bottom: 0.5rem;
        font-size: 1.5rem;
    }
    
    .completion-message p {
        margin: 0.5rem 0;
        font-size: 0.9rem;
    }
} 