:root {
  color-scheme: dark;
  --bg: #15131b;
  --text: #f4effa;
  --muted: #c3bacd;
  --line: #484052;
  --accent: #d9bdf7;
  --on-accent: #251239;
  font-family: "Noto Sans Thai", "Leelawadee UI", system-ui, sans-serif;
  line-height: 1.65;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: var(--bg); }
.wrap { width: min(100% - 2.5rem, 58rem); margin: 0 auto; }
.bar { border-bottom: 1px solid var(--line); }
.bar .wrap { min-height: 4.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 750; color: var(--text); text-decoration: none; }
.brand img { border-radius: 5px; }
a { color: var(--accent); text-underline-offset: .23em; }
a:hover { text-decoration-thickness: .15em; }
:focus-visible { outline: 3px solid #efb675; outline-offset: 4px; }
main { padding-block: clamp(2rem, 5vw, 4rem) 3rem; }
h1 { margin: 0 0 .4rem; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.22; }
h2 { margin: 0 0 .6rem; font-size: 1.35rem; }
p { margin: 0 0 1rem; }
.intro { color: var(--muted); max-width: 40rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); margin-top: 2rem; }
form { display: grid; gap: .55rem; }
label { font-weight: 650; }
label[for="ticket"] { margin-top: .35rem; }
input, select, button { font: inherit; min-height: 2.8rem; border-radius: 6px; }
input, select { width: 100%; color: inherit; padding: .55rem .7rem; background: #201c28; border: 1px solid #6e617e; }
button { width: fit-content; border: 1px solid transparent; padding: .45rem .95rem; color: var(--on-accent); background: var(--accent); font-weight: 750; cursor: pointer; }
button:disabled { cursor: default; opacity: .65; }
.secondary { background: transparent; border-color: #6e617e; color: var(--text); }
.hint, [role="status"] { color: var(--muted); font-size: .94rem; }
[role="status"]:empty { display: none; }
.rank { align-self: start; border-inline-start: 1px solid var(--line); padding-inline-start: 1.5rem; }
.rank > p, .project p { color: var(--muted); }
.order { margin-block: 1.5rem; padding: 1rem 1.1rem; border-inline-start: 3px solid #efb675; background: #211b29; }
.project { display: grid; grid-template-columns: minmax(7rem, 15rem) minmax(0, 1fr); align-items: center; gap: clamp(1rem, 4vw, 2.25rem); border-top: 1px solid var(--line); padding: 1.35rem 0; }
.project:first-of-type { margin-top: 1.75rem; }
.project img { display: block; width: 100%; max-height: 11rem; height: auto; object-fit: cover; border-radius: 8px; }
.project-fala img { max-width: 7.5rem; object-fit: contain; }
.project h2 { font-size: clamp(1.28rem, 3vw, 1.75rem); margin: 0 0 .35rem; line-height: 1.3; }
.project .links a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.rank ol { max-width: 34rem; padding-left: 1.7rem; margin: .4rem 0 0; }
.rank li div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem .15rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.rank b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.links { display: flex; gap: .55rem 1.6rem; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
@media (max-width: 42rem) {
  .layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .bar .wrap { min-height: 4rem; }
  .rank { border-inline-start: 0; border-top: 1px solid var(--line); padding: 1.25rem 0 0; }
  .project { grid-template-columns: minmax(0, 1fr); }
  .project-tenshi img { max-width: 23rem; }
}
@media (max-width: 24rem) {
  .wrap { width: min(100% - 1.5rem, 58rem); }
}
