﻿* {
    box-sizing: border-box;
    /*cursor: none;*/
}

#power-up-speed {
  --flash-border: #0077c2;
  --flash-ring:  rgba(72,186,255,.55);
  --flash-glow:  rgba(72,186,255,.9);
}

#power-up-army {
  --flash-border: #8a5600;                 /* darkened B57204 for contrast on white */
  --flash-ring:  rgba(181,114,4,.55);
  --flash-glow:  rgba(181,114,4,.9);
}

@keyframes flash {
  0%, 100% {
    border-color: var(--surface-line);
    box-shadow: 0 0 0 0 rgba(0,0,0,0);
    transform: scale(1);
  }
  35% {
    border-color: var(--flash-border);
    box-shadow: 0 0 0 3px var(--flash-ring),
                0 0 22px 6px var(--flash-glow);
    transform: scale(1.08);
  }
}
.activated { animation: flash .55s ease; }
.deny{ animation:deny .3s ease; }

@keyframes deny{ 25%{ transform:translateX(-4px); } 75%{ transform:translateX(4px); } }

@keyframes notifyCannot {
    0% { color: red; }
    100% { color: black; }
}

@keyframes denyText {
    0% { color: red; }
    100% { color: white; }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.notify-cannot {
    animation: notifyCannot 1s ease-in-out;
}

.deny-text {
    animation: denyText .6s ease;
}

html {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    touch-action: none;
    user-select: none;
}

body {
    margin: 0px;
    width: 100%;
    height: 100%;
    min-height: 100%;
    position: fixed;
    inset: 0;
    /*background-color: #265380;*/
    /*background-color: #18191C;*/
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden; /* Disable scrolling */
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    touch-action: none;
    /*background: url(../images/grid.png);*/
    /*background: url(../images/space-background.jpg);*/

    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

}

#content {
    display: flex;
    justify-content: center;
    height: 100%;
    position: relative;
    /*margin: auto;*/
}

#canvas {
    /*background-color: rgb(204, 230, 255);*/
    /*background: url(../images/grid.png);*/
    margin: auto;
    display: block;
}

#title,
#status {
    display: block;
    overflow-wrap: anywhere;
    white-space: normal;
    line-height: 1.08;
}

#game-mode-tooltip-overlay {
    --tooltip-left: 24px;
}

#stat-tooltip {
    white-space: pre-line;
}

#game-mode-tooltip-overlay::before, #stat-tooltip-overlay::before {
    content: '';
    display: block;  
    position: absolute;
    width: 0;
    height: 0;
    border: 15px solid transparent;
}

#game-mode-tooltip-overlay::after, #stat-tooltip-overlay::after {
    content: '';
    display: block;  
    position: absolute;
    width: 0;
    height: 0;
    border: 14px solid transparent;
}

#game-mode-tooltip-overlay::before {
    left: var(--tooltip-left);
    border-bottom-color: rgb(128,128,128,0.9);
    bottom: 100%;
}

#game-mode-tooltip-overlay::after {
    left: calc(var(--tooltip-left) + 1px);
    border-bottom-color: rgba(255,255,255,1);
    bottom: calc(100% - 1px);
}

#stat-tooltip-overlay::before {
    border-left-color: rgb(128,128,128,0.9);
    left: 100%;
    /*top: 6px;*/
    pointer-events: none;
}

#stat-tooltip-overlay::after {
    border-left-color: rgba(255,255,255,1);
    left: calc(100% - 1px);
    /*top: 7px;*/
    pointer-events: none;
}

#title-overlay {
    font-size: 16vh;
    color: rgba(0,0,0,0.8);
    transform: none;
    top: 0%;
    cursor: default;
}

#invite-overlay {
    color: rgba(0,0,0,0.8);
    cursor: default;
    top:0px;
    transform: initial;
}

#game-mode-overlay {
    /*display: inline-block;*/
}

#game-mode-overlay.closed {
    margin-left: 282px;
}

#game-mode-overlay.open {
    margin-left: 404px;
}

#game-mode-overlay.closed .game-mode-button-container:not(.selected) {
    display: none;
}

#game-mode-overlay.open #game-mode-buttons-container {
    display: flex;
}

.game-mode {
    background: #4CA6FF;
    border: 1px solid #265380;
    margin: auto;
    border-radius: 6px;
    width: 44px;
    padding: 0;
    height: 44px;
    margin-bottom: 16px;
}

.game-mode-button-container {
    display: grid;
}

#game-mode-overlay.open .game-mode-button-container:not(:last-child) {
    margin-right: 8px;
}

.game-mode-label {
    font-size: 10px;
}

.game-mode img {
    padding-top: 1px;
}

.game-mode img:not(.selected) {
    filter: grayscale(100%);
    cursor: pointer;
}

.game-mode img:hover {
    filter: none;
}

#status-overlay {
    font-size: 8vh;
    color: rgba(0,0,0,0.8);
    cursor: default;
}

#stats {
    position: absolute;
    right: 0px;
    top: 20px;
    font-family: monospace;
    width: 240px;
    font-size: 18px;
    background-color: rgb(0,0,0,0.6);
    z-index: 9999;
}

.fade-in-victory {
    animation: fadeIn 2.0s ease-in forwards;
    opacity: 0;
}

/*.fade-in-victory-team {
    animation: fadeIn 2.0s ease-in forwards;
    opacity: 0;
}*/

.fade-in-loss {
    animation: fadeIn 2.5s ease-in forwards;
    opacity: 0;
}

.leaderboard {
    display: block;
    clear: both;
}

.left {
    float: left;
}

.right {
    float: right;
}

.card {
    border-radius: 5px;
    padding: 4px;
    height: fit-content;
    margin: 18px;
    clear: both;
}

.card span {
}

.button, .input {
    background: #4CA6FF;
    border: 1px solid #265380;
    margin: 0 8px;
    padding: 8px 28px;
    border-radius: 20px;
    line-height: 24px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    outline: none;
    overflow: hidden;
    color: white;
    width: fit-content;
    margin: auto;
}

.button {
    cursor: pointer;
}

.input {
    border-radius: 12px;
    width: 50%;
}

.button:hover {
    background: #265380;
}

.button:not(:last-child) {
    margin-bottom: 16px;
}

.button:first-child {
    margin-bottom: 16px;
}

.overlay {
    /*cursor: auto;*/
    position: absolute;
    align-items: center;
    text-align: center;
    background: rgba(255,255,255,0.9);
    border-radius: 10px;
    display: grid;
    top: 50%;
    transform: translateY(-50%);
    padding: 16px;
    border: 1px solid rgb(128,128,128,0.9);
    z-index: 9999;
}

.text-only-overlay {
    background-color: rgba(0,0,0,0);
    border: 0;
    /* I get Comic Sans MS to work on desktop and Baskerville to work on Android. Supposedly that American Typewriter works on ios and Mac. Others are fallback. */
    font-family: 'Comic Sans MS', 'Baskerville', 'American Typewriter', 'Palatino', 'Roboto Light', 'Marker Felt', 'Chalkduster';
}

.dark-overlay {
    position: fixed; /* Fixed position to cover the entire viewport */
    top: 0;
    left: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    background-color: rgba(0, 0, 0, 0.5); /* Black with 50% opacity */
    z-index: 999; /* Ensure it's on top of other content */
}

#yes-no-dialog {
    z-index: 99999;
}

.game-mode-button, .invite-game-mode-button {

    width: 40px;
}

.select-color-container {
    display: flex;
}

.header {
    font-size: 14px;
    margin-bottom: 16px;
    display: block;
}

.invite-header {
    font-weight: bold;
}

.invite-header:not(:first-child) {
    margin-top: 16px;
}

input[type=checkbox] {
    display: none;
}

.checkbox::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 10px;
    cursor: pointer;
    background: #4CA6FF;
    border: 1px solid #265380;
    border-radius: 4px;
}

input[type=checkbox]:checked + .checkbox::before {
    content: '✓';
    font-size: 18px;
    line-height: 1;
    /*color: #265380;*/
}

.seat-name {
    margin-bottom: 16px;
    cursor: pointer;
}

.invite-seat {
    cursor: pointer;
}

.invite-link {
    /*cursor: pointer;*/
}

.button.negative {
    border-color: #932C2B;
    background: #FF766B;
}

.button.negative:hover {
    background: #932C2B;
}

#rpg-stats-overlay, #rpg-level-overlay, #battle-results-overlay, #reincarnation-overlay, #next-floor-overlay, #skills-overlay, #enter-dungeon-overlay {
    font: 16px monospace;
}

.button.rpg-button {
    border-radius: 8px;
    width: 42px;
    padding: 8px;
    /*width: 26px;
    padding: 0px;*/
    margin: 0px;
}

.button.rpg-help-button {
    width: 18px;
    line-height: 16px;
    border-radius: 12px;
    padding: 0px;
    margin: 0px;
}

.rpg-stat-header-label, .rpg-stat-header-value, .rpg-stat-header-increase, .rpg-stat-header-cost {
    font-weight: bold;
}

.rpg-stat-header-row {
}
.rpg-stat-row {
    margin-top: 4px;
    margin-bottom: 4px;
    text-align: left;
}

.rpg-stat-label {
    /*font-weight: bold;*/
}

.battle-result {
    float: right;
}

.rpg-stat-header-label, .rpg-stat-label, .battle-result {
    /*width: 80px;*/
    display: inline-block;
}

.rpg-stat-header-value, .rpg-stat-value {
    /*width: 80px;*/
    display: inline-block;
}

.rpg-stat-header-increase, .rpg-stat-increase {
    display: inline-block;
}

.rpg-stat-header-cost, .rpg-stat-cost {
    display: inline-block;
}

.health-bar {
    border-radius: 99px;
    flex-shrink: 0;
    /*width: 12px;
    flex-shrink: 0;*/
}

#floor-stats-label {
    font-family: monospace;
}

.ingame-overlay-container {
    top: 50%;
    transform: translate(-50%, -50%);
    left: 50%;
    width: max-content;
    z-index: 9999;
    position: absolute;
}

#stats-container {
    flex-direction: row;
    gap: 16px;
}

.btn-wrapper {
  display: inline-block; /* or inline-flex */
  width: fit-content;
  padding: 0;
  margin: 0;
  line-height: 0; /* kills any extra inline spacing */
}

/*select, .select {
    text-align: center;
    background: #4CA6FF;
    border: 1px solid #265380;
    margin: 0 8px;
    padding: 8px 0px;
    border-radius: 12px;
    line-height: 24px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    outline: none;
    color: white;
    width: fit-content;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='white' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select:hover, .select:hover {
    background-color: #265380;
}

select option {
    background: white;
    color: black;
    font-weight: normal;
}*/

.gui-stats-and-health {
    display: flex;
    flex-direction: row;
}

/*.gui-stats-and-health {
    position: absolute;
    top: 0;
    z-index: 2;
}
#gui-stats-and-health-player  { left: 0; }
#gui-stats-and-health-monster { right: 0; }*/

.gui-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
    height: fit-content;
}

.gui-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gui-stat-row svg {
    width: 40px;
    height: 40px;
}

.gui-stat-row span {
    font-family: monospace;
    font-size: 18px;
}

.gui-stat-row svg {
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
}
/*.gui-stat-row svg { filter: url(#icon-bevel); }*/


#power-ups-wrapper, #exit-wrapper {
    flex-direction: column;
    gap: 8px;
    display: flex;
    position: absolute;
    z-index: 1;
    /*top: 76px;
    left: 72px;
    margin-left: 64px;*/
}


#power-ups {
    flex-direction: row;
    gap: 16px;
    display: flex;
}

.power-up-video-icon {
    position: absolute;
    left: -8px;
    top: -10px;
}

.power-up-icon {
    height: 48px;
    width: 48px;
}

.power-up {
    opacity: 0.7;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
}
.power-up:hover {
    opacity: 0.9;
}

.power-up-label {
    font-family: monospace;
    text-align: center;
    font-size: 10px;
}

.power-up-shortcut {
    position: absolute;
    top: -5px;
    right: -5px;
    font-family: monospace;
    font-size: 10px;
    line-height: 1;
    color: #fff;
    background: #000;
    /*border: 1px solid #48baff;*/
    border-radius: 3px;
    padding: 2px 4px;
    /*box-shadow: 0 1px 0 #48baff;*/
}

.power-up-remaining {
    position: absolute;
    top: -5px;
    left: -5px;
    font-family: monospace;
    font-size: 10px;
    line-height: 1;
    color: #fff;
    background: #000;
    /*border: 1px solid #48baff;*/
    border-radius: 3px;
    padding: 2px 4px;
    z-index: 1;
    /*box-shadow: 0 1px 0 #48baff;*/
}

.power-up-shortcut, .power-up-video-icon {
    z-index: 1;
}


.cooldown {
    display: flex;
    align-items: center;
    margin-top: 1px
}

.cooldown-track {
    flex: 1;
    height: 9px;
    background: #000;
    border: 1px solid #000;
    border-radius: 999px;
    overflow: hidden;
}

.cooldown-fill {
    height: 100%;
    transform-origin: left center;
}


.select-container {
    position: relative; display: inline-block; width: fit-content;
    margin: auto; user-select: none;
}
.select-trigger {
    background: #EBB735  ; border: 1px solid #996E12;
    padding: 8px 40px 8px 28px; border-radius: 20px;
    line-height: 24px; font-size: 14px; font-weight: 600;
    letter-spacing: 0.02em; color: white; cursor: pointer;
    white-space: nowrap; outline: none; overflow: hidden;
    transition: background 0.15s ease;
}
.select-trigger:hover, .select-container.open .select-trigger { background: #996E12; }
.select-trigger::after {
    content: ''; position: absolute; right: 18px; top: 50%;
    width: 7px; height: 7px; border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: translateY(-65%) rotate(45deg);
    transition: transform 0.2s ease; pointer-events: none;
}
.select-container.open .select-trigger::after { transform: translateY(-35%) rotate(-135deg); }
.select-options {
    position: absolute; top: calc(100% + 6px); left: 50%; min-width: 100%;
    background: rgba(255,255,255,0.95); border: 1px solid rgb(128,128,128,0.9);
    border-radius: 10px; padding: 6px 0; z-index: 9999;
    opacity: 0; visibility: hidden; transform: translateX(-50%) translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    max-height: 240px; overflow-y: auto;
}
.select-container.open .select-options { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.select-option {
    padding: 8px 28px; font-size: 14px; font-weight: 600;
    letter-spacing: 0.02em; color: #996E12; cursor: pointer;
    white-space: nowrap; transition: background 0.1s ease, color 0.1s ease;
}
.select-option:hover { background: #EBB735  ; color: white; }
.select-option.selected { background: #996E12; color: white; }
.disabled { opacity: 0.4; cursor: default; pointer-events: none; }
 
.select-container.positive .select-trigger { border-color: #265380; background: #4CA6FF; }
.select-container.positive .select-trigger:hover,
.select-container.positive.open .select-trigger { background: #265380; }
.select-container.positive .select-option { color: #265380; }
.select-container.positive .select-option:hover { background: #4CA6FF; color: white; }
.select-container.positive .select-option.selected { background: #265380; color: white; }
 
.select-container.negative .select-trigger { border-color: #932C2B; background: #FF766B; }
.select-container.negative .select-trigger:hover,
.select-container.negative.open .select-trigger { background: #932C2B; }
.select-container.negative .select-option { color: #932C2B; }
.select-container.negative .select-option:hover { background: #FF766B; color: white; }
.select-container.negative .select-option.selected { background: #932C2B; color: white; }
 
.select-container.compact .select-trigger {
    padding: 6px 32px 6px 12px; font-size: 10px; border-radius: 6px; line-height: 18px;
}
.select-container.compact .select-trigger::after { right: 12px; width: 5px; height: 5px; }
.select-container.compact .select-options { border-radius: 6px; }
.select-container.compact .select-option { padding: 6px 12px; font-size: 10px; }



/* --- Toast notifications --- */
/* Add this to the end of app.css, before the dimension comments */
 
#toast-container {
    position: fixed;
    /*bottom: 20px;*/
   /* left: 50%;
    transform: translateX(-50%);*/
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 99999;
    pointer-events: none;
    bottom: 4px;
    right: 4px;
}
 
.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: white;
    border: 1px solid;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    cursor: pointer;
    opacity: 0;
    transform: translateY(-12px);
    animation: toastIn 0.25s ease forwards;
    max-width: 400px;
    word-break: break-word;
}
 
.toast.removing {
    animation: toastOut 0.3s ease forwards;
}
 
.toast.neutral {
    background: rgba(255,255,255,0.95);
    border-color: rgb(128,128,128,0.9);
    color: #333;
}
 
.toast.positive {
    background: #4CA6FF;
    border-color: #265380;
}
 
.toast.negative {
    background: #FF766B;
    border-color: #932C2B;
}
 
.toast-dismiss {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    font-size: 14px;
    opacity: 0.7;
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
    padding: 0;
    font-weight: bold;
}
 
.toast-dismiss:hover {
    opacity: 1;
}
 
@keyframes toastIn {
    0% { opacity: 0; transform: translateY(-12px); }
    100% { opacity: 1; transform: translateY(0); }
}
 
@keyframes toastOut {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-12px); }
}



/* 1077 x 606 */
/* 907 x 510 */
/* 821 x 462 */

/*
    < 1024w || < 560h
*/

@media (max-height: 600px) {
    #extra-skills-inner {
        max-height: 201px;
        overflow: auto;
        margin-bottom: 16px
    }
}
/*
@media (max-height: 550px) {
    .button.rpg-button {
        padding: 4px;
        width: 34px;
    }
}

@media (max-height: 670px) {
    .button.rpg-button.small {
        padding: 4px;
        width: 34px;
    }
}*/

/*@media (max-height: 449px) {
    #stats-container, #skills-overlay, #battle-results-overlay {
        transform: translate(-50%, -50%) scale(0.8);
    }
    #gui-stats-player {
        transform: translate(10%, -10%)  scale(0.8);
    }
    #gui-stats-monsters {
        transform: translate(-10%, -10%)  scale(0.8);
    }
}*/

@media (max-height: 540px) and (min-height: 450px) {
    #stats-container {
        transform: translate(-50%, -50%) scale(0.85) !important;
    }
}

@media (max-height: 680px) and (min-height: 650px) {
    #skills-overlay {
        transform: translate(-50%, -50%) scale(0.95) !important;
    }
}

@media (max-height: 650px) and (min-height: 450px) {
    #skills-overlay {
        transform: translate(-50%, -50%) scale(0.9) !important;
    }
}

#stat-tooltip-overlay {
    width: 234px
}

@media (max-width: 1000px) {
    #stat-tooltip-overlay {
        width: 140px
    }
}

.dungeon-btn {
    background: #4CA6FF;
    border: 1px solid #265380;
    border-radius: 6px;
    width: 44px;
    height: 44px;
}

.dungeon-btn img {
    width: 40px;
}

.dungeon-btn img:not(.selected) {
    filter: grayscale(100%);
}

.dungeon-btn:not(.locked) img:not(.selected) {
    cursor: pointer;
}

.dungeon-btn:not(.locked) img:hover {
    filter: none;
}
