
.ty-app, .ty-app * { box-sizing: border-box; }
.ty-app { --ty-cut: 8px; --ty-acc: #ffd166; --ty-ok: #e8f4ff; --ty-bad: #ff5d73; --ty-dim: #5b6b82;
  --gs-ink: #e8f4ff; --gs-muted: #9fb3c8; --gs-line: #2a3550; --gs-accent: #ffd166; --gs-accent-ink: #231600;
  --gs-panel: #0d1220; --gs-bg: #070a12; --gs-chip: rgba(10, 14, 26, .92);
  position: relative; display: flex; flex-direction: column; color: #e8f4ff; font: 16px/1.4 "Segoe UI", system-ui, Arial, sans-serif;
  overflow: clip; -webkit-tap-highlight-color: transparent; background: #070a12; }
.ty-app.ty-embedded { height: clamp(320px, calc(100svh - 110px), 900px); border: 1px solid #2a3550;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.ty-app .gs-stage, .ty-app .gs-main { min-height: 0; }
.ty-app.gs-wide .gs-stage { align-items: stretch; grid-template-rows: minmax(0, 1fr); }
.ty-app .gs-side { min-height: 0; overflow: auto; }
.ty-app .gs-main { display: flex; flex-direction: column; }
.ty-cut { clip-path: polygon(var(--ty-cut) 0, 100% 0, 100% calc(100% - var(--ty-cut)), calc(100% - var(--ty-cut)) 100%, 0 100%, 0 var(--ty-cut)); }
.ty-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 2px 0 env(safe-area-inset-bottom, 0); }
.ty-hud { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; flex: none; }
.ty-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 5px 4px; min-width: 0;
  background: rgba(13, 18, 32, .9); border: 1px solid #22304a; }
.ty-chip small { font: 700 9px/1 monospace; letter-spacing: 1.3px; color: #7d8ca5; text-transform: uppercase; white-space: nowrap; }
.ty-chip b { font: 800 17px/1.15 monospace; color: #fff; white-space: nowrap; }
.ty-chip b.t { color: #7dd3fc; } .ty-chip b.t.low { color: var(--ty-bad); }
.ty-chip b.w { color: var(--ty-acc); } .ty-chip b.a { color: #c4b5fd; } .ty-chip b.s { color: #5eead4; }
.ty-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex: none; min-width: 0; padding: 0 2px; }
.ty-title { font: 700 13.5px/1.3 Georgia, 'Times New Roman', serif; color: var(--ty-acc); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ty-sp { flex: none; font: 700 12px/1 monospace; color: #fde68a; padding: 4px 8px; background: rgba(253, 230, 138, .08); border: 1px solid rgba(253, 230, 138, .3); white-space: nowrap; }
.ty-sp.up { animation: tyUp .6s ease-out; }
.ty-sp[hidden] { display: none !important; }
@keyframes tyUp { 0% { transform: scale(1.18); } 100% { transform: scale(1); } }
.ty-arena { position: relative; flex: 1; min-height: 150px; overflow: hidden; background: linear-gradient(180deg, #0b1120, #070a12);
  border: 1px solid #22304a; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); cursor: text; }
.ty-arena canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.ty-text { position: absolute; inset: 0; overflow-y: auto; padding: 14px 16px 40px; font: 500 21px/1.75 'Consolas', 'Menlo', 'Roboto Mono', monospace;
  color: var(--ty-dim); word-break: normal; overflow-wrap: break-word; scrollbar-width: thin; user-select: none; -webkit-user-select: none; z-index: 1; }
.ty-word { display: inline-block; white-space: nowrap; margin-right: .55em; border-bottom: 2px solid transparent; }
.ty-word.bad { border-bottom-color: rgba(255, 93, 115, .7); }
.ty-c { position: relative; }
.ty-c.ok { color: var(--ty-ok); }
.ty-c.no { color: var(--ty-bad); text-shadow: 0 0 8px rgba(255, 93, 115, .45); }
.ty-x { color: rgba(255, 93, 115, .75); }   
.ty-caret { position: absolute; width: 2px; background: var(--ty-acc); box-shadow: 0 0 8px var(--ty-acc); transition: left .07s linear, top .07s linear; z-index: 2; pointer-events: none; }
.ty-caret.idle { animation: tyBlink 1s steps(1) infinite; }
@keyframes tyBlink { 50% { opacity: 0; } }
.ty-input { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; font-size: 16px; z-index: 0; }
.ty-tap { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; background: rgba(7, 10, 18, .55); }
.ty-tap[hidden] { display: none; }
.ty-tap button, .ty-go { min-height: 48px; padding: 10px 22px; border: 0; cursor: pointer; font: 900 15px 'Segoe UI', system-ui, sans-serif; letter-spacing: .5px;
  color: #231600; background: linear-gradient(135deg, #fde68a, #ffb347); box-shadow: 0 0 22px rgba(255, 179, 71, .4);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.ty-shake { animation: tyShake .18s linear; }
@keyframes tyShake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.ty-prog { flex: none; height: 4px; background: #121a2c; position: relative; overflow: hidden; }
.ty-prog i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #5eead4, #ffd166); transition: width .2s; }
.ty-ctl { display: flex; gap: 6px; flex: none; align-items: stretch; }
.ty-ctl button { min-height: 46px; min-width: 46px; padding: 0 12px; border: 1px solid #2a3550; background: #0f1628; color: #dbe7f7; cursor: pointer;
  font: 700 14px 'Segoe UI', system-ui, sans-serif; clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
.ty-ctl button[aria-pressed="true"] { border-color: var(--ty-acc); color: #231600; background: var(--ty-acc); }
.ty-ctl .ty-grow { flex: 1; }
.ty-ctl .ty-daily { color: #ffd166; border-color: #6b5320; }
.ty-rules { color: #cbd5e1; line-height: 1.5; }
.ty-ctl button:hover { filter: brightness(1.15); }
.ty-hint { flex: none; text-align: center; font: 11.5px monospace; color: #5b6b82; }
.ty-hint kbd { border: 1px solid #2a3550; padding: 0 5px; font: bold 11px monospace; color: #cbd5e1; }
.ty-over { position: absolute; inset: 0; z-index: 5; display: none; align-items: center; justify-content: center; padding: 12px; overflow-y: auto;
  background: radial-gradient(ellipse at center, rgba(7, 10, 18, .6), rgba(7, 10, 18, .9)); }
.ty-over.show { display: flex; animation: tyFade .22s ease-out; }
@keyframes tyFade { from { opacity: 0; } to { opacity: 1; } }
.ty-card { width: min(520px, 100%); margin: auto; padding: 16px 16px 14px; text-align: center; background: linear-gradient(180deg, #111a2e, #0a0f1c);
  border: 1px solid var(--ty-acc); box-shadow: 0 0 40px rgba(255, 209, 102, .14);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); }
.ty-kick { font: bold 11px monospace; letter-spacing: 3px; color: #5eead4; text-transform: uppercase; }
.ty-big { font: 900 26px/1.15 'Segoe UI', system-ui, sans-serif; margin: 6px 0 2px; color: #fff; }
.ty-badge { display: inline-block; margin: 6px 4px 0; font: bold 11.5px monospace; padding: 4px 10px; border: 1px solid currentColor;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); }
.ty-badge.elite { color: #5eead4; } .ty-badge.solid { color: #ffd166; } .ty-badge.developing { color: #cbd5e1; }
.ty-badge.sp { color: #34d399; } .ty-badge.warn { color: #ff99aa; }
.ty-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0; }
.ty-stat { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); padding: 7px 2px;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); }
.ty-stat b { display: block; font: bold 19px monospace; color: #fff; }
.ty-stat i { font-style: normal; font-size: 9.5px; letter-spacing: 1px; color: #8796ad; text-transform: uppercase; }
.ty-pb { font-size: 13px; color: #fde68a; min-height: 1em; }
.ty-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.ty-btns button { min-height: 46px; }
.ty-btns .ty-alt { background: #16213a; color: #dbe7f7; box-shadow: none; border: 1px solid #2a3550; }
.ty-runs { display: flex; flex-direction: column; gap: 4px; }
.ty-run { display: flex; gap: 8px; align-items: center; padding: 6px 8px; background: rgba(255, 255, 255, .03); border: 1px solid #1d2840; font-size: 13px; }
.ty-run b { font: bold 13px monospace; color: #ffd166; min-width: 30px; }
.ty-run .m { font: bold 10px monospace; padding: 1px 5px; border: 1px solid; }
.ty-run .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b7c4d8; }
.ty-run .s { font: bold 12px monospace; color: #fff; white-space: nowrap; }
.ty-msg { text-align: center; padding: 30px 10px; color: #9fb3c8; }
@media (max-width: 560px) {
  .ty-hud { gap: 4px; }
  .ty-chip { padding: 4px 2px; }
  .ty-chip small { font-size: 8px; letter-spacing: .6px; }
  .ty-chip b { font-size: 14.5px; }
  .ty-text { font-size: 18px; line-height: 1.7; padding: 10px 12px 36px; }
  .ty-stats { grid-template-columns: repeat(2, 1fr); }
  .ty-big { font-size: 22px; }
  .ty-hint { display: none; }
}
@media (max-width: 420px) {   
  .ty-app .gs-title { font-size: 13px; letter-spacing: .04em; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .ty-app .gs-tools { gap: 4px; }
  .ty-ctl button { padding: 0 9px; font-size: 13px; }
}
@media (max-height: 520px) {
  .ty-chip { padding: 2px; } .ty-chip b { font-size: 13px; } .ty-chip small { display: none; }
  .ty-ctl button { min-height: 40px; }
  .ty-meta { display: none; }
}
