/* Nav bar style */

nav .navbar-brand
{
    font-size: xx-large;
}

nav .navbar-brand
{
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2); /* subtle pop */
    background-color: #ffffff;
    border-radius: 12px;
    border-color: #000;
    
    border-style: solid;
}

nav .navbar-brand .mini {
    color: #0793ca;
    margin-left: 7px;
}

nav .navbar-brand .max {
    color: #d42727;
}

nav .navbar-brand .games {
    color: #0793ca;
    margin-right: 7px;
}

body 
{
    background-color: #376daab2;
}

.signature
{
    font-size: 1rem;
    color: #000000;
    margin-right: 20px;
}

.nav-link
{
    font-size: 1rem;
    color: #000000;
}

.custom-navbar 
{
    background-color: #f16c62;
}

.site-title {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: #333;
}

/* Home page game cards */

.game-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem;
    align-items: center;
}

.game-card {
    flex: 1 1 200px;
    max-width: 200px;
    text-align: center;
    text-decoration: none;
    color: #000;
    background-color: transparent;
    border-color: transparent;
}

.game-card img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.game-card p {
    margin-top: 10px;
    font-size: 1.2rem;
}

.game-card:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

main.container
{
    min-height: calc(100vh - 125px);
    justify-content: center;
    display: flex;
}

@media (max-width: 768px) {
    /* 2x2 grid for game cards on more narrow screens */
    .game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    }
    main.container {
    min-height: calc(100vh - 100px); /* larger offset if mobile navbar is taller */
    }
}

.info {
    font-size: 1.2rem;
    color: #000000;
    text-align: center;
    margin-top: 20px;
}

/* Game-bar (back arrow, how to play) styles */

.game-bar {
    margin-top: 10px;
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 1rem 2rem; 
    background-color: transparent; 
}

.game-bar-item {
    text-decoration: none; 
    font-size: 1.3rem; 
    display: flex; 
    align-items: center; 
    color: #000;
}

.game-bar-item:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Tic tac toe styles */

.board-container {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 100px auto;
    background-image: url("/static/images/tictactoe-board.png");
    background-size: cover;
}

.cell-button {
    position: absolute;
    width: 33.33%;
    height: 33.33%;
    font-size: 55px;
    background: none;
    border: none;
    cursor: pointer;
}

.cell-x,
.cell-o {
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 55px;
    font-weight: bold;
    text-shadow:
        -2px -2px 0 black,
        2px -2px 0 black,
        -2px  2px 0 black,
        2px  2px 0 black,
        0px  0px 4px black;
}

.cell-x {
    color: #f16c62;
}
.cell-o {
    color: #22bdfa;
}

/* Grid positioning for 3x3 */
.cell-0-0 { top: 0%; left: 0%; }
.cell-0-1 { top: 0%; left: 33.33%; }
.cell-0-2 { top: 0%; left: 66.66%; }

.cell-1-0 { top: 33.33%; left: 0%; }
.cell-1-1 { top: 33.33%; left: 33.33%; }
.cell-1-2 { top: 33.33%; left: 66.66%; }

.cell-2-0 { top: 66.66%; left: 0%; }
.cell-2-1 { top: 66.66%; left: 33.33%; }
.cell-2-2 { top: 66.66%; left: 66.66%; }


/* Minesweeper board styles */

.ms-message {
    display: flex;
    justify-content: center;
    text-align: center;
    font-size: 1.2rem;
    color: #000000;
    margin-top: 20px;
}

.ms-container {
    display: flex;
    justify-content: center;
}

.ms-board {
    margin-top: 1rem;
    border-collapse: collapse;
    border: 2px solid #000;    
    background-color: #21cc30;
    border-radius: 12px;
}

.ms-board table {
    border-spacing: 0;
    border-radius: 12px;
}

.ms-button {
    padding: 0;
    margin: 0;
    overflow: hidden;
    line-height: 0;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.ms-button button {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background-color: transparent;
    cursor: pointer;
    display: flex;
}

.ms-icon {
    width: 100%;
    height: 100%;
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    display: block;
    margin: auto;
    pointer-events: none;
}

.ms-icon-small {
    width: 1.5rem;
    height: auto;
    vertical-align: middle;
    object-fit: contain;
    margin-right: 10px;
}

.ms-board.easy .ms-button {
    width: 2.5rem;
    height: 2.5rem;
}
.ms-board.medium .ms-button {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
}

.ms-board.hard .ms-button {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.9rem;
}

.ms-button button {
    width: 100%;
    height: 100%;
    border: none;
    background-color: transparent;
    font-size: 1.2rem;
    cursor: pointer;
}

.ms-button.light {
    background-color: #61db3c;
}

.ms-button.revealed {
    background-color: #cfc98c;
}

.ms-button.light.revealed {
    background-color: #deeba8;
}

.ms-button.top-left {
    border-top-left-radius: 12px;
}

.ms-button.bottom-right {
    border-bottom-right-radius: 12px;
}

.ms-button.bottom-left {
    border-bottom-left-radius: 12px;
}

.ms-button.top-right {
    border-top-right-radius: 12px;
}

.ms-button button:hover {
    background-color: #e0e0e0;
    border-radius: 12px;
}

/* Nim styles */

.nim-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.nim-message {
    display: flex;
    justify-content: center;
    text-align: center;
    font-size: 1.5rem;
    color: #000000;
    margin: 30px;
}

#nim-board {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.pile-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pile {
    display: flex;
    gap: 8px;
}

.nim-object {
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.nim-object.selected {
    transform: translateY(-10px);
    opacity: 0.7;
}

/* get_training_games style */

.training-game-grid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3rem;
    align-items: center;
}

.training-game-card {
    text-align: center;
    text-decoration: none;
    color: #000;
    background-color: transparent;
    border-color: transparent;
}

.disclaimer {
    font-size: 1rem;
    color: #000000;
    text-align: center;
    margin-top: -30px;
}

label.training-game-card,
button.training-game-card {
    color: #000;
    font-size: 1.4rem;
}

button.training-game-card:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

input[id="training-games"] {
    border: 2px solid #888;
    background-color: transparent;
    color: #000;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 1.2rem;
    outline: none;
    transition: border-color 0.3s ease;
    text-align: center;
}

input[id="training-games"]:focus {
    border-color: #ccc;
}

/* Literally just to disable the up/down buttons on input field */

/* Chrome, Safari, Edge, Opera */
input[id="training-games"]::-webkit-inner-spin-button,
input[id="training-games"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[id="training-games"] {
    -moz-appearance: textfield;
}


/* Connect 4 styles */

.board-wrapper {
    position: relative;
    width: fit-content;
    margin: 30px auto;
    background-color: #0e0bd1;
    background-size: cover;
    background-position: center;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0,0,0,0.4);
}

.connect4-board {
    display: grid;
    grid-template-columns: repeat(7, 55px);
    grid-template-rows: repeat(6, 55px);
    gap: 10px;
}

.connect4-message {
    display: flex;
    justify-content: center;
    text-align: center;
    margin-top: 15px;
    font-size: 1.5rem;
    color: #000000;
}

.c4-cell {
    width: 57px;
    height: 57px;
    border-radius: 50%;
    background-color: white;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.3);
    cursor: pointer;
}

.c4-x {
    background-color: red;
}

.c4-o {
    background-color: yellow;
}

.c4-empty {
    background-color: white;
}

.c4-cell:hover {
    outline: 2px solid rgba(0,0,0,0.1);
    cursor: pointer;
}

.c4-highlight {
    background-color: #c6c6c6;
}

/* How to play page styles */

.instructions {
    justify-content: center;
    display: flex;
    align-items: center;
    flex-direction: column;
    font-size: 1.2rem;
    color: #000000;
    text-align: center;
    margin-top: 20px;
}

.game-name {
    font-size: 1.6rem;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    margin-bottom: .5rem
}

.ttt-row {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 16rem;
    flex-wrap: wrap;
    margin-top: 100px;
}

@media (max-width: 768px) {
    .ttt-row {
        gap: 4rem;  
    }
}

.ttt-1 {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 300px;
    margin-bottom: 0;
}

.ttt-1 img {
    width: 80px;
    height: auto;
    margin-bottom: 0.5rem;
    border-radius: 15px;
}

.ttt-1,
.ttt-2,
.ttt-3,
.ttt-4,
.ttt-5 {
    font-size: 1.6rem;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.ttt-2 img {
    width: 400px;
    height: auto;
    margin-top: 100px;
    border-radius: 15px;
}


.ttt-3 img {
    width: 400px;
    height: auto;
    border-radius: 15px;
}

.ttt-3 p {
    margin-top: 20px;
}

.ttt-4 {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0;
}

.ttt-4 img {
    width: 300px;
    height: auto;
    margin-bottom: 0.5rem;
    border-radius: 15px;
}

.ttt-4 p {
    margin-top: -40px;
}

.ttt-5 {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0;
}

.ttt-5 img {
    width: 50px;
    height: auto;
    margin-bottom: 0.5rem;
    border-radius: 15px;
}

.ttt-5 p {
    margin-top: 50px;
}

/* About page styles */

.ttt-6 {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0;
    font-size: 2.3rem;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.ttt-6 img {
    width: 80px;
    height: auto;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    border-color: #000;
    border-style: solid;
    border-width: 2px;
}


