body {
    font-family: "Balsamiq Sans", "Huninn", sans-serif;
}

/* Disable vertical page scrolling on desktop/tablet (width > 600px) */
@media (min-width: 601px) {
    html, body {
        overflow-y: hidden;
        height: 100vh;
    }
}

button:focus,
input:focus,
a:focus,
button:focus-visible,
input:focus-visible,
a:focus-visible,
button:active,
input:active,
a:active {
    outline: none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
    text-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}

* {
    -webkit-tap-highlight-color: transparent;
}

h1 {
    font-family: "Cabin Sketch", sans-serif;
    font-weight: bold;
    font-size: 64px;
    line-height: 60px;
    text-align: center;
    margin-top: 29px;
    user-select: none;
}

h2 {
    font-weight: normal;
    font-size: 16px;
    text-align: center;
    margin: -37px auto 20px auto;
    user-select: none;
}

.home-btn {
    font-size: 14px;
    display: block;
    margin: 0px auto;
    height: 25px;
    width: 64px;
    padding-top: 3px;
    user-select: none;
}

#add-btn {
    font-weight: normal;
    font-family: "Balsamiq Sans", sans-serif;
    color: white;
    background-color: black;
    border: none;
    appearance: none;
    -webkit-appearance: none; 
    -moz-appearance: none;
    --base-rotation: 10deg;
    transform: rotate(var(--base-rotation));
    margin-bottom: 10px;
}

@media (hover: hover) {
    #add-btn:hover {
        --base-rotation: 0deg;
        cursor: pointer;
    }
}

#edit-btn {
    font-weight: bold;
    font-family: "Balsamiq Sans", sans-serif;
    color: black;
    background-color: white;
    border: 2px solid black;
    appearance: none;
    -webkit-appearance: none; 
    -moz-appearance: none;
    --base-rotation: 10deg;
    transform: rotate(var(--base-rotation));
}

/* Header badge */
#home-top {
    position: relative;
}
#hatred-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 64px;
    height: auto;
    pointer-events: none;
    user-select: none;
}

@media (hover: hover) {
    #edit-btn:hover {
        --base-rotation: 0deg;
        cursor: pointer;
    }
}

.hidden {
    display: none;
}

#form {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: black;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateY(0);
    transition: transform 0.3s ease-out;
    box-sizing: border-box;
}

#form.hidden {
    transform: translateY(100%);
    pointer-events: none;
}

/* password form */
#password-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateX(0);
    transition: transform 0.3s ease-out;
    visibility: visible;
}

#password-form.hidden {
    visibility: hidden;
    pointer-events: none;
}

#password-form.slide-left {
    transform: translateX(-100%);
}

#password-form label{
    display: block;
    margin: 0 auto;
    color: white;
    font-size: 20px;
    font-weight: normal;
    text-align: center;
}

#password-form input {
    font-family: "Balsamiq Sans", sans-serif;
    color: white;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid white;
    margin: 0 auto;
    width: 210px;
    height: 60px;
    font-size: 32px;
    font-weight: normal;
    text-align: center;
    outline: none;
    display: block;
    letter-spacing: 0.5em;
    text-indent: 15px;
    margin-top: 30px;
    caret-color: transparent;
    box-sizing: border-box;
}

@media (hover: hover) {
    #password-form input:hover {
        border-bottom: 2px solid white;
    }
}

#password-form input:focus {
    border-bottom: 2px solid white;
}

#password-form input:-webkit-autofill,
#password-form input:-webkit-autofill:hover,
#password-form input:-webkit-autofill:focus,
#password-form input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px black inset !important;
    -webkit-text-fill-color: white !important;
    caret-color: transparent;
    border-bottom: 1px solid white;
}

#password-form input::selection {
    background: transparent;
    color: inherit;  
}

#password-form button {
    display: block;
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 50%;
    text-align: center;
    font-size: 24px;
    font-family: "Balsamiq Sans", sans-serif;
    font-weight: normal;
    background-color: black;
    color: white;
    border: 1px solid white;
    padding-top: 3px;
    margin-top: 30px;
    user-select: none;
    cursor: pointer;
}

#password-form p {
    font-weight: normal;
    text-align: center;
    font-size: 13px;
    margin-top: 24px;
}

@media (hover: hover) {
    #password-form button:hover {
        border: 2px solid white;
    }
}

.close-btn {
    position: absolute;
    top: 50px;
    right: 50px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1000;
    padding: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#close-btn1 svg path {
    stroke: white;
    stroke-width: 1;
}

@media (hover: hover) {
    #close-btn1:hover svg path {
        stroke-width: 2;
    }
}

#close-btn2 svg path {
    stroke: black;
    stroke-width: 2;
}

@media (hover: hover) {
    #close-btn2:hover svg path {
        stroke-width: 3;
    }
}

#close-btn3 svg path {
    stroke: white;
    stroke-width: 1;
}

@media (hover: hover) {
    #close-btn3:hover svg path {
        stroke-width: 2;
    }
}

/* canvas form */
#canvas-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background-color: white;
    color: black;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    visibility: hidden;
    pointer-events: none;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

#canvas-form.hidden {
    visibility: hidden;
    pointer-events: none;
}

#canvas-form.slide-in {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

#canvas-form.slide-left {
    transform: translateX(-100%);
}

#canvas-form canvas {
    border: 2px solid black;
    background-color: white;
    border-radius: 10px;
    touch-action: none;
}

#canvas-label {
    margin-bottom: -7px;
    font-size: 20px;
    font-weight: normal;
    text-align: center;
}

#odor-select-container {
    position: relative;
    width: 120px;
}

#odor-select-display {
    width: 120px;
    height: 18px;
    padding-top: 2px;
    margin: 5px auto;
    background-color: #cccccc;
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-family: "Balsamiq Sans", sans-serif;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

#odor-select-dropdown {
    position: absolute;
    top: 40px;
    left: 0;
    width: 120px;
    background-color: white;
    z-index: 1000;
}

.odor-option {
    padding: 3px 0 0 0;
    height: 17px;
    font-size: 14px;
    font-family: "Balsamiq Sans", sans-serif;
    text-align: center;
    cursor: pointer;
    color: black;
    transition: opacity 0.2s;
    user-select: none;
}

@media (hover: hover) {
    .odor-option:hover {
        opacity: 0.7;
    }
}
.odor-option:nth-child(1) { background-color: #cccccc; display: none; } 
.odor-option:nth-child(2) { background-color: #ff99ff; } 
.odor-option:nth-child(3) { background-color: #a1ffa5; } 
.odor-option:nth-child(4) { background-color: #2effff; } 
.odor-option:nth-child(5) { background-color: #d5ff57; } 
.odor-option:nth-child(6) { background-color: #d5a6ff; } 
.odor-option:nth-child(7) { background-color: #ffab73; }

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid black;
    cursor: pointer;
}

@media (hover: hover) {
    .color-option:hover {
        transform: scale(1.15);
    }
}

#tools {
    width: 305px;
    margin: 5px auto 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tool {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: transparent;
    position: relative;
}

.tool-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tool-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
}

@media (hover: hover) {
    .tool:hover .tool-hover {
        opacity: 1;
    }
}

#color-div {
    width: 96px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#tools-div {
    width: 96px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#color-black {
    background-color: black;
}

#color-odor {
    background-color: #cccccc;
}

.selected-color {
    transform: scale(1.15);
}

#canvas-msg {
    font-weight: normal;
    text-align: center;
    font-size: 13px;
    margin: 5px auto;
}

#ok-btn2 {
    display: block;
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 50%;
    text-align: center;
    font-size: 24px;
    font-family: "Balsamiq Sans", sans-serif;
    font-weight: normal;
    background-color: white;
    color: black;
    border: 2px solid black;
    padding-top: 3px;
    user-select: none;
    cursor: pointer;
}

@media (hover: hover) {
    #ok-btn2:hover {
        border: 3px solid black;
    }
}

/* Info form */
#blank-space {
    min-height: 30px;
}

#info-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background-color: black;
    color: white;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    visibility: hidden;
    pointer-events: none;
}

#info-form.hidden {
    visibility: hidden;
    pointer-events: none;
}

#info-form.slide-in {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    width: 100%;
}

.info label {
    font-size: 20px;
    font-weight: normal;
    color: white;
    text-align: center;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.info input {
    color: white;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid #ccc;
    width: 80%;
    max-width: 400px;
    height: 40px;
    font-size: 16px;
    text-align: center;
    outline: none;
    padding: 0;
    margin: 0 auto;
    display: block;
    box-sizing: border-box;
    font-family: "Balsamiq Sans", "Huninn", sans-serif;
}

.info input::placeholder {
    color: #5c5c5c;
    font-size: 16px;
}

@media (hover: hover) {
    .info input:hover {
        border-bottom: 2px solid white;
    }
}

.info input:focus {
    border-bottom: 2px solid white;
}

#time-input {
    font-size: 16px;
    color: white;
    text-align: center;
    margin: 0 auto;
    padding-left: 18px;
}

#info-form .ok-btn {
    display: block;
    margin: 0 auto;
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 50%;
    text-align: center;
    font-size: 24px;
    font-family: "Balsamiq Sans", sans-serif;
    font-weight: normal;
    background-color: black;
    color: white;
    border: 1px solid white;
    padding-top: 3px;
    margin-top: -5px;
    user-select: none;
    cursor: pointer;
}

@media (hover: hover) {
    #info-form .ok-btn:hover {
        border: 2px solid white;
    }
}

#info-msg {
    font-weight: normal;
    text-align: center;
    font-size: 13px;
    color: white;
    margin-top: 15px;
    min-height: 20px;
    line-height: 20px;
}

/* home page */
#drawings-gallery {
    margin-top: 40px;
    text-align: center;
}

#drawings-gallery h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    color: black;
}

#drawings-container {
    display: flex;
    gap: 15px;
    margin: -15px auto 0 auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    padding: 0 20px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#drawings-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Booster button bottom-right */
#booster-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 900;
}
#booster-btn .booster-icon,
#booster-btn .booster-hover {
    position: absolute;
    bottom: 10px; right: 0;
    width: 150px; height: 150px;
    object-fit: contain;
}
#booster-btn .booster-icon,
#booster-btn .booster-hover { 
    transform-origin: 50% 50%;
    animation: boosterFloatScale 2s ease-in-out infinite;
}
#booster-btn .booster-hover { opacity: 0; }
@media (hover: hover) {
  #booster-btn:hover .booster-hover { opacity: 1; }
  #booster-btn:hover .booster-icon { opacity: 0; }
}

/* Booster modal overlay */
#booster-overlay {
    position: fixed;
    inset: 0;
    z-index: 950;
    display: none;
}
#booster-overlay.hidden { display: none; }
#booster-overlay.show { display: block; }

#booster-backdrop {
    position: absolute;
    inset: 0;
}

@keyframes boosterFloatScale {
  0%   { transform: scale(1) translateY(0); }
  50%  { transform: scale(1.07) translateY(-5px); }
  100% { transform: scale(1) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  #booster-btn .booster-icon,
  #booster-btn .booster-hover { animation: none; }
}

/* Disable booster animation after user scroll interaction */
body.no-float #booster-btn .booster-icon,
body.no-float #booster-btn .booster-hover { animation: none !important; }
#booster-card {
    position: absolute;
    left: 50%;
    top: 100%; /* start off-screen bottom */
    transform: translate(-50%, 0);
    transition: transform .35s ease, top .35s ease;
}
#booster-card.show {
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Animations for page elements during booster */
.booster-down { transform: translateY(calc(100vh + 100%)); transition: transform .45s ease; will-change: transform; }
.home-top-up { transform: translateY(-110vh); transition: transform .45s ease; will-change: transform; }


@media (max-width: 600px) {
    #drawings-container {
        flex-direction: column;
        align-items: center;
        overflow-x: hidden;
        overflow-y: hidden;
        justify-content: center;
        padding: 0;
    }
}

.drawing-item {
    position: relative;
    background-color: white;
    border: 2px solid black;
    border-radius: 10px;
    text-align: center;
    width: 285px;
    height: 398px;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    box-sizing: border-box;
}

.drawing-item img {
    width: 245px;
    height: 245px;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

.drawing-item .name {
    font-family:"Cabin Sketch", sans-serif;
    font-size: 27px;
    font-weight: bold;
    margin: 8px 20px 3px 20px;
    color: black;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-spacing: -1px;
    letter-spacing: -0.5px;
}

.drawing-item .type {
    position: absolute;
    height: 18px;
    font-size: 14px;
    color: black;
    text-align: center;
    line-height: 18px;
    transform: rotate(10deg);
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 5px;
    z-index: 10;
    padding-top: 2px;
}

.drawing-item .location {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: bold;
    width: 245px;
    margin: 3px auto 5px auto;
}

.drawing-item .description {
    margin: 0 auto 9px auto;
    width: 245px;
    height: 30px;
    font-size: 12px;
    font-weight: normal;
    line-height: 15px;
    text-align: justify;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.drawing-item .description.single-line {
    line-height: 30px;
    text-align: center;
}

#line {
    margin: 0 50px 0 20px;
    border: 1px solid black;
}

.drawing-item .footer {
    display: flex;
    align-items: center;
    height: 34px;
    margin: 0 20px 0 20px;
}

.drawing-item .footer .trainer {
    font-size: 12px;
    font-weight: normal;
    text-align: left;
}

.drawing-item .footer .time {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: normal;
    text-align: center;
    width: 100%;
}

.drawing-item .footer .like {
    font-size: 16px;
    font-weight: normal;
    margin-left: auto;
    text-align: right;
}

.drawing-item .footer .like.liked {
    font-weight: bold;
}

.drawing-item .footer .space {
    width: 30px;
}

/* Angry like button */
.drawing-item .angry {
    position: absolute;
    bottom: 5px;
    right: 7px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.drawing-item .angry .angry-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.drawing-item .angry .angry-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
}

@media (hover: hover) {
    .drawing-item .angry:hover .angry-hover {
        opacity: 1;
    }
}

.drawing-item .angry .angry-active-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
}

.drawing-item .angry.angry-active .angry-active-img {
    opacity: 1;
}

.drawing-item .angry.angry-active .angry-hover {
    opacity: 0;
}

/* Shake animation */
@keyframes shake {
    0% { transform: translateX(0); }
    10% { transform: translateX(-4px); }
    20% { transform: translateX(4px); }
    30% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    50% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
    70% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
    90% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

#delete-tool.shake,
#odor-select-container.shake {
    animation: shake 1s ease;
}