@import url('https://fonts.googleapis.com/css2?family=Comic+Relief:wght@400;700&display=swap');

:root {
    --fab-bg-color: #111827;
    --fab-text-color: #ffffff;
    --fab-main-bg-color: radial-gradient(circle at 30% 30%, #ffffff 0%, #e5e7eb 60%, #d1d5db 100%);
    --modal-text-color: #0f0f0f;
    --modal-bg-color: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
    --sticky-font-size: 0.9rem;
    --container-text-color: #0f0f0f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: "Comic Relief", cursive, monospace;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    padding: 20px;
    background: linear-gradient(to bottom, #3b3b3b 0%, #000000 100%);
}

#datetime-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin: 3rem 0rem;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#time-display {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
}

#date-display {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
}

.container {
    max-width: 1000px;
    width: 100%;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    position: relative;
    transition: background 0.5s ease, border-color 0.5s ease;
    border: 0.3rem solid var(--container-text-color);
}

.hero {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    justify-content: center;
    margin: auto;
    text-align: center;
    overflow: hidden;
}

.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin: auto;
    border: 3px solid var(--container-text-color);
}

.archetypical-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--container-text-color);
}

.edit-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.edit-button {
    cursor: pointer;
    width: 1.2rem;
    height: 1.2rem;
}

.fab-container {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    z-index: 50;
}

.fab-main {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 9999px;
    border: 2px solid #000000;
    background: var(--fab-main-bg-color);
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 15px rgba(0,0,0,0.2), 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 20px rgba(0,0,0,0.25), 0 6px 8px rgba(0,0,0,0.22);
}

.fab-main.active {
    background: var(--fab-bg-color);
    color: #111827;
}

.fab-actions {
    display: grid;
    gap: 0.4rem;
    transform: translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.fab-container.open .fab-actions,
.fab-container:focus-within .fab-actions {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.fab-action {
    background: var(--fab-bg-color);
    color: var(--fab-text-color);
    border: 1px solid #000000;
    border-radius: 9999px;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0.95;
    white-space: nowrap;
    box-shadow: 0 6px 10px rgba(0,0,0,0.25);
}

.fab-action:hover {
    opacity: 1;
    background: #1f2937;
}

.fab-left-container {
    position: fixed;
    left: 2rem;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    z-index: 50;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: start;
    flex-grow: 1;
}

.symbols {
    display: flex;
    gap: 1rem;
    flex-direction: column-reverse;
    margin: auto;
}

#chapterTitle {
    font-size: 2.5rem;
    color: var(--container-text-color);
}

.quote-container {
    margin: 2rem 0rem;
    display: flex;
    text-align: left;
}

#quoteDisplay {
    font-style: italic;
    color: var(--container-text-color);
    margin: 0;
}

.refresh-quote-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 1rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.refresh-quote-btn:hover {
    opacity: 1;
    transform: rotate(180deg);
}

.timeDisplay{
    line-height: 2;
    max-width: 700px;
    color: var(--container-text-color);
    font-size: 1rem;
}

.numbers {font-size: 1.2rem;}

@media (max-width: 640px) {
    body { padding: 10px; }
    .container { padding: 2rem 0.5rem; border-width: 0.2rem;}
    .hero { flex-direction: column; gap: 1rem; align-items: center; }
    .hero-content { align-items: center; }
    #chapterTitle { font-size: 1.8rem; text-align: center; }
    .profile-image { width: 120px; height: 120px; }
    .archetypical-image { width: 40px; height: 40px; }
    .symbols { flex-direction: row; gap: 0.75rem; }
    .quote-container { margin: 1rem 0; flex-direction: column; align-items: center; text-align: center; }
    .refresh-quote-btn { margin-left: 0; margin-top: 0.5rem; }
    .timeDisplay { font-size: 0.95rem; text-align: center; }
    .numbers { font-size: 1.05rem; }
    .fab-container { right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); }
    .fab-actions { gap: 0.5rem; }
    .fab-action { padding: 0.6rem 0.8rem; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
    .fab-main, .fab-actions { transition: none; }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 60;
}

.modal-overlay.open { display: flex; }

.modal {
    width: min(92vw, 540px);
    background: var(--modal-bg-color);
    border: 2px solid #000000;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
    padding: 1rem 1.25rem;
}

.modal-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--modal-text-color);
}

.modal-body {
    color: var(--modal-text-color);
    line-height: 1.6;
    font-size: 0.98rem;
}

.modal-close {
    appearance: none;
    border: 1px solid #000000;
    background: #111827;
    color: #ffffff;
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    float: right;
}

.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.75rem; }
.theme-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.theme-label { color: #0f0f0f; font-weight: 600; }
.theme-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.theme-button { background: #111827; color: #ffffff; border: 1px solid #000000; border-radius: 6px; padding: 0.35rem 0.6rem; cursor: pointer; }

.notes-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.sticky-note {
    position: absolute;
    width: 200px;
    height: 200px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: auto;
    resize: both;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.sticky-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.sticky-title {
    font-weight: 600;
    color: #111827;
}

.sticky-delete {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
}

.sticky-delete:hover {
    color: #ef4444;
}

.sticky-text {
    border: none;
    background: transparent;
    color: #111827;
    padding: 0.5rem;
    resize: none;
    flex-grow: 1;
    font-family: inherit;
    font-size: var(--sticky-font-size);
    width: 100%;
}

@media (max-width: 640px) { .sticky-note { width: 160px; } .notes-layer { display: none; } .fab-left-container {display: none;}}