body {
    font-family: Arial, sans-serif;
    background-color: #121212;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 20px;
}

h1, h2 {
    color: #bb86fc;
    text-align: center;
}

.site-description {
    max-width: 650px;
    text-align: center;
    margin: 10px auto 30px auto;
    font-size: 1.1em;
    line-height: 1.6;
    color: #ccc;
}

#puzzle-info {
    text-align: center;
    background-color: #1f1f1f;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
}

#puzzle-title {
    margin: 0 0 10px 0;
    font-size: 28px;
}

#words-counter {
    font-size: 18px;
    color: #03dac6;
    font-weight: bold;
    margin-bottom: 5px;
}

#bonus-counter {
    font-size: 16px;
    color: #03dac6;
    margin-bottom: 10px;
}

#timer {
    font-size: 16px;
    color: #bb86fc;
}

#celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    box-sizing: border-box;
    padding: 20px;
}

#celebration-overlay.hidden {
    display: none;
}

.celebration-content {
    background-color: #1f1f1f;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 3px solid #03dac6;
    width: min(90vw, 600px);
    max-height: calc(100vh - 40px);
    overflow: hidden;
    animation: celebration-pulse 0.5s ease-in-out;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    font-size: min(1rem, 2.5vmin);
}

.celebration-content h2 {
    font-size: 2.5em;
    margin: 0.4em 0;
    color: #03dac6;
}

.celebration-content h3 {
    font-size: 1.4em;
    margin: 0.3em 0;
    color: #bb86fc;
}

.celebration-content p {
    font-size: 1.4em;
    margin: 0.3em 0;
}

.time-taken {
    font-size: 1.6em;
    color: #03dac6;
    font-weight: bold;
    margin: 0.5em 0;
}

#time-taken {
    color: #ffffff;
}

.celebration-section {
    margin: 0.5em 0;
    padding: 0.8em;
    background-color: #2c2c2c;
    border-radius: 8px;
    flex-shrink: 0;
}

.celebration-timer {
    margin-top: 0.5em;
    font-size: 1.2em;
}

#countdown {
    color: #bb86fc;
    font-weight: bold;
    font-size: 1.6em;
}

#celebration-bonus-count {
    color: #03dac6;
}

@keyframes celebration-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#summary-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
}

#summary-overlay.hidden {
    display: none;
}

.summary-content {
    background-color: #1f1f1f;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 3px solid #bb86fc;
    width: min(90vw, 700px);
    max-height: calc(100vh - 40px);
    overflow: hidden;
    animation: celebration-pulse 0.5s ease-in-out;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    font-size: min(1rem, 2.2vmin);
}

.summary-content h2 {
    font-size: 2.2em;
    margin: 0.4em 0;
    color: #bb86fc;
}

.summary-content h3 {
    font-size: 1.4em;
    margin: 0.3em 0;
    color: #03dac6;
}

.summary-stats {
    font-size: 1.3em;
    margin: 0.5em 0;
}

.summary-stats p {
    margin: 0.2em 0;
}

.summary-section {
    margin: 0.4em 0;
    padding: 0.6em;
    background-color: #2c2c2c;
    border-radius: 8px;
    flex-shrink: 0;
    overflow: hidden;
}

.word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    justify-content: center;
    margin-top: 0.3em;
    max-height: 25vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.2em;
}

.word-list span {
    background-color: #333;
    padding: 0.3em 0.6em;
    border-radius: 5px;
    font-size: 0.9em;
}

.word-list span.missed {
    background-color: #ff6b6b;
    color: #000;
}

.word-list span.found {
    background-color: #03dac6;
    color: #000;
}

.word-list span.bonus {
    background-color: #bb86fc;
    color: #000;
}

.summary-timer {
    font-size: 1.2em;
    margin-top: 0.5em;
    color: #03dac6;
}

#summary-countdown {
    color: #bb86fc;
    font-weight: bold;
    font-size: 1.4em;
}

#game-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    width: 100%;
    justify-content: center;
    margin-top: 20px;
}

#grid-and-input {
    display: flex;
    flex-direction: column;
}

#grid-container {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
    border: 3px solid #bb86fc;
    padding: 10px;
    background-color: #1f1f1f;
    border-radius: 5px;
    max-width: 100vw;
    box-sizing: border-box;
}

.grid-tile {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    font-weight: bold;
    background-color: #333333;
    border-radius: 3px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.highlighted {
    background-color: #03dac6;
    color: #000000;
    animation: flash-blue 0.6s ease-in-out;
}

.highlighted-other {
    background-color: #ff6b6b;
    color: #ffffff;
    animation: flash-red 0.6s ease-in-out;
}

.highlighted-custom {
    animation: flash-custom 0.6s ease-in-out;
}

@keyframes flash-blue {
    0% { 
        transform: scale(1);
        background-color: #333333;
    }
    50% { 
        transform: scale(1.2);
        background-color: #03dac6;
        box-shadow: 0 0 10px #03dac6;
    }
    100% { 
        transform: scale(1);
        background-color: #03dac6;
    }
}

@keyframes flash-custom {
    0% { 
        transform: scale(1);
    }
    50% { 
        transform: scale(1.2);
        box-shadow: 0 0 10px currentColor;
    }
    100% { 
        transform: scale(1);
    }
}

@keyframes flash-red {
    0% { 
        transform: scale(1);
        background-color: #333333;
    }
    50% { 
        transform: scale(1.2);
        background-color: #ff6b6b;
        box-shadow: 0 0 10px #ff6b6b;
    }
    100% { 
        transform: scale(1);
        background-color: #ff6b6b;
    }
}

/* Emoji Grid Styles */
.emoji-section {
    margin-top: 15px;
    text-align: center;
}

.emoji-grid {
    font-family: monospace;
    font-size: 12px;
    line-height: 1.1;
    margin: 10px auto 15px auto;
    padding: 10px;
    background: transparent;
    border-radius: 8px;
    display: block;
    white-space: pre;
    overflow-x: auto;
}

.copy-emoji-btn {
    margin-top: 10px;
    padding: 8px 20px;
    background: #03dac6;
    color: #121212;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.copy-emoji-btn:hover {
    background: #02c4af;
    transform: translateY(-2px);
}

.copy-emoji-btn:active {
    transform: translateY(0);
}

.copy-emoji-btn.copied {
    background: #4caf50;
}

.copy-emoji-btn.copied::after {
    content: " ✓";
}

/* Tablet responsive styles */
@media (max-width: 1024px) {
    #game-container {
        gap: 20px;
        margin-top: 15px;
        padding: 0 10px;
    }
    
    .grid-tile {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    #grid-container {
        padding: 8px;
        gap: 4px;
    }
}

/* Ensure overlays fit on very small screens */
@media (max-height: 600px) {
    .celebration-content,
    .summary-content {
        font-size: min(0.8rem, 2vmin);
    }
    
    .word-list {
        max-height: 15vh;
    }
    
    .celebration-section,
    .summary-section {
        margin: 0.2em 0;
        padding: 0.4em;
    }
}

@media (max-height: 400px) {
    .celebration-content,
    .summary-content {
        font-size: min(0.65rem, 1.8vmin);
        padding: 10px;
    }
    
    .word-list {
        display: none;
    }
    
    .celebration-section h3,
    .summary-section h3 {
        margin: 0.1em 0;
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    #game-container {
        gap: 15px;
        margin-top: 10px;
        padding: 0 5px;
        flex-direction: column;
        align-items: center;
    }
    
    #grid-container {
        padding: 6px;
        gap: 3px;
        border: 2px solid #bb86fc;
        margin: 0 auto;
        max-width: calc(100vw - 20px);
    }
    
    .grid-tile {
        width: calc((100vw - 60px) / 10);
        height: calc((100vw - 60px) / 10);
        max-width: 32px;
        max-height: 32px;
        min-width: 24px;
        min-height: 24px;
        font-size: 16px;
    }
    
    #grid-and-input {
        order: -1;
        width: 100%;
        max-width: calc(100vw - 20px);
    }
    
    #word-lists-container {
        flex-direction: column;
        width: 100%;
        max-width: 450px;
        min-width: unset;
    }
    
    .word-column ul {
        height: 200px;
    }
    
    .celebration-content, .summary-content {
        padding: 15px;
        margin: 0;
        max-width: calc(100vw - 20px);
        width: 100%;
        box-sizing: border-box;
    }
    
    .celebration-content h2 {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .summary-content h2 {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .celebration-content h3, .summary-content h3 {
        font-size: 16px;
        margin: 8px 0;
    }
    
    .celebration-content p, .summary-content p {
        font-size: 16px;
        margin: 8px 0;
    }
    
    .time-taken {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .summary-stats {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .emoji-grid {
        font-size: 10px;
        padding: 8px;
        margin: 8px auto 12px auto;
    }
    
    .copy-emoji-btn {
        padding: 6px 16px;
        font-size: 12px;
    }
    
    .word-list span {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .celebration-section, .summary-section {
        margin: 15px 0;
        padding: 12px;
    }
}

/* Very small mobile screens */
@media (max-width: 480px) {
    #game-container {
        padding: 0 2px;
        gap: 10px;
    }
    
    #grid-container {
        padding: 4px;
        gap: 2px;
        max-width: calc(100vw - 10px);
    }
    
    .grid-tile {
        width: calc((100vw - 40px) / 10);
        height: calc((100vw - 40px) / 10);
        max-width: 28px;
        max-height: 28px;
        min-width: 20px;
        min-height: 20px;
        font-size: 14px;
    }
    
    #grid-and-input {
        max-width: calc(100vw - 10px);
    }
    
    #word-input {
        font-size: 14px;
        padding: 8px;
    }
}

#word-input {
    width: 100%;
    box-sizing: border-box;
    margin-top: 15px;
    padding: 15px;
    font-size: 18px;
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 5px;
    color: white;
}

#word-lists-container {
    display: flex;
    gap: 20px;
    min-width: 500px;
}

.word-column {
    background-color: #1f1f1f;
    padding: 10px 20px;
    border-radius: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.word-column h2 {
    margin-top: 5px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    white-space: nowrap;
}

.word-column ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    height: 350px;
    overflow-y: auto;
}

.word-column li {
    background-color: #333;
    margin-bottom: 5px;
    padding: 8px;
    border-radius: 3px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.player-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #555;
    flex-shrink: 0;
}

/* --- Custom Scrollbar Styling --- */
.word-column ul {
  scrollbar-width: thin;
  scrollbar-color: #bb86fc #2c2c2c;
}

.word-column ul::-webkit-scrollbar {
  width: 8px;
}

.word-column ul::-webkit-scrollbar-track {
  background: #2c2c2c;
  border-radius: 10px;
}

.word-column ul::-webkit-scrollbar-thumb {
  background-color: #bb86fc;
  border-radius: 10px;
  border: 2px solid #2c2c2c;
}

.word-column ul::-webkit-scrollbar-thumb:hover {
  background-color: #a362ea;
}

/* --- Responsive Design --- */
@media (max-width: 950px) {
    body {
        padding: 10px;
    }

    #game-container {
        flex-direction: column;
        align-items: center;
    }

    #word-lists-container {
        flex-direction: column;
        width: 100%;
        max-width: 450px;
        min-width: unset;
    }

    .grid-tile {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    #grid-and-input {
        order: -1; /* Move grid to the top on mobile */
    }

    .word-column ul {
        height: 200px; /* Reduce height on smaller screens */
    }
}