html, body {
  overflow: auto;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: min(2.4dvh, 4.5vw);
  font-family: "Roboto", serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings: "wdth" 100;
}

body {
  justify-content: center;
  align-items: center;
  margin: 0;
  background-color: #f0f0f0;
  height: 100dvh;
}

.titleBar {
  position: relative;
}

.pageTitle {
  margin: 0;
  padding: 1rem;
  font-family: "Righteous", serif;
  font-weight: 400;
  font-style: normal;
  color: white;
  font-size: 1.5rem;
}

.appVersion {
  position: absolute;
  bottom: 0.27rem;
  width: 100%;
  font-size: 0.7rem;
}

.logs {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  cursor: pointer;
}

.wrapper {
  text-align: center;
  background-color: #ed4c5c;
  max-width: 800px;
  width: 100%;
  background-image: url('assets/bg.png');
  background-size: 100% auto;
  background-position: top left;
  background-repeat: no-repeat;
  height: 100%;
  display: grid;
  grid-template-rows: min-content auto;
  margin: auto;
}

.container {
  background-color: white;
  height: 100%;
  position: relative;
  padding: 1rem;
  box-sizing: border-box;
  border-top-left-radius: 1.5rem;
  border-top-right-radius: 1.5rem;
  display: grid;
  grid-template-rows: auto min-content min-content min-content;
  max-height: 100%;
  overflow-y: auto;
}

#status, #timer {
  padding: 0.5rem 0;
}

#status {
  position: relative;
  z-index: 20;
}

#timer {
  display: none;
}

#logArea {
  display: none;
  padding: 0.5rem;
  border: 1px solid #ccc;
  overflow-y: auto;
  text-align: left;
  font-family: monospace;
  z-index: 10;
  background-color: rgba(255, 255, 255, 0.8);
  max-height: 10rem;
  width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  max-width: 800px;
  margin: auto;
}

.conversationWrapper {
  position: relative;
}

#conversationLog {
  overflow-y: auto;
  text-align: left;
  grid-row: 2 / 3;
  position: absolute;
  top: min(41dvh, 90vw);
  height: calc(100dvh - min(41dvh, 90vw) - 13rem);
  width: 100%;
  padding-top: 1rem;
  z-index: 5;
}

#vrmViewer {
  width: 100%;
  height: 100%;
}

.transCommon {
  padding: 0.3rem 1rem 0.3rem 2rem;
  word-wrap: break-word;
  background-repeat: no-repeat;
  background-size: 1.2rem;
  background-position: 0.3rem 0.28rem;
}

.transcription {
  margin: 0 0 1rem 0;
  background-color: #f5f5f5;
  border-bottom: 0.08rem solid #1391a2;
  background-image: url('assets/lg-ja.png');
  font-size: 0.9rem;
}

.translation {
  margin: 0 0 0.2rem 0;
  background-color: #bde1e5;
  background-image: url('assets/lg-en.png');
}
.translation-entry {
  margin-bottom: 1rem;
  padding: 0.5rem;
  border-bottom: 1px solid #eee;
}
.translated-text {
  color: #000;
  font-weight: 500;
  margin-top: 0.5rem;
}

#latencyMetrics {
  display: none;
  font-size: 0.9rem;
  font-family: monospace;
  top: 5rem;
  z-index: 10;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 0;
  width: 100%;
  max-width: 800px;
  margin: auto;
}
#latencyMetrics table {
  width: 100%;
  border-collapse: collapse;
}
#latencyMetrics th, #latencyMetrics td {
  border: 1px solid #ddd;
  padding: 0.2rem;
  text-align: left;
}
#latencyMetrics th {
  background-color: #f2f2f2;
  font-weight: bold;
}

.buttonsLine {
  display: grid;
  grid-template-columns: min-content auto;
  bottom: 1rem;
  width: 100%;
}

.button {
  background-color: #1391A2;
  color: white;
  display: inline-block;
  padding: 1rem 1rem;
  border-radius: 0.7rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  height: 2.35rem;
  transition: background-color, opacity 0.2s ease-in-out, 0.2s ease-in-out;
}
.button.disabled {
  pointer-events: none;
  cursor: auto;
  opacity: 0.5;
}
.recordButton {
  background-image: url(assets/wave.png);
  right: 1rem;
  background-repeat: no-repeat;
  background-position: calc(50% + 3.5rem);
  background-size: 1.5rem;
  margin-left: 0.5rem;
  padding-right: 2.5rem;
}
.vadToggle {
  left: 1rem;
  background-color: #e78080;
  width: 3.2rem;
}

.button.highlight {
  background-color: red;
}
.vadToggle.highlight {

}
.appVersion {
  color: black;
}

.message {
  padding: 0.3rem 0.4rem;
  box-sizing: border-box;
  width: 40%;
  margin-top: -1rem !important;
  border-radius: 0.3rem;
  font-size: 0.9rem;
}
.user-message {
  background-color: rgba(189, 225, 229, 0.75);
  margin: 0;
}
.ai-message {
  background-color: rgba(230, 230, 230, 0.75);
  margin: 0;
  margin-left: 60%;
}

.momo {
  width: min(41dvh, 90vw);
  position: absolute;
  left: 50%;
  transform: translate(-50%, 0);
  opacity: 0;
}

.role-User {
  color: #ED4C5C;
  font-weight: 600;
}

.role-ai {
  color: #ED4C5C;
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.gradient {
  position: absolute;
  background-image: url('./assets/gradient.png');
  bottom: -1rem;
  width: 100%;
  height: 3rem;
  z-index: 15;
  background-size: 100% 100%;
}
