:root {
    --bg: #1a1a1a;
    --text: #f0f0f0;
    --accent: #c9a84f; /* Egyptian yellow dark */
    --bglight: #f7e8b5; /* Egyptian yellow light */
    --maxwidth-menu: 480px;
    --yellow: rgb(207, 188, 9);
    --yellow-light: rgb(245, 233, 125);
    --yellow-dark: rgb(163, 147, 3);
    --yellow-disabled: rgb(100, 90, 2);
    --purple: rgb(138, 43, 226);
    --purple-light: rgb(167, 79, 250);
    --purple-dark: rgb(113, 21, 199);
    --blue: rgb(56, 54, 219);
    --blue-light: rgb(82, 79, 250);
    --blue-dark: rgb(42, 39, 197);
    --yellow-elements: rgb(255, 255, 200);
    --yellow-elements-hover: rgb(245, 233, 165);
    --yellow-elements-select: rgb(226, 213, 137);
    --reminder: rgb(92, 238, 189);
}

.player-green { color: #4ae750; }
.player-blue { color: #24bce2; }
.player-red { color: #f44336; }
.player-yellow { color: #FFD700; }
.player-purple { color: #ba2cd3; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, sans-serif;
    display: flex;
    flex-direction: column;
}

#debug-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    color: var(--text);
    padding: 10px;
    z-index: 1000;
    width: 300px;
}

@media (min-width: 1024px) {
    #debug-menu {
        display: block;
    }
}

.screen {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    text-align: center;
}

.header {
    width: 100%;
}

.header-with-back-button {
    width: 100%;
    max-width: var(--maxwidth-menu);
    display: grid;
    grid-template-columns: 32px 1fr 32px;
}

.back-button {
    display: flex;
    align-self: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.back-button img {
    display: block; /* removes wrong click hitbox */
    width: 100%;
    height: 100%;
}

.button-yellow.loading::part(button) {
    pointer-events: none;
    background-color: var(--yellow-disabled);
    animation: wait-to-confirm-fill 1.5s linear forwards;
}

@keyframes wait-to-confirm-fill {
    to {
        background-color: var(--yellow);
    }
}

.player-name {
    color: var(--yellow-light);
}

/* Player selection screen */

#player-count-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    margin-top: 20px;
}

.player-count-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.player-count-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.player-count-label {
    margin: 0;
    font-size: large;
}

.player-count {
    font-size: xx-large;
}

.add-subtract-button {
    display: flex;
    align-self: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.add-subtract-button img {
    display: block; /* removes wrong click hitbox */
    width: 100%;
    height: 100%;
}

#difficulty-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

#difficulty-options sl-radio-button::part(button) {
    color: white;
    font-size: large;
}

#difficulty-options sl-radio-button::part(button):hover {
    background-color: var(--yellow);
    border-color: white;
    color: black;
}

#difficulty-options sl-radio-button::part(button--checked) {
    background-color: var(--yellow-light);
    border-color: white;
    color: black;
}

#difficulty-options sl-radio-button::part(button--checked):hover {
    background-color: var(--yellow-light);
    border-color: white;
    color: black;
}

/* Bidding tile preference screen */

#bidding-tile-select-dropdown-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 20px;
    margin-bottom: 50px;
}

.bidding-tile-select-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 4rem;
}

.bidding-tile-select-name {
    font-weight: bold;
    font-size: large;
}

.bidding-tile-select-dropdown sl-button::part(base) {
    font-size: large;
    width: 150px;
    background-color: var(--yellow-elements);
    border-color: var(--yellow-elements);
}

.bidding-tile-select-dropdown sl-button::part(base):hover {
    background-color: var(--yellow-elements-hover);
    border-color: var(--yellow-elements-hover);
}

.bidding-tile-select-dropdown sl-menu {
    font-size: large;
    width: 150px;
    background-color: var(--yellow-elements);
    border-color: var(--yellow-elements);
}

.bidding-tile-select-dropdown sl-menu sl-menu-item::part(base) {
    font-size: medium;
}

.bidding-tile-select-dropdown sl-menu sl-menu-item::part(base):hover {
    background-color: var(--yellow-elements-select);
    border-color: var(--yellow-elements-select);
}

/* Tile selection screen */

.tile-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
    max-width: var(--maxwidth-menu);
    padding: 0 10px;
}

.tile-button {
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 4px solid transparent;
    overflow: hidden;
    background: none;
    cursor: pointer;
}

.tile-button img {
    width: 100%;
    height: 100%;
}

.tile-button.selected {
    border-color: var(--accent);
}

#god-tile-use-button {
    margin-top: 40px;
}

#confirm-tile-selection-button {
    margin-top: 40px;
}

#review-game-state-button {
    margin-top: 40px;
}

/* Ra invoke prompt screen */

#invoke-ra-options {
    display: flex;
    flex-direction: column;
    gap: 50px;
    margin-top: 40px;
}

/* Player bidding screen */
#current-bidder {
    margin-top: 5px;
    font-size: large;
}

#player-bidding-options {
    display: flex;
    flex-direction: column;
    gap: 50px;
    margin-top: 40px;
}

.bidding-tile-button::part(base) {
    width: 80px;
    border: 4px solid rgb(51, 231, 216);
    background-color: var(--yellow);
    color: black;
    font-size: x-large
}

.bidding-tile-button::part(base):hover {
    border: 4px solid rgb(29, 204, 189);
    background-color: var(--yellow-dark);
}

#bidding-tile-pass-button::part(base) {
    margin-top: 40px;
}

/* Bidding outcome screen */
#bidding-outcome-continue-button::part(base) {
    margin-top: 40px;
}

#bidding-outcome-redo-button::part(base) {
    margin-top: 20px;
}

#discard-choice-button::part(base) {
    margin-top: 40px;
}

#drought-reminder-text {
    margin-bottom: 40px;
    color: var(--reminder);
}

/* Ra invoke prompt screen */

#confirm-tile-take-button {
    margin-top: 40px;
}

/* Game state review screen */
.state-review-display-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
    max-width: var(--maxwidth-menu);
}

.state-review-display-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: none;
}

.state-review-tile-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-top: 20px;
    max-width: var(--maxwidth-menu);
}

.state-review-tile-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: none;
}

.player-state {
    text-align: left
}

.state-review-player {
    padding: 0 10px;
    margin-bottom: 60px;
}

.state-review-player p {
    font-size: large
}

/* Shoelace */

.ra-button::part(base) {
    --sl-input-height-medium: 48px;
    --sl-input-border-width: 4px;
    border-radius: 20px;
    font-size: medium;
}

sl-dialog::part(panel) {
    background-color: #1a1a1a;
    border-radius: 5px;
    border: 3px solid white;
}

/* Dialog screens are only shown during errors or notices. The user
 * should not be able to close them without taking an action. */
sl-dialog::part(close-button) {
    display: none;
}

.button-yellow::part(base) {
    background-color: var(--yellow);
    border-color: var(--yellow-light);
    color: black;
}
.button-yellow::part(base):hover {
    background-color: var(--yellow-dark);
}

.button-purple::part(base) {
    color: white;
    background-color: var(--purple);
    border-color: var(--purple-light);
}
.button-purple::part(base):hover {
    background-color: var(--purple-dark);
}

.button-blue::part(base) {
    color: white;
    background-color: var(--blue);
    border-color: var(--blue-light);
}
.button-blue::part(base):hover {
    background-color: var(--blue-dark)
}