/* heading */
.center {
    text-align: center;
}

/* dark mode */
body.dark-mode {
    background-color: black;
    color: white;
}

body.dark-mode #hand {
    background-color: darkslateblue;
}

body.dark-mode .card {
    border-color: white;
}

body.dark-mode .card:hover {
    border-color: yellow;
}

body.dark-mode .cell {
    background-color: gray;
    border-color: white;
}

body.dark-mode .cell:hover {
    border-color: yellow;
}

body.dark-mode .player {
    background-color: darkcyan;
}

body.dark-mode .opponent {
    background-color: darkred;
}

/* Theme dropdown */
.toggle-container {
    position: fixed;
    top: 1%;
    left: 1%;
    z-index: 9999;
}

.toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
}

.dark-toggle {
    color: white;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* selection box */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup {
    background: white;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
}

button {
    padding: 10px 20px;
    margin: 10px;
    font-size: 16px;
}

.popup h2 {
    color: black;
}

/* hand selection */
#hand-selection {
    display: none;
}

#card-holder {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* game board */
.row {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cell {
    border: 1px solid black;
    border-radius: 5%;
    min-width: 10em;
    min-height: 10em;
    margin: 1em;
}

/* card hand */
#hand {
    background-color: darkblue;
    border-top: 1px solid black;
    display: flex;
    justify-content: center;
    gap: 1em;
    flex: 1;
}

.card {
    border: 1px solid black;
    border-radius: 5%;
    width: 10em;
    height: 10em;
    margin: 1em;
    position: relative;
}

.card .spike {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.card .spike.top {
    border-width: 0 0.5em 1em 0.5em;
    border-color: transparent transparent gray transparent;
    top: -1em;
    left: 50%;
    transform: translateX(-50%);
}

.card .spike.bottom {
    border-width: 1em 0.5em 0 0.5em;
    border-color: gray transparent transparent transparent;
    bottom: -1em;
    left: 50%;
    transform: translateX(-50%);
}

.card .spike.left {
    border-width: 0.5em 1em 0.5em 0;
    border-color: transparent gray transparent transparent;
    left: -1em;
    top: 50%;
    transform: translateY(-50%);
}

.card .spike.right {
    border-width: 0.5em 0 0.5em 1em;
    border-color: transparent transparent transparent gray;
    right: -1em;
    top: 50%;
    transform: translateY(-50%);
}

.player {
    background-color: aqua;
}

.opponent {
    background-color: red;
}

.selection {
    background-color: gray;
}

.card.selected {
    border-color: rgb(224, 210, 2);
    border-width: thick;
}

.card.selected:hover {
    transform: none;
}

.card:hover {
    transform: scale(1.05);
    border-color: rgb(224, 210, 2);
}

.card.placed:hover {
    transform: none;
    border-color: black;
}

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

#container {
    height: 100%;
    border-collapse: collapse;
    display: none;
}
