body { 
    display: flex;
    flex-wrap: wrap; 
    margin: 0; 
    /*overflow: hidden; */
    background-color: hsl(183, 89%, 31%); 
    font-family: 'Arial'
}

.cursor { 
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    pointer-events: none;
}

#potDiv {
    width: 100%;
    font-weight: bold;
    color: white;
}

#leaveButton {
    position: absolute;
    top: 5%;
    right: 5%;
    transform: translate(-50%, -50%);
    padding: 16px 32px;
    font-size: 18px;
    background-color: black;
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 4px 4px rgba(0, 0, 0, 0.3);
    transition: background 0.3s;
}

.button:hover {
    background-color: #333;
}

.hand {
    /* width: 50%; */
    display: flex;
    /* gap: 4px; */
    flex-wrap: wrap;
    touch-action: none;
    margin-left: 16px;
    margin-right: 16px;
}

.full-width-hand {
    width: 100%;
    justify-content: center;
    margin-bottom: 1em;
}

.myhand {
    gap: 8px;
    position: absolute;
    width: 100%;
    justify-content: center;
    bottom: 10%;
    margin-left: 0;
}

.ten {
    transform: translate(-1rem, 6%);
    letter-spacing: -1.7rem;
}

.small-hand .ten {
    transform: translate(-20%,6%);
    letter-spacing: -1rem;
}

.small-hand .card { /* scale didn't work because doesn't affect layout :( moreover, transforms don't compose. so highlighting a smaller card doubles the size*/
    width: 55px;
    height: 83px;
    font-size: 60px;
    border-radius: 11px;
    /* box-shadow: 2px 2px rgba(0,0,0,0.3); */
}

.small-hand canvas { /* root symbol */
    transform: scale(0.6);
}

.small-hand .card-back {
    width: 55px;
    height: 85px;
    border-radius: 11px;
    box-shadow: 2px 2px rgba(0,0,0,0.3);
}

.myhand .player-info {
    width: 100%;
    margin: 8px;
}

.myhand .chip {
    width: 50px;
    height: 15px;
}

.myhand .chip-stacks-container {
    width: 100%;
    margin: 10px 0px; /* or just use flex gap? */
}

.righthand {
    margin-left: auto;
    /* flex-direction: row-reverse; */
}

.handLabel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: white;
    font-weight: bold;
    gap: 8px;
}

.handLabel p {
    margin-block: 0;
    text-align: center;
    background-color: rgba(0,0,0,0.3);
    padding: 10px;
    border-radius: 16px;
    width: 100px;
}

.card {
    width: 90px;
    height: 135px;
    font-size: 100px;
    border-radius: 16px;
    background-color: rgb(251, 251, 250);
    box-shadow: 4px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-family: 'AppleMyungjo', serif;
    color: black;
    margin: 8px;
    user-select: none;
    touch-action: manipulation;
    overflow: hidden;
}

.card:hover {
    transition: transform 0.2s ease;
}

/* the equation result should not respond to mouse hover like regular cards */
.difference-card:hover {
    transform: none;
}

.single-digit {
    transform: translateY(6%);
}

.operator-card {
    font-family: 'Arial', serif;
    font-weight: 100;
    font-size: 100px;
    color: rgb(40, 40, 40);
}

.result-card {
    background-color: transparent;
    box-shadow: none;
    overflow: visible;
}

.small-hand .difference-card {
    display: block; /* need to display two lines in this card */
    padding: 0px 10px;
    font-size: 28px; /* need to apply calc()*/ 
    background-color: rgba(255,255,255,0.5);
    box-shadow: none;
    overflow: visible;
    width: auto; /* otherwise it's fixed width like the rest of the cards, 
    and goes off screen causing scrolling. */
}

.result-paragraph {
    margin-block-start: 0.2em;
    margin-block-end: 0.2em;
    color: black;
}

.difference-paragraph {
    letter-spacing: -.1rem;
    margin-block-start: 0em;
    color: rgb(240, 67, 67);
}

.card-highlighted {
    background-color: rgb(252, 252, 170);
    box-shadow: 4px 4px rgba(255, 215, 0, 0.9);
}

.tiebreaker-card {
    background-color: rgba(226, 252, 170, 0.534);
    box-shadow: 4px 4px rgba(255, 215, 0, 0.9);
}

/* is .myhand needed? */
.myhand .folded.card {
    background-color: #ccc;
}

.folded.card-back {
    animation: flip 0.3s cubic-bezier(0,2,1,2);
    animation-delay: var(--delay);
}

.new-card {
    animation: slideLeft 3s ease;
}

.blink-red {
    animation: blink 0.3s ease 2;
}

@keyframes blink {
    50% { background-color: rgb(235, 75, 75); }
    0%, 100% { background-color: white; }
}

@keyframes flip {
    to {
        transform: rotateY(180deg);
    }
  }

.card-bounce {
    animation: bounce 0.3s cubic-bezier(0,2,1,2);
    animation-delay: var(--delay);
}

@keyframes bounce {
    to {
      transform: translateY(-0.4em);
    }
  }

.folded {
    /* background-color: #ccc; */
    filter: grayscale(100%);
}

.card-back {
    width: 90px;
    height: 135px;
    border-radius: 16px;
    background: repeating-linear-gradient(
        45deg,
        #1400c4,
        #3760f3 10px,
        #ffffff 10px,
        #ffffff 10px
    );
    box-shadow: 4px 4px rgba(0, 0, 0, 0.3);
    margin: 8px;
    position: relative;
}

.card:hover {
    transform: scale(1.05);
}

#uiContainer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#bettingControls {
    position: absolute;
    width: 370px;
    bottom: 1%;
    left: 50%;
    transform: translate(-50%, -0%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#betSlider {
    width: 24%;
    height: 11px;
    border-radius: 5px;  
    background: rgba(0,0,0,0.4);
    -webkit-transition: .2s;
    transition: opacity .2s;
}

#nameContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

#nameInput {
    padding: 10px 16px;
    font-size: 16px;
    border: none;
    border-radius: 16px;
    background-color: white;
    color: black;
    outline: none;
    width: 200px;
}

#nameInput::placeholder {
    color: #555;
}

#joinButton,
#callRaiseButton,
#foldButton,
#allInButton,
#startButton,
#confirmChoice {
    padding: 10px 16px;
    font-size: 16px;
    border: none;
    border-radius: 16px;
    background-color: black;
    color: white;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

#confirmResults {
    padding: 10px 16px;
    font-size: 16px;
    border: none;
    border-radius: 16px;
    background-color: limegreen;
    color: white;
    transition: background-color 0.2s ease;
    cursor: pointer;
    position: absolute;
    left: 50%;
    top: 90%;
    transform: translateX(-50%)
}

#joinButton:hover,
#callRaiseButton:hover,
#foldButton:hover,
#allInButton:hover,
#startButton:hover,
#confirmResults:hover,
#confirmChoice:hover {
    background-color: #222;
}

#startButton:disabled,
#confirmChoice:disabled {
    background-color: #999;
    cursor: not-allowed;
    pointer-events: all !important;
}

#notificationWrapper {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#progressBarWrapper {
    width: 100%;
    height: 20px;
    background-color: rgba(0,0,0,0.4);;
}

#progressBar {
    height: 100%;
    background-color: #ebc605;
    transition: background-color 1s ease;
    animation: progressBar 90s ease;
}

@keyframes progressBar {
    0% { background-color: rgb(50, 205, 102); }
    55% { background-color: #ebc605; }
    75% { background-color: orange; }
    90% { background-color: red; }
    91% { background-color: orange; }
    92% { background-color: red; }
    93% { background-color: orange; }
    94% { background-color: red; }
    95% { background-color: orange; }
    96% { background-color: red; }
    97% { background-color: orange; }
    98% { background-color: red; }
    99% { background-color: red; }
}

#progressBarOverlay {
    text-align: center;
    font-size: 18px;
    vertical-align: center;
    color: white;
    background-color: transparent;
    height: 100%;
    width: 100%;
    z-index: 9998;
    position: relative;
    transform: translateY(-90%);
    text-shadow: rgba(0,0,0,0.3);
}

#notifications {
    position: fixed;
    top: 1rem;
    right: 50%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 9999;
    transform: translateX(50%);
    pointer-events: none; /* clicks go through unless needed */
}

.notification {
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    box-shadow: 4px 4px rgba(0,0,0,0.2);
    text-shadow: 2px 2px rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
    min-width: 200px;
    max-width: 300px;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease forwards;
    animation-delay: 0s, var(--duration);
}

@keyframes slideLeft {
    0% {
        transform: translateX(300%);
        opacity: 0;
        filter: sepia() saturate(500%);
    }
    30% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        filter: none;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        transform: translateY(-120%);
        opacity: 0;
    }
}

#lobbyTitleContainer {
    text-align: center;
    font-size: 120px;
    font-weight: bold;
    color: white;
}

.lobbyPlayerListItem {
    text-align: center;
    font-weight: bold;
    margin: 10px;
    min-width: 100px;
    padding: 10px 16px;
    font-size: 20px;
    border: none;
    border-radius: 16px;
    background-color: rgb(46, 46, 46);
    transition: background-color 0.2s ease;
    cursor: pointer;
    animation: fadeUp 1s ease-out forwards;
}

@keyframes fadeUp {
    0% {
      opacity: 0;
      transform: translateY(20px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .chip-stacks-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    margin: 20px;
    width: fit-content;
    position: relative;
}

.chip-stack {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 2px;
    transition: all 0.3s ease;
}

.chip-count-overlay {
    position: relative;
    top: -0.5rem;
    right: -0.5rem;
    background: rgb(23, 43, 36);
    color: rgb(231, 231, 231);
    font-size: 1.1rem;
    padding: 6px 10px;
    border-radius: 999px;
    z-index: 10;
    pointer-events: none;
}

.differential-span {
    color: yellow;
}

.chip {
    width: 30px;
    height: 13px;
    margin: -7.5px; /* so that they stack on top of each other */
    border-radius: 50% / 40%;
    background-color: crimson;
    border: 2px solid rgb(149, 31, 31);
    box-shadow: 4px 4px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(10px);
    animation: chipIn 0.3s ease forwards;
}

@keyframes chipIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chip.out {
    animation: chipOut 0.3s ease forwards;
}

@keyframes chipOut {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

.sortable-chosen {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 4px 4px rgba(0, 0, 0, 0.3);
    border-radius: 16px;
}

.sortable-ghost {
    border-radius: 16px;
    opacity: 0;
}

/* Hi Lo Selection Modal */

.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(250, 250, 250, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal {
    color: white;
  background: rgba(73, 102, 96, 0.84);
  padding: 24px 32px;
  border-radius: 16px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.modal h2 {
    color: white;
}

.options {
  display: flex;
  justify-content: space-around;
  margin: 16px 0;
}

.option {
    width: 100px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 20px;
    cursor: pointer;
    user-select: none;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.option.selected {
  background-color: rgba(101, 214, 255, 0.5);
}

.option:hover {
  background-color: rgba(101, 214, 255, 0.7);
}

.option p {
    margin-block-start: 0;
    margin-block-end: 0;
}

.low-symbol {
  width: 100px;
  height: 100px;
  font-size: 50px;
  background: white;
  /* border: 2px solid black; */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: black;
  margin-top: auto;
  margin-bottom: auto;
  box-shadow: 4px 4px rgba(0,0,0,0.3);
}

.trophy-div {
    font-size: 20px;
}

.high-symbol {
    border-radius: 8px;
  width: calc(115px / sqrt(2));
  height: calc(115px / sqrt(2));
  font-size: 50px;
  background: black;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  margin: auto;
  transform: rotate(45deg);
  box-shadow: 5px 0px rgba(0,0,0,0.3);
}

.high-symbol-span {
  transform: rotate(-45deg);
}

.low-symbol-mini, .high-symbol-mini {
    width: 30px;
    height: 30px;
    font-size: 20px;
}

.buttons {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.hidden {
  display: none;
}

@media (max-width: 500px) {
    #lobbyTitleContainer {
        font-size: 80px;
    }

    .hand {
        gap: 2px;
    }

    .card, .card-back {
        width: 40px;
        height: 60px;
        font-size: 40px;
        margin: 2px;
    }

    .chip {
        width: 20px;
        height: 20px;
        margin: -12px; 
    }

    /* make the chip stacks just one chip on mobile */
    .chip-stacks-container {
        gap: 0px;
    }

    .chip-stack {
        gap: 0px;
    }

    .difference-paragraph {
        letter-spacing: -.1rem;
    }

    .ten {
        transform: translate(-0.2rem, -0.7rem);
        letter-spacing: -.1rem;
    }
}