:root {
    --bg-dark: hsl(2 20% 1%);
    --bg: hsl(2 13% 5%);
    --bg-light: hsl(2 7% 9%);
    --text: hsl(2 42% 96%);
    --text-muted: hsl(2 6% 70%);
    --highlight: hsl(2 4% 40%);
    --border: hsl(2 5% 29%);
    --border-muted: hsl(2 7% 19%);
    --primary: hsl(0 66% 75%);
    --secondary: hsl(183 52% 57%);
    --danger: hsl(9 26% 64%);
    --warning: hsl(52 19% 57%);
    --success: hsl(146 17% 59%);
    --info: hsl(217 28% 65%);
    --border-card: solid 1px var(--border-muted);
    --shadow: 0px 2px 2px oklch(0 0 0 / 0.2), 0px 4px 4px oklch(0 0 0 / 0.1);
    --gradient: linear-gradient(0deg, var(--bg) 97%, var(--bg-light));
}

body.light {
    --bg-dark: hsl(2 9% 90%);
    --bg: hsl(2 20% 95%);
    --bg-light: hsl(2 100% 100%);
    --text: hsl(1 23% 5%);
    --text-muted: hsl(2 5% 29%);
    --highlight: hsl(2 100% 100%);
    --border: hsl(2 3% 51%);
    --border-muted: hsl(2 5% 63%);
    --primary: hsl(357 44% 32%);
    --secondary: hsl(183 100% 9%);
    --danger: hsl(9 21% 41%);
    --warning: hsl(52 23% 34%);
    --success: hsl(147 19% 36%);
    --info: hsl(217 22% 41%);
}

body {
    background-color: var(--bg-dark);
    color: var(--text);
    font-family: "Manrope", sans-serif;
    font-size: clamp(1em, 1.8vw, 1.8em);
    padding: 0px 4vw;
}

h1 {
    color: var(--primary);
    text-align: center;
}

button {
    cursor: pointer;
    transition: opacity 0.2s;
    border: none;
}

button:hover {
    opacity: 0.8;
}

.start {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 90vh;
    row-gap: 7vh;
}

.play{
    padding: 15px 40px;
    background-color: var(--primary);
    border: none;
    border-radius: 15px;
    font-size: .8em;
}

footer {
    position: relative;
    bottom: -1;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--text-muted);
    font-size: .7em;
}

footer a {
    color: var(--text);
    text-decoration: none;
}
footer a:hover {
    color: var(--primary);
}

.game{
    margin-top: clamp(10px, 2.5vh, 50px);
    display: flex;
    flex-direction: column;
}

.dealer-cards-container , .player-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, 115px);
    justify-content: center;
    align-items: center;
    margin-left: clamp(0px, 5vw, 700px);
    gap: clamp(3px, 1vw, 20px);
}

img{
    max-width: clamp(95px, 10vw, 115px);
}

.center-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    row-gap: 20px;
    margin-bottom: 20px;
    margin-top: 20px;
}

.game-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1000px;
    background: var(--gradient);
    border: var(--border-card);
    border-top: 1px solid var(--highlight);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    padding: 13px 1.5vw;
}

.game-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    row-gap: 5px;
    margin-left: -6vw;
}
.slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-muted);
    height: 15px;
    border-radius: 10px;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: url('chip.png');
  cursor: pointer;
}

.slider::-moz-range-thumb {
  border-radius: 50%;  
  width: 30px;
  height: 30px;
  border: 0;
  background: url('chip.png');
  cursor: pointer;
}

.text{
    width: 10%;
    background: var(--border-muted);
    color: var(--text);
    border: none;
    border-radius: 5px;
    font-size: .7em;
    text-align: center;
}

.betting {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    row-gap: 5px;
    margin-right: 10px;
}

.betting-input-container{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 150%
}

.betting button {
    background-color: var(--primary);
}


.chips-warning {
    position: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    row-gap: 10px;
    background-color: var(--danger);
    border-radius: 10px;
    padding: 10px;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    font-size: 1.5em;
    color: black;
    z-index: 10;
}

.chips-warning p{
    text-align: center;
}

.warning-background{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: black;
    opacity: 0.5;
}

.play-again {
    color: var(--text);
    cursor: pointer;
}

.play-again:hover {
    color: var(--primary);
}

.win-message{
    opacity: 0;
    pointer-events: none;
}

.player-won{
    background-color: var(--success);
}

.dealer-won{
    background-color: var(--danger);
}

.tie{
    background-color: var(--info);
}

.player-side{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    column-gap: 20px;
}

.bust{
    color: var(--danger);
}

.blackjack {
    color: var(--primary);
}

.blackjack-message {
    background: linear-gradient(
    270deg,
    var(--text),
    var(--primary),
    var(--text),
    var(--primary)
    );
    background-size: 300% 300%;
    background-clip: text;
    color: transparent;
    animation: logo-gradient 1.3s linear infinite;
    font-weight: bold;
    font-size: 1.2em;
}

@keyframes logo-gradient{
    0% {
    background-position: 100% 100%;
  }
 
  100% {
    background-position: 0% 50%;
  }
}

.stand-button {
    background-color: var(--secondary);
}

.hit-button, .double-down-button {
    background-color: var(--primary);
}

.hit-button{
    width: 100px;
}

.hidden{
    opacity: 0;
    pointer-events: none;
}

.shown{
    opacity: 1;
}

.center-container button, .win-message, .buy-back {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    color: var(--text);
    font-size: 1em;
}

.buy-back{
    background-color: var(--warning);
    color: black;
    font-size: 0.8em;
}