@import url('https://fonts.googleapis.com/css2?family=Ubuntu&family=Libre+Baskerville&display=swap');
@import './tagify.css';

:root {
  --font-color: #000;
  --input-font-color: #000;
  --link-color: #73a8a3;
  --link-hover-color: #73a8a3;
  --background-color: #FFF;
  --background-color-secondary: #eef2ff;
  --content-background: rgba(0,0,0,0.1);
  --border-color: #333;
  --border-color-secondary: #000;
  --tab-active: #acc7cd;
  --fail-background: #ffbfbf;
  --fail-color: #000;
  --success-background: #b1ffb1;
  --success-color: #000;
  --warning-background: #f1a14c;
  --disabled-color: #000;
  --disabled-background: #a4a4a4;
  --disabled--color: #000;
  --disabled-background-secondary: #989898;
  --main-font: 'Ubuntu', serif;
}
[data-theme="dark"] {
  --font-color: #CCC;
  --input-font-color: #000;
  --background-color: #000;
  --background-color-secondary: #2c393e;
  --content-background: rgba(0,0,0,0.1);
  --border-color: #777;
  --border-color-secondary: #333;
  --tab-active: #4d4d4d;
  --warning-background: #804200;
}
.debug {
  display: none !important;
}
html, body {
  margin: 0;
  padding: 0;
  transition: background 0.4s linear 0s;
  background-color: var(--background-color);
}
body {
  font-family: var(--main-font);
  color: var(--font-color);
  padding: 0;
  text-align: center;
}
body * {
  font-family: var(--main-font);
}
body a:hover{
  color: var(--link-hover-color);
}
html:not(#page-mj) body {
  height: 100vh;
  display: flex;
  flex-direction: column;
}
html:not(#page-mj) h2 {
  margin-bottom: 30px;
}
html:not(#page-mj) .page-wrapper {
  padding: 0 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
h3 {
  margin-top: 0;
}
#account_actions {
  display: flex;
  padding: 5px;
  font-size: 14px;
  justify-content: flex-end;
  align-items: center;
}
#account_actions > *:not(:last-child):after {
  content: '|';
  margin-left: 10px;
}
#account_actions a {
  color: var(--font-color);
}
#account_actions .enableDarkMode,
#account_actions .enableLightMode {
  height: 15px;
  width: 15px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  display: inline-block;
  cursor: pointer;
}
#account_actions .enableDarkMode {
  background: black;
  box-shadow: 0 0 3px black;
}
#account_actions .enableLightMode {
  background: white;
  box-shadow: 0 0 3px lightgray;
  border: 1px solid lightgray;
}
hr {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 0.1em 0;
    padding: 0;
}
.theme-switch {
  margin-right: 10px;
  display: flex;
  align-items: center;
}
.theme-switch > span {
  margin-left: 5px;
}
.wrapper-intro {
  display: flex;
  flex-basis: 100%;
  align-items: center;
}
.intro {
  flex: 2;
  margin: 10px 0 20px 0;
}
.intro-image {
  flex: 1;
}
.intro-image > img {
  max-width: 100%;
  height: auto;
  max-height: 150px;
}

.page-wrapper > form,
.page-wrapper > form > fieldset {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-items: center;
}
.page-wrapper > div {
  margin-bottom: 20px;
}
html:not(#page-new) textarea,
html:not(#page-new) select,
input {
  padding: 5px 10px;
  margin-bottom: 10px;
  box-sizing: border-box;
  font-size: 1em;
}
html:not(#page-new) label {
  margin-bottom: 5px;
}
.index-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}
.index-wrapper > div {
  display: flex;
  flex-direction: column;
}

.title-wrapper {
  margin-bottom: 50px;
}
h1 {
  font-size: 50px;
  margin: 0;
}
h2 {
  font-size: 40px;
  margin: 0;
}
.logo {
  height: 150px;
  margin: auto;
}
a {
  color: var(--link-color);
  text-decoration: none;
}
a.no-color,
a.no-color:hover {
  color: var(--font-color);
}

form {
  margin: 0;
}


input[type=submit],
#elections button,
.submit-button {
  font-size: 16px;
  font-weight: bold;
  text-transform: uppercase;
  padding: 10px;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: var(--background-color);
  transition: all linear 0.2s;
  color: var(--font-color);
  font-family: var(--main-font);
}

body .index-wrapper a {
  color: var(--font-color);
}
body .index-wrapper a {
  font-size: 25px;
  margin-bottom: 10px;
}
.index-wrapper a:hover {
  color: var(--link-hover-color);
}
.hello {
  margin-bottom: 20px;
  font-size: 20px;
}
.secondary-links {
  margin-top: auto;
  margin-bottom: 130px;
  font-size: 15px !important;
  display: flex;
  flex-direction: column;
}
.secondary-links > * {
  margin-bottom: 5px;
}

/* ECRAN MJ */
#page-mj .page-wrapper {
  padding: 0 15px;
  margin: 20px;
}
#page-mj h1 {
  display: none;
}
#page-mj h2 {
  margin-bottom: 10px;
}
.wrapper-main {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
}
.stats {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-align: center;
}

.stats, .tags {
  padding: 4px 10px;
  border-top: 1px solid var(--border-color);
  justify-content: center;
}
.tags > span {
  display: flex;
  align-items: center;
  justify-content: center;
}
#tags form {
  flex-wrap: nowrap;
  flex-direction: column;
}
#tags form > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#tags a {
  border-radius: 5px;
  background: #e35959;
  font-size: 0.8em;
  padding: 2px 5px;
  margin-bottom: 5px;
  color: black;
}
tags {
  margin-bottom: 10px;
  text-align: left;
}
tag + .tagify__input:before {
  content: '';
}
.tagify__dropdown__item {
  color: var(--input-font-color);
}
.tagify__dropdown__item:first-letter {
  text-transform: uppercase;
}
.tagify__input {
  min-height: 22px;
}
.tagify__input:before,
tag {
  font-size: 0.9em;
}
.tagify__tag-text:first-letter {
  text-transform: uppercase;
}
.stats > span:first-letter, .tags > span:first-letter {
  text-transform: uppercase;
}
.stats > span {
  display: block;
}
.wrapper-left {
  flex: 5;
  border: 1px solid var(--border-color);
  background: var(--tab-active);
  padding: 15px;
  display: flex;
  flex-direction: column;
}
.wrapper-center {
  flex: 2;
  border: 1px solid var(--border-color);
  padding: 15px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  margin-left: 1%;
  min-height: 300px;
}
.wrapper-center form input[type=submit] {
  margin-top: auto;
}
#poll_results {
  margin-bottom: 15px;
}
#poll_results table {
  margin: 20px 0;
}
#tabs {
  display: flex;
}
#tabs > div {
  border: 1px solid var(--border-color);
  padding: 5px;
  cursor: pointer;
  margin-right: 5px;
  border-bottom: 0;
  text-align: center;
  transition: all linear 0.2s;
}
#tabs > div:hover,
#tabs > div.active{
  background: var(--tab-active);
}
#tabs .last-item {
  margin-left: auto;
  margin-right: 0;
}
#tabs .first-item {
  margin-right: auto;
}
#choices > div#group.active,
#group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  grid-gap: 3px;
  grid-auto-rows: minmax(100px, auto);
  font-size: 13px;
  word-break: break-word;
  margin-top: 0px;
  padding: 15px 0;
}
#group > div {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  background: var(--background-color);
  border-radius: 8px;
}
#group-stats {
  display: flex;
  justify-content: center;
  flex-direction: column;
  text-align: right;
  margin: 0 auto;
}
#group-stats > span:first-letter {
  text-transform: uppercase;
}
#group > div.looser {
  background: var(--fail-background);
  color: var(--fail-color);
}
#group > div.winner {
  background: var(--success-background);
  color: var(--success-color);
}
#group > div.not-alive {
  background: var(--disabled-background);
  color: var(--disabled--color);
}
#group > div.inactive {
  opacity: 0.3;
}
#group > div.not-alive.looser,
#group > div.chosen {
  order: -1;
  animation-duration: .6s;
  animation-name: clignoter;
  animation-iteration-count: 4;
  transition: none;
}
#group > div.not-alive.looser {
  background: var(--disabled-background);
  color: var(--disabled-color);
}
#group > div.chosen {
  background: var(--warning-background);
}
#group .pj-name {
  padding: 4px 0;
}
#target .warning {
  margin: auto;
  display: none;
}
.warning {
  color: red;
}

@keyframes clignoter {
  0%   { opacity:1; }
  40%   {opacity:0; }
  100% { opacity:1; }
}
@keyframes bg-blink {
  0%   { background:transparent; }
  40%  { background: var(--warning-background); }
  100% { background:transparent; }
}

.pj-name {
  display: inline-block;
}
.pj-name:first-letter {
  text-transform: capitalize;
}
.not-alive {
  background: var(--disabled-background);
  position: relative;
}
.not-alive:before {
  content: '\2620 \FE0F';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  font-size: 26px;
}
.tag-bullet {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 100%;
  margin-right: 2px;
}
#choices {
  background: var(--background-color-secondary);
  border: 1px solid var(--border-color);
}
#choices > div {
  display: none;
}
#choices > div.active {
  display: flex;
  height: 100%;
  flex-direction: column;
  padding: 15px;
}
#choices > div > form:not(.grid),
.buttons-wrapper {
  display: flex;
  flex-wrap: wrap;
}
#choices .grid {
  text-align: left;
}
#choices > div > form > fieldset {
  flex: 1;
}
.buttons-wrapper > input,
#choices > div > form > input {
  flex-basis: 100%;
}
.buttons-wrapper > input,
.buttons-wrapper span {
  text-align: center;
}
#choices > div > form select,
#choices > div > form input:not([type=submit]) {
  margin-bottom: 5px;
  border-radius: 0;
}
.settings-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  grid-gap: 3px;
  grid-auto-rows: minmax(100px, auto);
}
#poll > a {
  margin-top: auto;
}
#elections form {
  justify-content: space-evenly;
}
#elections button:hover {
  background: var(--tab-active);
}
.epreuve-cr {
  background: #ffec84;
  padding: 15px;
  border-radius: 0 0 4px 4px;
  border: 1px solid var(--border-color);
  color: var(--input-font-color);
}
.success {
  color: green;
}
.fail {
  color: red;
}
#choices fieldset {
  background: var(--content-background);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  padding: 15px;
  text-align: left;
}
#choices fieldset legend {
  font-weight: bold;
  font-size: 1.1em;
}
.wrapper-penalite {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  justify-content: space-between;
  align-content: baseline;
  text-align: left;
}
.wrapper-penalite > label {
  flex-basis: 100%;
}
.wrapper-penalite > * {
  flex: 1;
}
.wrapper-between {
  align-self: center;
  padding: 15px;
}
#choices input[type=number] {
  text-align: center;
}

.delete-game {
  flex: 1;
}
#delete-game {
  display: block;
}
#delete-game-confirm {
  display: none;
  background: red;
  color: white;
}
#delete-game-confirm.active {
  display: block;
}
.poll-label {
  font-weight: bold;
  margin-bottom: 10px;
}
.winner-vote {
  color: green;
}
.traitor-vote {
  text-decoration: line-through;
}
.lead-vote {
  color: #04c804;
  font-weight: bold;
}
#poll .poll-action {
  margin-bottom: 5px;
}
#poll .poll-action:first-letter {
  text-transform: capitalize;
}
#poll input.poll-label {
  padding: 6px 10px !important;
}
.poll-plus {
  border: 1px solid var(--border-color);
  border-radius: 100%;
  width: 20px;
  height: 20px;
  background: var(--background-color);
  cursor: pointer;
}
.last-visible ~ input {
  display: none;
}
.last-visible + .poll-plus {
  display: none;
}

/* ECRAN PJ */
#page-character h1 {
  font-size: 30px;
}
#character-wrapper > div {
  border: 1px solid var(--border-color);
  padding: 15px;
}
.character {
  display: flex;
  flex-wrap: wrap;
}
.pj-role {
  flex-basis: 100%;
}
.character > .character-name {
  flex-basis: 100%;
  font-size: 1.5em;
}
.character > .character-tags,
.character > .character-stats {
  flex: 1;
}
.log {
  animation-duration: .6s;
  animation-name: bg-blink;
  animation-iteration-count: 4;
  transition: none;
}

#choices > #poll > form {
  flex-direction: row;
  flex-wrap: wrap;
}
#poll > form > input {
  flex-basis: 100%;
}
#choices .poll-choices {
  flex: 2;
}

.character-tags > div {
  text-transform: capitalize;
}
.character-tags, .character-stats {
  margin: 10px 0;
}
.character > div:first-letter,
.character-stats > div:first-letter {
  text-transform: capitalize;
}
input[type=submit] {
  margin-top: 15px;
}
.wakeup {
  font-size: 90px;
}
.powers {
  margin-top: 5px;
  font-weight: bold;
  color: darkred;
}
#loader {
  display: none;
  position: absolute;
  top: 15px;
  right: 15px;
}
#loader.active {
  display: block;
}
#loader,
#loader:after {
  border-radius: 50%;
  width: 4em;
  height: 4em;
}
#loader {
  font-size: 10px;
  text-indent: -9999em;
  border-top: 0.5em solid var(--font-color);
  border-right: 0.5em solid var(--font-color);
  border-bottom: 0.5em solid var(--font-color);
  border-left: 0.5em solid var(--background-color);
  -webkit-transform: translateZ(0);
  -ms-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-animation: load8 1.1s infinite linear;
  animation: load8 1.1s infinite linear;
}
@-webkit-keyframes load8 {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
@keyframes load8 {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

/* PAGE NEW */
#page-new fieldset {
  margin-bottom: 15px;
  align-items: flex-start;
  padding: 10px;
}
#page-new fieldset label {
  margin-right: 15px;
}