@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: #d6336c66; 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%, #33162699 68%, #331626eb 100%); z-index: 0; }
.poster-button.has-poster::after { background: linear-gradient(180deg, #33162655 0%, transparent 26%, transparent 72%, #33162699 100%); }
.poster-number { position: absolute; left: 11px; top: 10px; color: #331626cc; background: #fdf0f5b3; 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: #d6336cd9; 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: #3d1f2f; 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: #e8a01d; font-weight: 700; white-space: nowrap; }
.card-date { background: rgba(214,51,108,.12); color: #d6336c; border: 1px solid rgba(214,51,108,.45); border-radius: 999px; padding: 1px 8px; font-size: 10px; letter-spacing: .3px; white-space: nowrap; }
.card-action { width: 100%; margin-top: 11px; display: flex; justify-content: center; align-items: center; gap: 7px; padding: 9px 6px; background: #f9e0ec; border: 1px solid #ecc4d5; color: #6e4356; border-radius: 7px; font-size: 11px; font-weight: 700; transition: background .15s, border-color .15s, color .15s; }
.card-action:hover { background: #d6336c2e; border-color: #d6336c80; color: #d6336c; }
.card-action.saved { background: #d6336c26; border-color: #d6336c66; color: #d6336c; }
.card-progress { height: 3px; background: #f3cfdd; margin-top: 9px; border-radius: 99px; overflow: hidden; }
.card-progress span { display: block; background: linear-gradient(90deg, #d6336c, #f06595); height: 100%; }
.empty-state { text-align: center; padding: 55px 12px 75px; border: 1px dashed #eec3d4; background: #fbe3ef; 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: #331626; border: 1px solid #a61e4d66; color: #fdf0f5; font-size: 12px; z-index: 50; box-shadow: 0 12px 35px #00000080; max-width: calc(100% - 30px); }
dialog { border: 1px solid #e9bdd1; border-radius: 16px; padding: 28px; width: min(540px, calc(100% - 24px)); color: var(--ink); background: #fffafd; box-shadow: 0 24px 64px #000000aa; max-height: calc(100dvh - 30px); }
dialog::backdrop { background: #33162699; 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: #7c4a60; display: block; margin-bottom: 16px; }
form input, form select, form textarea { display: block; width: 100%; margin-top: 7px; border: 1px solid #eec3d4; padding: 11px 12px; border-radius: 8px; background: #f6d8e6; 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 #d6336c26; }
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: #c92a2a; }
.form-error { padding: 12px; background: #fbe3df88; border: 1px solid #d6336c66; color: #a61e4d; 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 #e8bcd0; }
.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: #9d7283; 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: #d6336c26; border: 1px solid #d6336c55; color: #a61e4d; padding: 5px 8px; border-radius: 5px; white-space: nowrap; }
.watch-source p { font-size: 12px; line-height: 1.7; color: var(--muted); }
.button-mdl { background: #845ef7; color: #ffffff; }
.button-mdl:hover { background: #9775fa; }
.watch-source .watch-footnote { font-size: 11px; color: #96677c; }
.watch-unavailable { border: 1px dashed #e8bcd0; 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: #f2cfe0; border: 1px solid #ecc4d5; 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: #d6336cd9; 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: #f06595; 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; } }

.lang-switch { display: inline-flex; border: 1px solid var(--muted); border-radius: 999px; overflow: hidden;  }
.lang-btn { border: 0; background: transparent; color: var(--muted); font: 700 11px system-ui, sans-serif; letter-spacing: .08em; padding: 7px 12px; cursor: pointer; }
.lang-btn + .lang-btn { border-left: 1px solid var(--muted); }
.lang-btn.active { background: var(--accent); color: #fff; }
.lang-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.card-grid { gap: 30px 22px; }
.anime-card { padding: 0; border: 0; border-radius: 0; background: transparent; }
.anime-card:hover { transform: translateY(-3px); box-shadow: none; }
.poster-button { border-radius: 16px 16px 5px 16px; box-shadow: 0 8px 22px #77314c24; }
.poster-format { border-radius: 99px; background: #fff8f1e8; color: #8e3156; }
.poster-number { border-radius: 99px; }
.card-info { padding: 13px 2px 2px; }
.card-info h3 { font-size: 14px; }
.card-action { border-radius: 99px; background: transparent; border-color: #dcb6c6; }
.card-action:hover { background: #f8dce8; }
.card-progress { height: 4px; }
@media (max-width: 760px) { .card-grid { gap: 24px 14px; } }
@media (max-width: 540px) { .card-grid { gap: 22px 12px; } .card-info h3 { font-size: 12px; } }