:root {
  color-scheme: dark;
  --bg: #101116;
  --panel: #181a22;
  --inset: #13151c;
  --line: #303340;
  --text: #f4f1fa;
  --quiet: #a8a7b7;
  --accent: #b8a2ff;
  --blue: #82bbff;
  --red: #ff8d98;
  --mint: #8ce4c1;
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button, summary, select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
.frame { width: min(1184px, calc(100% - 64px)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--quiet); }
.site-header { border-bottom: 1px solid var(--line); background: #13141a; }
.header-inner { display: flex; align-items: center; gap: 42px; min-height: 70px; }
.wordmark { font-weight: 900; font-size: 1.95rem; letter-spacing: -.09em; padding-right: 3px; }
.wordmark span { color: var(--accent); }
.header-inner nav { align-self: stretch; display: flex; }
.header-inner nav a { border-bottom: 2px solid var(--accent); display: grid; place-items: center; color: #e4d8ff; font-size: .9rem; padding: 0 8px; }
.region { margin-left: auto; border: 1px solid var(--line); border-radius: 18px; padding: 6px 11px; font-size: .8rem; font-weight: 800; letter-spacing: .06em; color: var(--accent); }
.region span { color: var(--quiet); letter-spacing: 0; margin-left: 3px; font-weight: 500; }

.hero { margin-top: 32px; min-height: 350px; position: relative; isolation: isolate; border: 1px solid #373247; border-radius: 18px; background: linear-gradient(115deg, #1d1928, #222036 56%, #191b23); }
.hero-art { position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; background: linear-gradient(90deg, #1d1928 43%, #1e192b66 65%, #15142077), linear-gradient(0deg, #252139, transparent 32%), url("https://ddragon.leagueoflegends.com/cdn/img/champion/splash/Jhin_0.jpg") 100% 39% / auto 157% no-repeat; }
.hero-copy { padding: 48px 48px 44px; }
.eyebrow { color: #d6c6ff; font-size: .875rem; font-weight: 750; letter-spacing: .07em; margin-bottom: 11px; }
h1 { font-size: clamp(2.65rem, 6vw, 4.25rem); letter-spacing: -.075em; line-height: 1.08; }
.subtitle { color: #cfcbdb; margin-top: 14px; }
.search-area { position: relative; margin-top: 29px; width: min(100%, 640px); }
#search-form { display: flex; gap: 8px; }
.search-input { display: flex; gap: 12px; padding: 0 17px; align-items: center; min-width: 0; flex: 1; border: 1px solid #565168; border-radius: 10px; background: #101117e8; }
.search-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px #a98cff2c; }
.search-input input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; height: 52px; }
.search-input input::placeholder { color: #b3b0c3; opacity: 1; }
.search-icon { width: 14px; height: 14px; flex: 0 0 14px; border: 1.5px solid #c4badb; border-radius: 50%; position: relative; margin-right: 4px; }
.search-icon::after { content: ""; width: 6px; height: 1.5px; background: #c4badb; position: absolute; right: -4px; bottom: -2px; rotate: 45deg; }
.button { min-height: 40px; border: 1px solid transparent; border-radius: 9px; padding: 9px 17px; font-weight: 750; font-size: .9rem; white-space: nowrap; }
.primary { color: #180d37; background: var(--accent); min-width: 96px; }
.primary:hover { background: #d0bdff; }
.secondary { background: #252230; border-color: #514764; color: #e9dcff; }
.secondary:hover { background: #30263f; }
button:disabled, select:disabled { opacity: .55; cursor: default; }
.example-button { border: 0; background: transparent; padding: 10px 0 0; color: #ddd4ed; font-size: .86rem; }
.example-button:hover strong { text-decoration: underline; }
.search-history { position: absolute; top: calc(100% + 6px); z-index: 4; width: 100%; border: 1px solid #514764; background: #191722; border-radius: 10px; padding: 12px; box-shadow: 0 12px 28px #08090dad; }
.search-history section + section { margin-top: 11px; }
.search-history h2 { color: var(--quiet); font-size: .85rem; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border-radius: 7px; background: #25222d; border: 1px solid #454050; color: var(--text); padding: 5px 9px; font-size: .875rem; overflow-wrap: anywhere; }
.chip:hover { border-color: var(--accent); }
.status { margin-top: 24px; padding: 16px 18px; border: 1px solid var(--line); background: var(--panel); border-radius: 11px; }
.status.error, .inline-error { color: #ffc0c6; }
body.has-query .hero { min-height: auto; margin-top: 21px; }
body.has-query .hero-copy { padding: 18px 23px; }
body.has-query .hero-copy > :is(.eyebrow, h1, .subtitle, .intro, .example-button), body.has-query .hero-art { display: none; }
.intro { color: #bdb8cc; font-size: .88rem; line-height: 1.55; margin-top: 8px; max-width: 640px; }
.intro[lang="en"] { color: #9f9ab0; font-size: .82rem; }
body.has-query .search-area { margin-top: 0; }

#results { margin-top: 20px; }
.profile-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }
.profile-card, .rank-card { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-width: 0; }
.profile-card { display: flex; align-items: center; gap: 13px; }
.profile-card h2 { font-size: 1.34rem; overflow-wrap: anywhere; letter-spacing: -.035em; }
.profile-card p { margin-top: 5px; font-size: .875rem; }
.profile-badge { flex: 0 0 52px; display: grid; place-items: center; height: 52px; border-radius: 12px; border: 1px solid #716099; color: #dcccff; background: #322649; font-size: 1.35rem; font-weight: 850; }
.favorite { margin-left: auto; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--accent); height: 36px; width: 36px; flex: 0 0 36px; font-size: 1.2rem; }
.favorite[aria-pressed="true"] { background: #33274c; }
.rank-card { display: flex; flex-direction: column; gap: 6px; }
.rank-card h3 { color: var(--quiet); font-size: .875rem; }
.rank-value { font-size: 1.28rem; font-weight: 800; letter-spacing: -.035em; }
.rank-value small { margin-left: 7px; font-size: .84rem; color: #cfbfff; white-space: nowrap; }
.rank-card p { font-size: .86rem; color: var(--quiet); }
.summary { margin-top: 12px; padding: 16px 20px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.summary-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.summary-header h2 { font-size: 1.05rem; }
.summary-header p { font-size: .82rem; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.matches { margin-top: 30px; }
.matches-header { display: flex; align-items: flex-end; justify-content: space-between; padding-bottom: 14px; gap: 15px; }
h2 { font-size: 1.4rem; }
.matches-header p { font-size: .88rem; margin-top: 5px; }
.matches-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.back-button { min-height: 32px; padding: 5px 12px; font-size: .84rem; border-color: var(--accent); }
.party-scope { margin-top: 6px; font-size: .84rem; color: #dccfff; overflow-wrap: anywhere; }
.party-scope.error { color: #ffc0c6; }
.filters { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; justify-content: flex-end; }
.party-filter { display: flex; align-items: center; gap: 8px; color: var(--quiet); font-size: .9rem; }
.party-filter input { width: 190px; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.party-filter input:focus { outline: 0; border-color: var(--accent); }
.party-filter .button { min-height: 34px; padding: 6px 12px; }
.filter { display: flex; align-items: center; gap: 10px; color: var(--quiet); font-size: .9rem; }
.filter select { padding: 7px 30px 7px 10px; appearance: none; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(45deg, transparent 50%, #b6a6da 50%) right 15px center / 5px 5px no-repeat, linear-gradient(135deg, #b6a6da 50%, transparent 50%) right 10px center / 5px 5px no-repeat, var(--panel); }
.match-list { display: grid; gap: 10px; }
.match { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: clip; }
.match[open] { border-color: #5b4d73; }
.match-summary { list-style: none; min-height: 80px; display: grid; grid-template-columns: 106px minmax(120px, 1fr) 103px minmax(190px, 270px) 22px; gap: 13px; align-items: center; padding: 12px 15px 12px 13px; border-left: 3px solid #777487; }
.match-summary::-webkit-details-marker, .deep > summary::-webkit-details-marker { display: none; }
.match-summary:hover { background: #21232d; }
.match-summary.win { border-left-color: var(--mint); }
.match-summary.loss { border-left-color: var(--red); }
.victory { color: var(--mint); }
.defeat { color: var(--red); }
.kind, .played, .unit-label { font-size: .81rem; color: var(--quiet); }
.outcome, .champion-label { display: grid; gap: 4px; }
.champion-slot { display: flex; gap: 9px; align-items: center; min-width: 0; }
.champion-label strong { word-break: keep-all; }
.scoreline { color: #e8e3f5; font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; }
.portrait, .item-icon { display: inline-grid; place-items: center; flex: 0 0 auto; object-fit: cover; border-radius: 6px; border: 1px solid #55536b; background: #262735; }
.portrait { width: 42px; height: 42px; font-weight: 800; }
.item-icon { width: 26px; height: 26px; font-size: .7rem; color: #cec6da; }
.item-icon.empty { opacity: .43; }
.assets { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.assets > .rune-icon { border-radius: 50%; margin-right: 3px; }
.caret { width: 8px; height: 8px; border-right: 1.5px solid #c8bce2; border-bottom: 1.5px solid #c8bce2; rotate: 45deg; justify-self: end; margin-right: 4px; }
details[open] > summary .caret { rotate: 225deg; }
.match-body { padding: 16px; border-top: 1px solid var(--line); background: #161820; }
.details-title { font-size: 1rem; margin-bottom: 11px; }
.teams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.team { overflow: hidden; border: 1px solid #383a49; border-radius: 9px; background: var(--inset); }
.team.blue { --team: var(--blue); }
.team.red { --team: var(--red); }
.team h3 { color: var(--team); font-size: .94rem; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.player { display: grid; grid-template-columns: 18px 34px minmax(0, 1fr); gap: 8px; align-items: start; padding: 10px 11px; border-top: 1px solid #292b37; }
.player .rank { align-self: center; text-align: center; font-weight: 800; font-size: .95rem; color: #d9d2ea; font-variant-numeric: tabular-nums; }
.player.glow { box-shadow: inset 0 0 0 1px #b8a2ff99, inset 0 0 18px #9d7bff33; }
.rank-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px; font-size: .68rem; font-weight: 850; letter-spacing: .04em; vertical-align: 1px; }
.rank-badge.mvp { background: #6b4bd6; color: #fff; }
.rank-badge.ace { background: #8a6a1f; color: #ffe9b0; }
.player-score { display: inline-flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.rating { font-weight: 800; font-size: .9rem; color: #e8e3f5; font-variant-numeric: tabular-nums; }
.rating.top { color: #d7c6ff; }
.rating-note { font-size: .8rem; color: var(--quiet); margin: -4px 0 10px; }
.rating-basis { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--inset); }
.rating-basis h4 { margin: 0 0 8px; font-size: .92rem; }
.basis-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.basis-list li { display: grid; grid-template-columns: minmax(120px, 160px) minmax(0, 1fr) 32px; gap: 10px; align-items: center; font-size: .84rem; color: var(--quiet); }
.basis-list strong { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.basis-bar { height: 6px; border-radius: 6px; background: #2b2d3a; overflow: hidden; }
.basis-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.player:first-of-type { border-top: none; }
.player.is-self { background: #2c223e; }
.player .portrait { width: 34px; height: 34px; }
.player-main { min-width: 0; display: grid; gap: 6px; }
.player-top, .player-build { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.player-top strong { font-size: .91rem; overflow-wrap: anywhere; }
.player-top .scoreline { font-size: .83rem; }
.player-build .item-icon { width: 23px; height: 23px; }
.damage { display: grid; grid-template-columns: minmax(0, 1fr) 65px; gap: 8px; align-items: center; }
.damage span { font-size: .79rem; color: #dbd7e6; text-align: right; font-variant-numeric: tabular-nums; }
.damage progress { display: block; appearance: none; border: 0; border-radius: 10px; background: #2b2d3a; height: 7px; width: 100%; accent-color: var(--team); }
.damage progress::-webkit-progress-bar { background: #2b2d3a; border-radius: 10px; }
.damage progress::-webkit-progress-value { background: var(--team); border-radius: 10px; }
.damage progress::-moz-progress-bar { background: var(--team); border-radius: 10px; }
.metric-header { margin-top: 22px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.metric { padding: 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--quiet); background: var(--inset); display: grid; gap: 4px; min-width: 0; }
.metric strong { color: var(--text); font-size: 1.16rem; letter-spacing: -.035em; }
.metric span { font-size: .86rem; }
.metric small { font-size: .76rem; overflow-wrap: anywhere; }
.deep { margin-top: 10px; }
.deep > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; border: 1px solid #504362; background: #242030; padding: 10px 13px; border-radius: 8px; font-weight: 760; font-size: .88rem; color: #e0d1fa; }
.deep > summary:hover { background: #2f253e; }
.deep > summary .when-open, .deep[open] > summary .when-closed { display: none; }
.deep[open] > summary .when-open { display: inline; }
.deep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.deep-panel { padding: 13px; background: var(--inset); border: 1px solid var(--line); border-radius: 9px; display: grid; gap: 9px; align-content: start; min-width: 0; }
.deep-panel h3 { font-size: .95rem; }
.deep-panel p, .deep-panel li { font-size: .87rem; line-height: 1.5; }
.detail-list { padding-left: 18px; margin: 0; }
.timeline-chart { width: 100%; height: 105px; }
.gold-legend { display: flex; gap: 13px; flex-wrap: wrap; }
.gold-legend .blue-value { color: var(--blue); }
.gold-legend .red-value { color: var(--red); }
.rune-group { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.rune-group strong { font-size: .82rem; color: var(--quiet); }
.more-area { text-align: center; padding: 17px 0 6px; }
.more-area p { margin-bottom: 12px; }
.empty-message, .inline-error { padding: 16px; background: var(--inset); border: 1px solid var(--line); border-radius: 8px; }
.inline-error .button { margin-top: 10px; }
.footer { padding: 23px 0 28px; margin-top: 38px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); color: var(--quiet); font-size: .78rem; }
.footer a:hover { color: var(--text); }
.legal-notice { line-height: 1.55; max-width: 860px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-links a { color: #cfc4e6; text-decoration: underline; text-underline-offset: 3px; }
.legal { max-width: 820px; padding-top: 28px; line-height: 1.65; }
.legal h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); letter-spacing: -.04em; }
.legal h1 span { display: block; font-size: .55em; color: var(--quiet); letter-spacing: 0; margin-top: 4px; }
.legal h2 { font-size: 1.15rem; margin: 30px 0 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.legal h3 { font-size: .98rem; margin: 18px 0 6px; color: #e4d8ff; }
.legal p, .legal li { color: #cfcbdb; font-size: .92rem; }
.legal ul { padding-left: 20px; margin: 6px 0; display: grid; gap: 6px; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.legal-lang { margin-top: 10px; }
.legal .muted { margin-top: 10px; }

@media (max-width: 900px) {
  .frame { width: calc(100% - 40px); }
  .match-summary { grid-template-columns: 88px minmax(100px, 1fr) 82px minmax(145px, 222px) 15px; gap: 9px; }
  .teams { grid-template-columns: 1fr; }
  .profile-card { grid-column: span 2; }
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .frame { width: calc(100% - 28px); }
  .header-inner { gap: 20px; min-height: 58px; }
  .wordmark { font-size: 1.65rem; }
  .region span { display: none; }
  .hero { margin-top: 19px; min-height: 300px; }
  .hero-copy { padding: 37px 18px 27px; }
  .hero-art { opacity: .52; }
  .primary { min-width: 66px; padding-inline: 10px; }
  .search-input { padding-inline: 11px; }
  .rank-card, .profile-card { padding: 13px; }
  .rank-value { font-size: 1.06rem; }
  .rank-value small { margin-left: 4px; }
  .match-summary { grid-template-columns: 77px minmax(min-content, 1fr) auto 11px; padding: 10px 8px; row-gap: 8px; min-height: 70px; }
  .match-summary .assets { grid-row: 2; grid-column: 2 / -1; }
  .match-summary .caret { grid-row: 1; grid-column: 4; margin-right: 0; }
  .match-summary .portrait { width: 32px; height: 32px; }
  .match-summary .item-icon { width: 22px; height: 22px; }
  .match-body { padding: 10px; }
  .match-summary .kind, .match-summary .played { font-size: .72rem; }
  .metrics, .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .basis-list li { grid-template-columns: minmax(96px, 120px) minmax(0, 1fr) 28px; gap: 8px; }
  .summary { padding: 14px; }
  .matches-header { flex-direction: column; align-items: stretch; }
  .filters { justify-content: flex-start; }
  .party-filter { width: 100%; }
  .party-filter input { flex: 1; width: auto; }
  .deep-grid { grid-template-columns: 1fr; }
  .footer { flex-wrap: wrap; }
}
@media (max-width: 350px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-card { grid-column: auto; }
  .matches-header { align-items: flex-start; flex-direction: column; }
  .match-summary { grid-template-columns: 69px minmax(min-content, 1fr) auto 9px; column-gap: 6px; }
  .match-summary .champion-slot { gap: 6px; }
  .match-summary .portrait { width: 28px; height: 28px; }
  .match-summary .scoreline { font-size: .84rem; }
}
