:root {
    --dark-raspberry: #861657;
    --dusty-mauve: #A64253;
    --sweet-peony: #D56AA0;
    --celadon: #BBDBB4;
    --cornsilk: #FCF0CC;
    --white: #ffffff;
    --black: #000000;
    --shadow: rgba(0, 0, 0, 0.1);
    --font-mono: 'Space Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-mono);
    background-color: var(--cornsilk);
    color: var(--black);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    position: relative;
    z-index: 1;
    padding: 2rem;
    padding-bottom: 5rem;
    max-width: 1200px;
    margin: 0 auto;
}

#rain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.rain-button {
    position: absolute;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: radial-gradient(circle at 30% 30%, #e8ffb7 0%, #b2d96a 30%, #7d9c29 100%);
    box-shadow: inset 0 5px 14px rgba(255, 255, 255, 0.45), 0 10px 22px rgba(0, 0, 0, 0.16);
    color: transparent;
    font-weight: 700;
    letter-spacing: 0.04em;
    transform: translateY(0) rotate(0deg);
    animation: rain-fall linear infinite;
}

.rain-button::before,
.rain-button::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 42%;
    height: 10%;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    transform-origin: center;
}

.rain-button::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.rain-button::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

@keyframes rain-fall {
    to {
        transform: translateY(120vh) rotate(360deg);
    }
}

.view {
    transition: opacity 0.3s ease-in-out;
}

.view.hidden {
    display: none;
    opacity: 0;
}

/* --- Wall View --- */

.wall-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2.5rem 3rem 2rem;
    background: transparent;
    border-radius: 12px;
    border: none;
}

.wall-header h1 {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    color: #333;
    text-shadow: 2px 2px 0px rgba(252, 240, 204, 0.8);
}

.wall-header p {
    font-size: 1rem;
    opacity: 0.7;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.sticky-note {
    position: relative; /* For the delete button positioning */
    background: var(--white);
    border: 2px solid var(--black);
    padding: 1.5rem;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 4px 4px 0px var(--black);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sticky-note:hover {
    transform: translate(-4px, -4px);
    box-shadow: 8px 8px 0px var(--black);
}

.note-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    height: 100%;
}

.poem-title {
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 0.5rem;
}

.poem-text {
    font-size: 1rem;
    line-height: 1.5;
    flex-grow: 1;
    white-space: pre-wrap;
}

.poem-signature {
    text-align: right;
    margin-top: auto;
    font-size: 0.9rem;
}

.delete-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: rgba(0,0,0,0.2);
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 0.2rem 0.5rem;
    z-index: 10;
}

.delete-btn:hover {
    color: var(--dark-raspberry);
    transform: scale(1.2);
}

.note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 1rem;
    margin-top: auto;
}

.note-meta {
    font-size: 0.8rem;
}

.vote-actions {
    display: flex;
    gap: 0.8rem;
}

.vote-btn {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.1);
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
    font-family: var(--font-mono);
}

.vote-btn:hover {
    background: rgba(0,0,0,0.05);
    border-color: var(--black);
}

.vote-btn:active {
    transform: scale(0.9);
}

.vote-btn.up.active {
    background: rgba(0, 128, 0, 0.1);
    color: green;
    border-color: green;
}

.vote-btn.down.active {
    background: rgba(134, 22, 87, 0.1);
    color: var(--dark-raspberry);
    border-color: var(--dark-raspberry);
}

/* --- Editor View --- */

#editor-view {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.editor-container {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.editor-header h2 {
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-bottom: 2rem;
}

.card-paper {
    background: var(--white);
    border: 2px solid var(--black);
    padding: 3rem;
    text-align: left;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    box-shadow: 12px 12px 0px rgba(0,0,0,0.05);
}

.card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1.5rem;
}

.line {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.line.right {
    justify-content: flex-end;
    margin-top: auto;
    text-align: right;
    display: block; /* For manual line breaking like the ref */
}

.label {
    font-weight: 700;
    font-size: 1.2rem;
}

input[type="text"] {
    border: none;
    border-bottom: 1px solid transparent;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    background: transparent;
    color: #888;
    outline: none;
    width: 200px;
}

input[type="text"]:focus {
    color: var(--black);
}

textarea {
    border: none;
    width: 100%;
    min-height: 150px;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    resize: none;
    background: transparent;
    outline: none;
    line-height: 1.6;
    color: #666;
}

textarea:focus {
    color: var(--black);
}

.editor-actions {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.secondary-btn, .primary-btn {
    font-family: var(--font-mono);
    padding: 1rem 3rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn {
    background: var(--white);
    border: 2px solid var(--black);
    color: var(--black);
}

.secondary-btn:hover {
    background: #f0f0f0;
}

.primary-btn {
    background: var(--black);
    border: 2px solid var(--black);
    color: var(--white);
}

.primary-btn:hover {
    background: #333;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--black);
    color: var(--white);
    border: none;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 100;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    background: var(--dark-raspberry);
}

/* Animations */
@keyframes popIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Site Credit Footer Bar */
.site-credit {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.8rem 2rem;
    background: var(--cornsilk);
    border-top: 2px solid var(--black);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--black);
    opacity: 1;
    text-align: center;
    letter-spacing: 1px;
    pointer-events: none;
    z-index: 50;
}

@media (max-width: 600px) {
    #app { padding: 1rem; }
    .fab { bottom: 2rem; right: 2rem; }
    .card-paper { padding: 1.5rem; }
    .site-credit { font-size: 1rem; }
}
