/* ダイトウタイム農楽部アプリ：どうぶつの森風のやさしい見た目 */
:root {
  --ground: #F7F0DA;
  --card: #FFFBEF;
  --ink: #5A4530;
  --ink-strong: #4A3826;
  --quiet: #7A6248;
  --line: #E5D9B8;
  --shadow: #E0D2AC;
  --mint: #7FD1AE;
  --mint-dark: #4FA583;
  --green: #1A6E53;
  --green-soft: #E3F2D3;
  --yellow: #F6C445;
  --yellow-dark: #D9A52E;
  --peach: #F9D7C5;
  --coral: #E9876B;
  --danger: #B5452A;
  --sea: #8FD3E8;
  --grass: #A8D88A;
  --sand: #F3E2A9;
  --soil: #A77B4F;
  --nav-h: 74px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); }
body {
  font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Yu Gothic', sans-serif;
  font-size: 16px; line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.35; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--ground); }

/* 見出しの帯と波線 */
.hd { background: var(--mint); color: var(--ink-strong); padding: 16px 16px 12px; display: flex; align-items: center; gap: 10px; padding-top: max(16px, env(safe-area-inset-top)); }
.hd .ttl { flex: 1; min-width: 0; }
.hd .sub { font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.hd h1 { font-size: 23px; font-weight: 700; }
.hd.peach { background: var(--peach); } .hd.yellow { background: var(--yellow); } .hd.coral { background: var(--coral); color: #3E2418; }
.scallop { height: 12px; flex-shrink: 0; background-image: radial-gradient(circle at 10px 0, var(--mint) 10px, transparent 10.5px); background-size: 20px 12px; background-repeat: repeat-x; }
.scallop.peach { background-image: radial-gradient(circle at 10px 0, var(--peach) 10px, transparent 10.5px); }
.scallop.yellow { background-image: radial-gradient(circle at 10px 0, var(--yellow) 10px, transparent 10.5px); }
.scallop.coral { background-image: radial-gradient(circle at 10px 0, var(--coral) 10px, transparent 10.5px); }

.main { flex: 1; padding: 6px 16px calc(var(--nav-h) + 24px); display: flex; flex-direction: column; gap: 14px; }

/* カード・ボタン */
.card { background: var(--card); border-radius: 22px; padding: 14px 16px; box-shadow: 0 4px 0 var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.card.flat { box-shadow: none; background: #F3EBD3; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.quiet { color: var(--quiet); font-size: 14px; }
.small { font-size: 13px; }
.bold { font-weight: 700; }
.center { text-align: center; }

.btn { min-height: 52px; border: 0; border-radius: 26px; padding: 0 20px; font-size: 16px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; background: var(--yellow); color: var(--ink-strong); box-shadow: 0 4px 0 var(--yellow-dark); }
.btn.mint { background: var(--mint); color: #1A4A38; box-shadow: 0 4px 0 var(--mint-dark); }
.btn.green { background: var(--green); color: #fff; box-shadow: 0 4px 0 #0F4F3A; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: none; border: 2px solid #D9C99C; }
.btn.danger { background: var(--danger); color: #fff; box-shadow: 0 4px 0 #84301C; }
.btn.small { min-height: 44px; font-size: 14px; padding: 0 14px; }
.btn.block { width: 100%; }
.btn:disabled { background: var(--line); color: var(--quiet); box-shadow: none; cursor: default; }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 var(--shadow); }
.iconbtn { width: 48px; height: 48px; border: 0; border-radius: 16px; background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 var(--mint-dark); text-decoration: none; position: relative; flex-shrink: 0; }
.backbtn { min-height: 44px; padding: 0 12px; border-radius: 14px; background: var(--card); color: var(--ink); display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; text-decoration: none; box-shadow: 0 3px 0 rgba(0,0,0,.12); border: 0; }
.dot { position: absolute; top: 6px; right: 7px; width: 10px; height: 10px; border-radius: 50%; background: #D9532B; border: 2px solid var(--card); }

.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { min-height: 44px; padding: 0 14px; border-radius: 22px; font-size: 14px; font-weight: 700; border: 2px solid #D9C99C; background: var(--card); color: var(--ink); }
.pill[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: #fff; }
.pill.warm[aria-pressed="true"] { border-color: #8A5A12; background: #FCEBC0; color: #4A3826; }
.chip { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; display: inline-block; white-space: nowrap; }
.chip.info { background: var(--green); color: #fff; } .chip.q { background: #FCEBC0; color: #6E4A08; }
.chip.share { background: var(--peach); color: #8E3B22; } .chip.chat { background: #D3EEF6; color: #1F5A70; }
.chip.ok { background: var(--green-soft); color: var(--green); } .chip.wait { background: #FCEBC0; color: #6E4A08; }
.chip.ng { background: var(--peach); color: #8E3B22; }

/* 入力 */
label.lbl { font-size: 14px; font-weight: 700; }
.field { width: 100%; min-height: 48px; border: 2px solid #D9C99C; border-radius: 16px; background: #fff; padding: 10px 14px; font-size: 16px; }
textarea.field { min-height: 96px; resize: vertical; }
.field:focus, .pill:focus-visible, .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid #2B6CB0; outline-offset: 2px; }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* アバター */
.av { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ink-strong); flex-shrink: 0; border: 2px solid #fff; }
.av.lg { width: 56px; height: 56px; font-size: 22px; }
.av.sm { width: 34px; height: 34px; font-size: 14px; }

/* 下のナビ */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
.nav .in { width: 100%; max-width: 560px; display: flex; }
.nav a { flex: 1; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13px; font-weight: 500; color: var(--quiet); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--green); font-weight: 700; }

/* 島マップ */
.mapwrap { position: relative; border-radius: 28px; overflow: hidden; background-color: var(--sea); background-image: radial-gradient(circle, #B5E3F1 2px, transparent 2.5px); background-size: 22px 22px; box-shadow: 0 4px 0 #5BB0CC; }
.mapscroll { overflow: auto; height: 430px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.mapinner { position: relative; transform-origin: 0 0; }
.mapinner svg { position: absolute; left: 0; top: 0; }
.plot { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; }
.plot .soil { border-radius: 30%; background: var(--soil); box-shadow: 0 2px 0 #7A5634; display: flex; align-items: center; justify-content: center; color: #CFF0B8; }
.plot.empty .soil { background: #C3E6A8; box-shadow: none; border: 2px dashed #7A9E5E; }
.plot.mine .soil { outline: 3px solid var(--yellow); }
.plot .nm { font-size: 11px; font-weight: 700; background: var(--card); color: var(--ink); padding: 0 5px; border-radius: 8px; white-space: nowrap; max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
.plot.mine .nm { background: var(--yellow); }
.plot .new { position: absolute; top: -6px; right: -8px; font-size: 9px; font-weight: 700; background: #D9532B; color: #fff; padding: 0 4px; border-radius: 6px; }
.lm { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; }
.lm .nm { font-size: 12px; font-weight: 700; background: var(--green); color: #fff; padding: 0 8px; border-radius: 9px; white-space: nowrap; }
.mapbtns { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 8px; }
.mapbtns button { width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--card); font-size: 22px; font-weight: 700; box-shadow: 0 3px 0 #5BB0CC; }
.maptag { position: absolute; left: 10px; top: 10px; font-size: 12px; font-weight: 700; background: var(--green); color: #fff; padding: 3px 10px; border-radius: 12px; }

.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.quick a { background: var(--card); border-radius: 18px; min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none; box-shadow: 0 3px 0 var(--shadow); }

/* 投稿 */
.post { background: var(--card); border-radius: 22px; box-shadow: 0 4px 0 var(--shadow); overflow: hidden; }
.post .ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #C9E8B0; }
.post .bd { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.react { min-height: 44px; padding: 0 14px; border-radius: 22px; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; border: 2px solid #D9C99C; background: var(--card); }
.react[aria-pressed="true"].like { border-color: #C0462A; background: #FBE0D8; color: #A8381F; }
.react[aria-pressed="true"].stamp { border-color: #B07A10; background: #FCEBC0; color: #6E4A08; }
.menu-dots { width: 44px; height: 44px; border: 0; border-radius: 50%; background: #F3EBD3; font-weight: 700; }
.bubble { flex: 1; background: var(--card); border-radius: 4px 16px 16px 16px; padding: 8px 12px; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.bubble.staff { background: var(--green-soft); }
.pre { white-space: pre-wrap; word-break: break-word; }

.listbtn { border: 0; border-radius: 20px; background: var(--card); padding: 12px 14px; text-align: left; color: var(--ink); display: flex; gap: 12px; align-items: center; box-shadow: 0 4px 0 var(--shadow); width: 100%; text-decoration: none; }

/* 動画 */
.thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; background: var(--peach); }
.vthumb { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; flex-shrink: 0; background: var(--peach); }

/* カレンダー */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.week button { min-height: 70px; border-radius: 16px; border: 2px solid transparent; background: var(--ground); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0; }
.week button[aria-pressed="true"] { background: var(--green); color: #fff; }
.week .wd { font-size: 12px; font-weight: 700; } .week .dn { font-size: 16px; font-weight: 700; }
.week .mk { width: 8px; height: 8px; border-radius: 50%; }
.bar { height: 14px; border-radius: 7px; background: #E8DDBC; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 7px; background: var(--mint); }
.switch { width: 56px; height: 32px; border-radius: 16px; border: 0; padding: 3px; display: flex; background: #C9BC97; flex-shrink: 0; }
.switch::after { content: ''; width: 26px; height: 26px; border-radius: 50%; background: #fff; }
.switch[aria-pressed="true"] { background: var(--green); justify-content: flex-end; }
.notice { background: #3F5A4C; color: #fff; border-radius: 18px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; }

/* 下から出るシート */
.sheet-bg { position: fixed; inset: 0; background: rgba(62,44,28,.55); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; background: var(--card); border-radius: 28px 28px 0 0; padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.sheet .grip { align-self: center; width: 48px; height: 5px; border-radius: 3px; background: #D9C99C; }
.opt { min-height: 50px; border-radius: 16px; padding: 0 14px; display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 700; text-align: left; border: 2px solid var(--line); background: #fff; }
.opt[aria-pressed="true"] { border-color: #8A5A12; background: #FCEBC0; }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translateX(-50%) translateY(20px); background: #3E2C1C; color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 15px; opacity: 0; transition: .25s; z-index: 60; max-width: 90vw; pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.loading { padding: 40px 0; text-align: center; color: var(--quiet); }
.empty { padding: 24px 12px; text-align: center; color: var(--quiet); font-size: 15px; }
.photo-pick { min-height: 92px; border: 3px dashed #D4BF7E; border-radius: 18px; background: var(--ground); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 15px; font-weight: 700; color: var(--quiet); }
.previews { display: flex; gap: 8px; flex-wrap: wrap; }
.previews img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; }
.code { font-size: 32px; font-weight: 700; letter-spacing: .15em; text-align: center; background: var(--ground); border-radius: 16px; padding: 10px; }

@media (min-width: 600px) {
  #app { box-shadow: 0 0 0 1px var(--line); }
}

/* 広告：ほかのカードと同じ形で、「PR」を必ず表示 */
.ad { background: var(--card); border-radius: 22px; padding: 10px 12px 12px; box-shadow: 0 4px 0 var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.chip.adpr { background: #EFE4C6; color: #6B5538; letter-spacing: .05em; }
.adlink { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.admedia { position: relative; width: 132px; flex-shrink: 0; }
.admedia img { width: 132px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: #EFE4C6; }
.adplay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.adtext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* 規約・ポリシー */
.legal { display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.8; }
.legal h3 { font-size: 16px; margin-top: 10px; }
.legal p { margin: 0; }
.linkbtn { border: 0; background: none; padding: 8px 4px; min-height: 44px; color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.legal-note { font-size: 13px; color: var(--quiet); background: #F3EBD3; border-radius: 14px; padding: 8px 12px; }
