/** {*/
/*    border: 1px solid black*/
/*}*/

body {
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    background-color: lightblue;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

#title {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    gap: 15px;
}

.title-icon {
    width: 50px;
    height: 50px;
    transform: rotate(-15deg);
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.3));
    animation: float 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.title-icon:hover {
    transform: rotate(0deg) scale(1.1);
}

@keyframes float {
    0%, 100% {
        transform: rotate(-15deg) translateY(0);
    }
    50% {
        transform: rotate(-12deg) translateY(-10px);
    }
}

.big-background-icon {
    position: fixed;
    bottom: -50px;
    right: -50px;
    width: 250px;
    height: 250px;
    opacity: 0.15;
    transform: rotate(-25deg);
    z-index: -1;
    filter: grayscale(0.5);
    pointer-events: none;
    animation: float-big 10s ease-in-out infinite;
}

@keyframes float-big {
    0%, 100% {
        transform: rotate(-25deg) translate(0, 0);
    }
    50% {
        transform: rotate(-20deg) translate(-20px, -20px);
    }
}

#instructions-btn {
    position: absolute;
    left: 0;
    font-size: 1.5rem;
    text-decoration: none;
    color: transparent;
    text-shadow: 0 0 0 #000;
    background: white;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid lightgray;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    line-height: 1;
    cursor: pointer;
}

#instructions-btn:active, 
#instructions-btn:visited {
    color: transparent;
    text-decoration: none;
}

#instructions-btn:hover {
    transform: scale(1.1);
}

/* Page Transition Styles */
body {
    transition: opacity 0.5s ease-in-out;
}

body.fade-in {
    opacity: 1;
}

body.fade-out {
    opacity: 0;
}

#character-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px auto 20px;
    width: 90vw;
    max-width: 500px;
    background-color: white;
    border: 1px solid lightgray;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding-bottom: 20px;
}

#character-image {
    padding: 10px;
    width: 100px;
    height: 100px;
    margin: 20px auto 5px;
    object-fit: cover;
    border-radius: 50%;
}

#clue-indicators {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    margin-bottom: 5px;
    padding: 0 10px;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    #clue-indicators {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
        padding: 5px 10px;
    }
    .clue-dot {
        width: 55px;
        height: 55px;
        font-size: 0.65rem;
    }
}

.clue-dot {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: #ddd;
    border: 1px solid #ccc;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: bold;
    color: black;
    overflow: hidden;
    text-align: center;
    padding: 2px;
    box-sizing: border-box;
}

.clue-dot p {
    margin: 0;
    line-height: 1.1;
    word-break: normal;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.clue-dot img.emoji {
    width: 2em;
    height: 2em;
}

.clue-dot.correct {
    background-color: #66e722;
    border-color: #55c61c;
}

#guess-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
}

#guess-container input {
    margin: 10px;
    padding: 10px;
    width: 85%;
    height: 40px;
    border-radius: 5px;
    border: 1px solid lightgray;
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
}

#view-all-btn {
    margin-bottom: 15px;
    padding: 8px 16px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s, transform 0.1s;
}

#view-all-btn:hover {
    background-color: #555;
    transform: scale(1.02);
}

#result-message {
    display: none;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    text-align: center;
    width: 100%;
}

#result-status {
    margin: 5px 0 5px;
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
}

#result-character {
    margin: 5px 0 15px;
}

#result-character-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

#result-guess-count {
    font-size: 1rem;
    color: #555;
    margin: 5px 0 0;
}

#result-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: center;
    margin-bottom: 15px;
}

#play-btn,
#play-again-btn {
    padding: 12px 24px;
    background-color: #66e722;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    transition: background 0.2s, transform 0.1s;
    width: 80%;
}

#play-btn:hover,
#play-again-btn:hover {
    background-color: #55c61a;
    transform: scale(1.02);
}

#view-all-btn-end {
    padding: 8px 16px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s, transform 0.1s;
    width: fit-content;
}

#view-all-btn-end:hover {
    background-color: #555;
    transform: scale(1.02);
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    line-height: 1.2;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close-btn:hover {
    color: #333;
}

#all-characters-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.character-list-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px 10px 10px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

#search-results {
    position: absolute;
    top: calc(100% - 9px);
    background-color: white;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    max-height: 250px;
    overflow-y: auto;
    z-index: 20;
    box-sizing: border-box;
    border: 1px solid lightgray;
    border-top: none;
    display: none;
    left: 10%;
    right: 10%;
}
.result-item {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    color: #333;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.1s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item .flag {
    font-size: 1rem;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover, .result-item.active {
    background-color: #f0f0f0;
}

.guess {
    width: 90vw;
    max-width: 500px;
    margin: 20px auto;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid lightgray;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding: 20px;
    box-sizing: border-box;
}

.guess h1 {
    margin: 0;
}

.guess-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 10px auto;
    border: 2px solid lightgray;
}

#clues-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-items: center;
    gap: 10px;
    width: fit-content;
    margin: 20px auto 0;
}

.clue-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.clue-wrapper:hover .clue-label {
    opacity: 1;
}

#guesses-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.clue {
    background-color: white;
    width: 75px;
    height: 75px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.75rem;
    font-weight: bold;
    border: 1px solid lightgray;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    overflow: hidden;
    padding: 3px;
    box-sizing: border-box;
    transition: transform 0.2s;
}

.clue:hover {
    transform: scale(1.05);
}

@media (min-width: 600px) {
    .clue {
        width: 90px;
        height: 90px;
        font-size: 0.9rem;
    }
}

.clue p.emoji {
    font-size: 1.5rem;
}

.clue p.emoji img.emoji {
    height: 1.25em;
    width: 1.25em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
}

@media (min-width: 600px) {
    .clue p.emoji {
        font-size: 2.25rem;
    }
    .clue p.emoji img.emoji {
        height: 1.25em;
        width: 1.25em;
    }
}

.flag img.emoji {
    height: 1em;
    width: 1em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
}

.clue-label {
    margin-top: 5px;
    font-size: 0.5rem;
    font-weight: bold;
    color: #333;
    text-transform: uppercase;
    opacity: 0.6;
    transition: opacity 0.2s;
}

@media (min-width: 600px) {
    .clue-label {
        margin-top: 10px;
        font-size: 0.75rem;
    }
}

.clue p {
    margin: 0;
    overflow-wrap: normal;
    word-break: normal;
}

/* Welcome Page Styles */
.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px auto;
    width: 90vw;
    max-width: 600px;
    background-color: white;
    border: 1px solid lightgray;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding: 30px;
    box-sizing: border-box;
}

.welcome-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid lightblue;
    padding-bottom: 5px;
    width: 100%;
    text-align: center;
}

.instructions {
    margin-bottom: 30px;
    line-height: 1.6;
    color: #444;
}

.instructions p {
    margin-bottom: 15px;
}

.example-section {
    width: 100%;
    margin-bottom: 30px;
}

.example-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.example-text {
    flex: 1;
    font-size: 0.9rem;
    color: #555;
}

.example-text strong {
    color: #333;
}

#login-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}