/*Main Page Foundation*/
body.game-page{
    min-height:100vh;
}

.game-page .hero {
    background:
        linear-gradient(
            135deg,
            var(--surface-color),
            var(--secondary-background)
        );
    border:
        1px solid var(--border-color);
    overflow:hidden;
}

/*Main Game Container*/
.game-container {
    width: 100%;
    padding: 0 20px 60px;
}

.species-badge {
    display:inline-flex;
    align-items:center;
    margin-top:24px;
    padding:
        10px 22px;
    border-radius:999px;
    background:
        linear-gradient(
            135deg,
            var(--secondary-background),
            var(--footer-background)
        );
    color:var(--primary-hover);
    font-weight:700;
    box-shadow:
        0 4px 12px var(--primary-shadow);
}

.game-layout{
    max-width:1200px;
    margin:30px auto;
    display:grid;
    grid-template-columns:
        minmax(0,1fr)
        420px;
    gap:30px;
    align-items:start;
}

.left-column,
.right-column {
    display: flex;
    flex-direction: column;
}

/*PROGRESS*/
    /*Progress Card*/
.progress-card{
    margin-top:20px;
    padding:24px;
    border-radius:20px;
}

.progress-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:16px;
}

.progress-label {
    margin:0;
    font-size:0.85rem;
    font-weight:700;
    letter-spacing:1.2px;
    color:var(--muted-text);
}

.progress-count {
    margin:0;
    font-weight:700;
    color:var(--primary-hover);
}

    /* Progress bar */
.progress-track {
    width:100%;
    height:10px;
    background:var(--secondary-background);
    border-radius:999px;
    overflow:hidden;
}

.progress-fill {
    height:100%;
    background:
        linear-gradient(
            90deg,
            var(--chart-gradient-start),
            var(--chart-gradient-end)
        );
    border-radius:999px;
    transition:
        width .4s ease;
}

/*FINDINGS+HINTS*/
    /*Header*/
.clues{
    padding:32px;
}

    /*Individual Hints*/
.clue-list {
    display:flex;
    flex-direction:column;
    gap:16px;
}

.clue-card {
    background:var(--secondary-background);
    border:1px solid var(--border-color);
    border-radius:18px;
    padding:20px;
    transition:
        transform .2s ease,
        box-shadow .2s ease;
     animation:
        clueReveal .35s ease both;
}

.clue-number {
    font-size:.85rem;
    font-weight:700;
    color:var(--primary-hover);
    margin-bottom:10px;
}

.clue-text {
    font-size:1.05rem;
    color:var(--text-color);
    line-height:1.6;
}

/*GUESSES*/
    /*Panel*/
.guess-panel {
    width:100%;
    margin:0;
}

.guess-subtitle {
    margin-top:8px;
    color:var(--muted-text);
}

    /*Form*/
.guess-form {
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:20px;
    margin-top:28px;
}

    /*Autocomplete*/
.autocomplete-wrapper {
    position:relative;
    width:100%;
}

    /*Input*/
.guess-input {
    width:100%;
    padding:18px 20px;
    font-size:18px;
    border-radius:16px;
    border:2px solid var(--border-color);
    outline:none;
    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.guess-input:focus {
    border-color:var(--primary-color);
    box-shadow:
        0 0 0 4px var(--primary-shadow);
}

.guess-input:disabled {
    background:var(--secondary-background);
    cursor:not-allowed;
}

    /*Button*/
.guess-button {
    width:200px;
    padding:14px 24px;
    border:none;
    border-radius:999px;
    background:var(--primary-color);
    color:var(--white);
    font-size:16px;
    font-weight:700;
    cursor:pointer;
    transition:
        background .2s ease,
        transform .15s ease;
}

.guess-button:disabled {
    opacity:.5;
    cursor:not-allowed;
    transform:none;
}

    /*Suggestions*/
.suggestions {
    position:absolute;
    top:calc(100% + 8px);
    left:0;
    right:0;
    background:var(--surface-color);
    border-radius:14px;
    border:1px solid var(--border-color);
    overflow:hidden;
    max-height:40vh;
    overflow-y:auto;
    box-shadow:
        0 12px 30px rgba(0,0,0,.12);
    z-index:1000;
}

.suggestion-item {
    padding:18px;
    min-height:52px;
    display:flex;
    align-items:center;
    cursor:pointer;
    transition:background .15s ease;
}

.suggestion-item:hover {
    background:var(--calendar-hover-background);
}

.suggestion-item.already-guessed {
    color:var(--muted-text);
    background:var(--secondary-background);
    cursor: not-allowed;
}

.suggestion-item.already-guessed:hover {
    background:var(--secondary-background);
}

/*GUESS HISTORY*/
.guess-history {
    width:100%;
    padding:32px;
}

    /*Empty Guess State*/
.empty-guesses {
    padding:20px;
    text-align:center;
    color:var(--muted-text);
    background:var(--secondary-background);
    border:1px dashed var(--border-color);
    border-radius:16px;
    font-style:italic;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.empty-guesses.fade-out {
    opacity:0;
}

.guess-list {
    display:flex;
    flex-direction:column;
    gap:12px;
}

.guess-card {
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:16px 20px;
    border-radius:16px;
    font-weight:600;
    transition:
        transform .2s ease;
}

    /*Wrong Guess*/
.guess-card.incorrect {
    background:var(--danger-background);
    border:1px solid var(--danger-border);
    color:var(--danger-text);
}

/*Correct Guess*/
.guess-card.correct {
    background:var(--success-background);
    border:1px solid var(--success-border);
    color:var(--success-text);
}

.guess-status {
    font-weight:800;
}

.attempt-number {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:26px;
    height:26px;
    margin-right:10px;
    border-radius:50%;
    background:var(--secondary-background);
    color:var(--primary-hover);
    font-size:.85rem;
}

/*RESULTS*/
.results {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 850px;
    margin: 30px auto;
    overflow: hidden;
    box-shadow:0 15px 35px var(--shadow-color);
}

.results .result-section {
    max-width:900px;
    margin-left:auto;
    margin-right:auto;
}

.result-header {
    text-align:center;
    padding:40px 24px;
    background:
        linear-gradient(
            135deg,
            var(--secondary-background),
            var(--surface-color)
        );
}

.result-icon {
    font-size:42px;
    margin-bottom:10px;
}

.result-label {
    margin:0;
    font-size:.85rem;
    font-weight:800;
    letter-spacing:1.5px;
    color:var(--primary-hover);
}

.result-header h2 {
    margin-top:10px;
    font-size:32px;
    color:var(--text-color);
}

.final-answer {
    display:inline-block;
    margin-top:20px;
    padding:12px 28px;
    border-radius:999px;
    background:var(--primary-color);
    color:var(--white);
    font-size:22px;
    font-weight:800;
    word-break: break-word;
    text-align: center;
    max-width:100%;
    }

.result-section {
    padding:28px 32px;
    border-top:1px solid var(--border-color);
}

.result-section h3 {
    margin-bottom:10px;
    color:var(--text-color);
}

.result-section p {
    color:var(--muted-text);
    line-height:1.7;
}

.game-message {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow:
        0 8px 20px var(--shadow-color);
}

.incorrect-message {
    background:var(--danger-background);
    color:var(--danger-text);
    border:1px solid var(--danger-border);
}

.correct-message {
    background:var(--success-background);
    color:var(--success-text);
    border:1px solid var(--success-border);
}

.message-icon {
    font-size: 1.5rem;
}

.message-text {
    flex: 1;
}

.game-message.show {
    animation:
        messagePop
        0.35s ease-out;
}

.result-modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity .3s ease,
        visibility .3s ease;
}

.result-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background:
        rgba(0,0,0,0.45);
}

.modal-card {
    position: relative;
    z-index: 2;
    width:min(
        92%,
        460px
    );
    max-height: 85vh;
    overflow-y: auto;
    background:var(--surface-color);
    border-radius: 24px;
    padding: 28px 32px;
    text-align: center;
    box-shadow:
        0 20px 60px var(--shadow-color);
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    transition:
        transform 0.35s cubic-bezier(0.2,1,0.2,1),
        opacity 0.35s;
}

.result-modal.active .modal-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.star-rating {
    display:flex;
    justify-content:center;
    gap:8px;
    margin:15px 0;
}

/* FEEDBACK */
.feedback-container {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.feedback-container h3 {
    margin: 0 0 8px;
    color: var(--text-color);
    font-size: 1.05rem;
}

.feedback-comment-box p {
    margin: 0 0 10px;
    color: var(--muted-text);
    font-size: .9rem;
}

.feedback-comment {
    display: block;
    width: 100%;
    min-height: 100px;
    padding: 14px 16px;
    box-sizing: border-box;

    resize: vertical;

    font-family: inherit;
    font-size: .95rem;
    line-height: 1.5;
    color: var(--text-color);

    background: var(--secondary-background);
    border: 1px solid var(--border-color);
    border-radius: 14px;

    outline: none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.feedback-comment::placeholder {
    color: var(--muted-text);
    opacity: .8;
}

.feedback-comment:focus {
    border-color: var(--primary-color);
    background: var(--surface-color);
    box-shadow:
        0 0 0 4px var(--primary-shadow);
}

.feedback-actions {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.feedback-submit {
    border: none;
    border-radius: 999px;
    padding: 11px 20px;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform:
            scale(.85)
            translateY(20px);
    }
    to {
        opacity: 1;
        transform:
            scale(1)
            translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    border: none;
    background: none;
    font-size: 28px;
    cursor: pointer;
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 8px;
    animation: iconBounce .8s ease;
}

.modal-label {
    color:var(--muted-text);
    margin-bottom: 8px;
}

.modal-performance {
    margin: 12px 0 20px;
    font-size: 1.2rem;
    font-weight: 700;
    color:var(--primary-color);
}

.modal-answer {
    font-size: 1.6rem;
    font-weight: 800;
    color:var(--success-text);
    margin-bottom: 16px;
    animation: answerPop .55s ease;
    word-break: break-word;
    text-align: center;
    max-width:100%;
    }

.modal-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.star-rating button {
    font-size: 2rem;
    color:var(--muted-text);
    background: none;
    border: none;
    cursor: pointer;
    transition: color .2s;
}

.star-rating button.selected {
    color:var(--star-color);
}

@media (min-width:901px) {
    .modal-card {
        max-height:80vh;
        padding:24px 28px;
    }
}

.stat-box {
    flex: 1;
    padding: 14px;
    background:var(--secondary-background);
    border-radius: 12px;
}

.stat-box span {
    display: block;
    font-size: .8rem;
    color:var(--muted-text);
}

.stat-box strong {
    font-size: 1.2rem;
}

.share-button {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 999px;
    background: var(--primary-color);
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow:
        0 6px 16px var(--primary-shadow);
    transition:
        background .2s ease,
        transform .15s ease,
        box-shadow .2s ease;
    margin-top: 20px;
}

.share-button:active {
    transform: scale(.97);
}

.share-button:active {
    transform: scale(.97);
}

@keyframes messagePop {
    from {
        opacity: 0;
        transform:
            translateY(-10px)
            scale(0.95);
    }
    to {
        opacity: 1;
        transform:
            translateY(0)
            scale(1);
    }
}

/*MOBILE RESPONSIVENESS*/
@media (max-width: 1000px) {
    .autocomplete-wrapper {
        position:relative;
        width:100%;
    }

    .left-column,
    .right-column {
        width: 100%;
    }
    .game-page {
        padding:
            env(safe-area-inset-top)
            calc(12px + env(safe-area-inset-right))
            calc(40px + env(safe-area-inset-bottom))
            calc(12px + env(safe-area-inset-left));
    }

    .page-section {
        margin-top: 12px;
        margin-bottom: 12px;
    }

    /*Header*/
    .site-header {
        padding:16px;
        flex-direction:column;
        gap:15px;
    }

    .site-title {
        font-size:22px;
    }

    .site-nav {
        width:100%;
        justify-content:center;
    }

    .site-nav .btn {
        flex:1;
    }

    .game-layout {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .progress-card {
        margin-top: 12px;
        padding: 16px;
    }

    .left-column,
    .right-column {
        display: contents;
    }

    .clues {
        order: 1;
    }

    .guess-panel {
        order: 2;
    }

    .guess-history {
        order: 3;
    }

    /*Cards*/
    .hero,
    .progress-card,
    .clues,
    .guess-panel,
    .guess-history,
    .results {
        border-radius: 18px;
        padding: 18px 16px;
    }

    .guess-card {
        flex-wrap: wrap;
        gap: 8px;
    }

    .guess-panel {
        border: 2px solid var(--primary-color);
        box-shadow: 0 8px 24px var(--primary-shadow);
    }

    .clue-text {
        font-size: 0.98rem;
        line-height: 1.5;
    }
    /*Hero*/
    .hero h1 {
        font-size:32px;
    }

    .hero-subtitle {
        font-size:1rem;
    }

    .hero {
        text-align:center;
    }

    .hero-content {
        padding:8px 0;
    }

    .species-badge {
        display:inline-flex;
    }

    /*Progress*/
    .progress-header {
        flex-direction:column;
        align-items:flex-start;
        gap:8px;
    }

    /*Section Titles*/
    .section-header h2 {
        font-size:22px;
    }

    /*Guess*/
    .guess-input {
        font-size: 17px;
        padding: 16px;
        min-height: 54px;
    }

    .guess-button {
        width:100%;
    }

    .guess-history .section-header {
        margin-bottom: 16px;
    }

    .guess-history .section-label {
        font-size: 0.8rem;
    }

    .guess-history .section-header h2 {
        font-size: 20px;
    }

    /*Results*/
    .final-answer {
        font-size:18px;
        padding:10px 20px;
    }

    .clue-card {
        padding: 16px;
        border-radius: 14px;
    }

    .clue-number {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }

    .clue-text {
        font-size: 0.98rem;
        line-height: 1.55;
    }

    .clue-list {
        gap: 12px;
    }

    .modal-card {
        width: calc(100% - 24px);
        padding: 24px 18px;
        max-height:90vh;
        overflow-y:auto;
    }

    .modal-answer {
        font-size: 1.3rem;
        word-break: break-word;
        text-align: center;
    }

    .modal-performance {
        font-size: 1rem;
    }

    .modal-stats {
        flex-direction: column;
    }

    .feedback-comment {
        min-height: 110px;
        font-size: 16px;
    }

    .feedback-actions {
        justify-content: stretch;
    }

    .feedback-submit {
        width: 100%;
    }
}

@keyframes clueReveal {
    from {
        opacity:0;
        transform:
            translateX(-15px);
    }
    to {
        opacity:1;
        transform:
            translateX(0);
    }
}

.guess-button:active {
    transform:
        scale(.97);
}

.animate {
    animation: slideIn 0.35s ease-out;
}


@keyframes slideIn {
    from {
        opacity: 0;
        transform:
            translateY(-15px);
    }
    to {
        opacity: 1;
        transform:
            translateY(0);
    }
}

@keyframes answerPop {
    0% {
        transform: scale(.6);
        opacity: 0;
    }
    70% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes iconBounce {
    0% {
        transform: scale(.4);
    }
    60% {
        transform: scale(1.25);
    }
    100% {
        transform: scale(1);
    }
}

@media (hover:hover) {

    .clue-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 25px rgba(0,0,0,.06);
    }

    .guess-card:hover {
        transform: translateX(4px);
    }

    .guess-button:hover {
        background:var(--primary-hover);
        transform:translateY(-2px);
    }

    .share-button:hover {
        background: var(--primary-hover);
        transform: translateY(-2px);
        box-shadow:
            0 8px 20px var(--primary-shadow);
    }
}

@media (min-width:901px) {
    .guess-panel {
        position: sticky;
        top: 24px;
    }
}