/* Homepage: the practice demo in the phone (index-mobile-content.php, js/phone-demo.js) - the look of
   /student/class/practice (app/data/css/wocabee_play.css). The phone screen changes its size with the page
   (179-302px wide), so everything is in em of .pd-screen, which follows the screen width (cqw; px where not supported). */

#iphone-mockup .screen { container-type: inline-size; }

.pd-screen {
    --pd-green: #28a745;
    --pd-blue: #007bff;
    --pd-teal: #17a2b8;
    --pd-dark: #3c3c3c;
    --pd-orange: #fba828;
    --pd-text: #2e2a22;
    --pd-shadow: 0 .15em .45em rgba(0, 0, 0, .12);
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: .8em .75em .55em;
    background: #f1f1f1 url(../img/bg_app.jpg) center top / 70% auto;
    color: var(--pd-text);
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-size: 4.7cqw;
    line-height: 1.25;
    text-align: center;
    overflow: hidden;
}

/* ---- top: what the demo is + the WocaPoints pill of the practice ---- */
.pd-title { margin-bottom: .45em; color: #6b6253; font-size: .8em; font-weight: 700; }
.pd-points {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5em;
    min-height: 2.3em;
    padding: 0 .9em;
    border-radius: .8em;
    background: var(--pd-dark);
    box-shadow: var(--pd-shadow);
    color: #fff;
    font-size: .92em;
    font-weight: 700;
}
.pd-points b { display: inline-block; font-weight: 700; }
.pd-points b.is-up { animation: pdBump .45s ease; }

/* ---- the methods: one at a time ---- */
.pd-methods { position: relative; flex: 1 1 auto; min-height: 0; }
.pd-method { display: none; flex-direction: column; align-items: center; gap: .5em; padding-top: .2em; }
.pd-method.is-active { display: flex; animation: pdInRight .3s ease both; }
.pd-method.is-active.from-left { animation-name: pdInLeft; }

.pd-task { margin: .55em 0 .1em; font-size: 1.02em; font-weight: 700; }
.pd-task i { margin-right: .15em; color: var(--pd-orange); }
.pd-task small { display: block; margin-top: .2em; color: #6b6253; font-size: .72em; font-weight: 600; }
.pd-hint { margin-top: -.3em; color: #6b6253; font-size: .72em; font-weight: 600; }

/* question (green), answers (blue) - rounded with a soft shadow as in the practice */
.pd-q, .pd-a, .pd-card, .pd-check {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35em;
    width: 100%;
    min-height: 2.75em;
    padding: .3em .8em;
    border: 0;
    border-radius: .85em;
    background: var(--pd-blue);
    box-shadow: var(--pd-shadow);
    color: #fff;
    font: inherit;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: transform .2s ease, background-color .25s ease, opacity .3s ease;
}
.pd-q { background: var(--pd-green); font-size: 1.15em; font-weight: 700; cursor: default; }
.pd-q--small, .pd-a--small { min-height: 2.25em; font-size: 1em; }
button.pd-q { cursor: pointer; }
.pd-a--word { letter-spacing: .12em; cursor: default; }
.pd-a--sentence { cursor: default; }
.pd-a:hover, .pd-card:hover, .pd-check:hover { transform: translateY(-1px); }
.pd-a:focus, .pd-q:focus, .pd-card:focus, .pd-check:focus { outline: none; }

/* the demo's answer: green with the chevrons the practice shows on a selected answer */
.pd-a.is-picked { background: var(--pd-green); animation: pdPop .4s ease; }
.pd-a.is-picked::before { content: "\203A"; margin-right: .2em; }
.pd-a.is-picked::after { content: "\2039"; margin-left: .2em; }

.pd-speaker { display: inline-block; color: var(--pd-dark); font-size: 1.55em; line-height: 1; cursor: pointer; }
.pd-speaker--big { margin: .15em 0; font-size: 2.6em; }
.pd-speaker.is-playing { animation: pdPulse .9s ease 2; }

/* typed answers */
.pd-input {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.55em;
    border: .14em solid #d9dee3;
    border-radius: .85em;
    background: #fff;
    color: var(--pd-text);
    font-size: 1.12em;
    font-weight: 600;
    white-space: pre;
}
.pd-input.is-typing { border-color: var(--pd-orange); box-shadow: 0 0 0 .2em rgba(251, 168, 40, .25); }
.pd-input.is-typing::after { content: ""; width: .08em; height: 1.1em; margin-left: .05em; background: var(--pd-text); animation: pdBlink 1s steps(1) infinite; }
.pd-input.is-done { border-color: var(--pd-green); box-shadow: 0 0 0 .2em rgba(40, 167, 69, .2); }
.pd-check { min-height: 2.45em; background: #6c757d; font-size: 1em; }
.pd-check.is-ready { background: var(--pd-blue); animation: pdPop .4s ease; }
.pd-gap { display: inline-block; min-width: 2.5em; border-bottom: .12em solid rgba(255, 255, 255, .8); line-height: 1.1; }

/* complete the word: dark letter tiles */
.pd-chars { display: flex; justify-content: center; gap: .45em; margin-top: .5em; }
.pd-char {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15em;
    height: 2.15em;
    border-radius: .55em;
    background: #4a4a4a;
    box-shadow: var(--pd-shadow);
    color: #fff;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .25s ease, transform .25s ease;
}
.pd-char.is-used { opacity: 0; transform: translateY(-.8em) scale(.6); }

/* pairs / pexeso: two groups as in the practice */
.pd-group { display: flex; flex-direction: column; gap: .35em; width: 100%; }
.pd-group + .pd-group { margin-top: .45em; }
.pd-q--small.is-selected, .pd-a--small.is-selected, .pd-card.is-open.is-selected { box-shadow: 0 0 0 .18em #fff, 0 0 0 .34em var(--pd-orange); }
.pd-q--small.is-matched, .pd-a--small.is-matched, .pd-card.is-matched { opacity: .35; transform: scale(.97); }
.pd-card { min-height: 2.15em; background: var(--pd-blue); font-size: 1em; }
.pd-card--word { background: var(--pd-teal); }
.pd-card span { display: none; }
.pd-card.is-open i { display: none; }
.pd-card.is-open span { display: inline; }
.pd-card.is-open { animation: pdFlip .35s ease; }
.pd-card i { animation: pdBeat 1.6s ease-in-out infinite; }

/* pictures */
.pd-pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45em; width: 100%; margin-top: .2em; }
.pd-pic-wrap { aspect-ratio: 1; padding: .2em; border-radius: .85em; background: #fff; box-shadow: var(--pd-shadow); cursor: pointer; transition: transform .25s ease, box-shadow .25s ease; }
.pd-pic-wrap.is-picked { box-shadow: 0 0 0 .2em var(--pd-green), var(--pd-shadow); transform: scale(1.06); }
.pd-pic, .pd-photo img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: .65em; }
.pd-photo { width: 78%; aspect-ratio: 4 / 3; padding: .25em; border-radius: .9em; background: #fff; box-shadow: var(--pd-shadow); }
.pd-photo--kids { width: 62%; aspect-ratio: 1; margin: .3em 0; }

/* falling word: it falls while the answer is typed */
.pd-sky { position: relative; width: 100%; height: 11em; }
.pd-falling { position: absolute; left: 0; top: 2.6em; }
.pd-method.is-active .pd-falling.is-falling { animation: pdFall 5.5s linear forwards; }

/* arrange the words */
.pd-words { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: .4em; margin: .5em 0 .3em; }
.pd-word {
    display: inline-flex;
    align-items: center;
    min-height: 2.1em;
    padding: .2em .75em;
    border-radius: .7em;
    background: var(--pd-blue);
    box-shadow: var(--pd-shadow);
    color: #fff;
    font-weight: 600;
    cursor: move;
    transition: transform .45s cubic-bezier(.3, .7, .3, 1);
}
.pd-word--fixed { background: var(--pd-green); cursor: default; }
.pd-words.is-done .pd-word { background: var(--pd-green); }

/* ---- kids ---- */
.pd-help { align-self: flex-start; color: var(--pd-blue); font-size: 2em; line-height: 1; cursor: pointer; }
.pd-screen--kids .pd-method { gap: .65em; }
.pd-speakers { display: flex; justify-content: space-around; width: 100%; }
.pd-speaker-tile { display: inline-flex; align-items: center; justify-content: center; width: 3.6em; height: 3.6em; border-radius: 1em; background: #fff; box-shadow: var(--pd-shadow); cursor: pointer; transition: transform .25s ease, box-shadow .25s ease; }
.pd-speaker-tile .pd-speaker { font-size: 1.8em; }
.pd-speaker-tile.is-picked { box-shadow: 0 0 0 .2em var(--pd-green), var(--pd-shadow); transform: scale(1.08); }
.pd-yesno { display: flex; gap: .8em; width: 100%; }
.pd-yes, .pd-no { flex: 1; min-height: 2.9em; border: 0; border-radius: .85em; box-shadow: var(--pd-shadow); color: #fff; font-size: 1.3em; cursor: pointer; }
.pd-yes { background: var(--pd-green); }
.pd-no { background: #dc3545; }
.pd-yes.is-picked { animation: pdPop .4s ease; box-shadow: 0 0 0 .2em #fff, 0 0 0 .38em var(--pd-green); }
.pd-pics--kids { margin-top: .6em; }

/* ---- bottom: arrows + a dot per method ---- */
.pd-nav { display: flex; align-items: center; justify-content: space-between; gap: .5em; padding-top: .5em; border-top: 1px solid rgba(46, 42, 34, .1); }
.pd-prev, .pd-next {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.4em;
    height: 2.4em;
    border: 0;
    border-radius: 50%;
    background: #ffc107;
    box-shadow: var(--pd-shadow);
    color: var(--pd-text);
    font-size: .95em;
    cursor: pointer;
}
.pd-prev:hover, .pd-next:hover { filter: brightness(.95); }
.pd-dots { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3em; }
.pd-dot { width: .5em; height: .5em; padding: 0; border: 0; border-radius: 1em; background: #d8cdbb; cursor: pointer; transition: width .25s ease, background-color .25s ease; }
.pd-dot.is-active { width: 1.3em; background: var(--pd-orange); }

@keyframes pdInRight { from { opacity: 0; transform: translateX(1.5em); } to { opacity: 1; transform: none; } }
@keyframes pdInLeft { from { opacity: 0; transform: translateX(-1.5em); } to { opacity: 1; transform: none; } }
@keyframes pdPop { 0% { transform: scale(1); } 45% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes pdBump { 0% { transform: none; } 40% { transform: translateY(-.25em) scale(1.2); color: var(--pd-orange); } 100% { transform: none; } }
@keyframes pdPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes pdBlink { 50% { opacity: 0; } }
@keyframes pdFlip { from { transform: rotateX(90deg); } to { transform: none; } }
@keyframes pdBeat { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.25); } }
@keyframes pdFall { from { transform: translateY(0); } to { transform: translateY(5.6em); } }

@media (prefers-reduced-motion: reduce) {
    .pd-method.is-active, .pd-card i, .pd-speaker.is-playing, .pd-card.is-open { animation: none; }
    .pd-method.is-active .pd-falling.is-falling { animation: none; transform: translateY(2.8em); }
}
