@font-face {
  font-family: "Triforce";
  src: url("/assets/fonts/Triforce.eot");
  src: url("/assets/fonts/Triforce.eot?#iefix") format("embedded-opentype"), url("/assets/fonts/Triforce.ttf") format("truetype");
  font-display: swap;
}

:root {
  --page-bg: #101714;
  --panel: rgb(8 13 11 / 96%);
  --panel-soft: #151b18;
  --gold: #aa8115;
  --gold-dim: #594813;
  --red: #ed2929;
  --cyan: #5cefff;
  --text: #edf2f2;
  --muted: #9b9f9e;
  --line: #aeb5b2;
}

#cc-main {
  --cc-bg: #111310;
  --cc-primary-color: #d8e8ef;
  --cc-secondary-color: #b8c7ce;
  --cc-btn-primary-bg: #ddab54;
  --cc-btn-primary-color: #131313;
  --cc-btn-primary-border-color: #ddab54;
  --cc-btn-primary-hover-bg: #f0c77f;
  --cc-btn-primary-hover-color: #131313;
  --cc-btn-primary-hover-border-color: #f0c77f;
  --cc-btn-secondary-bg: #232922;
  --cc-btn-secondary-color: #d8e8ef;
  --cc-btn-secondary-border-color: #487049;
  --cc-btn-secondary-hover-bg: #334033;
  --cc-btn-secondary-hover-color: #fff;
  --cc-btn-secondary-hover-border-color: #5b8b5c;
  --cc-separator-border-color: #487049;
  --cc-toggle-on-bg: #20734c;
  --cc-toggle-off-bg: #6c726b;
  --cc-toggle-readonly-bg: #487049;
  --cc-cookie-category-block-bg: #232922;
  --cc-cookie-category-block-border: #487049;
  --cc-cookie-category-block-hover-bg: #2c352b;
  --cc-cookie-category-block-hover-border: #5b8b5c;
  --cc-footer-bg: #111310;
  --cc-footer-color: #b8c7ce;
  --cc-footer-border-color: #487049;
}

.cookie-settings-button {
  position: fixed;
  bottom: 0;
  left: 1rem;
  z-index: 9998;
  min-height: 0;
  padding: .45rem .75rem;
  border-color: #ddab54;
  border-bottom: 0;
  border-radius: .4rem .4rem 0 0;
  color: #d8e8ef;
  background: #111310;
  box-shadow: none;
  font-size: 12px;
  line-height: 1.3;
}
.cookie-settings-button:hover,
.cookie-settings-button:focus { color: #fff; background: #232922; }

@media print {
  .cookie-settings-button { display: none; }
}

* { box-sizing: border-box; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font: 14px/1.32 "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--page-bg) url("/assets/images/triforce-bg.jpg") left top repeat;
}

a { color: var(--cyan); text-decoration: none; }
a:hover, a:focus { color: #a6f8ff; text-decoration: underline; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }

button, .button {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  justify-content: center;
  padding: 4px 11px;
  border: 1px solid #aaa;
  border-radius: 4px;
  color: #222;
  background: linear-gradient(#fff, #ddd);
  box-shadow: inset 0 1px #fff;
  cursor: pointer;
}
button:hover, button:focus, .button:hover, .button:focus {
  color: #111;
  background: #fff;
  text-decoration: none;
}

.site-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: 44px;
  border-bottom: 1px solid #715914;
  background: rgb(10 15 12 / 95%);
  box-shadow: 0 1px 4px rgb(0 0 0 / 60%);
}

.brand {
  display: flex;
  align-items: center;
  padding: 6px 17px;
}
.brand img { display: block; width: 178px; height: auto; }

.site-navigation { display: flex; min-width: 0; align-items: stretch; }
.site-navigation > a,
.site-navigation > details > summary {
  display: flex;
  min-height: 43px;
  align-items: center;
  padding: 0 11px;
  border: 0;
  color: #9a9d9c;
  background: transparent;
  font-size: 12px;
  font-weight: normal;
  white-space: nowrap;
}
.site-navigation > a:hover,
.site-navigation > a:focus,
.site-navigation > a.active,
.site-navigation > details[open] > summary,
.site-navigation > details[data-active] > summary {
  color: #fff;
  background: rgb(0 0 0 / 27%);
  text-decoration: none;
}

.games-dropdown { position: relative; }
.games-dropdown > summary { cursor: pointer; list-style: none; }
.games-dropdown > summary::-webkit-details-marker { display: none; }
.games-dropdown > summary::after {
  content: "";
  margin: 2px 0 0 6px;
  border: 4px solid transparent;
  border-top-color: #808382;
}
.dropdown-panel,
.account-menu {
  position: absolute;
  top: 44px;
  min-width: 235px;
  max-height: min(76vh, 650px);
  overflow-y: auto;
  border: 1px solid var(--gold);
  border-top: 0;
  background: #0b100e;
  box-shadow: 0 5px 12px rgb(0 0 0 / 75%);
}
.dropdown-panel a,
.account-menu a,
.account-menu button {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 8px 11px;
  border: 0;
  border-bottom: 1px solid #252a27;
  border-radius: 0;
  color: var(--cyan);
  background: transparent;
  box-shadow: none;
  font-weight: normal;
  text-align: left;
}
.dropdown-panel a:hover,
.account-menu a:hover,
.account-menu button:hover {
  color: #fff;
  background: #1a684b;
  text-decoration: none;
}

.account-link {
  display: flex;
  min-width: 80px;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 0 24px 0 10px;
  color: var(--cyan);
  font-size: 12px;
}
.account-link > a,
.account-link summary { color: var(--cyan); cursor: pointer; font-weight: normal; }
.account-link details { position: relative; }
.account-link summary { list-style: none; }
.account-menu { top: 29px; right: -24px; min-width: 170px; }
.account-menu form { margin: 0; }
.rupee {
  width: 16px;
  height: 26px;
  flex: 0 0 auto;
  background-image: url("/assets/images/rupees/rupees_16x26.png");
  background-repeat: no-repeat;
}
.rupee.red { background-position: -32px 0; }
.rupee.silver { background-position: -16px -26px; }
.nav-toggle { display: none; }

.page-container {
  width: calc(100% - 40px);
  max-width: 1420px;
  margin: 28px auto;
}
.well {
  border: 1px solid var(--gold);
  border-radius: 4px;
  color: var(--text);
  background: var(--panel);
  box-shadow: none;
}
.centered-content { width: min(1160px, 100%); margin: 0 auto; padding: 20px; }

h1, h2, h3 { margin-top: 0; color: var(--red); line-height: 1.1; }
h1 {
  margin-bottom: 18px;
  font: 40px/1.08 "Triforce", Georgia, serif;
  letter-spacing: .01em;
}
h2 { margin: 22px 0 10px; font-size: 25px; }
h3 { margin: 17px 0 7px; font-size: 18px; }
p { margin: 0 0 13px; }

.home-layout {
  display: grid;
  width: 100%;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.home-spacer { min-height: 1px; }
.world-records { padding: 10px 7px 13px; }
.world-records h1 {
  margin: 6px 0 6px;
  color: var(--red);
  font: 19px/1 "Triforce", Georgia, serif;
  text-align: center;
}
.world-records table { width: 100%; border-collapse: collapse; font-size: 13px; }
.world-records td { height: 19px; padding: 0 3px; border: 0; vertical-align: middle; white-space: nowrap; }
.world-records .game-icon { width: 22px; padding: 0; text-align: center; }
.world-records .game-icon img {
  display: block;
  width: 17px;
  max-height: 19px;
  margin: auto;
  object-fit: contain;
}
.world-records td:nth-child(2) { width: 67px; color: var(--cyan); }
.world-records .runner {
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
  white-space: normal;
}
.world-records .runner a { color: var(--cyan); }

.news-panel { min-width: 0; padding: 10px 20px 16px; }
.news-post { padding: 0 0 11px; border-bottom: 1px solid var(--gold-dim); }
.news-post + .news-post { padding-top: 9px; }
.news-post:last-child { border-bottom: 0; }
.news-post h1 {
  margin: 0 0 3px;
  color: var(--red);
  font: bold 26px/1.12 "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0;
}
.news-post h1 a { color: inherit; }
.news-post .markdown p { margin-bottom: 4px; }
.news-post .markdown h4 {
  margin: 4px 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.1;
}
.news-post .markdown h3 { margin: 9px 0 0; font-size: 18px; line-height: 1.1; }
.news-footer,
.page-info {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding-top: 7px;
  border-top: 1px solid var(--gold-dim);
  color: var(--muted);
  font-size: 12px;
}

.game-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.game-sidebar { overflow: hidden; padding: 19px; }
.game-logo {
  display: block;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--gold);
  color: var(--text);
  text-align: center;
}
.game-logo:hover { text-decoration: none; }
.game-logo img {
  display: block;
  max-width: 120px;
  max-height: 105px;
  margin: 0 auto 7px;
  object-fit: contain;
}
.game-logo span { display: block; color: var(--text); font: 20px/1.05 "Triforce", Georgia, serif; }
.game-sidebar nav { padding-top: 7px; }
.game-category { border: 0; }
.game-category summary {
  position: relative;
  padding: 7px 4px 7px 15px;
  color: #929594;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  list-style: none;
  text-transform: uppercase;
}
.game-category summary::-webkit-details-marker { display: none; }
.game-category summary::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 0;
  border: 4px solid transparent;
  border-left-color: #5d615f;
}
.game-category[open] summary::before { top: 9px; border-left-color: transparent; border-top-color: #5d615f; }
.game-category > div { margin: 0 -4px; background: transparent; }
.game-category a {
  display: block;
  padding: 4px 15px;
  border: 0;
  color: var(--cyan);
  font-size: 13px;
}
.game-category a:hover,
.game-category a.active { color: var(--cyan); background: #1a704f; text-decoration: none; }

.game-content { min-width: 0; padding: 12px 20px 28px; }
.article-content { padding-top: 5px; }
.article-content .markdown h6 + h2 { margin-top: 8px; margin-bottom: 3px; }
.article-content .markdown p { margin-bottom: 8px; }
.game-content > h1 { margin-bottom: 20px; }
.landing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.landing-grid h2 { text-align: center; }
.legacy-note { margin-top: 36px; padding: 0; border: 0; color: var(--text); background: transparent; }
.search-form,
.leaderboard-controls form { display: flex; flex-wrap: wrap; gap: 5px; align-items: end; }
input, select, textarea {
  width: 100%;
  min-height: 29px;
  padding: 4px 7px;
  border: 1px solid #aaa;
  border-radius: 4px;
  color: #222;
  background: #fff;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 16%);
}
textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgb(92 239 255 / 25%); border-color: var(--cyan); }
.search-form input { flex: 1 1 210px; }
.search-form button { flex: 0 0 auto; }

.content-table,
.runs-table { width: 100%; border-collapse: collapse; color: var(--text); background: transparent; }
.content-table th,
.content-table td,
.runs-table th,
.runs-table td { padding: 8px 9px; border: 1px solid var(--line); text-align: left; }
.content-table th,
.runs-table th { color: var(--text); background: transparent; font-variant: small-caps; text-align: center; }
.content-table tbody tr:nth-child(even),
.runs-table tbody tr:nth-child(even) { background: transparent; }
.content-table td:not(:first-child) { text-align: center; }
.runs-table tr.world-record td:first-child { border-left: 3px solid var(--gold); }
.runs-table tr.unverified { color: #909493; }
.table-scroll { overflow-x: auto; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 17px; }
.pagination label { display: flex; align-items: center; gap: 6px; font-weight: bold; }
.pagination select { width: auto; min-width: 62px; }

.leaderboard-content { width: min(1160px, 100%); }
.leaderboard-content h1 { text-align: center; }
.leaderboard-controls { margin-bottom: 18px; padding: 11px; border: 1px solid var(--gold-dim); background: #101512; }
.leaderboard-controls label { min-width: 125px; font-weight: bold; }
.leaderboard-controls select, .leaderboard-controls input { margin-top: 3px; }
.rules-panel { margin-top: 12px; }
.rules-panel summary { color: var(--cyan); cursor: pointer; font-weight: bold; }
.rules-panel > div { margin-top: 10px; padding: 10px; border: 1px solid var(--gold-dim); background: #0a0e0c; }
.game-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.game-picker a { display: flex; min-height: 140px; flex-direction: column; align-items: center; padding: 13px; border: 1px solid var(--gold-dim); background: #101512; text-align: center; }
.picker-icon { display: flex; height: 95px; align-items: center; justify-content: center; }
.picker-icon img { max-width: 100px; max-height: 90px; object-fit: contain; }

.video-embed { position: relative; width: min(850px, 100%); margin: 18px auto; padding-top: min(56.25%, 478px); background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.run-page h2 { text-align: center; }
.run-status { padding: 9px; border: 1px solid var(--line); text-align: center; }
.run-status.verified { color: #9de493; background: #102014; }
.run-status.unverified { color: #ead276; background: #211d0f; }

.markdown { overflow-wrap: anywhere; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown h1 { color: var(--red); }
.markdown h2 { color: var(--red); }
.markdown h3 { color: var(--red); }
.markdown img { height: auto; }
.markdown iframe { display: block; width: min(100%, 850px); min-height: 420px; margin: 15px auto; border: 0; }
.markdown pre { overflow-x: auto; padding: 10px; border: 1px solid #555; color: var(--text); background: #070a09; }
.markdown code { padding: 1px 4px; color: #f2d486; background: #1a201d; }
.markdown pre code { padding: 0; background: transparent; }
.markdown blockquote { margin: 14px 0; padding: 5px 15px; border-left: 3px solid var(--gold); color: #c5cbc9; background: #141916; }
.markdown table { display: table; width: 100%; max-width: 100%; border-collapse: collapse; color: var(--text); }
.markdown th, .markdown td { padding: 7px 8px; border: 1px solid var(--line); }
.markdown th { color: var(--text); background: transparent; font-variant: small-caps; }
.markdown table td { text-align: center; }
.markdown .tdtop { color: var(--red); font-weight: bold; text-align: center; }
.markdown .tdhead {
  color: var(--text);
  font: 14px/1.15 "Triforce", Georgia, serif;
  text-align: center;
}
.markdown h6 {
  margin: 0 0 8px;
  color: #929594;
  font-size: 11px;
  line-height: 1.1;
  text-transform: uppercase;
}
.markdown details { margin: 11px 0; padding: 8px 10px; border: 1px solid var(--gold-dim); background: #121714; }
.markdown summary { color: var(--cyan); cursor: pointer; font-weight: bold; }

.in-page-navigation {
  float: right;
  width: min(280px, 42%);
  margin: 0 0 18px 22px;
  padding: 11px;
  border: 1px solid var(--gold-dim);
  color: var(--text);
  background: #111713;
}
.in-page-navigation h2 { margin-top: 0; }
.in-page-navigation ul { margin-bottom: 0; padding-left: 19px; }
.in-page-navigation .level-3 { margin-left: 13px; }
.page-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-title { margin-bottom: 0; padding: 0; border: 0; }
.page-edit-button { min-height: 28px; flex: 0 0 auto; padding: 3px 10px; font-size: 12px; }

.profile-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; }
.profile-edit-link { margin: -8px 0 18px; }
.profile-edit-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.profile-edit-heading h1 { margin-bottom: 6px; }
.profile-edit-heading p { margin: 0; color: var(--muted); }
.profile-edit-layout { display: block; }
.profile-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 18px; }
.profile-password-section { margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--gold-dim); }
.profile-password-section h2 { margin: 0 0 13px; }
.profile-password-section small { margin-top: 2px; color: var(--muted); font-weight: normal; }
.profile-edit-form .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.auth-card { width: min(430px, 100%); margin: 70px auto 0; padding: 25px 30px; }
.stack-form { display: flex; flex-direction: column; gap: 13px; }
.stack-form label { display: flex; flex-direction: column; gap: 4px; font-weight: bold; }
.stack-form button { align-self: flex-start; }

.alert { margin-bottom: 16px; padding: 10px 13px; border: 1px solid; border-radius: 4px; }
.alert.notice { border-color: #4d7a44; color: #d9f4d5; background: #173019; }
.alert.error { border-color: #9c3235; color: #ffd9da; background: #3b1113; }
.alert.info { border-color: #9fc5d8; color: #1972a0; background: #d8eef8; }
.alert.info a { color: #17739e; font-weight: bold; text-decoration: underline; }
.alert ul { margin: 4px 0 0; padding-left: 26px; }
.error-page { text-align: center; }

@media (max-width: 1050px) {
  .home-layout { width: 100%; }
  .landing-grid { gap: 30px; }
}

@media (max-width: 820px) {
  .site-header { grid-template-columns: 1fr auto; min-height: 44px; }
  .brand { min-width: 0; }
  .brand img { width: min(178px, 60vw); }
  .nav-toggle {
    display: block;
    align-self: center;
    min-height: 31px;
    margin-right: 10px;
    border-color: var(--gold-dim);
    color: var(--text);
    background: #111713;
    box-shadow: none;
  }
  .nav-toggle:hover { color: #fff; background: #1b231f; }
  .site-navigation {
    display: none;
    grid-column: 1 / -1;
    flex-direction: column;
    border-top: 1px solid #303730;
  }
  .site-header.nav-open .site-navigation { display: flex; }
  .site-navigation > a, .site-navigation > details > summary { min-height: 39px; border-top: 1px solid #242a27; }
  .dropdown-panel { position: static; width: 100%; max-height: 45vh; border-right: 0; border-left: 0; box-shadow: none; }
  .account-link { grid-column: 1 / -1; min-height: 38px; justify-content: flex-start; padding-left: 18px; border-top: 1px solid #242a27; }
  .account-menu { top: 27px; right: auto; left: 0; }
  .page-container { width: calc(100% - 24px); margin: 12px auto; }
  .home-layout, .game-layout, .profile-grid { grid-template-columns: 1fr; }
  .home-spacer { display: none; }
  .world-records, .game-sidebar { order: 2; }
  .centered-content, .news-panel, .game-content { padding: 15px; }
  .landing-grid { grid-template-columns: 1fr; }
  .in-page-navigation { float: none; width: 100%; margin: 0 0 16px; }
  .markdown iframe { min-height: 260px; }
  h1 { font-size: 34px; }
  .news-post h1 { font-size: 23px; }
}

@media (max-width: 560px) {
  .profile-edit-heading { flex-direction: column; gap: 7px; }
  .profile-edit-grid { grid-template-columns: 1fr; }
}
