:root {
    --primary-color: #ff9ed2;
    --secondary-color: #b1a7ff;
    --bg-color: #fff5f8;
    --border-color: #ffe0eb;
    --radius: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body.compact-mode {
    font-family: 'Kiwi Maru', serif;
    background-color: var(--bg-color);
    color: #6d4c41;
    height: 100vh;
    overflow: hidden; /* 全体を固定 */
    display: flex;
    flex-direction: column;
}

.main-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    max-width: 450px;
    margin: 0 auto;
    width: 100%;
}

/* ヘッダーを小さく */
.mini-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.1rem;
    margin-bottom: 0.2rem;
}

.micro-mascot {
    width: 24px;
    height: auto;
    vertical-align: middle;
    margin-right: 5px;
}

.mini-header h1 {
    font-size: 1.1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

/* グラフをさらに低く */
.mini-stats {
    background: white;
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 2px solid var(--border-color);
    height: 100px;
}

.canvas-wrapper {
    height: 100%;
}

/* エディタの凝縮 */
.mini-editor {
    background: white;
    border-radius: var(--radius);
    padding: 0.8rem;
    border: 3px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

input[type="date"] {
    flex: 1;
    padding: 0.4rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.85rem;
}

.mini-mood-selector {
    display: flex;
    gap: 0.2rem;
    background: #fff0f5;
    padding: 0.2rem;
    border-radius: 20px;
}

.mini-mood-selector input { display: none; }
.mini-mood-selector label {
    font-size: 1.2rem;
    cursor: pointer;
    filter: grayscale(1);
    opacity: 0.3;
}
.mini-mood-selector input:checked + label {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.1);
}

.input-wrapper {
    position: relative;
    margin-bottom: 0.5rem;
}

textarea {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    resize: none;
    background: #fff9fb;
}

.submit-btn-mini {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.6rem;
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* 履歴エリアをスクロール可能に */
.mini-history {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.entry-card {
    background: white;
    padding: 0.6rem;
    border-radius: 15px;
    margin-bottom: 0.5rem;
    border-left: 5px solid var(--primary-color);
    font-size: 0.85rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
}

/* コントロール */
.top-controls {
    position: fixed;
    top: 5px;
    right: 5px;
    z-index: 100;
}

.circle-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: 2px solid white;
    font-size: 0.8rem;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
}

.modal-content {
    background: white;
    margin: 30% auto;
    padding: 1.5rem;
    width: 80%;
    border-radius: 25px;
    text-align: center;
    border: 4px solid var(--primary-color);
}

.fortune-item {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #fff9fb;
    border-radius: 15px;
    font-size: 0.9rem;
}

.stars-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 1;
}

.star {
    position: absolute; background: var(--primary-color);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    opacity: 0.1;
}

@keyframes floating {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.floating { animation: floating 3s ease-in-out infinite; }
