@import url("./layout.css");

.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
.anime-card { min-width: 0; animation: rise .45s both; animation-delay: calc(var(--index) * 35ms); }
.poster-button { display: block; position: relative; width: 100%; aspect-ratio: 3 / 3.9; padding: 0; overflow: hidden; border: 0; border-radius: 9px; background: var(--poster-bg); text-align: left; isolation: isolate; }
.poster-art { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.poster-button:hover .poster-art { transform: scale(1.04); }
.poster-button::after { position: absolute; content: ""; inset: 0; background: linear-gradient(transparent 28%, #102f3780 65%, #10272dde); z-index: 0; }
.poster-button.has-poster::after { background: linear-gradient(#10272d38, transparent 20%); }
.poster-number { position: absolute; left: 15px; top: 12px; color: #fff9; font: 12px Georgia, serif; z-index: 1; }
.poster-format { position: absolute; right: 12px; top: 12px; background: #f5f5e8e8; padding: 4px 7px; border-radius: 3px; color: #28474a; font-size: 9px; font-weight: bold; letter-spacing: .08em; z-index: 1; }
.poster-name { position: absolute; left: 18px; right: 15px; bottom: 23px; z-index: 1; color: #fffce8; font: 30px/.99 Georgia, serif; letter-spacing: -.04em; }
.card-info { padding: 12px 1px 0; }
.card-info h3 { font-size: 13px; font-weight: 700; line-height: 1.5; margin: 0 0 5px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.card-meta { color: var(--muted); font-size: 10px; display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.card-score { color: #517b68; white-space: nowrap; }
.card-action { width: 100%; margin-top: 12px; display: flex; justify-content: center; align-items: center; gap: 7px; padding: 9px 6px; background: transparent; border: 1px solid #d9dfda; color: #455b57; border-radius: 5px; font-size: 10px; font-weight: 700; }
.card-action:hover { background: #e8eee7; border-color: #9db7a2; }
.card-action.saved { background: #e8eee7; border-color: transparent; }
.card-progress { height: 2px; background: #dbe3da; margin-top: 9px; overflow: hidden; }
.card-progress span { display: block; background: #5c8e74; height: 100%; }
.empty-state { text-align: center; padding: 55px 12px 80px; border: 1px dashed #c9d5cd; border-radius: 10px; margin: 10px 0 35px; }
.empty-state > span { color: #658c7a; font: 60px Georgia, serif; }
.empty-state h3 { font: 29px Georgia, serif; margin: 12px; }
.empty-state p { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.storage-warning { padding: 15px; margin-bottom: 15px; border: 1px solid #d9b783; border-radius: 6px; background: #fff4d9; font-size: 13px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 13px 22px; border-radius: 7px; background: var(--ink); color: white; font-size: 12px; z-index: 10; box-shadow: 0 8px 35px #183c4526; max-width: calc(100% - 30px); }
dialog { border: 1px solid #d5ded4; border-radius: 14px; padding: 28px; width: min(540px, calc(100% - 24px)); color: var(--ink); background: var(--paper); max-height: calc(100dvh - 30px); }
dialog::backdrop { background: #132f3b88; backdrop-filter: blur(4px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.dialog-heading h2 { margin: 6px 0 0; font: 30px Georgia, serif; }
.close-button { background: none; border: 0; color: var(--ink); font-size: 27px; line-height: 1; padding: 0 3px; }
form label { font-size: 11px; font-weight: bold; display: block; margin-bottom: 18px; }
form input, form select, form textarea { display: block; width: 100%; margin-top: 7px; border: 1px solid #ced9d0; padding: 11px 10px; border-radius: 5px; background: #fffefa; color: var(--ink); font: 13px "Trebuchet MS", sans-serif; }
form textarea { resize: vertical; min-height: 85px; }
.form-row { display: flex; gap: 15px; }
.form-row > label { flex: 1; min-width: 0; }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.dialog-actions .button { margin-left: auto; }
.dialog-note { margin: 15px 0 0; text-align: right; font-size: 10px; color: var(--muted); }
.danger { color: #a4544b; }
.form-error { padding: 12px; background: #fae7dc; color: #923f36; font-size: 12px; border-radius: 5px; }
.watch-dialog { width: min(740px, calc(100% - 24px)); }
.watch-heading { display: flex; gap: 23px; align-items: center; padding-bottom: 22px; }
#watch-cover { flex: 0 0 115px; }
#watch-cover img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; }
.watch-heading > div:last-child { flex: 1; min-width: 0; }
.watch-heading h2 { margin: 0 0 10px; font-size: 31px; line-height: 1.15; overflow-wrap: anywhere; }
.watch-meta { color: #71816e; font-size: 11px; }
.watch-intro { font: italic 16px/1.5 Georgia, serif; color: #809074; }
.watch-source { border-top: 1px solid var(--line); padding: 21px 0 8px; }
.watch-source-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.watch-source h3 { margin: 0; font-size: 16px; }
.source-badge { font-size: 7px; letter-spacing: .1em; background: #e5ecd5; color: #627752; padding: 6px 8px; border-radius: 3px; white-space: nowrap; }
.watch-source p { font-size: 12px; line-height: 1.7; color: #6c7e6d; }
.button-crunchyroll { background: #ed6c22; color: white; }
.button-crunchyroll:hover { background: #cf5814; }
.watch-source .watch-footnote { font-size: 10px; color: #83907d; }
.watch-unavailable { border: 1px dashed #ccd8c7; padding: 18px; border-radius: 6px; font-size: 12px; color: #71816e; line-height: 1.7; }
@media (max-width: 540px) {
  .watch-heading { gap: 16px; align-items: flex-start; }
  #watch-cover { flex-basis: 85px; }
  .watch-heading h2 { font-size: 24px; }
  .watch-intro { font-size: 13px; }
  .watch-meta { font-size: 9px; line-height: 1.6; }
  .watch-source-heading { gap: 8px; }
  .watch-source h3 { font-size: 14px; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1120px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .poster-name { font-size: 28px; } }
@media (max-width: 760px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 14px; } .poster-name { font-size: 26px; left: 13px; } }
@media (max-width: 540px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px 16px; } .poster-name { font-size: 28px; } .dialog-actions { flex-wrap: wrap; } dialog { padding: 22px; } .form-row { gap: 9px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
