:root {
    --ink: #231942;
    --panel: #fff8ff;
    --pink: #ff4fb8;
    --blue: #39c6ff;
    --yellow: #ffe45e;
    --green: #6fffb0;
    --purple: #9b5cff;
    --shadow: #2f1a5f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Trebuchet MS", Verdana, Arial, sans-serif;
    background:
        linear-gradient(90deg, rgba(255, 79, 184, 0.16) 0 14%, transparent 14% 100%),
        linear-gradient(135deg, #66e3ff 0%, #fffd8f 42%, #ff9be8 78%, #8dffbd 100%);
    background-attachment: fixed;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.public-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
    background-size: 20px 20px;
    mix-blend-mode: soft-light;
}

.nyan-shell {
    min-height: calc(100vh - 56px);
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.hero {
    width: min(760px, 100%);
    text-align: center;
}

.eyebrow {
    margin: 16px 0 8px;
    color: #5a247a;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 22px;
    color: #ffffff;
    font-size: clamp(2.6rem, 12vw, 6.2rem);
    line-height: 0.95;
    text-shadow:
        4px 4px 0 var(--pink),
        8px 8px 0 var(--blue),
        12px 12px 0 var(--shadow);
}

.pixel-cat {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0;
    filter: drop-shadow(8px 8px 0 rgba(47, 26, 95, 0.25));
}

.cat-face {
    position: relative;
    z-index: 2;
    display: inline-grid;
    place-items: center;
    min-width: 126px;
    min-height: 76px;
    padding: 12px 16px;
    border: 5px solid var(--ink);
    background: #cfc7d8;
    color: var(--ink);
    font-family: "Courier New", monospace;
    font-size: 1.6rem;
    font-weight: 900;
    box-shadow: inset 0 -12px 0 rgba(0, 0, 0, 0.08);
}

.cat-face::before,
.cat-face::after {
    content: "";
    position: absolute;
    top: -22px;
    width: 28px;
    height: 28px;
    background: #cfc7d8;
    border-left: 5px solid var(--ink);
    border-top: 5px solid var(--ink);
}

.cat-face::before {
    left: 14px;
    transform: rotate(45deg);
}

.cat-face::after {
    right: 14px;
    transform: rotate(45deg);
}

.rainbow-tail {
    display: block;
    width: min(36vw, 250px);
    height: 72px;
    border: 5px solid var(--ink);
    border-right: 0;
    background: linear-gradient(
        to bottom,
        #ff4747 0 16.66%,
        #ff9f1c 16.66% 33.32%,
        #ffe45e 33.32% 49.98%,
        #6fffb0 49.98% 66.64%,
        #39c6ff 66.64% 83.3%,
        #9b5cff 83.3% 100%
    );
    image-rendering: pixelated;
}

.question-panel {
    position: relative;
    margin: 0 auto;
    width: min(680px, 100%);
    min-height: 170px;
    display: grid;
    place-items: center;
    padding: 28px;
    border: 6px solid var(--ink);
    background: var(--panel);
    box-shadow: 10px 10px 0 var(--shadow);
}

.question-panel::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 2px dashed rgba(155, 92, 255, 0.45);
    pointer-events: none;
}

.question-text {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: clamp(1.35rem, 4vw, 2.4rem);
    line-height: 1.25;
    font-weight: 900;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
}

.language-toggle {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    border: 4px solid var(--ink);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 6px 6px 0 rgba(35, 25, 66, 0.28);
}

.lang-button,
.primary-button,
.admin-button {
    border: 4px solid var(--ink);
    color: var(--ink);
    font-weight: 900;
    box-shadow: 5px 5px 0 var(--shadow);
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.lang-button:hover,
.primary-button:hover,
.admin-button:hover {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 var(--shadow);
}

.lang-button {
    min-width: 96px;
    padding: 10px 14px;
    background: #ffffff;
}

.lang-button.is-active {
    background: var(--yellow);
}

.primary-button {
    padding: 16px 24px;
    background: linear-gradient(90deg, var(--pink), var(--yellow), var(--green), var(--blue));
}

.ai-button {
    background: linear-gradient(90deg, #ffffff, var(--blue), var(--purple));
}

.status-text {
    min-height: 24px;
    margin: 18px 0 0;
    color: #5a247a;
    font-weight: 800;
}

.site-footer {
    min-height: 56px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
}

.site-footer a {
    color: var(--ink);
    font-weight: 900;
    text-decoration-thickness: 3px;
}

.admin-page {
    background: #fff7fd;
}

.admin-wrap {
    width: min(1080px, 100%);
    margin: 0 auto;
    padding: 28px 16px 56px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.admin-header h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(2rem, 7vw, 4rem);
    text-shadow: 3px 3px 0 var(--yellow), 6px 6px 0 var(--blue);
}

.admin-card,
.login-card {
    border: 4px solid var(--ink);
    background: #ffffff;
    box-shadow: 8px 8px 0 rgba(35, 25, 66, 0.22);
    padding: 22px;
    margin-bottom: 24px;
}

.login-card {
    width: min(460px, calc(100% - 32px));
    margin: 12vh auto 0;
    text-align: center;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-row {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.form-row label {
    font-weight: 900;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    border: 3px solid var(--ink);
    padding: 12px;
    background: #fffaff;
}

.form-row textarea {
    min-height: 120px;
    resize: vertical;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

#translationPanel {
    margin-top: 24px;
}

.admin-button {
    min-height: 46px;
    padding: 10px 16px;
    background: var(--yellow);
}

.admin-button.secondary {
    background: #ffffff;
}

.admin-button.danger {
    background: #ff6a8f;
}

.admin-message {
    min-height: 24px;
    font-weight: 800;
}

.question-list {
    display: grid;
    gap: 14px;
}

.question-item {
    border: 3px solid var(--ink);
    padding: 14px;
    background: #fffaff;
}

.question-item p {
    margin: 6px 0;
}

.question-meta {
    color: #694c82;
    font-size: 0.9rem;
    font-weight: 800;
}

@media (max-width: 760px) {
    .rainbow-tail {
        width: 120px;
    }

    .admin-header,
    .controls {
        align-items: stretch;
        flex-direction: column;
    }

    .language-toggle,
    .primary-button,
    .admin-button {
        width: 100%;
    }

    .lang-button {
        flex: 1;
        min-width: 0;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }
}
