:root {
    --bg1: #a1c4fd; /* plava */
    --bg2: #c2e9fb; /* svjetlo plava */
    --accent: #ffeb3b; /* žuta oblačić */
    --ink: #101828;
      /* tamni tekst */ --card: #ffffffee;
    --primary: #7c3aed; /* ljubičasta za gumb */
    --primary-2: #a78bfa; /* svjetlija */
    --shadow: 0 10px 20px rgba(16, 24, 40, .12);
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    font-family: "Nunito", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--ink);
    overflow-x: hidden;
    background: linear-gradient(135deg, var(--bg1), var(--bg2));
}

.bg-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bubble, .star {
    position: absolute;
    opacity: .25;
    filter: blur(0.2px);
    animation: floatUp linear infinite;
    border-radius: 50%;
    background: #fff;
}

.bubble {
    width: 18px;
    height: 18px;
}

.star {
    width: 8px;
    height: 8px;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

@keyframes floatUp {
    from {
        transform: translateY(100vh) translateX(var(--x));
    }
    to {
        transform: translateY(-20vh) translateX(calc(var(--x) + 10px));
    }
}

.wrapper {
    position: relative;
    z-index: 1;
    padding: clamp(16px, 3vw, 32px);
}

.title {
    text-align: center;
    margin: 8px auto 18px;
    max-width: 900px;
    color: #1f2937;
    text-shadow: 0 2px 0 #ffffff80;
}

.title h1 {
    font-size: clamp(28px, 5vw, 44px);
    margin: 0 0 8px;
    font-weight: 900;
    letter-spacing: .3px;
}

.title p {
    font-size: clamp(14px, 2.4vw, 18px);
    margin: 0;
    opacity: .9
}

.grid {
    display: grid;
    gap: 18px;
    margin: auto;
    max-width: 1000px;
    grid-template-columns: repeat(12, 1fr);
}

.characters {
    grid-column: 1 / -1;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 800px) {
    .characters {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card);
    border: 4px solid #111;
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 18px;
    position: relative;
    overflow: hidden;
    transition: transform .2s ease;
}

.card:after {
    content: "";
    position: absolute;
    inset: auto -20% -35% -20%;
    height: 70%;
    background: radial-gradient(120px 120px at 20% 30%, #fff8 0 50%, transparent 55%),
    radial-gradient(100px 100px at 80% 10%, #fff6 0 45%, transparent 55%);
    transform: rotate(-8deg);
}

.card:hover {
    transform: translateY(-4px) rotate(-.4deg);
}

.avatar {
    display: grid;
    place-items: center;
    background: #fff;
    border: 4px solid #111;
    border-radius: 20px;
    padding: 12px;
    aspect-ratio: 1.6 / 1;
}

.avatar img {
    width: 100%;
    max-width: 260px;
    height: auto;
}

.name {
    margin: 10px 0 0;
    font-weight: 900;
    font-size: clamp(18px, 2.6vw, 22px);
    display: flex;
    align-items: center;
    gap: 8px;
}

.name .badge {
    font-size: 12px;
    background: #111;
    color: #fff;
    border-radius: 999px;
    padding: 4px 10px;
}

.tooltip {
    position: absolute;
    left: 50%;
    top: -10px;
    transform: translate(-50%, -100%) scale(0);
    background: var(--accent);
    color: #111;
    padding: 14px 16px;
    border-radius: 18px;
    border: 3px solid #000;
    font-weight: 800;
    font-family: "Comic Sans MS", "Nunito", cursive;
    white-space: nowrap;
    box-shadow: 4px 4px 0 #000;
    opacity: 0;
    z-index: 5;
}

.tooltip::after {
    content: "";
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 16px 12px 0;
    border-style: solid;
    border-color: var(--accent) transparent transparent transparent;
    filter: drop-shadow(2px 2px 0 #000);
}

.tooltip.show {
    animation: pop .8s forwards, wobble .6s .8s ease-in-out;
}

@keyframes pop {
    0% {
        transform: translate(-50%, -100%) scale(0) rotate(-20deg);
        opacity: 0
    }
    40% {
        transform: translate(-50%, -100%) scale(1.25) rotate(12deg);
        opacity: 1
    }
    60% {
        transform: translate(-50%, -100%) scale(0.95) rotate(-6deg)
    }
    80% {
        transform: translate(-50%, -100%) scale(1.05) rotate(3deg)
    }
    100% {
        transform: translate(-50%, -100%) scale(1) rotate(0)
    }
}

@keyframes wobble {
    0%, 100% {
        transform: translate(-50%, -100%) scale(1) rotate(0)
    }
    25% {
        transform: translate(-50%, -100%) scale(1.05) rotate(3deg)
    }
    50% {
        transform: translate(-50%, -100%) scale(0.97) rotate(-3deg)
    }
    75% {
        transform: translate(-50%, -100%) scale(1.03) rotate(2deg)
    }
}

.panel {
    grid-column: 1 / -1;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(12, 1fr);
    align-items: start;
}

.left {
    grid-column: 1 / span 7;
}

.right {
    grid-column: 8 / -1;
}

@media (max-width: 900px) {
    .left, .right {
        grid-column: 1 / -1;
    }
}

.textarea-wrap {
    background: var(--card);
    border: 4px solid #111;
    border-radius: 22px;
    padding: 16px;
    box-shadow: var(--shadow);
}

label {
    font-weight: 900;
    display: block;
    margin: 0 0 8px;
}

textarea {
    width: 100%;
    min-height: 140px;
    resize: vertical;
    border: 3px solid #000;
    border-radius: 16px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 26px;
    outline: none;
    box-shadow: inset 2px 2px 0 #000;
    background: #fff;
}

.send {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 18px;
    background: linear-gradient(180deg, var(--primary), var(--primary-2));
    color: #fff;
    border: 3px solid #000;
    border-radius: 16px;
    padding: 12px 18px;
    box-shadow: 4px 4px 0 #000;
    cursor: pointer;
    position: relative;
    transition: transform .15s ease;
}

.send:hover {
    transform: translateY(-2px) rotate(-.5deg);
}

.send:active {
    transform: translateY(0) scale(.98);
}

.send .sparkle {
    position: absolute;
    inset: -6px;
    pointer-events: none;
}

.send .sparkle span {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: spark 1.2s ease-out infinite;
}

@keyframes spark {
    0% {
        transform: translate(0, 0) scale(.2);
        opacity: 0
    }
    20% {
        opacity: 1
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0);
        opacity: 0
    }
}

.helper {
    background: #ffffffb8;
    border: 3px dashed #111;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #111;
    color: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    margin-left: 6px;
}

.message-box {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 16px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.message-box.show {
    opacity: 1;
}

.question-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

.question-link {
    display: block;
    text-decoration: none;
    font-weight: 800;
    font-size: 15px;
    text-align: center;
    padding: 10px 16px;
    border-radius: 999px;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000;
    cursor: pointer;
    transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
    color: #111;
    z-index: 999999;
}

.question-link:hover {
    transform: translateY(-2px) translateX(-1px);
    box-shadow: 6px 6px 0 #000;
}

.question-link:active {
    transform: translateY(1px) translateX(1px);
    box-shadow: 2px 2px 0 #000;
}

.q-1 {
    background-color: #fca5a5;
}

/* crvena */
.q-2 {
    background-color: #fcd34d;
}

/* žuta */
.q-3 {
    background-color: #a7f3d0;
}

.logo {
    display: block;
    margin: 0 auto;
    max-width: 600px;
    width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .logo {
        max-width: 100%;
    }
}

.scroll-wrapper {
    width: 100%;
    max-width: 400px;
    text-align: center;
    z-index: 999999;
}

.scroll-box {
    height: 300px;
    overflow-y: auto;


    -webkit-overflow-scrolling: touch;
}

.scroll-box a {
    display: block;
    margin-bottom: 4px;
    text-decoration: none;

}

.scroll-box a:hover {
    background: #eaf4ff;
}

.scroll-btn {
    font-size: 24px;
    cursor: pointer;
    user-select: none;
    padding: 8px;
    display: inline-block;
    color: #0077cc;
    z-index: 999999;
}

.scroll-btn:hover {
    color: #005999;
}


#modalOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    justify-content: center;
    align-items: center;
}

#modalOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    justify-content: center;
    align-items: center;
}

#modalBox {
    background: #fff8dc;
    padding: 30px;
    border-radius: 25px;
    max-width: 500px;
    width: 85%;
    max-height: 80vh; /* 🚀 fiksna visina u odnosu na ekran */
    display: flex;
    flex-direction: column;
    position: relative;
    transform: rotate(-2deg);
    box-shadow: 8px 8px 0px #ff66cc, -6px -6px 0px #66ccff;
    animation: popIn 0.4s ease;
}

#modalBox h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #ff3399;
    text-align: center;
    text-shadow: 2px 2px #ffe6f2;
}

#modalClose {
    position: absolute;
    top: 8px;
    right: 15px;
    cursor: pointer;
    font-size: 34px;
    font-weight: bold;
    color: #ff3399;
    transform: rotate(10deg);
}

#modalClose:hover {
    color: #ff0000;
}

#modalContent {
    flex: 1;
    overflow-y: auto;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    background: #fff;
    padding: 15px;
    border-radius: 15px;
    border: 3px dashed #66ccff;
    transform: rotate(1deg);
}

@keyframes popIn {
    from {
        transform: scale(0.8) rotate(-5deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(-2deg);
        opacity: 1;
    }
}