:root {
  --darkBlue: #2A2E36;
  --darkBlueRGB: 42, 46, 54;
  --lightBlue: #9FCFFA;
  --green: #94D67E;

  --darkGold: #B99640;
  --gold: #E8CA80;
  --goldRGB: 232, 202, 128;

  --red: #FF552A;

  --white: #E2E3E7;

  --darkGrey: #707070;
  --grey: #A6A6A6;
  --lightGrey: #E8E8E8;

  --titleFont: 'Advent Pro', sans-serif;
  --bodyFont: 'PT Sans', sans-serif;

  --titleFontSize: 24px;
  --largeFontSize: 18px;
  --bodyFontSize: 16px;
  --tinyFontSize: 12px;

  --titleLineHeight: 28px;
  --largeLineHeight: 24px;
  --bodyLineHeight: 20px;
  --tinyLineHeight: 16px;

  --buy: var(--darkGold);
  --sell: var(--darkGrey);

  --text: var(--white);
  --textMuted: rgba(255,255,255,0.6);

  /* --rule: rgba(255,255,255, 0.1); */
  --rule: #41434b;
  --glass: rgba(255,255,255, 0.05);
  --glassLight: rgba(255,255,255, 0.08);
  --glassGold: rgba(185, 150, 64, 0.13);
  --glassGoldLight: rgba(185, 150, 64, 0.2);

  --level1: 0 2px 4px rgba(0,0,0,0.2);
  --level2: 0 2px 6px rgba(0,0,0,0.4);

  --safeTop: env(safe-area-inset-top);
  --safeBottom: env(safe-area-inset-bottom);
}

@media (min-width:1200px) {
  :root {
    --titleFontSize: 32px;
    --largeFontSize: 18px;
    --bodyFontSize: 14px;
    --tinyFontSize: 12px;
    
    --titleLineHeight: 40px;
    --largeLineHeight: 24px;
    --bodyLineHeight: 16px;
    --tinyLineHeight: 14px;
  }
}

* {
  overscroll-behavior-x: none;
}

html, body {
  position: relative;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overscroll-behavior-x: none; /* https://stackoverflow.com/questions/30636930/disable-web-page-navigation-on-swipeback-and-forward */
}

body {
  font-family: 'PT Sans', sans-serif;
  font-size: var(--bodyFontSize);
  line-height: var(--bodyLineHeight);

  background-color: var(--darkBlue);
  /* background: #2A2E36 radial-gradient(83.76% 98.08% at 12.99% 11.2%, #3d4961 0%, #111316 100%); */
  background-repeat: no-repeat;
  background-attachment: fixed;
  
  margin: 0;
  padding: 0;
}

a {
  text-decoration: none;
}

*:focus {
  outline: none;
}

* {
  -webkit-tap-highlight-color: transparent;
}



/* Rules */

hr,
.hr {
  flex: 0 0 auto;
  width: 100%;
  height: 1px;
  border: 0;
  margin: 31px 0 32px;
  background-color: var(--rule);
}

.vr {
  flex: 0 0 auto;
  height: 100%;
  width: 1px;
  margin: 0 32px;
  background-color: var(--rule);
}



/* Typography */

h1, 
.title-text {
  padding: 0;
  margin: 0 0 24px;
  font-family: var(--titleFont);
  font-size:  var(--titleFontSize);
  line-height: var(--titleLineHeight);
  font-weight: normal;
  color: white;
}

/* App Page Titles 
These are titles in the primary content/feed area of the app screen, used for
settings and such. This is a title with a rule underneith. 

Example:

```html
  <h1 class="app-title">Account Settings</h1>
```
*/

.app-title {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: max(var(--safeTop), 16px) 48px 15px;
  border-bottom: 1px solid var(--rule);
  margin: 0 0 16px;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;

  font-family: var(--titleFont);
  font-size:  var(--titleFontSize);
  text-align: center;
  line-height: 24px;
  font-weight: normal;
  color: white;
  
  background: linear-gradient(180deg, rgba(var(--darkBlueRGB),1) 0%, rgba(var(--darkBlueRGB),0.2) 100%);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

@media (min-width: 1200px) {
  .app-title {
    position: static;
    padding: 16px;
    margin: 0;
    text-align: left;
    line-height: 40px;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-bottom: 0;
  }
}

h2, h3, h4, h5, h6 {
  padding: 0;
  margin: 16px 0;
  font-family: var(--titleFont);
  font-size: var(--bodyFontSize);
  line-height: var(--bodyLineHeight);
  color: white;
}

p,
li,
.body-text {
  font-family: var(--bodyFont);
  font-size: var(--bodyFontSize);
  line-height: var(--bodyLineHeight);
  padding: 0;
  margin: 16px 0;
  color: white;
}

.tiny-text {
  font-family: var(--bodyFont);
  font-size: var(--tinyFontSize);
  line-height: var(--tinyLineHeight);
  padding: 0;
  margin: 0;
  color: white;
}

p a {
  color: inherit;
  text-decoration: underline;
}


/* Inputs */

.input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 40px;
  border: 0;
  padding: calc((40px - var(--bodyLineHeight)) / 2) 16px calc((40px - var(--bodyLineHeight)) / 2);
  margin: 8px 0;

  font-family: var(--bodyFont);
  font-size: var(--bodyFontSize);
  line-height: var(--bodyLineHeight);
  color: var(--white);
  
  border-radius: 20px;
  background: var(--glass);

  cursor: text;
}

.input::placeholder {
  color: var(--grey);
}

.input:focus,
.input.focused {
  background: var(--glassLight);
}

.input.center {
  text-align: center;
}

.input.left {
  text-align: left;
}

.input.disabled,
.input:disabled {
  opacity: 0.5;
  background-color: var(--glass);
}

textarea.input {
  resize: none;
  min-height: 80px;
  font-family: var(--bodyFont);
}

select.input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: calc((40px - var(--bodyLineHeight)) / 2) 16px;
}

.checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
}
    
.checkbox:before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 13px;
  position: relative;
  top: 2px;
  background: url('check-box.svg') no-repeat;
}

.checkbox:checked:before,
.checkbox.checked:before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 13px;
  position: relative;
  top: 2px;
  background: url('check-box-checked.svg') no-repeat;
}


/* Labels and inputs in labels */

label,
.label {
  display: block;
  font-family: var(--bodyFont);
  font-size: var(--bodyFontSize);
  line-height: var(--bodyFontSize);
  padding: 0;
  margin: 16px 0;
  color: white;
}

label .input,
.label .input {
  width: 100%;
}


/* Button */

.button {
  display: inline-block;
  appearance: none;
  padding: 8px 32px;
  border: 0;
  background-color: var(--glass);
  border-radius: 20px;
  text-align: center;
  font-family: var(--titleFont);
  font-weight: bold;
  font-size: var(--bodyFontSize);
  line-height: 24px;
  color: var(--white);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.button.primary {
  background-color: var(--darkGold);
  color: var(--white);
}

.button.primary.disabled,
.button.primary:disabled {
  background-color: var(--grey);
}

.button.tertiary {
  background-color: transparent;
  color: var(--white);
  font-weight: normal;
  min-width: 0px;
}

.button.tertiary.disabled,
.button.tertiary:disabled {
  color: var(--grey);
}


.button .initiate-room {
  background-color:var(--white);
  color: var(--darkBlue);
  font-weight: bold;
  min-width: 0px;
  min-width:150px;
}

@media (hover:hover) {
  .button:hover {
    background-color: var(--glassLight);
  }

  .button.tertiary:hover {
    background-color: transparent;
  }

  .button.primary:hover {
    background-color: var(--gold);
  }
}



/* Switches */

.switch-group {
  margin: 16px 0;
}

.switch-group .switch {
  margin-bottom: 0;
}

.switch {
  display: inline-block;
  appearance: none;
  padding: 8px 16px;
  border: 0;
  margin: 8px 0;
  
  background-color: rgba(255,255,255,0.1);
  border-radius: 0;

  text-align: center;
  font-family: var(--bodyFont);
  font-weight: normal;
  font-size: 14px;
  line-height: 24px;
  color: white;
  white-space: nowrap;

  cursor: pointer;
}

.switch.active {
  background-color: white;
  color: var(--darkBlue);
}

.switch.left,
.switch:first-child {
  padding-left: 24px;
  border-radius: 20px 0 0 20px;
}

.switch.right,
.switch:last-child {
  padding-right: 24px;
  border-radius: 0 20px 20px 0;
}


/* Banner */

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: 8px 0 8px 16px;
  border-radius: 4px;
  color: white;
  font-weight: bold;
  background-color: var(--darkGold);
}

.banner.error {
  background-color: var(--red);
}

.banner.info {
  background-color: var(--darkGrey);
}



/* Tabs */

.tab {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 20px;

  color: white;
  font-family: var(--bodyFont);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.tab > i {
  display: inline-block;
  width: 32px;
  margin-right: 4px;
  font-size: 16px;
  text-align: center;
}

.tab.active {
  background-color: var(--glassLight);
}

.tab:not(.active):active {
  background-color: var(--glass);
}


/* Small Tabs */

.small-tab {
  appearance: none;
  border: none;
  background: transparent;
  
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  padding: 8px;

  color: white;
  font-family: var(--bodyFont);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.small-tab > i {
  display: block;
  font-size: 16px;
  line-height: 24px;
}

.small-tab.active {
  background-color: rgba(255,255,255,0.1);
  border-radius: 20px;
}

.small-tab:not(.active):active {
  background-color: rgba(255,255,255,0.01);
  border-radius: 20px;
}


/* 
Overlays and Dialogs
*/

.dialog-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  z-index: 900;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;

  overflow: auto;
}

.dialog-overlay {
  display: none;
}

.dialog {
  box-sizing: border-box;
  width: 100%;
  max-height: 80vh;
  overflow: auto;

  padding: 24px 16px max(var(--safeBottom), 40px);
  
  border-radius: 16px 16px 0 0;
  background-color: var(--darkBlue);
  box-shadow: 0 0 24px rgba(0,0,0,0.8);
}

@media (min-width: 900px) {
  .dialog-wrapper {
    justify-content: center;
  }

  .dialog-overlay {
    display: block;
    position: absolute;
    z-index: 0;
    inset: 0 0 0 0;
    backdrop-filter: blur(8px);
    background-color: rgba(0,0,0,0.4);
  }

  .dialog {
    position: relative;
    z-index: 10;
    width: auto;
    min-width: 400px;
    border-radius: 16px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
  }
}


/* 
Tippy Theme 
https://atomiks.github.io/tippyjs/v6/themes/
*/

.tippy-box[data-theme~='moonroom'] {
  background-color: black;
  color: var(--lightGrey);
  border-radius: 8px;
  font-size: 12px;
  font-family: var(--bodyFont);
}

.tippy-box[data-theme~='moonroom'][data-placement^='top'] > .tippy-arrow::before {
  border-top-color: black;
}
.tippy-box[data-theme~='moonroom'][data-placement^='bottom'] > .tippy-arrow::before {
  border-bottom-color: black;
}
.tippy-box[data-theme~='moonroom'][data-placement^='left'] > .tippy-arrow::before {
  border-left-color: black;
}
.tippy-box[data-theme~='moonroom'][data-placement^='right'] > .tippy-arrow::before {
  border-right-color: black;
}

.firebase-emulator-warning {
  display: none;
}