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

.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 20px; }
.anime-card { min-width: 0; animation: rise .45s both; animation-delay: calc(var(--index) * 35ms); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }
.anime-card:hover { transform: translateY(-4px); border-color: #b3392e66; box-shadow: 0 14px 32px #00000066; }
.poster-button { display: block; position: relative; width: 100%; aspect-ratio: 3 / 4.1; padding: 0; overflow: hidden; border: 0; border-radius: 8px; background: var(--poster-bg); text-align: left; isolation: isolate; }
.poster-art { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.poster-button:hover .poster-art { transform: scale(1.05); }
.poster-button::after { position: absolute; content: ""; inset: 0; background: linear-gradient(transparent 30%, #221a0e99 68%, #221a0eeb 100%); z-index: 0; }
.poster-button.has-poster::after { background: linear-gradient(180deg, #221a0e55 0%, transparent 26%, transparent 72%, #221a0e99 100%); }
.poster-number { position: absolute; left: 11px; top: 10px; color: #221a0ecc; background: #f3ede1b3; backdrop-filter: blur(6px); padding: 2px 7px; border-radius: 5px; font: 700 10px system-ui, sans-serif; z-index: 1; }
.poster-format { position: absolute; right: 10px; top: 10px; background: #b3392ed9; backdrop-filter: blur(6px); padding: 4px 8px; border-radius: 5px; color: #ffffff; font-size: 9px; font-weight: 800; letter-spacing: .08em; z-index: 1; }
.poster-name { position: absolute; left: 16px; right: 14px; bottom: 20px; z-index: 1; color: #ffffff; font: 800 24px/1.05 "Inter", system-ui, sans-serif; letter-spacing: -.03em; }
.card-info { padding: 11px 3px 3px; }
.card-info h3 { font-size: 13px; font-weight: 700; color: #261d10; line-height: 1.45; margin: 0 0 5px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.card-meta { color: var(--muted); font-size: 11px; display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.card-score { color: #c98a12; font-weight: 700; white-space: nowrap; }
.card-action { width: 100%; margin-top: 11px; display: flex; justify-content: center; align-items: center; gap: 7px; padding: 9px 6px; background: #ede5d3; border: 1px solid #d8caa5; color: #4a3f28; border-radius: 7px; font-size: 11px; font-weight: 700; transition: background .15s, border-color .15s, color .15s; }
.card-action:hover { background: #b3392e2e; border-color: #b3392e80; color: #b3392e; }
.card-action.saved { background: #b3392e26; border-color: #b3392e66; color: #b3392e; }
.card-progress { height: 3px; background: #e4d7b8; margin-top: 9px; border-radius: 99px; overflow: hidden; }
.card-progress span { display: block; background: linear-gradient(90deg, #b3392e, #d99a16); height: 100%; }
.empty-state { text-align: center; padding: 55px 12px 75px; border: 1px dashed #d6c8a3; background: #f0e7d2; border-radius: 12px; margin: 10px 0 35px; }
.empty-state > span { color: var(--accent); font: 800 52px system-ui, sans-serif; }
.empty-state h3 { font: 800 24px system-ui, sans-serif; margin: 12px; color: var(--ink); }
.empty-state p { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.storage-warning { padding: 15px; margin-bottom: 15px; border: 1px solid #f59e0b66; border-radius: 8px; background: #fdf0d566; color: #8a5a0e; font-size: 13px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 13px 22px; border-radius: 9px; background: #221a0e; border: 1px solid #8f241b66; color: #f3ede1; font-size: 12px; z-index: 50; box-shadow: 0 12px 35px #00000080; max-width: calc(100% - 30px); }
dialog { border: 1px solid #d5c7a2; border-radius: 16px; padding: 28px; width: min(540px, calc(100% - 24px)); color: var(--ink); background: #fffdf6; box-shadow: 0 24px 64px #000000aa; max-height: calc(100dvh - 30px); }
dialog::backdrop { background: #221a0e99; backdrop-filter: blur(6px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.dialog-heading h2 { margin: 6px 0 0; font: 800 26px system-ui, sans-serif; color: var(--ink); }
.close-button { background: none; border: 0; color: var(--muted); font-size: 27px; line-height: 1; padding: 0 3px; }
.close-button:hover { color: var(--ink); }
form label { font-size: 11px; font-weight: 700; color: #51452d; display: block; margin-bottom: 16px; }
form input, form select, form textarea { display: block; width: 100%; margin-top: 7px; border: 1px solid #d6c8a3; padding: 11px 12px; border-radius: 8px; background: #ebe1cd; color: var(--ink); font: 13px "Inter", system-ui, sans-serif; }
form input:focus, form select:focus, form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #b3392e26; }
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: #c0392b; }
.form-error { padding: 12px; background: #fbe3df88; border: 1px solid #b3392e66; color: #a33327; font-size: 12px; border-radius: 7px; }
.watch-dialog { width: min(740px, calc(100% - 24px)); }
.watch-heading { display: flex; gap: 22px; 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: 8px; border: 1px solid #d4c6a1; }
.watch-heading > div:last-child { flex: 1; min-width: 0; }
.watch-heading h2 { margin: 0 0 8px; font-size: 26px; line-height: 1.18; overflow-wrap: anywhere; color: var(--ink); }
.watch-meta { color: #8a7a5c; font-size: 12px; }
.watch-intro { font-size: 13px; color: var(--muted); }
.watch-source { border-top: 1px solid var(--line); padding: 20px 0 8px; }
.watch-source-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.watch-source h3 { margin: 0; font-size: 15px; color: var(--ink); }
.source-badge { font-size: 8px; font-weight: 800; letter-spacing: .1em; background: #b3392e26; border: 1px solid #b3392e55; color: #8f241b; padding: 5px 8px; border-radius: 5px; white-space: nowrap; }
.watch-source p { font-size: 12px; line-height: 1.7; color: var(--muted); }
.button-imdb { background: #c98a12; color: #ffffff; }
.button-imdb:hover { background: #d99a16; }
.watch-source .watch-footnote { font-size: 11px; color: #6e6248; }
.watch-unavailable { border: 1px dashed #d4c6a1; padding: 18px; border-radius: 8px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.trailer-frame { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: #e5dac7; border: 1px solid #d8caa5; margin-top: 12px; }
.trailer-frame img, .trailer-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.trailer-frame img { object-fit: cover; }
.trailer-play { position: absolute; inset: 0; margin: auto; width: 60px; height: 60px; border: 1px solid #ffffff40; border-radius: 50%; background: #b3392ed9; backdrop-filter: blur(6px); color: #fff; font-size: 18px; line-height: 58px; padding-left: 4px; cursor: pointer; box-shadow: 0 8px 24px #00000080; transition: transform .2s, background .2s; }
.trailer-play:hover { background: #cf5f4f; transform: scale(1.08); }
@media (max-width: 540px) {
  .watch-heading { gap: 16px; align-items: flex-start; }
  #watch-cover { flex-basis: 85px; }
  .watch-heading h2 { font-size: 21px; }
  .watch-intro { font-size: 12px; }
  .watch-meta { font-size: 11px; line-height: 1.5; }
  .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: 22px; } }
@media (max-width: 760px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 14px; } .poster-name { font-size: 20px; left: 13px; } }
@media (max-width: 540px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; } .poster-name { font-size: 20px; } .dialog-actions { flex-wrap: wrap; } dialog { padding: 20px; } .form-row { gap: 9px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
