@import url("./layout.css");

.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 20px; }
.anime-card { border-radius: 5px; min-width: 0; animation: rise .45s both; animation-delay: calc(var(--index) * 35ms); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 10px; transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }
.anime-card:hover { transform: translateY(-4px); border-color: #22b8cf66; 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: 5px; 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%, #030a0e99 68%, #030a0eeb 100%); z-index: 0; }
.poster-button.has-poster::after { background: linear-gradient(180deg, #030a0e55 0%, transparent 26%, transparent 72%, #030a0e99 100%); }
.poster-number { position: absolute; left: 11px; top: 10px; color: #22b8cf; background: #050c10d9; 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: #22b8cfd9; 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: #c7e4ea; 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: #66d9e8; font-weight: 700; white-space: nowrap; }
.card-date { background: rgba(214,51,108,.12); color: #22b8cf; 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: #0f242e; border: 1px solid #1c4956; color: #6d98a3; border-radius: 7px; font-size: 11px; font-weight: 700; transition: background .15s, border-color .15s, color .15s; }
.card-action:hover { background: #22b8cf2e; border-color: #22b8cf80; color: #22b8cf; }
.card-action.saved { background: #22b8cf26; border-color: #22b8cf66; color: #22b8cf; }
.card-progress { height: 3px; background: #12333d; margin-top: 9px; border-radius: 99px; overflow: hidden; }
.card-progress span { display: block; background: linear-gradient(90deg, #22b8cf, #66d9e8); height: 100%; }
.empty-state { text-align: center; padding: 55px 12px 75px; border: 1px dashed #164150; background: #0f242e; border-radius: 5px; 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 #66d9e866; border-radius: 5px; background: #66d9e866; color: #66d9e8; font-size: 13px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 13px 22px; border-radius: 9px; background: #e3f4f8; border: 1px solid #1098ad66; color: #050c10; font-size: 12px; z-index: 50; box-shadow: 0 12px 35px #00000080; max-width: calc(100% - 30px); }
dialog { border: 1px solid #1a4b5c; border-radius: 16px; padding: 28px; width: min(540px, calc(100% - 24px)); color: var(--ink); background: #0a141a; box-shadow: 0 24px 64px #000000aa; max-height: calc(100dvh - 30px); }
dialog::backdrop { background: #030a0e99; 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: #7aa6b0; display: block; margin-bottom: 16px; }
form input, form select, form textarea { display: block; width: 100%; margin-top: 7px; border: 1px solid #164150; padding: 11px 12px; border-radius: 5px; background: #0d2129; 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 #22b8cf26; }
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: #0f242e88; border: 1px solid #ff5d6c55; color: #ff8fa3; 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: 5px; border: 1px solid #1c4956; }
.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: #8fb3bd; 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: #22b8cf26; border: 1px solid #22b8cf55; color: #1098ad; 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: #22b8cf; color: #050c10; }
.button-mdl:hover { background: #66d9e8; }
.watch-source .watch-footnote { font-size: 11px; color: #8fb3bd; }
.watch-unavailable { border: 1px dashed #1c4956; padding: 18px; border-radius: 5px; 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: #0f2a33; border: 1px solid #1c4956; 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: #22b8cfd9; 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: #66d9e8; 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: 5px; box-shadow: 0 8px 22px #0f242e24; }
.poster-format { border-radius: 99px; background: #e3f4f8e8; color: #1098ad; }
.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: #1c4956; }
.card-action:hover { background: #12333d; }
.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; } }

/* MusicList: cyan wave accents */
.button-dark { clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); border-radius: 0; box-shadow: none; }
.button-dark:hover { box-shadow: none; }
body::after { content: ""; position: fixed; inset: 0; z-index: 40; pointer-events: none; background: repeating-linear-gradient(0deg, #22b8cf08 0 1px, transparent 1px 3px); opacity: .5; }
.anime-card { position: relative; }
.anime-card::before { content: ""; position: absolute; top: 0; left: 10px; right: 10px; height: 2px; background: linear-gradient(90deg, #22b8cf, transparent); opacity: .7; }
.poster-format { border-radius: 3px; letter-spacing: .08em; }
.hero-copy h1 { font-family: "Inter", system-ui, sans-serif; text-transform: uppercase; letter-spacing: .01em; }
