:root {
  --bg: #071321;
  --panel: #0d1c2e;
  --panel-soft: #102238;
  --line: #294058;
  --gold: #efbd72;
  --coral: #ee6268;
  --cream: #f7f0e6;
  --muted: #aebccd;
}

html { min-height: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; background: radial-gradient(ellipse 75% 45% at 50% 31%, #0b1d31 0%, var(--bg) 72%); color: var(--cream); }
body > main { width: 100%; flex: 1 0 auto; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

body header, body header.site-header {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  width: 100%;
  height: 72px;
  padding: 0 clamp(24px, 4.5vw, 76px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid #7e9bb633;
  background: #081625e8;
}
body header .brand {
  width: max-content;
  display: inline-block;
  transform: none;
  white-space: nowrap;
  color: var(--cream);
  font: 700 clamp(21px, 2.2vw, 30px)/1 Georgia, 'Times New Roman', serif;
  letter-spacing: .018em;
}
body header .brand em { color: var(--gold); font-style: normal; }
body header .main-nav { height: 100%; display: flex; align-items: stretch; gap: clamp(20px, 3vw, 48px); }
body header .main-nav a { position: relative; display: inline-flex; align-items: center; color: #c2cbd7; font-size: 15px; text-decoration: none; white-space: nowrap; }
body header .main-nav a:hover, body header .main-nav a.active { color: #fff; }
body header .main-nav a.active::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold); }
body header .game-slot { display: block; justify-self: end; min-width: 0; color: var(--muted); text-align: right; white-space: nowrap; }
.game-header { display: flex; align-items: center; gap: 12px; min-width: 225px; padding: 3px 0; border: 0; background: none; color: #e4eaf1; text-align: left; }
.game-header:hover .game-line strong { color: var(--gold); }
.game-cup { flex: 0 0 auto; font-size: 23px; }
.game-details { display: block; min-width: 0; width: 100%; }
.game-line { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.game-line strong { color: #f3f4f5; font-weight: 700; }
.game-progress { display: block; height: 5px; overflow: hidden; border-radius: 99px; background: #27384e; }
.game-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), #f6d395); }
body header .badge-panel { position: absolute; z-index: 50; top: calc(100% + 9px); right: clamp(20px, 4.5vw, 76px); width: min(380px, calc(100vw - 30px)); max-height: calc(100vh - 94px); overflow-y: auto; padding: 22px; border: 1px solid #aa8659; border-radius: 16px; background: #0d1d30; color: #f5efe6; text-align: left; box-shadow: 0 26px 65px #000a, 0 0 0 1px #e9ba7830; animation: badge-appear .22s ease-out both; }
body header .badge-panel[hidden] { display: none; }
body header .badge-panel::before { content: ''; position: absolute; top: -6px; right: 31px; width: 11px; height: 11px; transform: rotate(45deg); border-top: 1px solid #aa8659; border-left: 1px solid #aa8659; background: #0d1d30; }
.badge-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.badge-eyebrow { color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.badge-panel-head h2 { margin: 6px 0 17px; color: #fff; font: 400 29px/1.05 Georgia, serif; }
.badge-panel-head h2 span { margin-left: 4px; color: var(--gold); font: 700 13px Arial, sans-serif; }
.badge-close { width: 32px; height: 32px; margin: -5px -5px 0 0; border: 1px solid #63748a; border-radius: 50%; background: transparent; color: #dbe4ee; font-size: 24px; line-height: 1; }
.badge-close:hover { border-color: var(--gold); color: var(--gold); }
.badge-daily { padding: 14px 15px 12px; border: 1px solid #3a526a; border-radius: 11px; background: #14283d; }
.badge-daily-line { display: flex; justify-content: space-between; gap: 12px; color: #e8edf4; font-size: 13px; }
.badge-daily-line span { color: var(--gold); font-weight: 800; }
.badge-daily-track { height: 7px; margin: 11px 0 9px; overflow: hidden; border-radius: 99px; background: #2b3e54; }
.badge-daily-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e0a95b, #f7d68d); }
.badge-daily p { margin: 0; color: #aebdcc; font-size: 11px; line-height: 1.35; }
.badge-list { display: grid; gap: 7px; margin-top: 16px; }
.badge-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) 19px; align-items: center; gap: 10px; min-height: 53px; padding: 7px 10px; border: 1px solid #31465b; border-radius: 10px; background: #102338; }
.badge-item.is-unlocked { border-color: #a88759; background: linear-gradient(95deg, #54402657, #102338 38%); }
.badge-item.is-locked { opacity: .58; }
.badge-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: #24384d; font-size: 20px; }
.badge-item.is-unlocked .badge-icon { background: #d5a65e30; box-shadow: inset 0 0 0 1px #dfb16b80; }
.badge-copy { display: grid; min-width: 0; gap: 2px; }
.badge-copy strong { overflow: hidden; color: #f5efe6; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.badge-copy small { color: #aebac8; font-size: 10px; }
.badge-state { color: var(--gold); font-size: 17px; font-weight: 800; text-align: center; }
@keyframes badge-appear { from { opacity: 0; transform: translateY(-7px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

body .category-bar { flex: 0 0 auto; width: 100%; min-height: 62px; border: 0; border-bottom: 1px solid #7e9bb62c; background: #081727; }
body .category-bar:not(nav) { display: flex; align-items: center; gap: 9px; overflow-x: auto; padding: 9px clamp(24px, 4.5vw, 76px) !important; scrollbar-width: thin; }
body .category-scroll { display: flex; align-items: center; gap: 9px; max-width: none; min-height: 62px; margin: 0; padding: 9px clamp(24px, 4.5vw, 76px); }
body .category-bar button, body .category-bar .category { flex: 0 0 auto; min-height: 40px; padding: 8px 16px !important; border: 1px solid #32485e; border-radius: 999px; background: transparent; color: #c5cbd4; font: 500 13px/1.2 Arial, sans-serif; white-space: nowrap; transition: background .2s ease, border-color .2s ease, color .2s ease; }
body .category-bar button:hover, body .category-bar .category:hover { border-color: #8d9cab; color: #fff; }
body .category-bar button.active, body .category-bar .category.active { border-color: var(--gold); background: var(--gold); color: #14202b; font-weight: 700; }

body .duel { width: 100%; max-width: 1740px; margin: 0 auto; padding: clamp(22px, 3vh, 34px) clamp(24px, 4.5vw, 76px) 20px; }
body .duel .intro, body .custom-duel .intro { display: block; min-height: 0; margin: 0 auto 24px; text-align: center; }
body .duel .intro .label, body .custom-duel .intro .label { margin: 0 0 9px; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .17em; }
body .duel .intro h1, body .custom-duel .intro h1 { margin: 0; color: #fff; font: 400 clamp(35px, 4vw, 58px)/1.08 Georgia, 'Times New Roman', serif; }
body .duel .intro h1 em, body .custom-duel .intro h1 em { color: var(--gold); font-style: normal; }
body .duel .intro > p:last-child, body .custom-duel .intro > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
body .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(52px, 5vw, 86px); align-items: stretch; position: relative; }
body .card { display: grid; grid-template-columns: 44% minmax(0, 1fr); height: clamp(360px, calc(100vh - 360px), 480px); min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: 0 18px 42px #0000001c; transition: border-color .25s ease, box-shadow .25s ease; }
body .card:hover { border-color: #53708b; box-shadow: 0 20px 48px #0004; }
body .card .poster { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 0; aspect-ratio: auto; overflow: hidden; border-right: 1px solid #304258; background: #07111d; text-decoration: none; isolation: isolate; transform: none; }
body .card .poster::before { content: ''; position: absolute; z-index: 2; inset: 12px; border: 1px solid transparent; border-radius: 5px; pointer-events: none; transition: border-color .25s ease; }
body .card .poster::after { display: none; }
body .card .poster img { position: static !important; display: block; width: 100% !important; height: 100% !important; object-fit: contain !important; object-position: center !important; transition: transform .45s ease, filter .45s ease !important; }
body .card .poster-hover { position: absolute; z-index: 3; right: 17px; bottom: 16px; left: 17px; padding: 8px; border-radius: 6px; background: #071321da; color: #fff; font-size: 13px; font-weight: 700; text-align: center; opacity: 0; transform: translateY(7px); transition: opacity .25s ease, transform .25s ease; }
body .card .poster:hover, body .card .poster:focus-visible { box-shadow: none; transform: none; }
body .card .poster:hover::before, body .card .poster:focus-visible::before { border-color: var(--gold); }
body .card .poster:hover img, body .card .poster:focus-visible img { transform: scale(1.025); filter: saturate(1.08); }
body .card .poster:hover .poster-hover, body .card .poster:focus-visible .poster-hover { opacity: 1; transform: translateY(0); }
body .card .copy { display: flex; flex-direction: column; height: 100%; min-width: 0; padding: clamp(18px, 2.2vw, 32px); overflow: hidden; }
body .card .copy > small { color: var(--coral); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
body .card .copy h2 { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; margin: 13px 0 7px; color: #fff; font: 400 clamp(24px, 2.25vw, 38px)/1.06 Georgia, 'Times New Roman', serif; }
body .card .copy .film-meta { display: block; margin: 0 0 20px; color: #b9c5d3; font-size: 13px; line-height: 1.35; white-space: pre-wrap; }
body .card .copy .film-synopsis { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 5; margin: 0 0 12px; color: #c7d0dc; font-size: clamp(13px, 1vw, 16px); line-height: 1.52; }
body .card .card-bottom { margin-top: auto; }
body .card .actions { display: grid; grid-template-columns: 1fr; gap: 9px; margin: 0; }
body .card .actions button { --vote-glow: #ee6268a8; --vote-fade: #ee626800; position: relative; isolation: isolate; overflow: hidden; width: 100%; height: 47px; border: 1px solid transparent; border-radius: 9px; background: var(--coral); color: #fff; font-size: 18px; font-weight: 800; box-shadow: 0 0 0 0 var(--vote-fade); transition: background .2s ease, border-color .2s ease, box-shadow .25s ease, transform .2s ease; }
body .card .actions button::before { content: ''; position: absolute; top: -30%; bottom: -30%; left: -65%; width: 40%; transform: skewX(-25deg); background: linear-gradient(90deg, transparent, #ffffffa0, transparent); pointer-events: none; }
body .card .actions button:hover:not(:disabled), body .card .actions button:focus-visible:not(:disabled) { background: #fc747a; box-shadow: 0 0 0 2px #ff9b9c66, 0 0 24px #ee626883, 0 8px 24px #ee626844; transform: translateY(-2px) scale(1.025); }
body .card .actions button:hover:not(:disabled)::before, body .card .actions button:focus-visible:not(:disabled)::before { animation: vote-shine .7s ease-out both; }
body .card .actions button:active:not(:disabled) { transform: translateY(1px) scale(.97); }
body .card .actions button.down { --vote-glow: #83aaffaa; --vote-fade: #83aaff00; border-color: #8796a9; background: transparent; color: #f5f5f5; }
body .card .actions button.down:hover:not(:disabled), body .card .actions button.down:focus-visible:not(:disabled) { border-color: #98b8ff; background: #243a5d; box-shadow: 0 0 0 2px #83aaff66, 0 0 24px #83aaff80, 0 8px 24px #5985df38; }
body .card.vote-up-ok, body .card.vote-down-ok { transform: none; }
body .card.vote-up-ok { border-color: #ff9b9c !important; box-shadow: 0 0 0 2px #ee626854, 0 0 30px #ee626833; }
body .card.vote-down-ok { border-color: #98b8ff !important; box-shadow: 0 0 0 2px #83aaff54, 0 0 30px #83aaff33; }
body .card.vote-up-ok .actions button[data-v="1"], body .card.vote-down-ok .actions button[data-v="-1"] { opacity: 1; animation: vote-confirm .6s ease-out both; }

@keyframes vote-shine { from { left: -65%; } to { left: 130%; } }
@keyframes vote-confirm {
  0% { transform: scale(1); box-shadow: 0 0 0 0 var(--vote-glow), 0 0 0 0 var(--vote-glow); }
  35% { transform: scale(1.08); box-shadow: 0 0 0 5px var(--vote-glow), 0 0 28px 3px var(--vote-glow); }
  65% { transform: scale(.985); box-shadow: 0 0 0 12px var(--vote-fade), 0 0 16px 1px var(--vote-glow); }
  100% { transform: scale(1); box-shadow: 0 0 0 20px var(--vote-fade), 0 0 0 0 var(--vote-fade); }
}
body .card .film-link { display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 43px; margin: 9px 0 0; padding: 8px 12px; border: 1px solid var(--gold); border-radius: 9px; background: transparent; color: var(--gold); font-size: 13px; font-weight: 800; text-align: center; text-decoration: none; transition: background .18s ease, color .18s ease, border-color .18s ease; }
body .card .film-link:hover, body .card .film-link:focus-visible { border-color: #ffdda1; background: #efbd7217; color: #ffdda1; text-decoration: none; }
body .card .thanks { min-height: 16px; margin-top: 5px; color: #8de1b0; font-size: 12px; text-align: left; }
body .cards .vs { z-index: 3; display: grid; place-items: center; width: 72px; height: 72px; padding: 0; border: 1px solid var(--gold); border-radius: 50%; background: var(--bg); color: var(--gold); font: 700 29px Georgia, serif; box-shadow: 0 0 0 8px var(--bg); }

body .notice { max-width: 740px; margin: 0 auto 16px; padding: 15px 20px; border: 1px solid #b28a54; border-radius: 10px; background: #192434; color: #ffd293; text-align: center; }
body #next .next { margin: 12px auto 0; }
body .film-modal { background: #06101dc9; }
body .film-modal__panel { border-color: #b68f5d; border-radius: 13px; background: var(--panel); }
body .film-modal__return { color: var(--gold); }

body .my-duel-page { max-width: 1740px; padding: 45px clamp(24px, 4.5vw, 76px) 60px; }
body .my-duel-intro { margin: 0 auto; text-align: center; }
body .my-duel-intro h1 { color: #fff; }
body .my-duel-intro .search-form { max-width: 690px; margin: 28px auto 0; }
body .search-form input { border-color: var(--line); background: var(--panel); }
body .search-form button, body .search-result button, body .new-duel { background: var(--gold); }
body .search-result { border-color: var(--line); border-radius: 12px; background: var(--panel); text-align: left; }
body .search-result img { object-fit: contain; background: #07111d; }
body .custom-duel .cards { margin-top: 0; }
body .custom-duel .intro { margin-bottom: 24px; }

body .top-page { width: min(1180px, calc(100% - 48px)); min-height: 0; padding: 45px 0 65px; }
body .top-heading { text-align: center; }
body .top-heading h1 { font-size: clamp(40px, 5vw, 64px); }
body .top-heading h1 em { color: var(--gold); }
body .top-card { border-color: var(--line); border-radius: 12px; background: var(--panel); }
body .top-card .poster-link img { object-fit: contain; background: #07111d; }
body .top-card .rank, body .top-card .movie-score strong { color: var(--gold); }
body .top-status { border-color: var(--line); background: var(--panel); }

body footer { flex: 0 0 auto; display: block; width: 100%; min-height: 58px; margin-top: auto; padding: 19px clamp(24px, 4.5vw, 76px); border-top: 1px solid #7e9bb633; color: #a5afbb; background: #081625; font-size: 12px; line-height: 1.4; text-align: left; }
body footer a { color: var(--gold); text-decoration: none; }
body footer a:hover { text-decoration: underline; }

@media (max-width: 1199px) {
  body .cards { grid-template-columns: minmax(0, 760px); justify-content: center; gap: 0; }
  body .card { height: 420px; }
  body .card .copy h2 { -webkit-line-clamp: 2; }
  body .card .copy .film-synopsis { -webkit-line-clamp: 4; }
  body .cards .card:first-child { order: 1; }
  body .cards .vs { position: relative; top: auto; left: auto; justify-self: center; order: 2; width: 62px; height: 62px; margin: -10px 0; transform: none; font-size: 24px; }
  body .cards .card:nth-child(2) { order: 3; }
}

@media (min-width: 1200px) and (max-height: 850px) {
  body .card .copy h2 { -webkit-line-clamp: 2; }
  body .card .copy .film-synopsis { -webkit-line-clamp: 3; }
  body .card .copy .film-meta { margin-bottom: 12px; }
  body .card .actions button { height: 43px; }
  body .card .film-link { min-height: 40px; }
}

@media (min-width: 1200px) and (max-height: 760px) {
  body .duel { padding-top: 16px; }
  body .duel .intro { margin-bottom: 14px; }
  body .card .copy { padding: 16px; }
  body .card .copy h2 { margin: 8px 0 5px; font-size: clamp(22px, 2vw, 30px); }
  body .card .copy .film-meta { margin-bottom: 8px; }
  body .card .copy .film-synopsis { -webkit-line-clamp: 2; margin-bottom: 8px; }
  body .card .actions { gap: 7px; }
  body .card .actions button { height: 38px; }
  body .card .film-link { min-height: 36px; margin-top: 7px; }
}

@media (max-width: 750px) {
  body header, body header.site-header { height: auto; min-height: 98px; grid-template-columns: 1fr auto; gap: 0 12px; padding: 13px 18px 0; }
  body header .brand { font-size: 20px; }
  body header .game-slot { align-self: start; }
  .game-header { min-width: 0; gap: 5px; }
  .game-cup { font-size: 18px; }
  .game-details { width: auto; }
  .game-line { margin: 0; font-size: 10px; }
  .game-line span, .game-progress { display: none; }
  body header .main-nav { display: flex; grid-column: 1 / -1; justify-content: center; gap: clamp(24px, 8vw, 60px); margin-top: 7px; }
  body header .main-nav a { font-size: 13px; }
  body header .badge-panel { position: fixed; top: auto; right: 0; bottom: 0; left: 0; width: 100%; max-height: min(78vh, 680px); padding: 20px; border-radius: 18px 18px 0 0; animation-name: badge-sheet-appear; }
  body header .badge-panel::before { display: none; }
  body .category-bar { min-height: 54px; }
  body .category-bar:not(nav), body .category-scroll { min-height: 54px; padding: 7px 18px !important; }
  body .category-bar button, body .category-bar .category { min-height: 38px; padding: 8px 13px !important; font-size: 12px; }
  body .duel { padding: 25px 18px 30px; }
  body .duel .intro, body .custom-duel .intro { margin-bottom: 20px; }
  body .duel .intro h1, body .custom-duel .intro h1 { font-size: clamp(34px, 7vw, 50px); }
  body .duel .intro > p:last-child, body .custom-duel .intro > p:last-child { font-size: 13px; }
  body .card { grid-template-columns: 42% minmax(0, 1fr); height: 370px; }
  body .card .copy { padding: 18px; }
  body .card .copy h2 { font-size: 25px; }
  body .card .copy .film-meta { margin-bottom: 12px; font-size: 12px; }
  body .card .copy .film-synopsis { -webkit-line-clamp: 4; font-size: 13px; }
  body .card .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body .card .actions button { height: 42px; font-size: 15px; }
  body .my-duel-page { padding: 30px 18px 55px; }
  body .top-page { width: calc(100% - 36px); padding-top: 30px; }
  body footer { padding: 16px 18px; text-align: center; }
}

@keyframes badge-sheet-appear { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 560px) {
  body .card { grid-template-columns: 1fr; height: auto; }
  body .card .poster { height: 350px; border-right: 0; border-bottom: 1px solid var(--line); }
  body .card .poster img { width: auto !important; max-width: 100%; height: 100% !important; }
  body .card .copy { min-height: 360px; }
  body .card .copy h2 { font-size: 29px; }
  body .card .copy .film-synopsis { -webkit-line-clamp: 5; }
}

@media (prefers-reduced-motion: reduce) {
  body .card, body .card .poster img, body .card .poster-hover, body .card .actions button { transition: none !important; animation: none !important; }
  body header .badge-panel { animation: none !important; }
  body .card .actions button::before { display: none; }
  body .card .actions button:hover:not(:disabled), body .card .actions button:focus-visible:not(:disabled) { transform: none; }
}
