@font-face {
    font-family: "Raleway";
    src: url(./fonts/Raleway-VariableFont_wght.ttf);
}

@font-face {
    font-family: "Lato";
    src: url(./fonts/Lato-Regular.ttf);
}

@font-face {
    font-family: "Lato Light";
    src: url(./fonts/Lato-Light.ttf);
}

@keyframes boardAppearance {
    from {
        opacity: 0;
        scale: 0.95;
    }

    to {
        opacity: 1;
        scale: 1;
    }
}

@keyframes scoreNumbersChange {
    0% {
        scale: 1;
    }

    50% {
        scale: 1.25;
        filter: brightness(110%);
    }

    100% {
        scale: 1;
    }
}

@keyframes inputAppearance {
    from {
        translate: -100vw 0;
        opacity: 0;
    }

    to {
        translate: 0 0;
        opacity: 1;
    }
}

* {
    box-sizing: border-box;
}

p,
h1,
body {
    margin: 0;
}

a {
    text-decoration: none;
    color: #F5F5F5;
    cursor: pointer;
}

header {
    display: flex;
    align-items: center;

    background-color: #27384A;

    height: 76px;
    padding: 32px;

    position: sticky;

    margin-bottom: 32px;

    border-bottom: 1px solid #31475D;
    box-shadow: 0 2px 8px #00000033;
}

body {
    background-color: #243447;

    font-family: "Lato Light";
    font-weight: 400;
    font-size: 16px;

    color: #F5F5F5;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

input[type="text"] {
    background-color: #30475E;
    border: 1px solid #3F5B78;
    border-radius: 8px;

    padding: 14px 12px;

    color: #F5F5F5;
    font-size: 16px;

    max-height: 40px;

    max-width: 320px;
}

label {
    font-size: 20px;
}

main {
    flex: 1;
}

#main {
    display: flex;

    align-items: center;
    justify-content: center;

    flex-direction: column;

    gap: 24px;
}

.first-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.first-screen-text {
    font-size: 32px;
}

.controls-btns {
    display: flex;

    gap: 12px;
}

.board-and-buttons {
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 12px;
}

.main-scores-and-board {
    display: flex;

    justify-content: space-between;
}

.main-board {
    border: 1px solid #3A506B;

    width: 300px;
    height: 300px;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);

    animation-name: boardAppearance;
    animation-duration: 0.8s;
    animation-timing-function: ease-out;
}

.set-player {
    display: flex;
    flex-direction: column;

    align-items: center;

    gap: 8px;
}

.set-player-animation {
    animation-name: inputAppearance;
    animation-duration: 0.35s;
    animation-timing-function: ease-out;
}

.primary-btn {
    background-color: #2E4158;
    color: #F5F5F5;

    font-size: 16px;
    font-weight: 700;

    min-height: 40px;
    min-width: 200px;

    padding: 12px 18px;

    border-radius: 8px;

    border: none;
}

.player-btn {
    background-color: #40627F;
    width: 70%;
    font-size: 16px;
}

.player-btn:hover {
    background-color: #4C6B8A;
}

.player-btn:active {
    background-color: #32485E;
}

.board-btn {
    background-color: #2E4158;
    border: 1px solid #3A506B;

    font-weight: bold;
    font-size: 44px;
}

.board-btn:hover {
    background-color: #3A506B;
}

.board-btn[data-mark="X"] {
    color: #FF6B6B;
}

.board-btn[data-mark="O"] {
    color: #4ECDC4;
}

.board-winner-btn {
    background-color: #2F514D;
    border: 1px solid #4E8F87;
}

.control-btn {
    border: none;
    border-radius: 8px;

    padding: 12px 18px;

    font-size: 16px;

    color: #F5F5F5;
}

.reset-game-btn {
    background-color: #5A3E4B;
}

.reset-game-btn:hover {
    background-color: #6B4A59;
}

.reset-game-btn:active {
    background-color: #4A3340;
}

.new-game-btn {
    background-color: #5B7C9E;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.winner-announcement-inner-wrapper .new-game-btn {
    min-width: 180px;
}

.new-game-btn:hover {
    background-color: #6B8FB4;
}

.new-game-btn:active {
    background-color: #4C6B8A;
}

.change-pl-btn {
    background-color: #3A506B;
}

.change-pl-btn:hover {
    background-color: #46627F;
}

.change-pl-btn:active {
    background-color: #32485E;
}

#turn-announcement {
    font-size: 22px;
}

.turn-announcement-X {
    color: #FF6B6B;
}

.turn-announcement-O {
    color: #4ECDC4;
}

.winner-announcement {
    background-color: #3A506B;
    border: 1px solid #3A506B;
    border-radius: 14px;
    min-width: 360px;

    padding: 32px;

    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45),
        0 4px 10px rgba(0, 0, 0, 0.3);

    animation-name: boardAppearance;
    animation-duration: 0.8s;
    animation-timing-function: ease-out;
}

.winner-announcement-outer-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 12px;
}

.winner-announcement-inner-wrapper {
    display: flex;
    flex-direction: column;

    justify-content: center;
    align-items: center;

    gap: 16px;

    margin-left: 16px;
}

.winner-announcement-close-btn {
    align-self: flex-start;
    background-color: transparent;
    color: #A8B2C1;
    border: none;
    opacity: 0.7;
}

.winner-announcement-btn:hover {
    background-color: #46627F;
}

.winner-announcement-btn:active {
    background-color: #32485E;
}

.winner-announcement-text {
    font-size: 28px;
    font-weight: bold;
    color: #F5F5F5;
    margin-top: 32px;
    margin-bottom: 14px;
    text-align: center;
}

.subline-text {
    color: #93A4B8;
    margin-bottom: 24px;
}

footer {
    align-self: center;
    padding-bottom: 32px;
}

#footerText {
    font-size: 16px;
    color: #E0E0E0;
}

.gameResults {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 10px;

    padding: 30px 70px;

    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;

    margin-bottom: 30px;

    width: 480px;
    height: 210px;

    background-color: #2E4057;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);

    animation-name: boardAppearance;
    animation-duration: 0.8s;
    animation-timing-function: ease-out;
}

.scoreBoard {
    display: flex;
    justify-content: center;

    gap: 150px;
}

.scoreAnimation {
    animation-name: scoreNumbersChange;
    animation-duration: 0.4s;
}

.full-attribution{
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 8px;
}

.inactive {
    display: none;
}

@media screen and (max-width: 415px) {
    button {
        font-size: 13px;
    }

    .gameResults {
        padding: 15px;
        width: 300px;
        height: 180px;
    }

    .winner-announcement{
        max-width: 360px;
    }
}