/* Mood Meter – Clean, colorful, kid-friendly */

.mood-meter-wrapper {
    max-width: 520px;
    margin: 0 auto 2rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1a1a1a;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 1.5rem 1.25rem 2rem;
    position: relative;
}

.mm-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.mm-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: #2c3e50;
}

.mm-subtitle {
    font-size: 0.95rem;
    color: #444;
    margin: 0;
}

/* Profile */
.mm-profile-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.mm-profile-row label {
    font-weight: 600;
    font-size: 0.9rem;
}

.mm-profile-row input {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 1rem;
    width: 140px;
    text-align: center;
}

.mm-profile-row input:focus {
    outline: none;
    border-color: #4a90d9;
}

/* Grid container – labels sit in the padding gutter outside the square */
.mm-grid-container {
    position: relative;
    margin: 1.5rem auto 1.25rem;
    max-width: 300px;
    padding: 1.85rem 2.6rem;
    overflow: visible;
}

.mm-axis-label {
    position: absolute;
    font-size: 0.72rem;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    z-index: 5;
    pointer-events: none;
}

.mm-axis-y-top {
    top: 0.2rem;
    left: 50%;
    transform: translateX(-50%);
}

.mm-axis-y-bottom {
    bottom: 0.2rem;
    left: 50%;
    transform: translateX(-50%);
}

/* Side labels: centered in left/right padding, rotated */
.mm-axis-x-left {
    left: 0;
    width: 2.6rem;
    top: 50%;
    text-align: center;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: center center;
}

.mm-axis-x-right {
    right: 0;
    width: 2.6rem;
    top: 50%;
    text-align: center;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: center center;
}

/* The actual 2×2 grid */
.mm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 3px solid #333;
    cursor: crosshair;
    user-select: none;
    touch-action: none;
}

.mm-quad {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.15s ease;
}

.mm-quad:hover {
    filter: brightness(1.08);
}

.mm-quad-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
    pointer-events: none;
}

.mm-red    { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.mm-yellow { background: linear-gradient(135deg, #f1c40f, #f39c12); }
.mm-blue   { background: linear-gradient(135deg, #3498db, #2980b9); }
.mm-green  { background: linear-gradient(135deg, #2ecc71, #27ae60); }

/* Marker */
.mm-marker {
    position: absolute;
    width: 28px;
    height: 28px;
    margin-left: -14px;
    margin-top: -14px;
    pointer-events: none;
    z-index: 10;
    transition: left 0.05s linear, top 0.05s linear;
}

.mm-marker-dot {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #222;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

/* Readout */
.mm-readout {
    text-align: center;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Emotion panel */
.mm-emotion-panel {
    margin-top: 1.25rem;
}

.mm-emotion-panel h3 {
    font-size: 1.05rem;
    margin: 0 0 0.25rem;
    text-align: center;
}

.mm-emotion-hint {
    font-size: 0.8rem;
    color: #444;
    text-align: center;
    margin: 0 0 0.75rem;
}

.mm-emotion-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.mm-emotion-btn {
    border: 2px solid #bbb;
    background: #f5f5f5;
    color: #1a1a1a !important;
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 600;
}

.mm-emotion-btn:hover {
    border-color: #2c6cb0;
    background: #d6e8fa;
    color: #0d3b66 !important;
}

.mm-emotion-btn.selected {
    background: #2c6cb0;
    color: #ffffff !important;
    border-color: #2c6cb0;
}

/* Note panel */
.mm-note-panel {
    margin-top: 1.25rem;
}

.mm-note-panel label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.mm-note-panel textarea {
    width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
}

.mm-note-panel textarea:focus {
    outline: none;
    border-color: #4a90d9;
}

/* Actions */
.mm-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.mm-btn {
    flex: 1;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.mm-btn:active {
    transform: scale(0.97);
}

.mm-btn-primary {
    background: #4a90d9;
    color: #fff;
    box-shadow: 0 3px 10px rgba(74,144,217,0.35);
}

.mm-btn-primary:hover {
    background: #3a7bc8;
}

.mm-btn-secondary {
    background: #e8e8e8;
    color: #1a1a1a !important;
    border: 2px solid #ccc;
}

.mm-btn-secondary:hover {
    background: #d0d0d0;
    color: #000 !important;
    border-color: #999;
}

.mm-btn-block {
    width: 100%;
    margin-top: 1rem;
}

/* Strategies */
.mm-strategies-panel {
    margin-top: 1.25rem;
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem 1.1rem;
}

.mm-strategies-panel h3 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}

.mm-strategies-panel ul {
    margin: 0 0 0.5rem;
    padding-left: 1.2rem;
}

.mm-strategies-panel li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
    font-size: 0.95rem;
}

/* Success */
.mm-success {
    text-align: center;
    padding: 2rem 1rem;
}

.mm-success-icon {
    width: 64px;
    height: 64px;
    background: #27ae60;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
    font-weight: bold;
}

/* History */
.mm-history-section {
    margin-top: 2.5rem;
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
}

.mm-history-title {
    font-size: 1.15rem;
    margin: 0 0 1rem;
    text-align: center;
}

.mm-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.mm-history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f9f9f9;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
}

.mm-history-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mm-history-dot.yellow { background: #f1c40f; }
.mm-history-dot.red    { background: #e74c3c; }
.mm-history-dot.green  { background: #2ecc71; }
.mm-history-dot.blue   { background: #3498db; }

.mm-history-meta {
    flex: 1;
    min-width: 0;
}

.mm-history-emotion {
    font-weight: 600;
    display: block;
}

.mm-history-note {
    display: block;
    font-size: 0.85rem;
    color: #444;
    margin: 0.2rem 0;
    line-height: 1.35;
    font-style: italic;
}

.mm-history-time {
    font-size: 0.8rem;
    color: #555;
}

.mm-loading {
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}

/* Responsive tweaks */
@media (max-width: 480px) {
    .mood-meter-wrapper {
        padding: 1.1rem 0.9rem 1.5rem;
        border-radius: 12px;
    }
    .mm-title {
        font-size: 1.3rem;
    }
    .mm-grid-container {
        max-width: 280px;
    }
}

/* Login prompt */
.mm-login-prompt {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.mm-login-inner {
    max-width: 320px;
    margin: 0 auto;
}

.mm-login-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.mm-login-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0 1rem;
}

.mm-login-actions .mm-btn {
    text-decoration: none;
    display: block;
    text-align: center;
}

.mm-login-note {
    font-size: 0.8rem;
    color: #555;
    margin: 0;
}

.mm-user-bar {
    text-align: center;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.75rem;
}

.mm-user-bar a {
    color: #2c6cb0;
    text-decoration: none;
    font-weight: 600;
}

.mm-user-bar a:hover {
    text-decoration: underline;
}

/* Auth forms */
.mm-auth-form {
    text-align: left;
    margin-top: 1.25rem;
}

.mm-field {
    margin-bottom: 0.9rem;
}

.mm-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #333;
}

.mm-field input[type="text"],
.mm-field input[type="email"],
.mm-field input[type="password"] {
    width: 100%;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    box-sizing: border-box;
}

.mm-field input:focus {
    outline: none;
    border-color: #4a90d9;
}

.mm-field-check label {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.mm-auth-message {
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

.mm-auth-toggle {
    text-align: center;
    font-size: 0.9rem;
    margin-top: 1.25rem;
    color: #555;
}

.mm-auth-toggle a {
    color: #2c6cb0;
    font-weight: 600;
    text-decoration: none;
}

.mm-auth-toggle a:hover {
    text-decoration: underline;
}

.mm-link-btn {
    background: none;
    border: none;
    color: #2c6cb0;
    font-weight: 600;
    font-size: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}
.mm-link-btn:hover {
    text-decoration: underline;
}


/* Suggested / closest emotion for coordinates */
.mm-emotion-btn.mm-suggested {
    border-color: #2c6cb0;
    background: #d6e8fa;
    color: #0d3b66 !important;
    box-shadow: 0 0 0 2px rgba(44, 108, 176, 0.25);
    font-weight: 700;
}

.mm-readout-badge {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eef5ff;
    color: #2c6cb0;
}

/* Account panel */
.mm-account-panel {
    margin-top: 1rem;
    padding-top: 0.5rem;
}
.mm-account-panel h3 {
    text-align: center;
    margin: 0 0 1rem;
}


.mm-profile-select {
    flex: 1;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    font-size: 1rem;
    background: #fff;
    color: #1a1a1a;
}
.mm-profile-select:focus {
    outline: none;
    border-color: #4a90d9;
}
.mm-members-heading {
    margin: 1.25rem 0 0.35rem;
    font-size: 1rem;
}
.mm-members-hint {
    font-size: 0.8rem;
    color: #444;
    margin: 0 0 0.75rem;
    line-height: 1.35;
}


.mm-members-tip {
    text-align: center;
    font-size: 0.78rem;
    color: #444;
    margin: -0.35rem 0 0.85rem;
    line-height: 1.35;
}


/* Plan toggle */
.mm-plan-toggle {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
}
.mm-plan-option {
    display: block;
    cursor: pointer;
}
.mm-plan-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.mm-plan-card {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s;
}
.mm-plan-card strong {
    font-size: 0.95rem;
    color: #222;
}
.mm-plan-card small {
    font-size: 0.78rem;
    color: #444;
}
.mm-plan-option input:checked + .mm-plan-card {
    border-color: #4a90d9;
    background: #eef5ff;
}
.mm-plan-disabled {
    cursor: not-allowed;
    opacity: 0.65;
}
.mm-plan-disabled .mm-plan-card {
    background: #f3f3f3;
}


/* Account mode: hide main UI without touching <script> nodes */
.mood-meter-wrapper.mm-account-mode > *:not(.mm-user-bar):not(#mm-account-panel) {
    display: none !important;
}

/* Challenge + stats */
.mm-challenge-panel {
    background: #f0f6ff;
    border: 1px solid #c5daf5;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin: 0.75rem 0 1rem;
}
.mm-challenge-idle p,
.mm-challenge-status {
    font-size: 0.88rem;
    color: #333;
    margin: 0.4rem 0 0.75rem;
}
.mm-challenge-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.mm-challenge-progress-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #333;
    margin-bottom: 0.35rem;
}
.mm-progress-bar {
    height: 8px;
    background: #d9e6f7;
    border-radius: 999px;
    overflow: hidden;
}
.mm-progress-fill {
    height: 100%;
    background: #2c6cb0;
    border-radius: 999px;
    transition: width 0.3s ease;
}
.mm-stats-panel {
    margin: 0 0 1.25rem;
    padding: 0.85rem 0.5rem 0.25rem;
    border-top: 1px solid #eee;
}
.mm-stats-title {
    font-size: 1rem;
    margin: 0 0 0.75rem;
    text-align: center;
}
.mm-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.mm-stat {
    text-align: center;
    background: #f7f8fa;
    border-radius: 10px;
    padding: 0.55rem 0.25rem;
}
.mm-stat-num {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a1a;
}
.mm-stat-label {
    font-size: 0.72rem;
    color: #444;
}
.mm-quad-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}
.mm-quad-stat {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
    color: #fff;
}
.mm-qs-red { background: #e74c3c; }
.mm-qs-yellow { background: #e0a800; color: #222; }
.mm-qs-blue { background: #3498db; }
.mm-qs-green { background: #27ae60; }
.mm-qs-count { margin-right: 0.25rem; }


.mm-consent-text {
    font-size: 0.75rem;
    line-height: 1.45;
    color: #444;
    background: #f6f7f9;
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    margin: 0.5rem 0 1rem;
}
.mm-member-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem 0.85rem 0.35rem;
    margin-bottom: 0.75rem;
    background: #fafbfc;
}

.mm-schedule-days,
.mm-schedule-hours {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.4rem 0 0.75rem;
}
.mm-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    padding: 0.25rem 0.45rem;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    user-select: none;
}
.mm-chip input { margin: 0; }
.mm-chip:has(input:checked) {
    background: #e8f1fb;
    border-color: #2c6cb0;
    color: #1a4a7a;
}
.mm-chip-hour { min-width: 4.2rem; }

.mm-members-hint {
    color: #444;
}
.mm-consent-text {
    color: #444;
}
.mm-chip {
    color: #333;
    border-color: #9aa3b2;
}
