/* Small red flower area */

.flower-section {
    max-width: 1000px;
    margin: 0 auto 28px;
    padding: 16px 12px 18px;
    user-select: none;
    -webkit-user-select: none;
}

.flower-header {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.flower-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-family: var(--font-cute);
    color: var(--text-dark);
    font-size: 1.05rem;
    font-weight: 700;
}

.flower-count {
    color: var(--primary-color);
    font-family: var(--font-cute);
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
}

.flower-count span:last-child {
    color: var(--text-light);
    font-size: 0.78rem;
    margin-left: 2px;
}

.flower-actions {
    display: flex;
    gap: 8px;
}

.flower-view-toggle {
    width: fit-content;
    margin: 0 auto 14px;
    box-shadow: none;
}

.flower-view-toggle .toggle-btn {
    min-width: 82px;
}

.flower-btn {
    border: 2px solid rgba(255, 142, 199, 0.22);
    background: #fff;
    color: var(--text-medium);
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.flower-btn:hover {
    transform: translateY(-1px);
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #fff8fc;
}

.flower-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 194, 226, 0.28);
}

.flower-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff8ec7, #ff6b86);
    transition: width 0.35s ease;
}

.flower-panel {
    display: none;
}

.flower-panel.active {
    display: block;
}

.flower-preview {
    position: relative;
    display: grid;
    grid-template-columns: repeat(20, minmax(0, 1fr));
    gap: 5px;
    margin-top: 12px;
    min-height: 96px;
    user-select: none;
    -webkit-user-select: none;
}

.flower-preview::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    z-index: 0;
    border-left: 1.5px dashed rgba(139, 110, 158, 0.32);
    transform: translateX(-50%);
    pointer-events: none;
}

.flower-dot {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    min-width: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.55);
    cursor: default;
    filter: grayscale(1);
    opacity: 0.32;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    z-index: 1;
    transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease, background 0.25s ease;
}

.flower-number {
    position: absolute;
    top: 3px;
    left: 4px;
    z-index: 2;
    color: #9b86aa;
    font-size: 0.52rem;
    font-weight: 700;
    line-height: 1;
}

.flower-symbol {
    position: relative;
    z-index: 1;
}

.flower-dot.active {
    opacity: 1;
    filter: none;
    cursor: pointer;
    background: rgba(255, 142, 199, 0.12);
}

.flower-dot.active .flower-number {
    color: #d61f69;
}

.flower-dot.active:hover {
    transform: translateY(-1px) scale(1.08);
    background: rgba(255, 142, 199, 0.22);
}

.flower-log-list {
    margin-top: 0;
    display: grid;
    gap: 8px;
}

.flower-log-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 194, 226, 0.22);
}

.flower-log-item:first-child {
    border-top: 0;
}

.flower-log-main {
    min-width: 0;
}

.flower-log-action {
    display: inline-block;
    margin-right: 6px;
    font-size: 0.76rem;
    font-weight: 700;
}

.flower-log-action.add {
    color: #ec4899;
}

.flower-log-action.deduct {
    color: #8b5cf6;
}

.flower-log-note {
    color: var(--text-medium);
    font-size: 0.82rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.flower-log-meta,
.flower-log-empty {
    color: var(--text-light);
    font-size: 0.72rem;
    white-space: nowrap;
}

.flower-log-empty,
.flower-log-end {
    text-align: center;
}

.flower-log-end {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 0 4px;
    color: #d5b3ff;
    font-size: 0.85rem;
    font-style: italic;
}

.flower-log-end::before,
.flower-log-end::after {
    content: '';
    flex: 1;
    border-top: 1px dashed rgba(213, 179, 255, 0.55);
}

.flower-log-link {
    color: #ec4899;
    text-decoration: none;
    margin-left: 8px;
    font-weight: 700;
}

.flower-log-link:hover {
    text-decoration: underline;
}

.flower-log-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 0 2px;
}

.flower-page-btn {
    min-width: 68px;
    min-height: 32px;
    padding: 0 12px;
    border: 2px solid rgba(255, 142, 199, 0.18);
    background: #fff;
    color: var(--text-medium);
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.flower-page-btn:not(:disabled):hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #fff8fc;
}

.flower-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.flower-page-info {
    min-width: 54px;
    color: var(--text-light);
    font-size: 0.76rem;
    font-weight: 700;
    text-align: center;
}

.flower-section.loading {
    opacity: 0.68;
}

.flower-modal .flower-modal-current {
    margin: 0 0 14px;
    color: var(--text-medium);
    font-size: 0.9rem;
}

.flower-modal .edit-field input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #f0e0f6;
    background: #fdf5ff;
    border-radius: 14px;
    font-size: 1rem;
    color: #5a3e6f;
    font-family: inherit;
    box-sizing: border-box;
}

.flower-modal .edit-field input[type="number"]:focus {
    outline: none;
    border-color: #ff8ec7;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 142, 199, 0.1);
}

@media (max-width: 640px) {
    .flower-header {
        grid-template-columns: 1fr auto;
    }

    .flower-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .flower-view-toggle {
        width: 100%;
    }

    .flower-view-toggle .toggle-btn {
        flex: 1;
        min-width: 0;
    }

    .flower-btn {
        flex: 1;
    }

    .flower-preview {
        grid-template-columns: repeat(10, minmax(0, 1fr));
        min-height: 190px;
    }

    .flower-log-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .flower-log-meta {
        white-space: normal;
    }
}
