@font-face {
    font-family: 'PirataOne';
    src: url('/fonts/PirataOne-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Majalla';
    src: url('/fonts/majalla.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Nyala';
    src: url('/fonts/nyala.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'HightTower';
    src: url('/fonts/HTOWERT.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

html {
    font-size: 2.25vh;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

.background-color {
    height: 100%;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -9999999;
    background-color: #262626;
    background-image:
        radial-gradient(60vw 50vh at 50% -5%, color-mix(in srgb, var(--player-primary, #ffdf80) 40%, transparent), transparent 70%),
        radial-gradient(140vw 120vh at 50% 130%, rgba(0, 0, 0, 0.6), transparent 75%);
}

.participant-name {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-direction: column;
    position: relative;
    padding-top: 0.6vh;
    padding-bottom: 0.5vh;
    margin-bottom: 2vh;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.6) 0%, rgba(60, 60, 60, 0.4) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0 0 3vh 3vh;
    margin-right: 15vw;
    margin-left: 15vw;
}

/* Gloomhaven class-card look (the glowing border above a card's title banner): a two-tone line in the
   player's own colours across the top edge, brightest under the name and fading at the corners, with a
   small glowing spark marking each end where the card's ornament would sit. */
.participant-name::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg,
        transparent,
        var(--player-secondary, #ffdf80) 25%,
        var(--player-primary, #ffdf80) 50%,
        var(--player-secondary, #ffdf80) 75%,
        transparent);
    opacity: 0.9;
}

.participant-name h1 {
    font-family: 'PirataOne';
    font-weight: 600;
    font-size: 2rem;
    letter-spacing: 0.01em;
    margin: 0.35vh 0;
    color: #ffdf80;
    -webkit-text-stroke-width: 0.25px;
    -webkit-text-stroke-color: black;
}

.game-info {
    border-radius: 2.5vh;
    margin-bottom: 1vh;
    margin-left: 2.5vw;
    margin-right: 2.5vw;
    background-color: black;
    margin-bottom: 1em;
}

.round-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 95vw;
    padding: 1vh 25vw;
    background: #ffdf80;
    border-top-left-radius: 2.5vh;
    border-top-right-radius: 2.5vh;
    font-family: 'Nyala', serif;
    font-weight: 800;
    text-align: center;
    font-size: 1.1em;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.player-row {
    display: flex;
    align-content: center;
    justify-content: space-between;
    align-items: center;
    padding-top: 1vh;
    padding-bottom: 1vh;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    padding: 1.5vh 0vw;
    /* The row's background is the participant's raw primary colour (set inline per row); at full
       saturation a whole row of it fights with the name/HP/initiative sitting on top. */
    filter: saturate(0.7) brightness(0.88);
}

.player-row * {
    pointer-events: none;
}

.players-info {
    width: 95vw;
    background: rgba(0, 0, 0, 0.15);
    border-bottom-left-radius: 2.5vh;
    border-bottom-right-radius: 2.5vh;
    overflow: hidden;
}

.elements-info {
    width: 95vw;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5vh;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 2vh;
    border-radius: 2.5vh;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    margin-top: 1.5vh;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.element-info {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75vh 4vw;
    border-radius: 2.5vh;
    transition: transform 0.2s ease;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 2px solid rgba(0, 0, 0, 0.1);
    font-family: 'Nyala', serif;
}

.element-info--dark {
    color: white;
}

.element-rounds-dot {
    height: 2vh;
    width: 2vh;
    border-radius: 50%;
    display: inline-block;
    box-shadow: inset 0px 0px 0px 0.2vh black;
    margin-left: 10px;
}

.element-rounds-dot--fresh {
    background-color: green;
}

.element-rounds-dot--last-round {
    background-color: orange;
}

.dm-management {
    display: flex;
    flex-direction: column;
}

    .dm-management > *:not(:last-child) {
        margin-bottom: 5vh;
    }

.dm-management-button {
    width: 35vw;
}

.dm-management-button--compact {
    min-width: 17.5vw;
}

.lock-nisjetif-button {
    width: 15vw;
    border-radius: 0.5vh;
    margin-left: 1vh;
    padding-top: 1px;
    padding-bottom: 1px;
}

.initiative-selection {
    display: flex;
    align-content: center;
    justify-content: space-between;
    align-items: center;
    gap: 1vh;
}

.initiative-group {
    display: flex;
    align-items: center;
}

.initiative-field {
    width: 5rem;
    border-radius: 0.5vh;
}

.rest-group {
    display: flex;
    gap: 1vh;
    align-items: center;
}

.rest-icon {
    width: 3vh;
    height: 3vh;
}

.rest-button {
    background-color: #ffdf80;
    border: 2px solid rgba(0,0,0,0.3);
    border-radius: 1vh;
    padding: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rest-button:hover {
}

.rest-button:active {
    transform: scale(0.95);
}

.remove-member-button {
    margin-right: 1vh;
}

.dm-management_row {
    display: flex;
    align-content: center;
    justify-content: space-between;
    align-items: center;
    margin-left: 5vw;
    margin-right: 5vw;
    width: 90vw;
}

/* space-between only spreads a row apart when there are two buttons pulling against each other; a lone
   button (Playlist) has nothing to space against and space-between just pins it to the left edge. */
.dm-management_row--single {
    justify-content: center;
}

.initiative-text {
    background: rgba(0, 0, 0, 0.65);
    color: darkgray;
    width: 5.5vh;
    min-width: 5.5vh;
    border-radius: 0.5em;
    margin-right: 1vh;
    font-family: 'HightTower', cursive;
    font-size: 1.5em;
    transition: all 0.3s ease;
    flex-shrink: 0;
    height: 6vh;

    display: flex;
    justify-content: center;
    align-items: center;
}

    .initiative-text.is-number {
        align-items: flex-start;
    }

.initiative-text_glowing {
    background: rgba(0, 0, 0, 0.65);
    color: lightgoldenrodyellow;
    width: 5.5vh;
    min-width: 5.5vh;
    border-radius: 0.5em;
    text-align: center;
    margin-right: 1vh;
    text-shadow: 0 0 10px #ffd352, 0 0 15px #ffd352, 0 0 20px #ffd352, 0 0 25px #ffd352;
    -webkit-text-stroke-width: 0.2px;
    -webkit-text-stroke-color: black;
    font-family: 'HightTower', cursive;
    font-size: 1.5em;
    transition: all 0.3s ease;
    flex-shrink: 0;
    height: 6vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .initiative-text_glowing.is-number {
        align-items: flex-start;
    }

.initiative-info {
    background: linear-gradient(135deg, rgba(30,30,30,0.6) 0%, rgba(60,60,60,0.4) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 2vh;
    padding: 2vh 1.5vh;
    margin: 1.5vh 2.5vw;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.initiative-info > :last-child {
    margin-bottom: 0;
}

.initiative-info > *:not(:last-child) {
    margin-bottom: 0.5vh;
}

.player-name {
    font-weight: bold;
    font-family: 'PirataOne';
    font-size: 1.2em;
}

.element-menu-title {
    font-weight: bold;
    font-size: 1.2em;
}

.element-circle {
    width: 5vh;
    height: 5vh;
    border-radius: 50%;
    margin-bottom: 0.5vh;
}

.condition-icon {
    height: 2vh;
    max-width: 2vh;
}

.participant-initiative-name {
    font-family: 'PirataOne', cursive;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased !important;
    text-rendering: optimizelegibility !important;
    font-size: 1.35em;
    letter-spacing: 0.02em;
    font-weight: 500;
    margin-left: 1vh;
    color: #d1cdc7;
    text-shadow: 0 0 2px rgba(209, 205, 199, 0.75), 0 0 4px rgba(209, 205, 199, 0.5), 0 0 8px rgba(209, 205, 199, 0.3);
    /* Gives the hit points beside it a shared starting point, so the table reads as a column for as long as
       the names stay under it rather than jumping about per row. */
    min-width: 6.5em;
    flex-shrink: 0;
}

/* Everything that is not the name: conditions, then hit points, then initiative, in that reading order,
   pinned to the row's right edge by the row's own space-between. */
.participant-right {
    display: flex;
    align-items: center;
    gap: 1.2vh;
    flex-shrink: 0;
}

/* Sits directly beside the initiative number it explains. A fixed width rather than a minimum, so "1/12"
   and "14/20" occupy the same box and every row's chip lines up in a column instead of each one sizing
   to its own digits. Widest case is 4 digits either side of the slash, e.g. "88/88". The colour and size
   of the halo come from the hit point ratio and are set per row; see HitPointGlow. */
.participant-hit-points {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.5em;
    flex-shrink: 0;
    padding: 0.4vh 0;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 0.5em;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.participant-hit-points__value {
    font-family: 'Nyala', serif;
    font-weight: 800;
    font-size: 0.95em;
    letter-spacing: 0.02em;
    color: #fff;
}

.player-row--dead {
    opacity: 0.55;
    filter: grayscale(0.6);
}

.player-row--last {
    border-bottom-left-radius: 1.5vh;
    border-bottom-right-radius: 1.5vh;
}

.player-row--locked {
    -webkit-box-shadow: rgba(0, 0, 0, 0.3) 0px 0px 0px 1000px inset;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 0px 0px 1000px inset;
}

.participant-conditions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5vh;
}

.participant-status-icon {
    width: 4vh;
    height: 4vh;
    border-radius: 50%;
}

.participant-condition {
    width: fit-content;
    border-radius: 25%;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.participant-condition--fresh {
    background-color: darkred;
}

.participant-condition--fading {
    background-color: red;
}

.participant-condition--last-round {
    background-color: orange;
}

.participant-condition--dead {
    background-color: black;
}

.participant-death-icon {
    width: 4vh;
    height: 4vh;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4vh;
    line-height: 1;
}

.tracker-fields {
    display: flex;
    flex-direction: column;
    gap: 1.2vh;
    width: fit-content;
    margin: 1.5vh auto;
    padding: 1.8vh 3vh;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.6) 0%, rgba(60, 60, 60, 0.4) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 2vh;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.tracker-field {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1vh;
    margin-bottom: 0;
}

.tracker-field__label {
    font-family: 'Nyala', serif;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 1.2em;
    color: #ffdf80;
}

/* Same fixed width on both rows, so the HP and XP controls line up however much is inside them. */
.tracker-field__pair {
    display: flex;
    align-items: center;
    gap: 0.4em;
    width: 14.5em;
}

.tracker-field__separator {
    font-family: 'Nyala', serif;
    font-weight: 800;
    color: #ffdf80;
}

/* Fixed rather than a share of the row, so the experience field matches the current hit points instead of
   stretching to fill a row it has fewer things in. */
.tracker-field__input {
    box-sizing: border-box;
    width: 4em;
    height: 2.4em;
    flex: none;
    min-width: 0;
    border-radius: 0.5vh;
    border: 2px solid rgba(255, 223, 128, 0.4);
    background-color: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-family: 'Nyala', serif;
    font-weight: 700;
    text-align: center;
    padding: 0.25em 0.5em;
}

.tracker-field__step {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2.4em;
    height: 2.4em;
    background-color: #ffdf80;
    border: 2px solid rgba(0, 0, 0, 0.35);
    border-radius: 0.5vh;
    cursor: pointer;
    color: #3a2a05;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 3px 0 0 rgba(0, 0, 0, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.tracker-field__step:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.35);
}

.hit-point-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1vh;
    margin-bottom: 1vh;
}

.hit-point-button {
    width: 4em;
    background-color: #fff;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.5vh;
    cursor: pointer;
    font-weight: 700;
    padding: 0.5vh 0;
}

.hit-point-button:active {
    transform: scale(0.95);
}

.hit-point-separator {
    font-weight: 700;
    color: #fff;
}

.hit-point-input {
    width: 4em;
    text-align: center;
    border-radius: 0.5vh;
    border: 2px solid rgba(0, 0, 0, 0.2);
    padding: 0.5vh;
    font-size: 1.1em;
}

.player-page {
    display: flex;
    flex-direction: column;
}

/* One button family for every DM/player action, gold pill styling borrowed from the popups (dropdowns,
   the moodplayer panel) so the whole page reads as one design instead of dm-management-button's bare
   OS-default look next to dropbtn's styled one. */
.dropbtn,
.dm-management-button {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid rgba(0, 0, 0, 0.25);
    cursor: pointer;
    background-color: #ffdf80;
    border-radius: 2.5vh;
    font-family: 'Nyala', serif;
    font-weight: 800;
    text-align: center;
    font-size: 1em;
    color: #3a2a05;
    min-width: 7em;
    padding: 0.3em 0.5em;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.dropbtn--compact {
    padding: 0.3em 0.25em;
}

.dropbtn:active,
.dm-management-button:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Same gold pill, hue-rotated rather than given separate colours - so a "good" action (add monster, next
   round) reads green and a "drastic" one (reset round, reset game) reads red, while staying visibly the
   same button family as the (untinted, gold) element buttons. border/box-shadow are greyscale, so the
   rotation only touches the background and text. */
.dm-management-button--positive {
    filter: hue-rotate(95deg);
}

.dm-management-button--danger {
    filter: hue-rotate(-45deg);
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content-activate-element {
    display: none;
    position: absolute;
    background-color: #f1f1f1;
    min-width: 100vw;
    text-align: center;
    overflow: auto;
    box-shadow: 0px 8px 24px 0px rgba(0,0,0,0.3);
    z-index: 1;
    border-radius: 1vh;
}

.dropdown-content-activate-element.show {
    animation: slideIn 0.2s ease-out;
}

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

.dropdown-content-use-element {
    display: none;
    position: absolute;
    background-color: #f1f1f1;
    min-width: 100vw;
    text-align: center;
    overflow: auto;
    box-shadow: 0px 8px 24px 0px rgba(0,0,0,0.3);
    z-index: 1;
    border-radius: 1vh;
}

.dropdown-content-use-element.show {
    animation: slideIn 0.2s ease-out;
}

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

.dropdown-content-apply-condition {
    display: none;
    position: absolute;
    background-color: #f1f1f1;
    min-width: 100vw;
    text-align: center;
    overflow: auto;
    box-shadow: 0px 8px 24px 0px rgba(0,0,0,0.3);
    z-index: 1;
    border-radius: 1vh;
}

.dropdown-content-apply-condition.show {
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.context-menu-header {
    background-color: #333;
    color: white;
    padding: 1.5vh 2vh;
    border-top-left-radius: 1vh;
    border-top-right-radius: 1vh;
    text-align: center;
}

.context-menu-section {
    padding: 1vh 2vh;
    border-bottom: 1px solid #ddd;
    background-color: antiquewhite;
}

    .context-menu-section:last-child {
        border-bottom: none;
        border-bottom-left-radius: 1vh;
        border-bottom-right-radius: 1vh;
    }

.section-title {
    font-size: 0.9em;
    font-weight: bold;
    color: #666;
    margin-bottom: 1vh;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Nyala', cursive;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1vh;
    padding: 0.5vh;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: -webkit-center;
    justify-content: center;
    padding: 1vh;
    background-color: white;
    border-radius: 0.5vh;
    cursor: pointer;
    border: 2px solid;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.status-item:active {
    transform: scale(0.95);
}

.status-icon-small {
    width: 5vh;
    height: 5vh;
    margin-bottom: 0.5vh;
}

.status-name {
    font-size: 0.8em;
    font-weight: 500;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    color: black;
    font-family: 'Nyala', cursive;
}

.action-item {
    display: block;
    padding: 1.5vh 2vh;
    background-color: #fff;
    border-radius: 0.5vh;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    border: 2px solid transparent;
}

    .action-item:hover {
        background-color: #e0e0e0;
    }

.action-item-danger {
    color: #d32f2f;
    border-color: #ffcdd2;
}

    .action-item-danger:hover {
        background-color: #ffebee;
        border-color: #ef5350;
    }

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

.show {
    display: block;
}

.moodplayer-control {
    display: none;
    position: absolute;
    left: 0;
    min-width: 100vw;
    box-sizing: border-box;
    padding: 2vh;
    border-radius: 1vh;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    box-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.3);
    z-index: 2;
    flex-direction: column;
    gap: 1.5vh;
}

.moodplayer-control.show {
    display: flex;
    animation: slideIn 0.2s ease-out;
}

.moodplayer-control__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
}

.moodplayer-control__status--online {
    color: #7CFC7C;
}

.moodplayer-control__status--offline {
    color: #aaa;
}

.moodplayer-control__now {
    min-height: 1.5em;
    opacity: 0.85;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.2em;
}

.moodplayer-control__song {
    font-weight: bold;
}

.moodplayer-control__meta {
    font-size: 0.85em;
    opacity: 0.8;
}

.moodplayer-control__transport {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6vw;
}

/* The tappable area was already this big; it just did not look it, because a 12% white fill on a dark
   panel reads as background. Capped so the circles stay circles on a laptop instead of filling the row. */
.moodplayer-control__transport-button {
    border-radius: 50%;
    width: min(17vw, 4.5rem);
    height: min(17vw, 4.5rem);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    background: rgba(255, 255, 255, 0.22);
    transition: transform 0.1s ease;
}

.moodplayer-control__transport-button:active {
    transform: scale(0.93);
}

.moodplayer-control__transport-button--play {
    background: #7CFC7C;
    color: #000;
    border-color: rgba(0, 0, 0, 0.25);
    width: min(22vw, 5.75rem);
    height: min(22vw, 5.75rem);
}

.moodplayer-control__icon {
    width: 45%;
    height: 45%;
    fill: currentColor;
}

.moodplayer-control__volume {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4vw;
}

.moodplayer-control__volume-button {
    border-radius: 0.5vh;
    padding: 1vh 4vw;
    cursor: pointer;
}

.moodplayer-control__volume-value {
    min-width: 4em;
    text-align: center;
    font-size: 1.2em;
}

.moodplayer-control__playlists {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5vw;
    justify-content: center;
}

.moodplayer-control__playlist {
    border-radius: 0.5vh;
    padding: 1vh 3vw;
    cursor: pointer;
    border: 2px solid transparent;
}

.moodplayer-control__playlist--active {
    border-color: #7CFC7C;
    font-weight: bold;
}
