:root {
  color-scheme: dark;
  --bg: #090b12;
  --panel: #101420;
  --panel-raised: #151b2a;
  --navy: #1b2540;
  --red: #ef3158;
  --red-deep: #c91e43;
  --white: #f4f5f7;
  --muted: #9299a9;
  --line: rgba(255, 255, 255, 0.085);
  --font: "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 82% 14%, rgba(28, 42, 80, 0.35), transparent 35rem),
    radial-gradient(ellipse at 8% 56%, rgba(74, 14, 35, 0.16), transparent 28rem),
    var(--bg);
  color: var(--white);
  font-family: var(--font);
  line-height: 1.65;
  min-height: 100vh;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
img { display: block; max-width: 100%; }
.page-width { width: min(1100px, calc(100% - 48px)); margin-inline: auto; }

.topbar {
  min-height: 70px;
  padding: 0 max(24px, calc((100vw - 1100px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 19, 0.76);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 850; letter-spacing: -0.035em; }
.brand img { width: 36px; height: 36px; object-fit: cover; border-radius: 5px; background: #000; }
.brand-red { color: #ff617a; }
.topbar-right, .nav-session { display: flex; align-items: center; gap: 10px; }
.version-chip {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #9da5b4;
  font: 9px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.035em;
}
.nav-session .nav-user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d6d9e0; font-size: 12px; }
.nav-session .nav-link { color: #bec3cf; font-size: 12px; transition: color .18s ease; }
.nav-session .nav-link:hover { color: #fff; }
.nav-session .nav-logout { background: transparent; border: 0; padding: 5px; cursor: pointer; color: #a4aaba; font-size: 11px; }

.button {
  min-height: 46px;
  padding: 11px 17px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: linear-gradient(135deg, #f02e57, #d21e46); box-shadow: 0 8px 22px rgba(219, 25, 66, .17); }
.button-primary:hover { background: #fa3e63; }
.button-quiet { color: #f0f1f5; background: #1b2233; border-color: rgba(255,255,255,.08); }
.button-quiet:hover { background: #242e45; }
.button-small { min-height: 36px; padding: 7px 12px; font-size: 11px; }
.button-full { width: 100%; }
.text-link { display: inline-block; margin-top: 18px; color: #c5cad4; font-size: 12px; transition: color .18s ease; }
.text-link:hover { color: white; }

.hero { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 60px; padding-block: 64px 70px; min-height: 555px; }
.eyebrow { margin: 0 0 13px; color: #ed536f; font: 700 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .2em; }
.eyebrow-dot { display: inline-block; width: 6px; height: 6px; margin: 0 7px 1px 0; background: var(--red); }
.hero h1, .auth-aside h1 { margin: 0; font-size: clamp(46px, 6.4vw, 72px); line-height: 1.08; letter-spacing: -.055em; font-weight: 900; }
.hero h1 span, .auth-aside h1 span, .page-heading h1 span, .intro-section h2 span { color: #ff5172; }
.hero-description { max-width: 540px; margin: 18px 0 24px; color: #c4c8d1; font-size: 14px; line-height: 1.95; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-art { display: flex; flex-direction: column; align-items: center; gap: 13px; }
.art-frame { width: min(100%, 375px); aspect-ratio: 1; display: grid; place-items: center; background: #000; border: 1px solid rgba(255,255,255,.055); border-radius: 7px; box-shadow: 0 24px 60px rgba(0,0,0,.3); overflow: hidden; }
.art-frame img { width: 88%; height: 88%; object-fit: contain; }
.art-caption { color: #596173; font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .28em; }
.server-card { margin-top: 24px; padding: 14px 15px 11px; max-width: 475px; border: 1px solid var(--line); border-radius: 7px; background: rgba(17, 21, 33, .7); }
.server-label { margin: 0 0 9px; color: #d5d8df; font-size: 11px; font-weight: 700; }
.server-values { display: flex; gap: 22px; flex-wrap: wrap; }
.server-value { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.server-value strong { color: white; font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.muted-label { color: var(--muted); font-size: 10px; }
.copy-button { padding: 3px 7px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.035); color: #d9dce4; font-size: 10px; cursor: pointer; transition: border-color .18s, background .18s; }
.copy-button:hover { background: rgba(239,49,88,.14); border-color: rgba(239,49,88,.5); }
.copy-feedback { display: block; min-height: 16px; color: #f0748b; font-size: 10px; }
.stripe-rule { height: 8px; background: repeating-linear-gradient(115deg, #ef3158 0 9px, #fff 9px 17px, #162c74 17px 25px, #111522 25px 34px); opacity: .85; }
.intro-section { padding-block: 64px 72px; }
.intro-section h2 { max-width: 740px; margin: 0; font-size: clamp(30px, 4.6vw, 46px); line-height: 1.27; letter-spacing: -.04em; }
.intro-section > p:last-child { max-width: 650px; margin-top: 17px; color: #adb3c0; font-size: 13px; line-height: 2; }
.site-footer { display: flex; align-items: center; justify-content: space-between; min-height: 80px; border-top: 1px solid var(--line); color: #858c9b; font-size: 10px; }
.brand-footer img { width: 27px; height: 27px; }
.brand-footer { font-size: 13px; }

.auth-layout { display: grid; grid-template-columns: 1fr 430px; align-items: center; gap: 80px; max-width: 1010px; min-height: calc(100vh - 70px); padding-block: 48px; }
.auth-aside h1 { font-size: clamp(42px, 5.4vw, 60px); }
.auth-aside > p:not(.eyebrow) { max-width: 400px; color: #b9bfcb; font-size: 14px; line-height: 2; }
.mini-logo { width: 155px; height: 105px; margin-top: 25px; display: grid; place-items: center; background: #000; border-radius: 6px; overflow: hidden; }
.mini-logo img { width: 100%; height: 100%; object-fit: cover; }
.form-card { padding: 28px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(150deg, rgba(20,25,39,.98), rgba(15,18,28,.96)); box-shadow: 0 22px 70px rgba(0,0,0,.22); }
.form-card h2, .clip-card h2 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.form-intro { margin: 3px 0 23px; color: #9ba2b1; font-size: 12px; }
.stack-form { display: grid; gap: 14px; }
.stack-form label, .add-player-form label { display: grid; gap: 6px; color: #d7dae1; font-size: 11px; font-weight: 650; }
.stack-form input, .add-player-form input, .search-field input {
  width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid rgba(255,255,255,.12); border-radius: 5px; outline: 0; color: white; background: #0c0f18; font-size: 12px; transition: border-color .18s, box-shadow .18s;
}
.stack-form input:focus, .add-player-form input:focus, .search-field input:focus, .tier-select:focus { border-color: rgba(239,49,88,.78); box-shadow: 0 0 0 3px rgba(239,49,88,.12); }
.stack-form input::placeholder, .add-player-form input::placeholder, .search-field input::placeholder { color: #656d7c; }
.optional { color: #808797; font-weight: 400; }
.captcha-box { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: rgba(7,9,15,.45); }
.captcha-box > div { display: grid; gap: 1px; }
.captcha-box strong { font: 700 14px ui-monospace, SFMono-Regular, Consolas, monospace; }
.captcha-box input[type=number] { grid-column: 1 / -1; }
.form-message { min-height: 17px; margin: 0; color: #f08497; font-size: 11px; }
.form-message.success { color: #64d4a9; }
.form-switch { margin: 17px 0 0; color: #a5acb9; text-align: center; font-size: 11px; }
.form-switch a { color: #ff617d; font-weight: 700; }

.content-page { min-height: calc(100vh - 160px); padding-block: 45px 55px; }
.narrow-page { max-width: 780px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 26px; margin-bottom: 26px; }
.page-heading h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.25; letter-spacing: -.045em; }
.page-description { margin: 6px 0 0; color: #9da4b1; font-size: 12px; }
.compact-server { min-width: 285px; max-width: 330px; margin-top: 3px; padding: 10px 12px 7px; }
.compact-server .server-value { gap: 6px; }
.compact-server .server-value strong { font-size: 10px; }
.rankings-panel { padding: 21px; border: 1px solid var(--line); border-radius: 8px; background: rgba(16,20,32,.87); }
.panel-topline { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.panel-topline .eyebrow { margin-bottom: 3px; }
.panel-topline h2 { margin: 0; font-size: 21px; }
.search-field { display: flex; align-items: center; gap: 7px; width: 230px; color: #9ca4b3; }
.search-field > span { font-size: 21px; }
.search-field input { min-height: 37px; }
.mode-tabs { display: flex; gap: 5px; margin-top: 18px; overflow-x: auto; scrollbar-width: thin; }
.mode-tab { flex: 0 0 auto; padding: 8px 12px; border: 1px solid transparent; border-radius: 5px; color: #9ca3b1; background: transparent; font-size: 11px; cursor: pointer; }
.mode-tab:hover { color: white; background: rgba(255,255,255,.045); }
.mode-tab.active { color: white; border-color: rgba(239,49,88,.4); background: rgba(239,49,88,.12); }
.sample-note { margin: 12px 0; color: #8b93a2; font-size: 10px; }
.table-scroll { width: 100%; overflow-x: auto; }
.ranking-table { width: 100%; border-collapse: collapse; text-align: left; }
.ranking-table th { padding: 11px 12px; border-bottom: 1px solid var(--line); color: #7f8797; font-size: 9px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.ranking-table td { padding: 13px 12px; border-bottom: 1px solid rgba(255,255,255,.055); color: #dbe0e8; font-size: 12px; white-space: nowrap; }
.ranking-table tbody tr:last-child td { border-bottom: 0; }
.ranking-table tbody tr { transition: background .15s ease; }
.ranking-table tbody tr:hover { background: rgba(255,255,255,.025); }
.rank-number { color: #959eae !important; font: 700 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.player-link { font-weight: 700; transition: color .18s; }
.player-link:hover { color: #ff647e; }
.points-number { color: #fff !important; font: 700 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.tier-badge { display: inline-flex; justify-content: center; min-width: 43px; padding: 3px 7px; border: 1px solid color-mix(in srgb, var(--tier-color), transparent 54%); border-radius: 4px; color: var(--tier-color); background: color-mix(in srgb, var(--tier-color), transparent 90%); font: 800 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.table-status { height: 94px; color: #969ead !important; text-align: center; }

.settings-card { max-width: 560px; }
.account-role { display: flex; align-items: center; gap: 8px; margin: 0 0 22px; color: #9ba2b1; font-size: 11px; }
.account-role strong { color: white; font-size: 13px; }
.role-badge { padding: 2px 7px; border: 1px solid rgba(239,49,88,.3); border-radius: 999px; color: #ff748b; font-size: 9px; }
.add-player-form { display: grid; gap: 12px; margin-bottom: 10px; }
.add-player-form label { display: grid; gap: 6px; color: #d7dae1; font-size: 11px; font-weight: 650; }
.add-player-form input { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid rgba(255,255,255,.12); border-radius: 5px; outline: 0; color: white; background: #0c0f18; font-size: 12px; }
.new-player-tier-fieldset { min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.new-player-tier-fieldset legend { padding-inline: 5px; color: #aeb5c3; font-size: 10px; }
.add-tier-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.add-player-form .button { justify-self: start; }
.admin-panel { padding-top: 17px; }
.admin-table { min-width: 840px; }
.admin-table td { padding: 10px 8px; }
.admin-table th { padding-inline: 8px; }
.tier-select { min-width: 70px; padding: 6px 20px 6px 8px; border: 1px solid var(--line); border-radius: 4px; color: #f4f5f7; background: #0c0f18; font: 700 10px ui-monospace, SFMono-Regular, Consolas, monospace; cursor: pointer; }
.delete-button { padding: 6px 9px; border: 1px solid rgba(239,49,88,.28); border-radius: 4px; color: #ff758a; background: rgba(239,49,88,.08); font-size: 10px; cursor: pointer; }
.delete-button:hover { background: rgba(239,49,88,.19); }

.profile-card { padding: 25px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(145deg, rgba(25,32,51,.95), rgba(13,16,26,.96)); }
.profile-kicker { color: #929aab; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; }
.profile-name { margin: 3px 0 14px; font-size: clamp(28px, 5vw, 42px); line-height: 1.25; letter-spacing: -.045em; }
.profile-total { display: flex; align-items: baseline; gap: 8px; margin-bottom: 18px; color: #979faf; font-size: 11px; }
.profile-total strong { color: white; font: 800 21px ui-monospace, SFMono-Regular, Consolas, monospace; }
.profile-tiers { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-tier { display: grid; gap: 6px; min-width: 90px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: rgba(0,0,0,.18); }
.profile-tier span:first-child { color: #9ba3b2; font-size: 9px; }
.clip-card { margin-top: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: rgba(16,20,32,.7); }
.clip-card h2 { font-size: 18px; }
.clip-placeholder { min-height: 185px; margin-top: 13px; display: grid; place-items: center; border: 1px dashed rgba(255,255,255,.16); border-radius: 5px; color: #747c8d; background: rgba(0,0,0,.26); font-size: 12px; }

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr .8fr; gap: 28px; min-height: 0; padding-block: 52px 48px; }
  .auth-layout { grid-template-columns: .8fr 1fr; gap: 28px; }
  .auth-aside h1 { font-size: 44px; }
  .compact-server { min-width: 255px; }
}
@media (max-width: 640px) {
  .page-width { width: calc(100% - 40px); }
  .topbar { min-height: 62px; padding-inline: 18px; }
  .topbar-right { gap: 7px; }
  .version-chip { font-size: 8px; }
  .topbar .nav-session .nav-link, .topbar .nav-session .nav-user-name { display: none; }
  .hero { display: flex; flex-direction: column; align-items: stretch; gap: 30px; padding-block: 42px 40px; }
  .hero h1 { font-size: clamp(48px, 13vw, 64px); }
  .hero-description { margin-block: 14px 20px; font-size: 13px; }
  .hero-art { align-items: center; }
  .art-frame { width: min(82vw, 300px); }
  .server-card { max-width: none; }
  .intro-section { padding-block: 48px; }
  .site-footer { min-height: 67px; gap: 12px; font-size: 9px; }
  .auth-layout { display: flex; flex-direction: column; align-items: stretch; gap: 23px; min-height: 0; padding-block: 38px; }
  .auth-aside h1 { font-size: 42px; }
  .auth-aside > p:not(.eyebrow) { margin-bottom: 0; font-size: 12px; }
  .mini-logo { display: none; }
  .form-card { padding: 21px; }
  .page-heading { flex-direction: column; gap: 15px; }
  .compact-server { width: 100%; max-width: none; }
  .content-page { padding-block: 32px 42px; }
  .rankings-panel { padding: 15px 12px; }
  .panel-topline { align-items: flex-start; flex-direction: column; }
  .search-field { width: 100%; }
  .mode-tabs { margin-inline: -2px; }
  .ranking-table th { padding: 10px 9px; }
  .ranking-table td { padding: 12px 9px; }
  .add-tier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-card, .clip-card { padding: 18px; }
}
