:root {
    --bg: #fdf6ec;
    --ink: #3a3226;
    --line: #3a3226;
    --accent: #ff8fab;
    --accent-2: #8ecae6;
    --cell: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Galmuri11', 'Apple SD Gothic Neo', sans-serif;
    image-rendering: pixelated;
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 20px 60px;
}

/* ---- header ---- */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 20px;
}

.logo {
    font-size: 26px;
    font-weight: bold;
    text-decoration: none;
    color: var(--ink);
    letter-spacing: 2px;
}

.logo-dot { color: var(--accent); margin-left: 4px; }

.site-header nav a {
    color: var(--ink);
    text-decoration: none;
    margin-left: 16px;
    padding: 8px 12px;
    border: 2px solid var(--line);
    background: var(--cell);
    box-shadow: 3px 3px 0 var(--line);
    font-size: 14px;
}

.site-header nav a:hover { background: var(--accent); color: #fff; }

/* ---- flash ---- */
.flash {
    border: 2px solid var(--line);
    box-shadow: 3px 3px 0 var(--line);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 14px;
}

.flash-ok { background: #d8f3dc; }
.flash-error { background: #ffd7d7; }

/* ---- calendar ---- */
.calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0 20px;
}

.month-title { text-align: center; }
.month-title h1 { margin: 0; font-size: 32px; letter-spacing: 1px; }
.month-title .handle { margin: 6px 0 0; font-size: 14px; opacity: .7; }

.month-nav {
    text-decoration: none;
    color: var(--ink);
    font-size: 20px;
    padding: 10px 16px;
    border: 2px solid var(--line);
    background: var(--cell);
    box-shadow: 3px 3px 0 var(--line);
}

.month-nav:hover { background: var(--accent-2); }

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.weekday {
    text-align: center;
    font-size: 14px;
    padding: 6px 0;
}

.weekday.sun { color: #e63946; }
.weekday.sat { color: #457b9d; }

.day {
    position: relative;
    aspect-ratio: 3 / 3.4;
    border: 2px solid var(--line);
    background: var(--cell);
    box-shadow: 3px 3px 0 var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--ink);
    overflow: hidden;
}

.day.empty {
    border: none;
    background: transparent;
    box-shadow: none;
}

.day:not(.empty):hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--line);
}

.day.today { outline: 4px solid var(--accent); outline-offset: -4px; }

.day-num {
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 13px;
    background: var(--bg);
    border: 1px solid var(--line);
    padding: 1px 5px;
    z-index: 1;
}

.day .avatar {
    width: 92%;
    height: 92%;
    object-fit: contain;
    image-rendering: pixelated;
}

.day .plus {
    font-size: 28px;
    opacity: 0;
    color: var(--accent);
}

.day:hover .plus { opacity: 1; }

.day .pending { font-size: 24px; opacity: .4; }

/* ---- entry form ---- */
.entry {
    max-width: 560px;
    margin: 0 auto;
    border: 2px solid var(--line);
    background: var(--cell);
    box-shadow: 5px 5px 0 var(--line);
    padding: 28px;
}

.entry h1 { margin-top: 0; font-size: 24px; }
.weekday-label { font-size: 16px; opacity: .6; }

.entry-avatar { text-align: center; margin-bottom: 20px; }

.avatar-big {
    width: 280px;
    max-width: 100%;
    image-rendering: pixelated;
    border: 2px solid var(--line);
    background: #fff;
}

.entry label {
    display: block;
    margin: 16px 0 8px;
    font-size: 15px;
}

.entry textarea,
.entry input[type="text"] {
    width: 100%;
    border: 2px solid var(--line);
    background: var(--bg);
    padding: 12px;
    font-family: inherit;
    font-size: 15px;
    resize: vertical;
}

.entry textarea:focus,
.entry input[type="text"]:focus {
    outline: 3px solid var(--accent-2);
}

.entry-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    border: 2px solid var(--line);
    background: var(--cell);
    box-shadow: 3px 3px 0 var(--line);
    padding: 12px 18px;
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
}

.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-danger { background: #ffd7d7; margin-top: 14px; }

.field-error { color: #e63946; font-size: 13px; margin: 6px 0 0; }
.hint { font-size: 13px; opacity: .7; }

.site-footer {
    text-align: center;
    font-size: 13px;
    opacity: .5;
    padding: 30px 0;
}

@media (max-width: 720px) {
    .calendar { gap: 6px; }
    .day-num { font-size: 11px; }
    .month-title h1 { font-size: 22px; }
}
