:root {
    color-scheme: light;
    --ink: #304d3d;
    --green: #3e6650;
    --cream: #f8f6ee;
    --muted: #6d7b69;
    --line: #e1e4d6;
    --gold: #b08a45;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--ink);
    background: radial-gradient(ellipse at 7% 20%, #e9eddf88, transparent 45%), var(--cream);
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    -webkit-text-size-adjust: 100%;
}
button { color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { opacity: .42; cursor: default; }
button:focus-visible, summary:focus-visible { outline: 3px solid #b78a43; outline-offset: 4px; }
button { transition: background .18s, box-shadow .18s, transform .18s; }
.garden-shell { max-width: 450px; margin: auto; padding: 14px 28px 40px; }
.page-heading { display: flex; align-items: center; gap: 12px; }
.eyebrow { display: block; margin: 0 0 7px; color: #75836a; font-size: 9px; font-weight: 650; letter-spacing: 2px; }
.money { display: flex; align-items: baseline; gap: 7px; padding: 9px 13px; border: 1px solid #e6dfc9; border-radius: 11px; background: #fffdf6; }
.money > span { align-self: center; padding-right: 8px; border-right: 1px solid #e6dfc9; font-size: 10px; color: #72765c; }
.money strong { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.money small { color: #94713b; font-size: 11px; }
.companion { position: relative; display: flex; align-items: center; gap: 22px; min-height: 122px; margin-bottom: 24px; padding: 12px 28px 12px 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(110deg, #e8eddf 0%, #f0f2e7 30%, #fffdf6 80%); }
.companion::after { content: ''; position: absolute; width: 190px; height: 190px; right: -88px; bottom: -134px; border: 1px solid #c8d3b9; border-radius: 50%; box-shadow: 0 0 0 18px #e5ebdc70, 0 0 0 36px #e5ebdc40; pointer-events: none; }
.portrait { position: relative; flex-shrink: 0; width: 96px; height: 96px; padding: 0; overflow: hidden; border: 3px solid #fffdf5; border-radius: 50%; background: #dce5c7; box-shadow: 0 4px 12px #334f3415; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait span { position: absolute; left: 0; bottom: 0; width: 100%; padding: 5px 0 7px; color: #fffdf5; background: #385540d9; font-size: 9px; }
.companion-copy { flex: 1; min-width: 0; padding: 5px 0; }
.companion-caption { display: block; margin-bottom: 8px; font-size: 10px; letter-spacing: 1px; color: #6f8064; }
.companion-name { display: block; font-size: 12px; font-weight: 700; }
.companion p { margin: 6px 0 0; font-size: 14px; line-height: 1.8; }
.companion-stamp { display: flex; align-items: center; flex-direction: column; gap: 2px; flex-shrink: 0; width: 100px; color: #8b9c78; }
.companion-stamp svg { width: 55px; height: 55px; opacity: .75; }
.companion-stamp > span { font-size: 7px; letter-spacing: 1.1px; }
.garden-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; gap: 24px; }
.garden { overflow: hidden; border: 1px solid #d1dcc0; border-radius: 24px; background: #dce7c7; box-shadow: 0 10px 32px #314d3509; }
.garden-label { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px 14px; background: #f4efdb; }
.garden-label h2 { margin: 0; font-size: 21px; font-weight: 650; letter-spacing: 2px; }
.garden-label .eyebrow { font-size: 8px; letter-spacing: 1.7px; }
.plot-count { border: 1px solid #cbd3b7; border-radius: 20px; padding: 6px 11px; color: #657457; font-size: 10px; background: #f9f6e96b; }
.landscape { position: relative; overflow: hidden; height: 151px; background: #f4efdb; }
.landscape img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.garden-status { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 9px 22px; background: #c7d7b2; color: #46613c; border-top: 1px solid #edf1dc70; border-bottom: 1px solid #aebf9a70; font-size: 10px; }
.status-dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: #65854c; box-shadow: 0 0 0 3px #ffffff45; }
.status-season { margin-left: auto; padding-left: 10px; white-space: nowrap; color: #617a51; font-size: 9px; }
.plots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; padding: 27px 24px 13px; background: radial-gradient(ellipse at 50% 0%, #eff2dc55, transparent 70%); }
.plot { --soil: #89684e; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: end; min-width: 0; min-height: 143px; padding: 12px 5px 13px; color: #fcf4df; background: repeating-linear-gradient(0deg, transparent 0 15px, #ffffff06 15px 17px), var(--soil); border: 1px solid #6e503f30; border-radius: 16px; box-shadow: inset 0 3px 0 #51382916, 0 5px 0 #acbc8e; }
.plot::before { content: ''; position: absolute; inset: 6px; pointer-events: none; border: 1px solid #d6b18a30; border-radius: 11px; }
.plot.empty { color: #4c6741; background: #c5d3b0; border: 1px dashed #8fa779; box-shadow: inset 0 1px 3px #49683e05; }
.plot.empty::before { border: 0; }
.plot .crop-art { display: flex; align-items: center; justify-content: center; width: 75px; height: 75px; margin: 1px 0 9px; transform: scale(var(--size, 1)); transform-origin: center 80%; filter: drop-shadow(0 4px 2px #30241718); pointer-events: none; }
.crop-art svg { display: block; width: 100%; height: 100%; }
.plot.empty .crop-art { width: 47px; height: 47px; margin: 10px 0 22px; font-size: 26px; font-weight: 300; color: #678151; border: 1px solid #95ac7f; border-radius: 50%; background: #dde5ca55; filter: none; }
.plot .crop-name { position: relative; font-size: 12px; font-weight: 650; }
.plot .time { margin-top: 5px; color: #eadcc8; font-size: 10px; font-variant-numeric: tabular-nums; }
.plot.empty .time { color: #6c835e; font-size: 8px; letter-spacing: 1.1px; }
.plot.ready { --soil: #7b6048; border-color: #f1d18d; box-shadow: inset 0 0 0 2px #d8b67180, 0 5px 0 #a1b17e; }
.plot.ready::after { content: '収穫できる'; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 4px 9px; color: #514b2c; background: #f3d99f; border: 1px solid #ebcf94; border-radius: 8px; font-size: 9px; font-weight: 700; box-shadow: 0 2px 4px #51432b16; }
.plot.ready .time { color: #ffe9b2; }
.plot.gold .crop-art { filter: sepia(.8) saturate(1.8) drop-shadow(0 0 7px #f8d87d80); }
.plot.rainbow .crop-art { filter: drop-shadow(0 0 6px #d5beec); animation: shimmer 6s ease-in-out infinite; }
.plot[data-watered="true"] .crop-name::after { content: '●'; margin-left: 4px; color: #afced2; font-size: 7px; vertical-align: middle; }
.growth { width: 64%; height: 3px; margin-top: 9px; overflow: hidden; border-radius: 4px; background: #4f3a2b5c; }
.growth[hidden] { display: none; }
.growth i { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: #bdcfa0; transition: width 1s linear; }
.garden[data-soil="1"] .plot:not(.empty) { --soil: #806047; }
.garden[data-soil="2"] .plot:not(.empty), .garden[data-soil="3"] .plot:not(.empty) { --soil: #75563f; }
.garden-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 24px 21px; color: #516b43; font-size: 10px; line-height: 1.7; }
.garden-footer > span:last-child { color: #859964; font-size: 18px; }
.garden-sidebar { min-width: 0; }
.garden-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.garden-tools button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 97px; padding: 14px 5px; background: #fffdf6; border: 1px solid var(--line); border-radius: 17px; font-size: 11px; font-weight: 650; box-shadow: 0 3px 8px #34463103; }
.garden-tools button:last-child { grid-column: span 2; min-height: 63px; flex-direction: row; gap: 14px; }
.tool-icon { display: block; width: 39px; height: 39px; }
.tool-icon svg { display: block; width: 100%; height: 100%; }
.garden-tools button:last-child .tool-icon { width: 32px; height: 32px; }
.garden-tools b { position: absolute; top: 9px; right: 10px; display: flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 20px; color: #f9f7e9; background: #667e53; font-size: 9px; font-weight: 600; }
.table-preview { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; padding: 23px 19px; overflow: hidden; border: 1px solid #e4dcc7; border-radius: 20px; background: repeating-linear-gradient(0deg, transparent 0 26px, #b39a6f07 26px 27px), #efe8d9; }
.table-preview h2 { margin: 0 0 10px; font-size: 17px; font-weight: 650; letter-spacing: 1px; }
.table-preview .eyebrow { color: #8a7b5f; font-size: 7px; letter-spacing: 1.4px; }
.table-preview p:last-child { margin: 0; font-size: 10px; line-height: 1.8; color: #746d59; }
.table-preview button { position: relative; flex-shrink: 0; width: 75px; height: 75px; padding: 0; border: 5px solid #fffdf5; border-radius: 50%; background: #f7f3e7; box-shadow: inset 0 0 0 1px #e4ddc9, 0 4px 0 #dcd3bd; font-size: 32px; }
.plate-leaf { position: absolute; right: -13px; bottom: -6px; width: 32px; height: 32px; transform: rotate(20deg); }
.plate-leaf svg { width: 100%; height: 100%; }
.help { margin: 22px 4px 0; color: #6f7969; font-size: 11px; line-height: 1.9; }
.help summary { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; list-style: none; }
.help summary::-webkit-details-marker { display: none; }
.help summary::before { content: '+'; display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border: 1px solid #ccd5be; border-radius: 50%; color: #6b805a; }
.help[open] summary::before { content: '−'; }
.help p { margin: 10px 0; }
.notice { position: fixed; z-index: 20; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); margin: 0; padding: 14px 20px; border: 1px solid #78906b; border-radius: 14px; background: #36543f; color: #fffaf0; box-shadow: 0 8px 24px #263f3226; font-size: 12px; line-height: 1.7; }
/* Passive feedback must not intercept taps during consecutive harvesting. */
.notice { pointer-events: none; }
.notice:empty { display: none; }
dialog { width: min(540px, calc(100% - 28px)); max-height: 85vh; max-height: 85dvh; padding: 0 24px 24px; overflow-x: hidden; color: var(--ink); background: var(--cream); border: 1px solid #d6ddca; border-radius: 24px; box-shadow: 0 24px 80px #203d3438; }
dialog::backdrop { background: #243d3269; backdrop-filter: blur(5px); }
.sheet-head { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -24px 18px; padding: 21px 24px 16px; border-bottom: 1px solid var(--line); background: var(--cream); }
.sheet-head h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: .6px; }
.sheet-head button { flex-shrink: 0; width: 40px; height: 40px; padding: 0; color: #52694b; background: #e9eddf; border: 1px solid #d8e0cd; border-radius: 50%; font-size: 23px; font-weight: 300; }
.sheet-note { margin: 12px 0 16px; color: #66755f; font-size: 12px; line-height: 1.9; overflow-wrap: anywhere; }
.sheet-note:empty { display: none; }
.item-row { display: grid; grid-template-columns: 43px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 10px 0; padding: 16px 14px; border: 1px solid #e1e4d6; border-radius: 16px; background: #fffdf7; }
.item-icon { display: flex; align-items: center; justify-content: center; width: 43px; min-height: 43px; color: #82946b; font-size: 29px; }
.item-icon svg { width: 43px; height: 43px; }
.item-copy { min-width: 0; }
.item-copy strong { font-size: 13px; line-height: 1.6; font-weight: 650; }
.item-copy p { margin: 5px 0 0; color: #6d7865; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.item-row button, .primary { flex-shrink: 0; min-height: 42px; padding: 10px 13px; border: 1px solid #43664c; border-radius: 10px; color: #fffdf2; background: #4b6c51; font-size: 11px; font-weight: 600; }
#sheetBody > button { min-height: 44px; padding: 12px 20px; border: 1px solid #d6dfc8; border-radius: 12px; color: #456342; background: #e9eedf; font-size: 12px; }
.item-row.selected { border-color: #9bb389; background: #edf2e5; }
.item-row.selected button:disabled { color: #506c45; background: #dbe7cf; border-color: transparent; opacity: 1; }
.harvest-big { display: flex; justify-content: center; align-items: center; width: 150px; height: 150px; margin: 20px auto; border: 1px solid #e7dfc5; border-radius: 50%; background: radial-gradient(circle, #faf0d2, #f6f1e0 65%, #f9f6eb); font-size: 70px; }
.harvest-big svg { width: 115px; height: 115px; }
.harvest-info { margin: 16px 0; text-align: center; font-size: 15px; line-height: 2; }
.table-dishes { display: flex; justify-content: center; flex-wrap: wrap; gap: 13px; padding: 24px; border-radius: 18px; background: #eee8d9; font-size: 44px; }
.plot-dialog-actions { display: flex; justify-content: center; gap: 12px; margin: 20px 0; }
.plot-dialog-actions button { min-height: 46px; min-width: 120px; padding: 12px 20px; border: 1px solid #cdd8be; border-radius: 12px; background: #e8eedc; color: #486640; font-size: 13px; font-weight: 600; }
.plot-dialog-actions [data-harvest] { border-color: #4b6c51; background: #4b6c51; color: #fffdf2; }
.sale-actions { display: flex; flex-direction: column; flex-shrink: 0; gap: 7px; }
.sale-actions button { min-height: 39px; padding: 9px 10px; font-size: 10px; }
.sale-actions button:first-child { color: #4b6842; background: #edf1e3; border-color: #dbe2cc; }
@keyframes shimmer { 50% { filter: drop-shadow(0 0 10px #e3c484) drop-shadow(0 0 3px #c5e0dd); } }
@media (hover: hover) {
    button:not(:disabled):hover { transform: translateY(-2px); }
    .plot:not(:disabled):hover { box-shadow: inset 0 0 0 1px #e8d8ad80, 0 7px 0 #a3b581; }
    .garden-tools button:hover { background: #eff3e8; border-color: #b7c7a3; box-shadow: 0 5px 14px #3e59380b; }
    .portrait:hover { box-shadow: 0 4px 15px #334f342b; }
}
@media all {
    .garden-shell { max-width: 450px; padding: 12px 18px 32px; }
    .garden-layout { display: block; }
    .companion { gap: 16px; min-height: 108px; padding: 10px 18px 10px 11px; margin-bottom: 18px; }
    .portrait { width: 82px; height: 82px; }
    .companion-stamp { width: 72px; }
    .companion-stamp svg { width: 43px; height: 43px; }
    .companion-stamp > span { font-size: 6px; letter-spacing: .5px; }
    .companion p { font-size: 13px; }
    .garden-tools { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-top: 18px; }
    .garden-tools button, .garden-tools button:last-child { grid-column: auto; flex-direction: column; gap: 7px; min-height: 88px; padding: 12px 2px; font-size: 10px; border-radius: 15px; }
    .tool-icon, .garden-tools button:last-child .tool-icon { width: 34px; height: 34px; }
    .garden-tools b { top: 6px; right: 6px; height: 16px; min-width: 16px; font-size: 8px; }
    .table-preview { margin-top: 18px; padding: 21px 25px; }
    .table-preview button { width: 82px; height: 82px; }
    .table-preview .eyebrow { font-size: 8px; }
    .table-preview p:last-child { font-size: 11px; }
}
@media (max-width: 420px) {
    .garden-shell { padding: 9px 12px 28px; }
    .money { padding: 7px 11px; }
    .money strong { font-size: 17px; }
    .companion { gap: 12px; padding-right: 14px; border-radius: 18px; }
    .portrait { width: 75px; height: 75px; }
    .portrait span { font-size: 8px; }
    .companion-caption { font-size: 9px; letter-spacing: .4px; }
    .companion-name { font-size: 11px; }
    .companion p { font-size: 12px; line-height: 1.8; }
    .companion-stamp { display: none; }
    .garden { border-radius: 21px; }
    .garden-label { padding: 18px 20px 12px; }
    .garden-label h2 { font-size: 19px; }
    .landscape { height: 114px; }
    .garden-status { padding: 10px 17px; font-size: 9px; }
    .status-season { font-size: 8px; padding-left: 5px; }
    .plots { gap: 19px 11px; padding: 24px 16px 10px; }
    .plot { min-height: 127px; padding-bottom: 12px; border-radius: 13px; }
    .plot .crop-art { width: 61px; height: 61px; }
    .plot.empty .crop-art { width: 39px; height: 39px; margin: 8px 0 21px; font-size: 23px; }
    .plot .crop-name { font-size: 11px; }
    .plot .time { font-size: 9px; }
    .plot.ready::after { padding: 4px 7px; font-size: 8px; }
    .garden-footer { padding: 15px 18px 18px; font-size: 9px; }
    .garden-tools { gap: 5px; margin-top: 15px; }
    .garden-tools button, .garden-tools button:last-child { min-height: 81px; font-size: 9px; }
    .tool-icon, .garden-tools button:last-child .tool-icon { width: 31px; height: 31px; }
    .table-preview { padding: 20px; }
    dialog { padding: 0 16px 20px; border-radius: 21px; }
    .sheet-head { margin: 0 -16px 15px; padding: 17px 16px 14px; }
    .item-row { grid-template-columns: 35px minmax(0, 1fr) auto; gap: 9px; padding: 14px 10px; }
    .item-icon, .item-icon svg { width: 35px; }
    .item-copy strong { font-size: 12px; }
    .item-copy p { font-size: 10px; }
    .item-row button { padding: 10px; font-size: 10px; }
    .sale-actions button { font-size: 9px; padding: 8px; }
}
@media (max-width: 340px) {
    .status-season { display: none; }
    .garden-tools button, .garden-tools button:last-child { font-size: 8px; }
    .item-row { grid-template-columns: 32px minmax(0, 1fr); }
    .item-row > button, .item-row > .sale-actions { grid-column: 2; }
    .sale-actions { flex-direction: row; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Keep the portrait garden and its everyday actions together. */
.garden-label { gap: 8px; padding: 8px 12px; }
.garden-label .money { padding: 5px 9px; }
.garden-label .money strong { font-size: 17px; }
.garden-label .plot-count { margin-left: auto; }
.landscape { height: 52px; }
.companion { min-height: 96px; margin-bottom: 10px; padding: 8px 12px; gap: 12px; }
.portrait { width: 78px; height: 78px; }
.companion-copy { padding: 0; }
.companion p { line-height: 1.65; }
.plot .care { min-height: 14px; margin-top: 4px; font-size: 10px; line-height: 1.4; color: #f6ebd6; }
.plot .care:empty { display: none; }
.plot[data-watered="true"] .crop-name::after { content: none; }
.garden-ranking:empty { display: none; }
.garden-ranking { margin-top: 8px; }
.meal-count:empty { display: none; }
.meal-count { position: absolute; right: -8px; top: -12px; white-space: nowrap; padding: 4px 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); color: var(--ink); font-size: 10px; }
.recipe-card .recipe-ingredients, .recipe-card .recipe-preview { grid-column: 1 / -1; }
.recipe-ingredients { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ingredient { display: inline-flex; align-items: center; gap: 4px; padding: 5px 7px; border-radius: 9px; background: #edf1e3; color: #405b37; font-size: 12px; }
.ingredient svg { flex-shrink: 0; width: 25px; height: 25px; }
.ingredient.missing { background: #f5e8d9; color: #785030; }
.recipe-yield { font-size: 12px; font-weight: 650; }
.recipe-preview { min-width: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.recipe-preview summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.recipe-preview summary::before { content: '＋'; margin-right: 5px; }
.recipe-preview[open] summary::before { content: '−'; }
.recipe-preview p { margin: 0; overflow-wrap: anywhere; }
dialog[data-result="record"] .harvest-big, dialog[data-result="gold"] .harvest-big { border-color: #c3973f; box-shadow: 0 0 0 5px #d9b45825, 0 0 22px #d8b15440; }
dialog[data-result="rainbow"] .harvest-big { border-color: #a692c3; box-shadow: 0 0 0 5px #c1afd630; }
@media all {
    .garden-shell { padding: 8px 12px 24px; }
    .companion { min-height: 94px; margin-bottom: 8px; padding: 8px 10px; }
    .portrait { width: 76px; height: 76px; }
    .garden-label { padding: 7px 10px; }
    .landscape { height: 48px; }
    .garden-status { padding: 7px 12px; min-height: 32px; }
    .plots { padding: 19px 12px 8px; gap: 17px 10px; }
    .plot { min-height: 127px; }
    .garden-footer { padding: 8px 12px 10px; }
    .garden-tools { margin-top: 8px; gap: 5px; }
    .garden-tools button, .garden-tools button:last-child { min-height: 64px; padding: 6px 2px; gap: 4px; font-size: 10px; }
    .tool-icon, .garden-tools button:last-child .tool-icon { width: 26px; height: 26px; }
    .table-preview { margin-top: 10px; padding: 12px 16px; }
    .table-preview button { width: 62px; height: 62px; font-size: 27px; }
    .table-preview h2 { margin-bottom: 5px; }
    .table-preview .eyebrow { display: none; }
    .status-season { display: none; }
    .plot .time { font-size: 10px; }
    .plot.empty .time { letter-spacing: 0; font-size: 10px; }
    .item-row button { min-height: 44px; }
}

/* Match meal artwork to the existing crop illustrations. */
#dish { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
#dish svg { width: 57px; height: 57px; }
.table-dishes svg { display: block; width: 66px; height: 66px; }
.recipe-yield { display: inline-flex; align-items: center; gap: 4px; }
.recipe-yield svg { flex-shrink: 0; width: 28px; height: 28px; }
