/* Teclas Turbo: the race track sits on the canvas; text, hands and keyboard
   are DOM on top of it. */
.pop-dom.tt-dom { padding: 0; justify-content: stretch; align-items: stretch; }
.tt { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; width: 100%; color: #1d2433; }
.tt-road { flex: 0 0 clamp(96px, 24vh, 190px); width: 100%; }

/* The text to type */
.tt-panel { position: relative; flex: 0 0 auto; width: calc(100% - 20px); max-width: 760px; margin-top: 8px; background: #fffdf6; border-radius: 20px; padding: 10px 14px 8px; border-top: 6px solid #ff4f5b; background-image: radial-gradient(rgba(29, 36, 51, 0.035) 1px, transparent 1px); background-size: 8px 8px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18), 0 10px 24px rgba(0, 0, 0, 0.18); }
.tt-new { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; align-items: center; font-weight: 800; font-size: 15px; color: #5b6475; margin-bottom: 4px; }
.tt-new[hidden] { display: none; }
.tt-new .k { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; color: #fff; font-size: 18px; margin-right: 4px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); }
.tt-line { font-family: "Baloo 2", "Trebuchet MS", system-ui, sans-serif; white-space: pre; text-align: left; overflow: hidden; letter-spacing: 0.02em; }
.tt-line.cur { font-size: clamp(26px, 7.4vw, 42px); font-weight: 800; line-height: 1.35; color: #8a93a6; }
.tt-line.next { font-size: clamp(16px, 4.2vw, 22px); font-weight: 700; line-height: 1.3; color: #b3b9c6; min-height: 1.3em; }
.tt-line span { display: inline-block; border-radius: 6px; padding: 0 1px; }
.tt-line .ok { color: #1f9d6b; }
.tt-line .fx { color: #e08a00; }
.tt-line .sp { color: transparent; position: relative; min-width: 0.42em; }
.tt-line .sp::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 0.3em; height: 3px; border-radius: 2px; background: #d6dae3; }
.tt-line .ok.sp::after { background: #9fdcc2; }
.tt-line .cur { color: #1d2433; background: #ffe066; box-shadow: 0 4px 0 #e2a600; animation: tt-blink 1s ease-in-out infinite; }
.tt-line .cur.sp::after { background: #e2a600; }
.tt-line .cur.bad { background: #ff8a8a; box-shadow: 0 4px 0 #d23b3b; animation: tt-shake 0.3s; }
.tt-tip { display: flex; justify-content: center; align-items: center; gap: 8px; font-weight: 800; font-size: clamp(14px, 3.8vw, 17px); color: #5b6475; min-height: 24px; }
.tt-tip i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
.tt-stats { position: absolute; right: 12px; top: -14px; background: #1d2433; color: #fff; border-radius: 999px; font-size: 13px; font-weight: 800; padding: 2px 10px; }

/* Hands */
.tt-hands { flex: 0 0 auto; display: flex; justify-content: center; width: 100%; margin: 8px 0 4px; }
.tt-hands svg { display: block; height: clamp(64px, 12vh, 112px); width: auto; max-width: 86%; overflow: visible; }
.tt-hands .fg { stroke: rgba(120, 60, 30, 0.3); stroke-width: 2; transition: fill 0.15s; }
.tt-hands .fg.on { stroke: #1d2433; stroke-width: 3; animation: tt-finger 0.9s ease-in-out infinite; }
.tt-hands .fg.on2 { stroke: #1d2433; stroke-width: 2.5; stroke-dasharray: 5 4; }
.tt-hands .palm { fill: url(#ttSkin); stroke: rgba(120, 60, 30, 0.25); stroke-width: 2; }
.tt-hands text { font: 800 15px "Baloo 2", system-ui, sans-serif; fill: #1d2433; stroke: none; text-anchor: middle; pointer-events: none; }

/* On-screen keyboard: a guide, and the way to type on a tablet or phone */
.tt-kb { flex: 0 0 auto; width: calc(100% - 12px); max-width: 760px; margin: auto 0 calc(8px + env(safe-area-inset-bottom, 0px)); padding: 6px; border-radius: 18px; background: linear-gradient(180deg, #2c3550, #151a28); border: 2px solid rgba(255, 255, 255, 0.08); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.12); display: flex; flex-direction: column; gap: 5px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.tt-row { display: flex; gap: 4px; justify-content: center; }
.tt-key { position: relative; flex: 1 1 0; min-width: 0; height: clamp(34px, 6.2vh, 50px); border: 0; border-radius: 8px; padding: 0; font: 800 clamp(14px, 3.9vw, 20px) "Baloo 2", system-ui, sans-serif; color: #1d2433; background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 55%), var(--soft); box-shadow: 0 4px 0 var(--edge), 0 5px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -3px 0 rgba(0, 0, 0, 0.07); cursor: pointer; transition: transform 0.08s; }
.tt-key.w14 { flex-grow: 1.45; font-size: clamp(11px, 3vw, 15px); }
.tt-key.space { flex: 0 0 56%; font-size: clamp(12px, 3.2vw, 15px); }
.tt-key.home::after { content: ""; position: absolute; left: 34%; right: 34%; bottom: 6px; height: 3px; border-radius: 2px; background: rgba(0, 0, 0, 0.45); }
.tt-key.off { opacity: 0.38; }
.tt-key.go { background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 55%), var(--strong); color: #fff; transform: translateY(-3px) scale(1.12); box-shadow: 0 3px 0 var(--edge), 0 0 0 3px #fff, 0 0 16px 4px var(--strong); z-index: 1; }
.tt-key.go2 { background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 55%), var(--strong); color: #fff; box-shadow: 0 3px 0 var(--edge), 0 0 0 2px #fff; }
.tt-key.down { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.tt-key.lock { outline: 3px solid #ffe066; }

@keyframes tt-blink { 50% { box-shadow: 0 4px 0 #e2a600, 0 0 0 4px rgba(255, 224, 102, 0.45); } }
@keyframes tt-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes tt-finger { 50% { transform: translateY(-4px); } }
.tt-hands .fg.on { transform-box: fill-box; }

@media (max-height: 640px) {
  .tt-hands { display: none; }
  .tt-road { flex-basis: clamp(80px, 20vh, 140px); }
}
@media (max-height: 520px) {
  .tt-line.next { display: none; }
  .tt-key { height: 30px; }
}
