:root {
  --bg-main: #171616;
  --bg-dark: #000;
  --bg-alt: #141414;
  --bg-world: #e0e0e0;
  --bg-button: #1a1a1a;
  --bg-overlay: rgba(20, 20, 20, 0.83);
  
  --text-primary: #fff;
  --text-secondary: #dcdcdc;
  --text-dark: #2d2d2d;
  --text-body: #2d2d2d; /* Consolidated from #292929 */
  --text-muted: #dcdcdc;
  
  
  --border-dark: #2d2d2d;
  --border-gray: #333;
  --border-white: #fff;
  
  --white: #fff;
  --black: #000;
  --error: #ff5e5e;
  
  --shadow-retro: 0.6cqw 0.6cqw 0 rgba(255, 255, 255, 0.2);
  --shadow-label: 0.35cqmin 0.35cqmin 0 var(--black);
}

/* add minimalist basic style in css classic */
@font-face {
  font-family: 'Press Start 2P';
  src: url('./assets/Press_Start_2P/PressStart2P-Regular.ttf');
}

/* 
  #####################################
  #####################################
  ############# GENERAL CSS ###########
  #####################################
  #####################################
*/

body {
    color: var(--text-body);
    background-color: var(--bg-main);
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/*  Font Definitions */
* {
  font-family: 'Press Start 2P';
}

.container {
  container-type: size;
  width: 100vw;
  height: 56.25vw;
  overflow: hidden;
}

.child-layer {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  aspect-ratio: 16/9;
  container-type: size;
  width: min(100dvw, calc(100dvh * 16 / 9));
  height: auto;
}


/* 
  #####################################
  #####################################
  ############# WORLD CSS #############
  #####################################
  #####################################
*/


.world {
  overflow: hidden;
  background-color: var(--bg-world);
}

.floor {
  position: absolute;
  background-color: var(--border-dark);
  transform: translate3d(0, calc(56.25cqw * 0.89), 0);
  width: 100cqw;
  height: 10cqw;
}

.actor {
  width: 8cqmin;
  height: 6.8cqmin;
  border: 0.4cqmin solid var(--border-dark);
  box-sizing: border-box; 
  position: absolute;
  overflow: visible !important;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.actor .eyes {
 padding: 2cqmin 1.5cqmin;
 display: flex;
 justify-content: space-between;
}

.actor .eyes .eye {
  width: 1.1cqmin;
  height: 1.1cqmin;
  background-color: var(--border-dark);
}

.stair {
  position: absolute;
  width: 8cqmin;
  height: 2cqmin;
  background-color: var(--border-dark);
  transition: opacity 0.4s ease-out;
}

.text {
  position: absolute;
  color: var(--text-dark);
  white-space: nowrap;
  pointer-events: none;
  
  width: max-content;
  
  display: flex;
  justify-content: center;

  box-sizing: border-box;
  padding: 1cqmin 1.2cqmin;
}

.you-marker, .bot-marker {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.you-marker {
  animation: bouncePointer 0.8s infinite alternate;
}

.bot-marker {
  opacity: 0.5;
  animation: botMarker 0.8s infinite alternate;
}

.you-label, .bot-label {
    background: var(--bg-alt);
    color: var(--text-muted);
    padding: 0.4cqmin 0.8cqmin;
    font-size: 0.8cqw;
    border: 0.2cqmin solid var(--black);
    box-shadow: var(--shadow-label);
}

.pointer-arrow {
    width: 0;
    height: 0;
    border-left: 0.8cqmin solid transparent;
    border-right: 0.8cqmin solid transparent;
    border-top: 1.2cqmin solid var(--bg-alt);
    filter: drop-shadow(0.35cqmin 0.35cqmin 0 var(--black));
}

@keyframes botMarker {
    from { transform: translateX(calc(2.1cqw - 50%)) translateY(-13cqmin) }
    to { transform: translateX(calc(2.1cqw - 50%)) translateY(-13cqmin) }
}

@keyframes bouncePointer {
    from { transform: translateX(calc(2.1cqw - 50%)) translateY(-13cqmin) }
    to { transform: translateX(calc(2.1cqw - 50%)) translateY(-14.2cqmin) }
}




/* 
  #####################################
  #####################################
  ############# UI CSS ################
  #####################################
  #####################################
*/
h1 {
  color: var(--white);
  line-height: 8cqmin;
  letter-spacing: 0.8cqmin;
  text-align: center;
  font-size: 6cqmin;
  font-style: italic;
}

.main-menu{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background-color: var(--bg-overlay);
}

.style-retro {
    background: var(--white);
    color: var(--black);
    border: 0.5cqw solid var(--black);
    box-shadow: var(--shadow-retro);
    padding: 1.5cqw 3cqw;
    font-size: 1.5cqw;
}

#message {
  position: absolute;
  display: none;
  font-size: 2.5cqmin;
  text-align: center;
  transform: translate(50cqmin, 10cqmin);
}

button {
    color: var(--text-dark);
    cursor: pointer;
    padding: 0.5cqw 1cqw;
    border: 0.1cqw solid var(--border-dark);
}


.crt-screen {
    position: absolute;
    width: inherit;
    height: inherit;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.05), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.05));
    background-size: 100% 0.4cqw, 0.3cqw 100%;
    pointer-events: none;
    z-index: 1000;
}

.crt-screen::after {
    content: " ";
    display: block;
    position: absolute;
    inset: 0;
    background: radial-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 1001;
}

.modal-quiz {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 65cqw;
    background: var(--bg-dark);
    border: 0.6cqw solid var(--border-white);
    padding: 3cqw;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 2cqw;
    box-shadow: var(--shadow-retro);
}

.title-quiz {
    color: var(--text-primary);
    text-align: center;
    line-height: 1.4;
    font-size: 1.8cqw;
    margin: 0;
    margin-bottom: 2cqw;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5cqw;
}

.btn-option {
    background: var(--bg-button);
    border: 0.4cqw solid var(--border-gray);
    color: var(--text-primary);
    padding: 1.5cqw;
    text-align: left;
    font-size: 1cqw;
    cursor: pointer;
    transition: all 0.1s;
}

.btn-option:hover:not(:disabled) {
    background: var(--white);
    color: var(--black);
    border-color: var(--border-white);
}

.btn-option:disabled {
    cursor: default;
    opacity: 0.7;
}

.btn-option.selected {
    background: var(--white);
    color: var(--black);
    border-color: var(--border-white);
}

.timer-container {
    width: 100%;
    height: 1.2cqw;
    background: var(--bg-button);
    border: 0.3cqw solid var(--border-gray);
    margin-top: 1cqw;
    position: relative;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    width: 100%;
    background: var(--white);
    transition: width 0.1s linear;
}

.feedback-modal {
    text-align: center;
    color: var(--text-primary);
}

.feedback-status {
    font-size: 2.5cqw;
    margin-bottom: 1.5cqw;
}

.feedback-correct {
    color: var(--text-primary);
    font-size: 1.2cqw;
    opacity: 0.8;
}

.shake {
    animation: shakeAnim 0.4s ease-in-out;
}

@keyframes shakeAnim {
    0%, 100% { transform: translate(-50%, -50%) }
    20% { transform: translate(calc(-50% - 1cqw), calc(-50% + 0.5cqw)) }
    40% { transform: translate(calc(-50% + 1cqw), calc(-50% - 0.5cqw)) }
    60% { transform: translate(calc(-50% - 0.5cqw), calc(-50% + 0.5cqw)) }
    80% { transform: translate(calc(-50% + 0.5cqw), calc(-50% - 0.5cqw)) }
}

/* Tick Animation */
.tick-simple {
    position: absolute;
    top: -16cqmin;
    left: 4cqmin; /* Center of the avatar which is 8cqmin wide */
    transform: translateX(-50%);
    color: var(--black);
    font-size: 5cqmin;
    text-shadow: 0.4cqmin 0.4cqmin 0 var(--white);
    pointer-events: none;
    z-index: 100;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
