@import url("https://fonts.googleapis.com/css?family=Montserrat:700,900");

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	user-select: none;
	-webkit-user-drag: none;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

:root {
	--red: #ff4081;
	--black: #222;
	--white: #fff;
	--grey: #e0e0e0;
	--menu-grey: #757575;
	--accent: #448aff;
	--bg: #ffffff;
}
[data-theme="dark"] {
	--red: #ff4081;
	--black: #ccc;
	--white: #222;
	--grey: #616161;
	--menu-grey: #616161;
	--accent: #ff4081;
	--bg: #1c1c1c;
}

html {
	height: 100%;
}

body {
	min-height: 100%;
	font-family: "Montserrat", sans-serif;
	font-weight: 700;
	background-color: var(--bg);
}
h1 {
  font-family: 'Montserrat';
  font-weight: 900;
  font-size: 7vh;
  line-height: 1.25;
  color: var(--black);
}
a {
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  color: var(--black);
}
a:hover,
a:active,
a.underline {
  box-shadow: inset 0 -1vmin 0 var(--accent);
}

.menu {
  pointer-events: all;
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  opacity: 1;
  transition: opacity 0.1s ease;
  z-index: 1;
  background-color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.menu.hidden {
  pointer-events: none;
  opacity: 0;
}
.menu small {
  font-size: 4vmin;
  color: var(--menu-grey);
}

.menu .levels a {
  margin: 0 1.5vmin;
}
.menu .levels a.active {
  box-shadow: inset 0 -1vmin 0 var(--accent);
}

.menu .controls-bar {
  position: fixed;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 1vmin;
  padding-right: 2vmin;
}

.menu .lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1.5px solid var(--menu-grey);
  border-radius: 6px;
  color: var(--black);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.3em 0.5em;
  cursor: pointer;
}

.menu .lang-select option {
  background: var(--white);
  color: var(--black);
}

.menu .dark-mode-switch {
  width: 15vmin;
  height: 15vmin;
  max-width: 96px;
  max-height: 96px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.switch {
  position: relative;
  background: transparent;
  border: 0;
  width: 30px;
  height: 30px;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
}

.switch .mode {
  position: relative;
  width: 20px;
  height: 20px;
  transition: transform 0.45s ease;
  border-radius: 50%;
  background: #1a202c;
}

.switch .mode::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  left: 50%;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  border-radius: 50%;
  background: inherit;
  z-index: -1;
  opacity: 0;
  transition: box-shadow 0.4s 0s ease;
}

.switch .mode::after {
  content: "";
  position: absolute;
  width: 90%;
  height: 90%;

  top: -20%;
  left: 30%;

  border-radius: 50%;
  background: white;

  transition: transform 0.45s ease;
}

[data-theme="dark"] .switch .mode {
  transform: scale(0.5);
  background: white;
}
[data-theme="dark"] .switch .mode::before {
  opacity: 1;
  box-shadow: 0 -20px 0 0 white, 0 20px 0 0 white, -20px 0 0 0 white,
  20px 0 0 0 white, 15px 15px 0 0 white, 15px -15px 0 0 white,
  -15px 15px 0 0 white, -15px -15px 0 0 white;
}
[data-theme="dark"] .switch .mode::after {
  opacity: 0;
  transition: background 0.45s ease;
  transform: translateX(50%) translateY(-50%);
}

.layout {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	row-gap: 2vmin;
	max-width: 820px;
	margin: 0 auto;
	padding-top: 17vmin;
}

.pile {
	display: flex;
	flex-direction: column;
	align-items: center;
}
.pile .card:not(:first-child) {
	margin-top: -11vmin;
}

.pile.single {
	justify-content: center;
}

.card {
	cursor: pointer;
	border-radius: 0.8vmin;
	box-shadow: 0px 0px 0px 4px var(--white);
	color: var(--white);
	margin: 0.25vmin;
	display: grid;
	padding: 0vmin 0.6vmin;
	align-items: center;
	justify-items: center;
	grid-template-columns: 1fr 2fr;
	font-size: 2.9vmin;
	width: 12vmin;
	aspect-ratio: 5 / 7;
}
.card.red {
	background-color: var(--red);
}
.card.black {
	background-color: var(--black);
}
.card.red.closed,
.card.black.closed {
	background-color: var(--grey);
}

.card.placeholder {
	background-color: transparent;
	border: 2px dashed var(--grey);
	color: transparent;
}

.card.red.selected,
.card.black.selected {
	transform: scale(1.1);
}

.closed .rank,
.closed .suit,
.closed .main {
	display: none;
}

.card .rank {
	justify-self: start;
}
.card .suit {
	justify-self: end;
}
.card .main {
	font-size: 6.7vmin;
	line-height: 9vmin;
	grid-column-end: span 2;
}

.pile.single .card.disabled {
	cursor: default;
	opacity: 0.4;
}

.hamburger {
	z-index: 2;
	position: fixed;
	width: 15vmin;
	height: 15vmin;
	max-width: 96px;
	max-height: 96px;
	cursor: pointer;
}
.hamburger div {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	transition: transform 0.2s ease;
}
.hamburger div:before {
	content: "";
	width: 50%;
	height: 12.5%;
	background: var(--black);
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	margin: auto;
}
.hamburger .line-1 {
	transform: translateY(-12.5%);
}
.hamburger .line-2 {
	transform: translateY(12.5%);
}
.hamburger.open div:before {
	outline: 0 solid transparent;
}
.hamburger.open .line-1 {
	transform: rotate(225deg);
}
.hamburger.open .line-2 {
	transform: rotate(-225deg);
}
.dialog {
  pointer-events: all;
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  padding: 2rem;
  opacity: 1;
  transition: opacity 0.1s ease;
  z-index: 1000;
  background-color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.dialog.hidden {
  pointer-events: none;
  opacity: 0;
}
.dialog .dialog-content {
  display: grid;
  grid-template-rows: auto;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: 'message message message' 'action-1 . action-2';
}
@media (max-width: 480px) {
  .dialog .dialog-content {
    grid-template-areas: 'message message message' 'action-1 . .' 'action-2 . .';
  }
}
.dialog-content h1 {
  grid-area: message;
}
.dialog-content a {
  box-shadow: inset 0 -1vmin 0 var(--accent);
}
.dialog-content a:nth-child(1) {
  grid-area: action-1;
}
.dialog-content a:nth-child(2) {
  grid-area: action-2;
}
