:root {
    --button-bg: #F7F7F7;
    --button-text: #222222;
    --button-active: #EBEBEB;
    --button-height: 60px;
    --airbnb-pink: #FF385C;
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --ink-hsl: 0, 0%, 0%;
    --ink: hsla(var(--ink-hsl), 1.0);
    --control: white;
    --line-height-ratio: 1.4;
    --font-size: 16px;
    --line-height: calc(var(--line-height-ratio) * var(--font-size));
}


*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, video, svg, canvas {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}


@media (prefers-color-scheme: dark) {
    :root {
        --ink-hsl: 0, 0%, 100%;
        --control: hsla(var(--ink-hsl), 0.25);
    }
}


@font-face {
  font-family: 'Material Symbols Rounded';
  font-style: normal;
  font-display: block;
  src: url(MaterialSymbolsRounded-FILL,GRAD,opsz,wght.woff2) format('woff2');
}


/* Prevent scrolling and bouncing */
html {
    height: -webkit-fill-available;
    position: fixed;
    width: 100%;
    overflow: hidden;
}

h1 {

    font-weight: 400;
    font-size: 1.5rem;
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
/*    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;*/
    font-family: sans-serif;
    background-color: white;
    color: var(--ink);

    /* Prevent scrolling and bouncing */
    overflow: hidden;
    width: 100%;
    font-size: var(--font-size);
    line-height: var(--line-height-ratio);
}

@media (prefers-color-scheme: dark) {
    body {
        background-color: hsla(0, 0%, 12%, 1.0);
    }
}

input {
    color: var(--ink);
    background-color: var(--control);
    border: 1px solid hsla(var(--ink-hsl), 0.12);
}

p {

    margin-block-start: var(--line-height);
    margin-block-end: var(--line-height);

}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: calc(var(--sat) + var(--line-height)) 20px calc(var(--sab) + 20px) 20px;
    max-width: 430px;
    width: 100%;
    margin: 0 auto;
    position: relative;

    padding-bottom: calc( 3*var(--button-height) + 2*12px + max(20px, var(--sab)) );

    /* Make this container scrollable */
    overflow-y: auto; /* Show scrollbar only when content overflows */
    
    /* This prevents the "bounce" effect on iOS when scrolling this container */
    overscroll-behavior-y: contain; 
    
    /* This enables momentum-based scrolling for a smoother feel on touch devices */
    -webkit-overflow-scrolling: touch; 
}

.prompt {
    font-size: calc(1.25 * var(--font-size));
    line-height: calc(1.5*var(--line-height));
    text-align: center;
    /*margin-bottom: auto;*/
    padding: 0;

    text-wrap: pretty; /* prevents orphans somewhat */
}

.keyboard {
    display: grid;
    grid-template-columns: repeat(4, 60px);
    gap: 12px;
    margin-bottom: max(20px, var(--sab));
    justify-content: center;
    contain: layout;
    transform: translateZ(0);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
}

button {
    height: var(--button-height);
    border: 1px solid hsla(var(--ink-hsl), 0.12);
    border-radius: 12px;
    background-color: var(--control);
    color: var(--ink);
    font-size: 18px;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    transform-origin: center;
    contain: layout;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 
               0 4px 12px rgba(0, 0, 0, 0.05);
               
    -webkit-user-select: none; /* For Safari/Chrome on iOS */
    user-select: none;
}

.button {
    width: 60px;
}


/*.material-symbols-outlined {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;  
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
}
*/

button.autoplay {
    grid-column: span 4;
}

/*
button.autoplay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
*/

/*
.overlay {
    font-size: 0.66em;
}
*/

/* material symbols outlined */
.ms {
    justify-self: center;

    font-family: 'Material Symbols Rounded';
    font-weight: 300;
    font-style: normal;
    font-size: 24px;  
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;

}

.button:active {
    background-color: var(--button-active);
    transform: scale(0.96);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.button.wide {
    grid-column: span 2;
    width: calc(120px + 12px);
}

.button.play {
    border-radius: 50%;
    width: var(--button-height);
    height: var(--button-height);
    position: relative;
    padding: 0; /* Remove default padding */
}

.play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 12px;
    border-color: transparent transparent transparent black;
    position: absolute;
    top: 50%;
    left: 54%; /* Back to the original position */
    transform: translate(-50%, -50%);
}

.menubutton {
    border: 0;
    box-shadow: none;
    background-color: transparent;
    cursor: pointer;
}

.setting {
    display: flex;
    align-items: center;
}

.top {
    display: flex;
    align-items: center; 
    gap: 1rem;
    width: 100%;
}

.flex {
    flex:1;
}

.stats {
    text-align: right;
    margin: 0 8px;
}

.menu {

/*    font-size: calc(1.25 * var(--font-size));
    line-height: calc(1.5*var(--line-height));
*/
    padding: 0 12px;
}

.menu .button {
    box-shadow: none;
    border-radius: 30px;
}

.menu .setting {
    width: 100%;
    text-align: left;
    padding-left: 24px;

    height: var(--button-height);
}

.display-none {
    display: none;
}

.num {
    font-family: monospace;
}

input.num {
    width: 5em;
    /*border: 0;*/
    text-align: right;

    /*font-family: sans-serif;*/
    font-size: var(--font-size);
    padding:0;


/*    font-size: calc(1.25 * var(--font-size));
    line-height: calc(1.5*var(--line-height));
*/
}

.icon {
    margin-right: 8px;
}

.qcount {
    text-align: right;
    margin-right: 8px;
    width: 5ex;
}

.login {
    width: 100%;
    padding: 24px;
    margin: 0 auto;
    gap: var(--line-height);
}

.login input {
    width: 100%;
    height: 48px;
    padding: 0 0.75rem;
}

.login button {
    width: 100%;
}

