.debug-mode * {
    outline: 1px solid red !important;
}

.hide {
    display: none !important;
}

body {
    background-color: #f4f4f4;
    background-color: white;
    margin: 0;
    overflow: hidden;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

#viewport {
    position: relative;
    width: min(50em, 100%);
    height: 100svh;
    margin: 0 auto;
    overflow: hidden;
}

/* scenes */
.scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f4f4f4;
    /* display: none; */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* .scene.active {
    display: flex;
    flex-direction: column;
} */

.scene .content {
    flex-grow: 1;
    background: white;
    padding: 1em;
    /* border: 1px solid #ddd; */
    position: relative;
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* launch scene */
.launch-content {
    background-color: bisque;
}

.launch-img {
  /* position: absolute; */
  top: 0;
  left: 0;
  width: 100%;
  height: 70%;
  object-fit: cover;
  object-position: 32% 20%;
}

.launch-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* align-items: center; */
  width: 100%;
  --border-color: transparent;
  --border-width: 0px;

}

/* setup scene */
.setup-scene-wrapper {
    position: relative;
    display: flex;
    height: 85%;
    flex-direction: column;
    flex-grow: 1;
    align-items: stretch;
}

.setup-header {
  height: 20%;
  overflow-y: auto;
}

.setup-container {
  height: 50%;
  flex-grow: 1;
  overflow-y: scroll;
}

.setup-footer {
  height: 15%;
  flex-grow: 1;
  overflow-y: auto;
}

.setup-card {
  display: flex;
  flex-direction: column;
  width: 100%;

}

.language-presets {
  overflow-x: auto; /* narrow screens */
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  /* max-height: 300px;
  overflow-y: auto; */
  padding: 1rem;
  border: 1px solid var(--sl-color-neutral-200);
  border-radius: var(--sl-border-radius-medium);
}

/* game scene */
.game-scene-wrapper {
    position: relative;
    display: flex;
    height: 100%;
    flex-direction: column;
    flex-grow: 1;
    align-items: stretch;
}

.game-score-header {
    display: flex;
    height: auto;
    background-color: white;
    margin-top: 1em;
    padding: 1em;
    border: 1px solid gainsboro;
    border-radius: 12px;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    gap: 8px;
}

.game-scene-top {
    height: 47%;
    background-color: floralwhite;
    background-color: white;
    border-top-left-radius: 4em;
    border-top-right-radius: 4em;
    display: flex;
    align-items: center;
    justify-content: center;

}

.game-scene-middle {
    height: 6%;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* --- TimerBar styles --- */
.webspeech-timer-bar {
  width: 100%;
  margin: 25px auto;
  border: none;
  border-radius: 50px;
  background-color: lightgray;
}

.webspeech-timer-bar .inner {
  height: 6px;
  border-radius: 50px;
  animation: timerbar-countdown;
  animation-duration: 40s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
  animation-play-state: paused;
  animation-timing-function: linear;
}
  
@keyframes timerbar-countdown {
  0% {
    width: 100%;
    background-color: var(--sl-color-pink-300);
  }
  100% {
    width: 0%;
    background-color: var(--sl-color-pink-700);
  }
}

.game-scene-bottom {
    height: 47%;
    background-color: floralwhite;
    background-color: white;
    border-bottom-left-radius: 4em;
    border-bottom-right-radius: 4em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-scene-bottom {
    font-size: x-large;
}

.game-scene-bottom-action-bar {
    display: flex;
    height: auto;
    background-color: white;
    margin-top: 1em;
    padding: 0.8em;
    border: 1px solid gainsboro;
    border-radius: 12px;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    gap: 0.7em;
}

.game-scene-bottom-action-bar sl-button:first-child {
    margin-right: auto;
}

.action-button sl-icon {
  font-size: 1.1rem;
}

.action-button.recording {
  outline: 1px solid var(--sl-color-primary-500);
  border-radius: var(--sl-input-border-radius-medium);
  animation: pulse-border 2.4s infinite ease-in-out;
  border: 0px solid transparent !important;
}

@keyframes pulse-border {
  0% {
    outline-width: 1px;
    outline-offset: 0px;
    opacity: 0.7;
  }
  50% {
    /* Grows the outline slightly outward */
    outline-width: 1px;
    outline-offset: 4px;
    opacity: 1;
  }
  100% {
    outline-width: 1px;
    outline-offset: 0px;
    opacity: 0.7;
  }
}

/* shoelace */
:root {
  --sl-color-primary-50: var(--sl-color-pink-50);
  --sl-color-primary-100: var(--sl-color-pink-100);
  --sl-color-primary-200: var(--sl-color-pink-200);
  --sl-color-primary-300: var(--sl-color-pink-300);
  --sl-color-primary-400: var(--sl-color-pink-400);
  --sl-color-primary-500: var(--sl-color-pink-500);
  --sl-color-primary-600: var(--sl-color-pink-600);
  --sl-color-primary-700: var(--sl-color-pink-700);
  --sl-color-primary-800: var(--sl-color-pink-800);
  --sl-color-primary-900: var(--sl-color-pink-900);
  --sl-color-primary-950: var(--sl-color-pink-950);
}

sl-button::part(base) {
  transition: all 0.3s ease;
}

/* Multilingual Noto Font */
:root {
  /* This is the master list.*/
  --game-fonts: "Noto Sans", "Noto Sans JP", "Noto Sans SC", 
                "Noto Sans KR", "Noto Sans Arabic", "Noto Sans Thai", 
                "Noto Sans Devanagari", sans-serif;
}

.speech-output {
  font-family: var(--game-fonts);
  font-display: swap; /* Shows fallback text immediately while Noto loads */
}

/* RTL Support for Middle Eastern Languages */
[lang="ar"], [lang="he"], [lang="fa"] {
  direction: rtl;
}