/* Extracted styles from index.html */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body { height: 100%; }

body {
    background: #ffffff;
    color: #000000;
    font-family: "Spline Sans Mono", monospace;
    overflow: hidden;
    cursor: grab;
}

body:active {
    cursor: grabbing;
}

#canvas {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ui-overlay {
    position: fixed;
    top: 8px;
    left: 28px;
    right: 28px;
    z-index: 100;
    pointer-events: none;
}

.ui-overlay h1 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #000000;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.ui-overlay p {
    font-size: 14px;
    color: #333333;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
}

.ui-overlay button {
    pointer-events: auto;
}

/* Re-enable pointer events for actual clickable children */
.ui-overlay .title-box,
.ui-overlay .button-box,
.ui-overlay button,
.ui-overlay a,
.ui-overlay [role="button"] {
    pointer-events: auto;
}

.ui-overlay button,
#addWordModal button {
    cursor: pointer !important;
}

/* Modal baseline: surface is default, not grab */
#addWordModal { cursor: default !important; }

/* Only text-ish fields get I-beam */
#addWordModal input[type="text"],
#addWordModal input[type="email"],
#addWordModal input[type="search"],
#addWordModal input[type="url"],
#addWordModal input[type="tel"],
#addWordModal input[type="number"],
#addWordModal textarea {
    cursor: text !important;
}

#addWordModal button,
#addWordModal button * {
    cursor: pointer !important;
}

body.modal-open {
    cursor: auto !important;
}

.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    text-align: center;
    color: #000000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #000000;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.rain-mode #titleText,
.rain-mode #aboutBox span,
.rain-mode #addWordBox span,
.rain-mode #titleBox span {
    color: #cccccc !important;
}

.rain-mode #addWordBox span {
    background-color: #333333 !important;
    border-color: #000000 !important;
    color: #cccccc !important;
}

.rain-mode #addWordBox:hover span {
    background-color: #000000 !important;
    border-color: #000000 !important;
    color: #cccccc !important;
}

.rain-mode #audioToggleBox span {
    background-color: #333333 !important;
    border-color: #000000 !important;
    color: #cccccc !important;
}

.rain-mode #audioToggleBox:hover span {
    background-color: #000000 !important;
    border-color: #000000 !important;
    color: #cccccc !important;
}

.rain-mode #titleBox::after {
    background-color: #333333 !important;
    border-color: #000000 !important;
    color: #cccccc !important;
}

.rain-mode #addWordModal>div {
    background-color: #333333 !important;
    border-color: #000000 !important;
}

.rain-mode #addWordModal label {
    color: #cccccc !important;
}

.rain-mode #addWordModal input,
.rain-mode #addWordModal textarea {
    background-color: #333333 !important;
    border-color: #000000 !important;
    color: #cccccc !important;
}

.rain-mode #addWordModal input::placeholder,
.rain-mode #addWordModal textarea::placeholder {
    color: rgba(204, 204, 204, 0.6) !important;
}

.rain-mode #addWordModal button[type="submit"] {
    background-color: #000000 !important;
    color: #cccccc !important;
}

.rain-mode #addWordModal button[type="submit"]:hover {
    background-color: #333333 !important;
}

.rain-mode #closeAddWordModal {
    color: #000000 !important;
}

.rain-mode #audioToggleBox span {
    background-color: #333333 !important;
    border-color: #000000 !important;
    color: #cccccc !important;
}

.rain-mode #audioToggleBox:hover span {
    background-color: #000000 !important;
}

#aboutBox {
    position: relative;
}

#titleBox {
    position: relative;
}

#titleBox::after {
    content: "A digital garden where words bloom like flowers. Each word represents something meaningful to someone, growing in a shared space of language and connection. Hover over the flowers to discover stories, or add your own word to the garden.";
    position: absolute;
    top: 100%;
    left: 0;
    background: #f5f1eb;
    border: 1px solid #d4c8b8;
    padding: 14px 20px;
    font-size: 13px;
    color: #5d4e37;
    white-space: normal;
    min-width: 400px;
    max-width: 400px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 1000;
    margin-top: 15px;
    line-height: 1.4;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#titleBox:hover::after {
    opacity: 1;
    visibility: visible;
}

#titleBox:hover span {
    color: #FF69B4 !important;
}

#addWordBox {
    border-radius: 4px;
    transition: all 0.2s;
}

#addWordBox:hover span {
    background-color: #ffffff !important;
    transform: translateY(-1px);
}

#audioToggleBox:hover span {
    background-color: #ffffff !important;
    transform: translateY(-1px);
}

.ui-overlay {
    z-index: 100;
}

#addWordModal input::placeholder,
#addWordModal textarea::placeholder {
    color: rgba(93, 78, 55, 0.6) !important;
}

#addWordModal input:focus,
#addWordModal textarea:focus {
    border-color: #FF69B4 !important;
    outline: none !important;
}

.ui-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.title-box {
    display: flex;
    align-items: center;
    cursor: auto; /* container not a hand */
}

.title-text {
    color: #333333;
    font-family: "Spline Sans Mono", monospace;
    font-size: 0.9rem;
    padding: 20px 0;
    /* font-weight: 450; */
}

/* Hand only on real click targets */
.title-text,
.button-span {
    cursor: pointer;
}

.button-box {
    display: flex;
    align-items: center;
    cursor: auto; /* container not a hand */
}

.button-span {
    color: #5d4e37;
    font-family: "Spline Sans Mono", monospace;
    font-size: 0.9rem;
    /* font-weight: 450; */
    background: #f5f1eb;
    border: 1px solid #d4c8b8;
    padding: 3px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

#addWordModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #f5f1eb;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
    border: 1px solid #d4c8b8;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #5d4e37;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    position: absolute;
    top: 10px;
    right: 10px;
}

.close-btn:hover {
    background-color: rgba(93, 78, 55, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 12px;
    font-weight: normal;
    color: #5d4e37;
    font-family: "Spline Sans Mono", monospace;
    font-size: 0.9rem;
}

.input-field {
    width: 100%;
    padding: 12px;
    border: 1px solid #d4c8b8;
    font-size: 0.9rem;
    font-family: "Spline Sans Mono", monospace;
    transition: border-color 0.2s;
    border-radius: 8px;
    background: #f5f1eb;
    color: #5d4e37;
}

.textarea-field {
    width: 100%;
    height: 80px;
    padding: 12px;
    border: 1px solid #d4c8b8;
    font-size: 0.9rem;
    font-family: "Spline Sans Mono", monospace;
    resize: none;
    transition: border-color 0.2s;
    border-radius: 8px;
    background: #f5f1eb;
    color: #5d4e37;
}

.form-row {
    margin-bottom: 20px;
}

.form-row.description {
    margin-bottom: 25px;
}

.submit-row {
    display: flex;
    justify-content: stretch;
}

.submit-btn {
    width: 100%;
    padding: 12px 20px;
    background: #5d4e37;
    color: white;
    border: none;
    font-size: 0.9rem;
    font-family: "Spline Sans Mono", monospace;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 8px;
}

.submit-btn:hover {
    background-color: #4a3e2e;
}

/* Location opt-in */
.location-row {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    caret-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Ensure label itself uses pointer inside modal too */
#addWordModal .checkbox-label,
#addWordModal .checkbox-label *,
#addWordModal label[for] {
    cursor: pointer !important;
}