/* style.css */
:root {
  --radius: 1.5vmin;
}
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #222;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  color: #fff;
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
}
#main-container {
  display: flex;
  justify-content: center;
  align-items: center;
}
#title-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  font-size: calc(0.035 * min(0.84 * 100vh, 100vw));
  background-color: transparent;
}
#board-container {
  background-color: #2a2a2a;
  box-shadow: 0 1vmin 3vmin rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 2;
  aspect-ratio: 1 / 1;
}
#controls-wrapper {
  display: flex;
  position: relative;
  z-index: 1;
  background-color: transparent;
  flex-shrink: 0;
}
#info-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  font-size: calc(0.035 * min(0.84 * 100vh, 100vw));
  background-color: transparent;
  width: 100%;
}
.info-text,
.btn {
  padding: 1.5vmin 2.5vmin;
  flex: 1;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  box-sizing: border-box;
}
.btn {
  background-color: #444;
  color: #ddd;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s;
  border: none;
}
.btn:hover {
  background-color: #555;
}
.btn.disabled,
#button1.disabled {
  background-color: #333;
  color: #666;
  cursor: not-allowed;
  pointer-events: none;
}
.info-text {
  color: #fff;
  background-color: transparent;
  text-wrap: nowrap;
}
#title,
#title-h {
  text-decoration: none;
  font-size: 1.25em;
  font-weight: bold;
  text-transform: uppercase;
}
@media (max-aspect-ratio: 125/100) {
  #main-container {
    flex-direction: column;
    width: 100%;
    height: 100%;
  }
  #title-container {
    order: 1;
    flex-shrink: 0;
  }
  #board-container {
    order: 2;
    width: 100%;
    height: auto;
    flex-shrink: 1;
    min-height: 0;
  }
  #controls-wrapper {
    order: 3;
    width: 100%;
  }
  #info-container {
    width: 100%;
  }
  .btn {
    border-radius: 0 0 var(--radius) var(--radius);
  }
  #info-container > * + * {
    margin-left: 1vmin;
  }
  #text1 {
    margin-left: 5vmin;
  }
  .horizontal-only {
    display: none !important;
  }
  #title,
  #text1 {
    white-space: nowrap;
    overflow-wrap: normal;
  }
}
@media (min-aspect-ratio: 84/100) and (max-aspect-ratio: 125/100) {
  #main-container {
    width: 84vh;
    justify-content: center;
  }
  #board-container {
    flex-grow: 0;
  }
}
@media (min-aspect-ratio: 125/100) {
  #main-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
  }
  #title-container {
    display: none;
  }
  .horizontal-only {
    display: flex !important;
  }
  #board-container {
    height: 100vh;
    width: 100vh;
  }
  #controls-wrapper {
    width: 25vmin;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  #info-container {
    flex-direction: column;
    justify-content: center;
    height: auto;
    width: 100%;
  }
  .info-text {
    text-align: center;
    width: 100%;
  }
  .btn {
    border-radius: 0 var(--radius) var(--radius) 0;
    flex: 0 0 auto;
    width: 100%;
  }
  #info-container > * + * {
    margin-top: 1vmin;
  }
  #title-h {
    white-space: normal;
    overflow-wrap: break-word;
  }
}
#install-prompt {
  font-size: calc(0.035 * min(0.84 * 100vh, 100vw));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
}
#install-prompt.install-notification {
  position: fixed;
  top: -100px;
  left: 0;
  width: 100%;
  background-color: #333;
  color: white;
  padding: 1vmin 2vmin;
  text-align: center;
  z-index: 10000;
  transition: top 0.5s ease-in-out;
}
#install-prompt.install-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #333;
  color: white;
  padding: 2vmin;
  text-align: center;
  z-index: 10000;
  min-width: 200px;
}
#install-prompt.install-below {
  margin: 1vmin;
  padding: 1.5vmin 2.5vmin;
  width: calc(100% - 2vmin);
}
#install-prompt .install-btn {
  border-radius: var(--radius);
  padding: 0.5vmin 2vmin;
  font-size: calc(0.035 * min(0.84 * 100vh, 100vw));
}
#install-prompt .close-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0;
  vertical-align: top;
  position: absolute;
  top: 1vmin;
  right: 1vmin;
  font-size: 4vmin;
}
.progress-bar-wrapper {
  position: relative;
}
.progress-bar-wrapper::before {
  content: "";
  position: absolute;
  bottom: 1vmin;
  left: 0;
  right: 0;
  height: 0.5vmin;
  background-color: #555;
}
.progress-bar-wrapper::after {
  content: "";
  position: absolute;
  bottom: 1vmin;
  left: 0;
  height: 0.5vmin;
  width: var(--progress, 0%);
  background-color: #888;
  transition: width 0.5s ease-in-out;
}
.unreliable {
  color: red;
  animation: blink 1s infinite;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
@keyframes blink {
  0% {
    color: red;
  }
  50% {
    color: #fff;
  }
  100% {
    color: red;
  }
}
.captures-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0.5;
}
.capture-count {
  width: calc(min(0.84 * 100vh, 100vw) / 10);
  height: calc(min(0.84 * 100vh, 100vw) / 10);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 2px black;
  margin: 0 0.5vmin;
}
.capture-score {
  width: calc(min(0.84 * 100vh, 100vw) / 10);
  height: calc(min(0.84 * 100vh, 100vw) / 10);
  border-radius: 50%;
  border: 0.2vmin solid white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 2px black;
  margin: 0 0.5vmin;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#black-captures,
#black-captures-h {
  background-image: url(../lib/wgo/stones/black_128.png);
  background-size: cover;
  color: white;
}
#white-captures,
#white-captures-h {
  background-image: url(../lib/wgo/stones/white_128.png);
  background-size: cover;
  color: black;
  transform: scale(0.95);
}
@media (prefers-color-scheme: light) {
  html,
  body {
    background-color: #fff;
    color: #000;
  }
  #board-container {
    background-color: #f5f5f5;
  }
  .info-text {
    color: #000;
  }
  #white-captures,
  #white-captures-h {
    transform: none;
  }
  #install-prompt.install-notification,
  #install-prompt.install-popup,
  #install-prompt.install-below {
    background-color: #f0f0f0;
    color: #000;
  }
  .unreliable {
    color: red;
  }
}
.resume-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2em;
  z-index: 2000;
  cursor: pointer;
}
.resume-overlay-hidden {
  display: none;
}
