/* Original game graphics; provenance in stardew/SOURCES.md.
   One theme layer for shared UI. Page layouts stay in their existing modules. */
:root {
  --ink:#493019;
  --muted:#786044;
  --paper:#fff2d5;
  --line:#ddbf86;
  --soft:#f4dfae;
  --gold:#956025;
  --radius:0px;
  --game-frame:url('stardew/dialogue-frame-v1.png');
}
body { background:#faf5e7; }
.game-icon {
  display:inline-block;
  width:28px;
  height:28px;
  flex:0 0 auto;
  vertical-align:middle;
  background:center / contain no-repeat;
  image-rendering:pixelated;
}
.game-icon--junimo { background-image:url('stardew/junimo-v1.png'); }
.game-icon--stardrop { background-image:url('stardew/stardrop-v1.png'); }
.game-icon--chest { background-image:url('stardew/chest-v1.png'); }
.brand>.game-icon { width:34px; height:34px; }
.site-header { background:#fff2d5; border-bottom:4px double #b88545; }
.site-footer { border-top:4px double #cfab70; gap:24px; }
.game-credit { display:block; max-width:420px; font-size:11px; color:var(--muted); }
.paper,.notice,.account-menu,.town-overview .week,.town-announcement,.empty,.gate,.festival,.town-help {
  border:16px solid #a5662d;
  border-image:var(--game-frame) 24 / 16px / 0 stretch;
  border-radius:0;
  background:#fff0cf;
  box-shadow:0 4px 0 #82512718;
}
.paper { padding:22px; }
.record { background:#fff5de; }
.record:hover { box-shadow:0 7px 0 #82512718; }
.record .eyebrow { display:flex; align-items:center; gap:7px; color:#725035; }
.record .eyebrow::before {
  content:'';
  width:20px;
  height:26px;
  flex-shrink:0;
  background:url('stardew/chest-v1.png') center / contain no-repeat;
  image-rendering:pixelated;
}
.record-actions { border-top-color:#ddc498; }
.cover,.video-preview,.detail-cover,.external-screen { border-radius:2px; }
.empty { background:#fff3d8; }
.empty>span,.award>span { display:none; }
.empty::before,.award::before,.festival-star::before {
  content:'';
  display:block;
  width:52px;
  height:52px;
  margin:0 auto 8px;
  background:url('stardew/junimo-v1.png') center / contain no-repeat;
  image-rendering:pixelated;
}
.award::before,.festival-star::before { background-image:url('stardew/stardrop-v1.png'); }
.festival-star { font-size:0; }
.festival-star::before { width:72px; height:72px; margin:0; }
.festival { color:#493019; background:#fbe4b3; }
.festival .eyebrow { color:#785128; }
.notice { background:#ffdfa5; padding:14px 18px; }
.game-message { display:flex; gap:14px; align-items:center; }
.game-message .game-icon { width:36px; height:36px; }
.account-menu { padding:6px; width:242px; background:#ffe4ae; }
.account-menu a,.account-menu button { border-radius:0; }
.account-menu a:hover,.account-menu button:hover { background:#ffd18d; }
.primary,.account summary,.main-nav a[aria-current=page],.music-toggle,.town-help-toggle {
  border:10px solid #a5662d;
  border-image:var(--game-frame) 24 / 10px / 0 stretch;
  border-radius:0;
  background:#ffd697;
  color:#493019;
  box-shadow:0 3px 0 #87502522;
}
.primary { padding:6px 14px; }
.primary:hover,.account[open] summary { color:#3a2416; background:#ffca7b; }
.primary:active,.town-help-toggle:active { transform:translateY(2px); }
.main-nav a { border-radius:0; }
.main-nav a[aria-current=page] { padding:3px 8px; }
.account summary { padding:2px 8px; }
.account summary .game-icon { width:22px; height:22px; }
input:not([type=checkbox]):not([type=hidden]),select,textarea {
  border:2px solid #b48049;
  border-radius:0;
  background:#fffaf0;
  box-shadow:inset 2px 2px 0 #ecd5ad;
}
.errorlist,.village-map .house-label,.town-calendar {
  border:8px solid #a5662d;
  border-image:var(--game-frame) 24 / 8px / 0 stretch;
  border-radius:0;
}
.errorlist { background:#ffe4c7; color:#872e1e; }
.week { padding:10px 12px; background:#ffe1a6; }
.week>span::before { content:'◆'; color:#966022; margin-right:6px; }
.week p { color:#6e5236; border-top-color:#d5b680; }
.town-announcement { background:#ffecc5; color:#63472e; }
.town-announcement summary { padding:6px 12px; }
.village-tabs,.collection-tabs a,.members>span { border-radius:2px; }
.village-tabs { background:#efd4a4; border:2px solid #b88545; }
.village-tabs a { border-radius:0; }
.village-tabs a[aria-selected=true],.collection-tabs a[aria-current=page] { background:#ffe3a9; color:#493019; box-shadow:inset 0 -3px #a5682e; }
.stage-chip {
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:2px 7px;
  background:#f5e2b8;
  color:#684826;
  line-height:1.1;
  border:8px solid #a5662d;
  border-image:var(--game-frame) 24 / 8px / 0 stretch;
  border-radius:0;
}
.group-intro { background:#fff0cf; }
.gate-form { padding:32px; }
.music-toggle { padding:4px 11px; }
.music-toggle[aria-pressed=true] { background:#f6dda3; }
.town-help-toggle {
  display:flex;
  align-items:center;
  gap:7px;
  position:fixed;
  left:22px;
  bottom:max(18px,env(safe-area-inset-bottom));
  z-index:30;
  min-height:44px;
  padding:2px 9px;
  font-size:13px;
}
.town-help-toggle[hidden] { display:none; }
.town-help {
  width:min(720px,calc(100% - 32px));
  max-height:calc(100dvh - 40px);
  margin:auto;
  padding:28px;
  color:var(--ink);
  overflow:auto;
  background:#ffe3ae;
}
.town-help::backdrop { background:#201b27a6; }
.town-help[open] { animation:dialog-arrive .16s ease-out; }
.town-help-close { display:flex; justify-content:flex-end; margin:-16px -16px 6px 0; }
.town-help-close button {
  width:44px;
  height:44px;
  border:8px solid #a5662d;
  border-image:var(--game-frame) 24 / 8px / 0 stretch;
  border-radius:0;
  color:#69341c;
  background:#ffce8d;
  font-size:28px;
  line-height:1;
}
.town-help-body { display:grid; grid-template-columns:110px minmax(0,1fr); gap:26px; }
.junimo-portrait {
  text-align:center;
  align-self:start;
  padding:20px 6px 12px;
  background:#eec17c;
  border:8px solid #a5662d;
  border-image:var(--game-frame) 24 / 8px / 0 stretch;
}
.junimo-portrait .game-icon { width:80px; height:80px; }
.junimo-portrait>span:last-child { display:block; font-size:12px; margin-top:10px; }
.town-help h2 { font-size:24px; line-height:1.5; margin-bottom:14px; }
.town-help .eyebrow { color:#86552d; margin-bottom:8px; }
.town-help-copy>p { font-size:14px; }
.town-help-links { display:grid; gap:8px; margin:20px 0; }
.town-help-links a {
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  background:#fff0cc;
  border:8px solid #a5662d;
  border-image:var(--game-frame) 24 / 8px / 0 stretch;
  min-height:60px;
}
.town-help-links a:hover { background:#fff7e5; }
.town-help-links strong,.town-help-links small { display:block; }
.town-help-links strong { font-size:14px; }
.town-help-links small { font-size:12px; color:#785739; }
.town-help-tip { border-top:1px solid #caa36e; padding-top:14px; margin-bottom:0; color:#765330; }
@keyframes dialog-arrive { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
@media(max-width:600px) {
  .paper { padding:16px; }
  .notice { padding:10px 12px; }
  .main-nav a[aria-current=page] { padding:3px 0; border-width:8px; border-image-width:8px; }
  .gate-form { padding:26px 16px; }
  .festival { padding:20px 14px; }
  .festival-star::before { width:36px; height:36px; }
  .town-help-toggle { left:14px; }
  .town-help { padding:16px; width:calc(100% - 24px); }
  .town-help-close { margin:-8px -8px 8px 0; }
  .town-help-body { grid-template-columns:1fr; gap:16px; }
  .junimo-portrait { display:flex; align-items:center; gap:14px; padding:8px 12px; }
  .junimo-portrait .game-icon { width:44px; height:44px; }
  .junimo-portrait>span:last-child { margin:0; }
  .town-help h2 { font-size:21px; }
}
@media(prefers-reduced-motion:reduce) {
  .town-help[open] { animation:none; }
  .primary:active,.town-help-toggle:active { transform:none; }
}
/* Compact Bilibili-style cards: frame only the wide artwork. */
.content-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
  margin: 20px 0 32px;
}
.content-grid .paper.record {
  min-width: 0;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  border: 0;
  border-image: none;
  background: transparent;
  box-shadow: none;
}
.content-grid .paper.record:hover { transform: translateY(-2px); box-shadow: none; }
.record-cover-link {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 8px solid #a5662d;
  border-image: var(--game-frame) 24 / 8px / 0 stretch;
  background: #ead092;
}
.record-cover-link .cover {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: cover;
}
.cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #fff1c3;
  background: linear-gradient(135deg, #8c552e, #d29b47);
  font-size: 12px;
}
.cover-placeholder > span:first-child { font-size: 23px; line-height: 1; }
.record-cover-link .play-mark {
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #2b2118dd;
  color: #fff4d1;
  font-size: 12px;
}
.record .eyebrow { margin: 8px 1px 3px; font-size: 11px; line-height: 1.3; }
.record .eyebrow::before { width: 14px; height: 18px; }
.record h3 { margin: 0 1px 5px; font-size: 16px; line-height: 1.35; }
.record h3 a {
  color: inherit;
  text-decoration: none;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.record > p:not(.eyebrow) {
  margin: 0 1px 6px;
  font-size: 12px;
  line-height: 1.45;
  color: #795f45;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.record > small {
  display: block;
  margin: 0 1px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #896d4e;
}
.record-actions { margin: 0 1px; padding-top: 7px; border-top: 1px solid #e1c693; }
.record-actions a { font-size: 12px; }
.attachment-panel {
  margin-top: 24px;
  padding: 18px 20px;
  background: #fff2d3;
  border: 8px solid #a5662d;
  border-image: var(--game-frame) 24 / 8px / 0 stretch;
}
.attachment-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.attachment-panel h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.attachment-kind { flex: none; padding: 5px 8px; background: #f4d28f; color: #6a4529; font-size: 12px; }
.attachment-meta { margin: 6px 0 14px; color: #85694a; font-size: 13px; }
.attachment-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.attachment-actions .secondary { color: #6b472b; text-decoration: underline; font-size: 13px; }
.detail-attachment-preview {
  display: block;
  width: min(100%, 680px);
  max-height: 520px;
  object-fit: contain;
  margin-top: 16px;
  border: 8px solid #a5662d;
  border-image: var(--game-frame) 24 / 8px / 0 stretch;
  background: #f7e5bd;
}
@media (max-width: 1280px) { .content-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .content-grid { grid-template-columns: 1fr; gap: 18px; }
  .record h3 { font-size: 16px; }
  .attachment-panel { padding: 14px; }
  .attachment-heading { flex-direction: column; gap: 8px; }
}
