:root {
    --bg: #0f172a;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: #ffffff;
    --text: #172033;
    --muted: #64748b;
    --line: rgba(15, 23, 42, 0.12);
    --accent: #0f766e;
    --accent-dark: #115e59;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        linear-gradient(125deg, #0f766e, #1d4ed8, #c2410c, #7c3aed);
    background-size: 280% 280%;
    animation: pageGradient 16s ease infinite;
}

button,
input,
textarea {
    font: inherit;
}

@keyframes pageGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

button {
    cursor: pointer;
}

.app-shell {
    min-height: 100vh;
}

.home-view {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    padding: 20px clamp(18px, 4vw, 56px);
    color: #fff;
}

.brand {
    font-weight: 800;
    font-size: 22px;
    margin-right: 12px;
}

.tab-button,
.refresh-button,
.back-button,
.primary-action {
    border: 0;
    border-radius: 8px;
    min-height: 42px;
    padding: 0 16px;
}

.tab-button {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.32);
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.28);
}

.hero {
    align-self: center;
    width: min(520px, calc(100% - 36px));
    margin: 0 auto 8vh;
    color: #fff;
}

.home-meme-gif {
    display: block;
    width: min(520px, 100%);
    aspect-ratio: 1 / 1;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
}

.eyebrow {
    margin: 0 0 12px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(44px, 8vw, 86px);
    line-height: 0.95;
}

.hero-text {
    max-width: 540px;
    margin: 22px 0 28px;
    font-size: 18px;
    line-height: 1.55;
}

.primary-action {
    color: #fff;
    background: var(--accent);
    font-weight: 750;
}

.primary-action:hover {
    background: var(--accent-dark);
}

.notes-view {
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.auth-view,
.secrets-view,
.secret-open-view,
.game-view {
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.hidden {
    display: none;
}

.auth-form.hidden {
    display: none;
}

.notes-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    color: #fff;
}

.notes-header h1 {
    margin: 8px 0 0;
    font-size: 42px;
}

.back-button,
.refresh-button {
    color: var(--text);
    background: var(--panel-strong);
}

.note-editor,
.notes-list,
.auth-panel,
.game-frame-wrap {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 8px;
    backdrop-filter: blur(14px);
}

.auth-grid {
    display: grid;
    grid-template-columns: minmax(0, 520px);
    gap: 18px;
    justify-content: start;
}

.secret-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.secret-result {
    display: grid;
    gap: 12px;
}

.secret-text {
    min-height: 120px;
    margin: 0;
    padding: 14px;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.secret-open-link {
    color: var(--accent);
    font-weight: 750;
    text-decoration: none;
}

.secret-open-link:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

.auth-switch {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    margin-bottom: 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.32);
}

.auth-mode-button {
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: transparent;
}

.auth-mode-button.active {
    color: var(--text);
    background: var(--panel-strong);
}

.auth-panel {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.auth-panel h2 {
    margin: 0;
}

.form-note {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.note-editor {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: end;
    padding: 16px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.9);
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.status-line {
    min-height: 24px;
    margin: 14px 4px;
    color: #fff;
    font-weight: 700;
}

.notes-list {
    display: grid;
    gap: 1px;
    overflow: hidden;
}

.note-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.note-meta {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.note-text {
    margin: 0;
    line-height: 1.5;
    white-space: pre-wrap;
}

.delete-button {
    align-self: start;
    min-width: 42px;
    min-height: 38px;
    border: 1px solid rgba(180, 35, 24, 0.22);
    border-radius: 8px;
    color: var(--danger);
    background: rgba(255, 255, 255, 0.75);
}

.empty-state {
    padding: 28px 16px;
    text-align: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.72);
}

.link-button {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.game-frame-wrap {
    overflow: hidden;
    height: min(76vh, 760px);
    min-height: 520px;
}

.game-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #050816;
}

@media (max-width: 760px) {
    .topbar,
    .notes-header,
    .note-editor,
    .note-card {
        grid-template-columns: 1fr;
    }

    .notes-header,
    .topbar {
        align-items: stretch;
    }

    .note-editor {
        display: grid;
    }

    .notes-header {
        display: grid;
    }

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

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

    .game-frame-wrap {
        min-height: 420px;
    }
}
