
@font-face {
    font-family: "TAN Tangkiwood";
    src: url("TAN-Tangkiwood-Font/TAN-Tangkiwood-Font/TAN-Tangkiwood-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --black: #000;
    --white: #fff;
    --green: #08ba59;
    --red: #ff0000;
    --pink-red: #ff9999;
    --hint-colour: #1b1a45;
    --panel-grey: #f4f4f4;
}

[hidden] {
    display: none !important;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--white);
    color: var(--black);
    font-family: "TAN Tangkiwood", serif;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid #079db5;
    outline-offset: 2px;
}

.site-header {
    flex: 0 0 auto;
    min-height: 145px;
    padding: 8px 28px 18px;
    border-bottom: 6px solid var(--black);
}

.site-header a {
    display: inline-block;
}

.site-logo {
    display: block;
    width: 250px;
    height: 125px;
    object-fit: contain;
    object-position: left center;
}

main {
    flex: 1 0 auto;
    width: 100%;
}

/* HOMEPAGE */

.homepage {
    min-height: 820px;
    padding: 110px 6vw 100px;
}

.mode-grid {
    width: min(1450px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 90px 7vw;
    align-items: center;
}

.mode-button {
    --button-colour: #ff0000;
    --button-image: none;
    --image-position: center;
    --image-size: cover;

    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: 100%;
    min-height: 165px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    border: 7px solid var(--black);
    border-radius: 23px;
    background: var(--button-colour);
    color: var(--white);
    text-align: left;
}

.mode-button::before {
    position: absolute;
    z-index: -2;
    inset: 0;
    content: "";
    background-image: var(--button-image);
    background-position: var(--image-position);
    background-size: var(--image-size);
    background-repeat: no-repeat;
}

.mode-button::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    background: var(--button-colour);
    opacity: .62;
}

.mode-button:disabled {
    cursor: wait;
    opacity: .75;
}

.mode-title {
    display: block;
    font-size: clamp(44px, 4.5vw, 76px);
    line-height: .98;
    text-transform: uppercase;
}

.mode-subtitle {
    display: block;
    font-size: clamp(30px, 3.2vw, 52px);
    line-height: 1.05;
}

.party-button {
    --button-colour: #ff0000;
    --button-image: url("assets/homepage/party_symbols_1950s.jpg");
    --image-position: right top;
    --image-size: auto 190%;
}

.leader-button {
    --button-colour: #079db5;
    --button-image: url("assets/homepage/nehru.png");
    --image-position: 78% 35%;
    --image-size: cover;
}

.constituency-button {
    --button-colour: #008044;
    --button-image: url("assets/homepage/south_goa_ls.png");
    --image-position: right center;
    --image-size: cover;
    grid-column: 1 / -1;
    justify-self: center;
    width: min(720px, 100%);
    min-height: 165px;
}

#loading-message {
    margin: 24px auto 0;
    text-align: center;
    font-size: 16px;
}

/* GAME SCREEN */

.game-screen {
    position: relative;
    width: min(1500px, 94%);
    min-height: 650px;
    margin: 0 auto;
    padding: 22px 0 55px;
}

.game-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 22px;
    margin-bottom: 28px;
}

.plain-button {
    padding: 8px 12px;
    border: 3px solid var(--black);
    border-radius: 0;
    background: var(--white);
    color: var(--black);
    font-size: 16px;
}

.game-mode-label {
    min-width: 0;
    margin: 0;
    font-size: clamp(34px, 5vw, 72px);
    line-height: 1.05;
    text-align: left;
    text-transform: uppercase;
}

.run-display {
    padding-top: 4px;
    font-size: clamp(21px, 2.3vw, 31px);
    white-space: nowrap;
}

#run-counter {
    color: var(--green);
}

#question-title {
    margin: 0 0 8px;
    font-size: clamp(24px, 3vw, 38px);
    text-align: center;
}

.question-context {
    margin: 0 0 25px;
    font-size: 15px;
    text-align: center;
}

.game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: clamp(24px, 4vw, 60px);
    margin-top: 25px;
}

.photo-column,
.answer-column {
    min-width: 0;
}

.photo-panel {
    width: 100%;
    height: 480px;
    padding: 8px;
    overflow: hidden;
    border: 6px solid var(--black);
    background: var(--panel-grey);
}

#politician-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: var(--panel-grey);
}

.photo-hints {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
}

.hint-button {
    min-width: 105px;
    padding: 10px 14px;
    border: 4px solid var(--black);
    border-radius: 0;
    background: #808080;
    color: var(--white);
    font-size: 14px;
    letter-spacing: 1px;
    text-align: center;
    text-transform: uppercase;
}

.hint-button:hover {
    background: #666;
}

.hint-text {
    width: fit-content;
    max-width: 100%;
    margin: -2px 0 8px;
    padding: 12px 14px;
    border: 4px solid var(--black);
    background: var(--white);
    color: var(--hint-colour);
    font-size: 15px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* ANSWER BOX */

.answer-column {
    padding: 28px;
    border: 6px solid var(--black);
    background: var(--panel-grey);
}

#answer-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
}

#answer-label {
    display: block;
    margin: 0;
    font-size: clamp(20px, 2vw, 28px);
    line-height: 1.3;
}

#answer-input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 72px;
    padding: 12px 18px;
    border: 5px solid var(--black);
    border-radius: 0;
    background: var(--white);
    color: var(--black);
    font-family: "TAN Tangkiwood", serif;
    font-size: clamp(18px, 2vw, 27px);
}

#answer-input::placeholder {
    color: #777;
    opacity: 1;
    font-family: "TAN Tangkiwood", serif;
}

.submit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 72px;
    padding: 8px 14px;
    border: 5px solid var(--black);
    border-radius: 0;
    background: var(--green);
    color: var(--white);
}

.submit-button::after {
    content: "↑";
    display: block;
    font-family: Arial, sans-serif;
    font-size: 43px;
    font-weight: 900;
    line-height: .85;
    transform: scaleX(.9);
}

.submit-button:disabled {
    cursor: default;
    opacity: .55;
}

.feedback {
    margin: 14px 0 0;
    font-size: 16px;
}

.feedback:empty {
    display: none;
}

.feedback.correct {
    color: #007c3d;
}

.feedback.incorrect {
    color: var(--red);
}

/* GAME OVER OVERLAY */

.game-over-panel[hidden] {
    display: none !important;
}

.game-over-panel {
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    overflow-y: auto;
    background: rgb(0 0 0 / 62%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.game-over-card {
    width: min(100%, 1000px);
    margin: auto;
    border: 6px solid var(--black);
    background: var(--white);
    text-align: center;
}

.game-over-heading {
    min-height: 115px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    background: var(--red);
    border-bottom: 6px solid var(--black);
}

.game-over-heading h2 {
    margin: 0;
    color: var(--white);
    font-size: clamp(30px, 4.5vw, 54px);
    line-height: 1.1;
    text-transform: uppercase;
    -webkit-text-stroke: 1px var(--black);
    text-shadow: 2px 2px 0 var(--black);
}

.game-over-content {
    min-height: 310px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 25px;
}

.game-over-content p {
    max-width: 850px;
    margin: 12px auto;
    font-size: clamp(17px, 2vw, 25px);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.okay-button {
    min-width: 145px;
    margin-top: 14px;
    padding: 12px 26px;
    border: 5px solid var(--black);
    border-radius: 0;
    background: var(--green);
    color: var(--white);
    font-size: 18px;
}

.game-over-content .game-over-run {
    margin-top: 14px;
    margin-bottom: 0;
    color: #555;
    font-size: 13px;
}

.game-over-run span {
    color: var(--green);
}

/* FOOTER */

.site-footer {
    flex: 0 0 auto;
    min-height: 120px;
    display: flex;
    align-items: flex-end;
    gap: 18px;
    padding: 10px 18px;
    border-top: 6px solid var(--black);
}

.footer-credit {
    display: flex;
    align-items: stretch;
    height: 105px;
    flex: 0 0 auto;
}

.footer-art {
    display: block;
    width: 105px;
    height: 105px;
    object-fit: cover;
    border: 3px solid var(--black);
}

.footer-tag {
    width: 34px;
    min-width: 34px;
    height: 105px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: 3px solid var(--black);
    border-left: 0;
    background: var(--pink-red);
    color: var(--black);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: "TAN Tangkiwood", serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.5px;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.footer-email {
    align-self: flex-end;
    margin: 0 0 5px;
    color: var(--black);
    font-size: 13px;
    text-decoration: none;
    overflow-wrap: anywhere;
}

/* RESPONSIVE */

@media (max-width: 800px) {
    .site-header {
        min-height: 110px;
        padding: 6px 14px 12px;
    }

    .site-logo {
        width: 195px;
        height: 90px;
    }

    .homepage {
        min-height: 720px;
        padding: 55px 5vw 70px;
    }

    .mode-grid {
        gap: 32px;
    }

    .mode-button {
        min-height: 130px;
        border-width: 5px;
        border-radius: 16px;
    }

    .mode-title {
        font-size: clamp(28px, 5vw, 44px);
    }

    .mode-subtitle {
        font-size: clamp(21px, 3.8vw, 32px);
    }

    .constituency-button {
        min-height: 130px;
    }

    .game-screen {
        width: 92%;
        padding-top: 18px;
    }

    .game-topbar {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px;
    }

    .game-mode-label {
        grid-column: 1 / -1;
        grid-row: 1;
        padding-top: 4px;
        font-size: clamp(34px, 7vw, 52px);
    }

    #back-button {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
    }

    .run-display {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
        font-size: 16px;
    }

    .game-layout {
        grid-template-columns: 1fr;
        gap: 28px;
        margin-top: 24px;
    }

    .photo-panel {
        height: min(480px, 110vw);
    }

    .answer-column {
        padding: 20px;
    }

    #answer-input,
    .submit-button {
        min-height: 64px;
    }

    .game-over-panel {
        padding: 14px;
    }

    .game-over-card {
        border-width: 5px;
    }

    .game-over-heading {
        min-height: 90px;
    }

    .game-over-content {
        min-height: 260px;
        padding: 20px 14px;
    }

    .site-footer {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 520px) {
    .mode-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .constituency-button {
        grid-column: auto;
        width: 100%;
    }

    .mode-button {
        min-height: 120px;
    }

    .game-over-panel {
        padding: 10px;
    }

    .game-over-heading {
        min-height: 78px;
    }

    .game-over-content {
        min-height: 230px;
    }

    .footer-email {
        font-size: 11px;
    }
}