/* Sówka — style.
 * Bez flexboksa, grida, zmiennych CSS i jednostek vh: stare przeglądarki Androida 4.x
 * ich nie znają. Układ robimy pozycjonowaniem absolutnym i inline-blockami.
 */

* { -webkit-box-sizing: border-box; box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; }
body {
  background: #fef6e4;
  color: #2b2d42;
  font-family: Roboto, "Droid Sans", "Helvetica Neue", Arial, sans-serif;
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
button {
  font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0;
  outline: none; -webkit-appearance: none; cursor: pointer; text-align: center;
}
input { font: inherit; }
svg { display: block; }

#app { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; }
#err {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 99;
  background: #b00020; color: #fff; font: 14px monospace; padding: 8px 12px;
}

/* ---- górny pasek ---- */
.top { position: absolute; top: 0; left: 0; right: 0; height: 72px; background: #fff; z-index: 5; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.top .title {
  position: absolute; top: 0; left: 170px; right: 170px; height: 72px; line-height: 72px;
  text-align: center; font-size: 30px; font-weight: bold;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.top .tl { position: absolute; left: 8px; top: 8px; height: 56px; white-space: nowrap; }
.top .tr { position: absolute; right: 8px; top: 8px; height: 56px; white-space: nowrap; }
.ibtn { display: inline-block; vertical-align: top; width: 56px; height: 56px; border-radius: 28px; background: #eef1f7; margin: 0 4px; padding: 8px; color: #2b2d42; }
.ibtn svg { width: 40px; height: 40px; }
.ibtn.on { background: #c8f1fa; }
.stars {
  display: inline-block; vertical-align: top; height: 56px; line-height: 56px; padding: 0 16px 0 10px; margin-left: 4px;
  border-radius: 28px; background: #fff3c4; font-size: 26px; font-weight: bold; color: #a16207;
}
.stars svg { display: inline-block; vertical-align: middle; width: 34px; height: 34px; color: #f6b400; margin: -5px 6px 0 0; }
.who {
  display: inline-block; vertical-align: top; height: 56px; line-height: 56px; padding: 0 18px 0 6px; max-width: 260px;
  border-radius: 28px; background: #eef1f7; font-size: 22px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.who .ava { margin: -3px 8px 0 0; }
.ava { display: inline-block; vertical-align: middle; border-radius: 50%; color: #fff; text-align: center; font-weight: bold; }

/* ---- przewijana treść ---- */
.body {
  position: absolute; top: 72px; left: 0; right: 0; bottom: 0; padding: 16px 10px 40px;
  overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; text-align: center;
}
.hero { margin: 4px auto 6px; white-space: nowrap; }
.owlbox { display: inline-block; vertical-align: middle; width: 130px; height: 130px; }
.owlbox svg { width: 130px; height: 130px; }
.bubble {
  display: inline-block; vertical-align: middle; position: relative; margin-left: 18px; max-width: 520px; white-space: normal;
  background: #fff; border-radius: 26px; padding: 18px 26px; font-size: 28px; font-weight: bold; text-align: left;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .08);
}
.bubble:before {
  content: ''; position: absolute; left: -16px; top: 50%; margin-top: -11px;
  border-top: 11px solid transparent; border-bottom: 11px solid transparent; border-right: 16px solid #fff;
}
.note { font-size: 20px; color: #6b7280; margin: 0 0 4px; }

.tile {
  display: inline-block; vertical-align: top; width: 250px; margin: 12px; padding: 16px 10px 14px;
  border-radius: 30px; background: #fff; box-shadow: 0 6px 0 rgba(0, 0, 0, .12);
}
.tile .pic svg { width: 150px; height: 130px; margin: 0 auto; }
.tile .lbl { font-size: 28px; font-weight: bold; margin-top: 6px; }
.tile .sub { font-size: 20px; font-weight: bold; color: #6b7280; margin-top: 4px; height: 26px; }
.tile .sub svg { display: inline-block; vertical-align: middle; width: 24px; height: 24px; color: #f6b400; margin: -4px 4px 0 0; }
.c1 { background: #ffd6e0; } .c2 { background: #c8f1fa; } .c3 { background: #fff1bf; } .c4 { background: #d4f5e4; } .c5 { background: #e9ddff; }

.tile:active, .tbtn:active, .key:active, .ibtn:active, .gtile:active, .ptile:active, .btn:active, .cbtn:active {
  -webkit-transform: translateY(3px); transform: translateY(3px);
}

.gtile {
  display: inline-block; vertical-align: top; width: 128px; margin: 8px; padding: 8px 6px 6px;
  border-radius: 22px; background: #fff; box-shadow: 0 5px 0 rgba(0, 0, 0, .1);
}
.gtile svg.gl { width: 100px; height: 96px; margin: 0 auto; }
.gtile.wide { width: 210px; }
.gtile.wide svg.gl { width: 186px; height: 70px; }
.gtile .lbl { font-size: 20px; font-weight: bold; height: 26px; }
.mini { height: 24px; white-space: nowrap; }
.mini svg { display: inline-block; width: 22px; height: 22px; color: #dde1ea; margin: 0 1px; }
.mini svg.on { color: #f6b400; }

/* ---- kartka do pisania ---- */
.stage { position: absolute; top: 72px; left: 0; right: 0; bottom: 108px; background: #fff; overflow: hidden; }
.stage canvas { position: absolute; top: 0; left: 0; touch-action: none; -ms-touch-action: none; }
.tools { position: absolute; left: 0; right: 0; bottom: 0; height: 108px; padding-top: 10px; text-align: center; white-space: nowrap; background: #fef6e4; }
.tbtn {
  display: inline-block; vertical-align: top; width: 124px; height: 88px; margin: 0 7px; padding-top: 6px;
  border-radius: 24px; background: #fff; box-shadow: 0 5px 0 rgba(0, 0, 0, .12); font-size: 18px; font-weight: bold;
}
.tbtn svg { width: 46px; height: 46px; margin: 0 auto 2px; }
.tbtn.go { width: 170px; background: #2fbf65; color: #fff; }

/* rysowanie */
.dtools { padding-top: 24px; }
.dtools .sw { display: inline-block; vertical-align: middle; width: 46px; height: 46px; border-radius: 23px; margin: 0 3px; border: 4px solid #fff; box-shadow: 0 0 0 2px #dde1ea; }
.dtools .sw.on { box-shadow: 0 0 0 4px #2b2d42; }
.dtools .sz { display: inline-block; vertical-align: middle; width: 50px; height: 50px; border-radius: 25px; background: #fff; margin: 0 3px; }
.dtools .sz i { display: block; margin-left: auto; margin-right: auto; border-radius: 50%; background: #2b2d42; }
.dtools .sz.on { background: #c8f1fa; }
.dtools .ibtn { vertical-align: middle; background: #fff; }
.dtools .ibtn.on { background: #c8f1fa; }
.sep { display: inline-block; width: 16px; }

/* ---- okienko z wynikiem ---- */
.veil { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(43, 45, 66, .5); text-align: center; }
.veil:before { content: ''; display: inline-block; height: 100%; vertical-align: middle; }
.card {
  display: inline-block; vertical-align: middle; width: 580px; max-width: 94%; padding: 22px 24px 26px;
  background: #fff; border-radius: 34px; box-shadow: 0 10px 0 rgba(0, 0, 0, .15);
  -webkit-animation: pop .35s ease-out; animation: pop .35s ease-out;
}
.card .owl { width: 110px; height: 110px; margin: 0 auto; -webkit-animation: hop 1.1s ease-in-out infinite; animation: hop 1.1s ease-in-out infinite; }
.big-stars { white-space: nowrap; }
.big-stars svg { display: inline-block; width: 76px; height: 76px; margin: 4px; color: #dde1ea; }
.big-stars svg.on { color: #f6b400; }
.card .msg { font-size: 32px; font-weight: bold; margin: 10px 0 6px; }
.card .hint { font-size: 22px; color: #4b5563; margin-bottom: 6px; }
.score { font-size: 40px; font-weight: bold; color: #a16207; white-space: nowrap; }
.score svg { display: inline-block; vertical-align: middle; width: 70px; height: 70px; color: #f6b400; }
.score b { font-size: 70px; vertical-align: middle; margin: 0 6px; }
.btn {
  display: inline-block; vertical-align: top; min-width: 190px; height: 76px; line-height: 76px; margin: 14px 8px 0; padding: 0 24px;
  border-radius: 38px; background: #eef1f7; font-size: 26px; font-weight: bold; box-shadow: 0 5px 0 rgba(0, 0, 0, .12); white-space: nowrap;
}
.btn svg { display: inline-block; vertical-align: middle; width: 36px; height: 36px; margin: -4px 8px 0 -4px; }
.btn.go { background: #2fbf65; color: #fff; }
.btn.go svg { margin: -4px -6px 0 8px; }
.toast {
  position: absolute; left: 50%; top: 90px; width: 400px; margin-left: -200px; z-index: 30; padding: 14px 20px;
  background: #2b2d42; color: #fff; font-size: 24px; font-weight: bold; border-radius: 30px; text-align: center;
}

/* ---- liczenie ---- */
.dots { position: absolute; top: 80px; left: 0; right: 0; height: 26px; text-align: center; }
.dots span { display: inline-block; width: 20px; height: 20px; border-radius: 10px; background: #dde1ea; margin: 3px 5px; }
.dots span.now { background: #fff; border: 4px solid #1d4ed8; }
.dots span.ok { background: #2fbf65; }
.dots span.meh { background: #fbbf24; }
.dots span.bad { background: #ef476f; }
.mq { position: absolute; top: 108px; left: 0; right: 0; bottom: 206px; text-align: center; overflow: hidden; }
.mq:before { content: ''; display: inline-block; height: 100%; vertical-align: middle; }
.mq-in { display: inline-block; vertical-align: middle; width: 98%; }
.qtext { font-size: 30px; font-weight: bold; margin-bottom: 8px; }
.qrow { white-space: nowrap; margin: 6px 0; }
.qrow > * { display: inline-block; vertical-align: middle; }
.objs { text-align: left; white-space: normal; margin: 0 10px; }
.obj { display: inline-block; margin: 3px; }
.obj svg { width: 100%; height: 100%; }
.sign { font-size: 64px; font-weight: bold; margin: 0 8px; color: #6b7280; }
.expr { font-size: 76px; font-weight: bold; white-space: nowrap; margin-top: 4px; }
.expr span { display: inline-block; vertical-align: middle; margin: 0 8px; }
.slot {
  display: inline-block; vertical-align: middle; min-width: 120px; height: 104px; line-height: 94px; padding: 0 16px; margin: 0 8px;
  border: 5px dashed #9aa6b8; border-radius: 24px; background: #fff; color: #9aa6b8; font-size: 76px; font-weight: bold; text-align: center;
}
.expr .slot { margin: 0 8px; }
.slot.filled { color: #1d4ed8; border: 5px solid #1d4ed8; }
.slot.ok { color: #13803f; border: 5px solid #2fbf65; background: #e3f8eb; }
.slot.bad { color: #c81e4a; border: 5px solid #ef476f; background: #fde7ee; -webkit-animation: shake .45s; animation: shake .45s; }
.slot.show { color: #13803f; border: 5px solid #2fbf65; }
.seq .box, .seq .slot {
  display: inline-block; vertical-align: middle; min-width: 110px; height: 104px; line-height: 94px; margin: 0 6px;
  border-radius: 22px; font-size: 64px; font-weight: bold;
}
.seq .box { border: 5px solid #dde1ea; background: #fff; }
.cmpnum { text-align: center; margin: 0 10px; }
.cmpnum .n { font-size: 84px; font-weight: bold; line-height: 100px; }
.cmpnum .objs { margin: 0 auto; }

.pad { position: absolute; left: 0; right: 0; bottom: 0; height: 206px; padding-top: 6px; text-align: center; }
.pad-row { white-space: nowrap; }
.key {
  display: inline-block; vertical-align: top; width: 96px; height: 88px; margin: 5px;
  border-radius: 22px; background: #fff; box-shadow: 0 5px 0 rgba(0, 0, 0, .14); font-size: 50px; font-weight: bold; line-height: 88px;
}
.key svg { width: 50px; height: 50px; margin: 19px auto 0; }
.key-ok { background: #2fbf65; color: #fff; }
.key-del { background: #ffe2e9; color: #c81e4a; }
.cbtn {
  display: inline-block; vertical-align: top; width: 170px; height: 160px; margin: 10px 14px; padding-top: 6px;
  border-radius: 28px; background: #fff; box-shadow: 0 6px 0 rgba(0, 0, 0, .14);
}
.cbtn b { display: block; font-size: 90px; line-height: 110px; }
.cbtn small { display: block; font-size: 20px; font-weight: bold; color: #6b7280; }

/* ---- profile ---- */
.ptile {
  display: inline-block; vertical-align: top; width: 200px; margin: 14px; padding: 20px 8px;
  border-radius: 30px; background: #fff; box-shadow: 0 6px 0 rgba(0, 0, 0, .1);
}
.ptile .lbl { font-size: 26px; font-weight: bold; margin-top: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptile.add .ava { width: 120px; height: 120px; background: #eef1f7; color: #6b7280; }
.ptile.add .ava svg { width: 64px; height: 64px; margin: 28px auto; }
.form h2 { font-size: 34px; margin: 6px 0; }
.form p { font-size: 24px; margin: 6px 0 14px; }
.form input {
  width: 380px; max-width: 90%; height: 76px; font-size: 36px; text-align: center; outline: none;
  border: 4px solid #dde1ea; border-radius: 24px; -webkit-user-select: text; user-select: text;
}
.colors { margin: 18px 0 4px; }
.colors button { display: inline-block; width: 64px; height: 64px; border-radius: 32px; margin: 8px; border: 5px solid #fff; box-shadow: 0 0 0 2px #dde1ea; }
.colors button.on { box-shadow: 0 0 0 5px #2b2d42; }

/* ---- dla rodzica ---- */
.panel { max-width: 780px; margin: 0 auto; text-align: left; }
.row { background: #fff; border-radius: 22px; padding: 16px 20px; margin: 12px 0; box-shadow: 0 3px 0 rgba(0, 0, 0, .06); }
.row h3 { margin: 0 0 6px; font-size: 22px; }
.row p { margin: 4px 0 10px; color: #4b5563; font-size: 18px; }
.seg { display: inline-block; vertical-align: middle; border-radius: 26px; background: #eef1f7; padding: 4px; margin: 4px 10px 4px 0; }
.seg button { display: inline-block; height: 48px; padding: 0 22px; border-radius: 22px; font-size: 20px; font-weight: bold; color: #4b5563; }
.seg button.on { background: #1d4ed8; color: #fff; }
.sbtn { display: inline-block; vertical-align: middle; height: 52px; padding: 0 22px; margin: 4px 10px 4px 0; border-radius: 26px; background: #eef1f7; font-size: 20px; font-weight: bold; }
.sbtn.danger { background: #ffe2e9; color: #c81e4a; }
.prow { padding: 6px 0; font-size: 22px; font-weight: bold; }
.prow .ava { margin-right: 10px; }
.mono { font-family: monospace; font-size: 14px; color: #4b5563; white-space: pre-wrap; word-wrap: break-word; -webkit-user-select: text; user-select: text; }

.panel-h { font-size: 26px; margin: 26px 0 4px 6px; }
.sbtn.go { background: #2fbf65; color: #fff; }
.kid { padding: 10px 0 14px; border-top: 2px solid #eef1f7; }
.kid:first-child { border-top: 0; }
.kstat { display: inline-block; font-size: 17px; font-weight: bold; color: #6b7280; margin-left: 12px; }
.kstat svg { display: inline-block; vertical-align: middle; width: 20px; height: 20px; color: #f6b400; margin: -3px 2px 0 0; }
.field {
  display: inline-block; vertical-align: middle; height: 54px; width: 260px; max-width: 100%; margin: 4px 10px 4px 0; padding: 0 14px;
  font-size: 22px; border: 3px solid #dde1ea; border-radius: 16px; outline: none; background: #fff; -webkit-user-select: text; user-select: text;
}
.field.code { width: 200px; letter-spacing: 2px; }
.field.big { display: block; margin: 10px auto; width: 380px; height: 72px; font-size: 30px; text-align: center; }
.colors.small { margin: 6px 0; }
.colors.small button { width: 46px; height: 46px; margin: 4px 6px 4px 0; }
.errmsg { min-height: 30px; margin: 8px 0; font-size: 20px; font-weight: bold; color: #c81e4a; }

/* kod dziecka */
.code-dots { margin: 18px 0 6px; white-space: nowrap; }
.code-dots span { display: inline-block; width: 46px; height: 46px; margin: 0 10px; border-radius: 23px; border: 5px solid #9aa6b8; background: #fff; }
.code-dots span.on { background: #1d4ed8; border-color: #1d4ed8; }
.code-dots.bad span { border-color: #ef476f; -webkit-animation: shake .45s; animation: shake .45s; }
.mq-in .ava { margin-bottom: 8px; }

/* ---- moje wyniki ---- */
.res { max-width: 920px; margin: 0 auto; }
.res-head { white-space: nowrap; margin: 2px 0 8px; }
.res-head .nm { display: inline-block; vertical-align: middle; font-size: 34px; font-weight: bold; margin: 0 18px 0 14px; }
.res-head .big {
  display: inline-block; vertical-align: middle; padding: 4px 24px 4px 14px; border-radius: 40px;
  background: #fff3c4; color: #a16207; font-size: 46px; font-weight: bold;
}
.res-head .big svg { display: inline-block; vertical-align: middle; width: 56px; height: 56px; color: #f6b400; margin: -8px 6px 0 0; }
.stat { display: inline-block; vertical-align: top; width: 270px; margin: 8px; padding: 12px 10px; border-radius: 26px; box-shadow: 0 5px 0 rgba(0, 0, 0, .08); }
.stat .v { font-size: 56px; font-weight: bold; line-height: 66px; }
.stat .l { font-size: 20px; font-weight: bold; color: #4b5563; }
.stat .s { font-size: 20px; font-weight: bold; color: #a16207; height: 26px; }
.stat .s svg { display: inline-block; vertical-align: middle; width: 24px; height: 24px; color: #f6b400; margin: -4px 4px 0 0; }
.st1 { background: #c8f1fa; } .st2 { background: #ffd6e0; } .st3 { background: #d4f5e4; }
.cal { margin: 10px 8px; padding: 12px 6px 12px; border-radius: 26px; background: #fff; white-space: nowrap; overflow: hidden; }
.cal .d { display: inline-block; vertical-align: top; width: 54px; margin: 0 2px; font-size: 16px; font-weight: bold; color: #6b7280; }
.cal .c { width: 44px; height: 44px; line-height: 38px; margin: 6px auto 0; border-radius: 22px; border: 3px solid #dde1ea; font-size: 17px; color: #fff; }
.cal .c.l1 { background: #a7e8bd; border-color: #a7e8bd; color: #13803f; }
.cal .c.l2 { background: #2fbf65; border-color: #2fbf65; }
.cal .c.l3 { background: #13803f; border-color: #13803f; }
.cal .d.now { color: #1d4ed8; }
.cal .d.now .c { border-color: #1d4ed8; }
.sec { margin: 10px 8px; padding: 14px 20px; border-radius: 26px; background: #fff; text-align: left; }
.sec h3 { margin: 0 0 8px; font-size: 22px; }
.bar-row { margin: 10px 0; white-space: nowrap; }
.bar-row .t { display: inline-block; vertical-align: middle; width: 190px; font-size: 20px; font-weight: bold; }
.bar { display: inline-block; vertical-align: middle; width: 45%; height: 22px; border-radius: 11px; background: #eef1f7; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 11px; background: #2fbf65; }
.bar-row .n { display: inline-block; vertical-align: middle; margin-left: 12px; font-size: 18px; font-weight: bold; color: #6b7280; }
.score-mini { display: inline-block; vertical-align: middle; width: 120px; font-size: 20px; font-weight: bold; color: #a16207; }
.score-mini svg { display: inline-block; vertical-align: middle; width: 24px; height: 24px; color: #f6b400; margin: -4px 4px 0 0; }
.rec { padding: 9px 0; border-top: 2px solid #eef1f7; font-size: 20px; }
.rec:first-of-type { border-top: 0; }
.rec .when { float: right; font-size: 16px; color: #6b7280; margin-top: 3px; }
.rec .lbl { font-weight: bold; margin-right: 10px; }
.rec .rs { display: inline-block; vertical-align: middle; color: #a16207; font-weight: bold; }
.rec .rs svg { display: inline-block; vertical-align: middle; width: 22px; height: 22px; color: #dde1ea; margin: -3px 1px 0; }
.rec .rs svg.on, .rec .rs > svg:first-child:last-of-type { color: #f6b400; }
.empty { color: #6b7280; font-size: 20px; }

/* ---- animacje ---- */
@-webkit-keyframes pop { from { -webkit-transform: scale(.6); opacity: 0; } to { -webkit-transform: scale(1); opacity: 1; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@-webkit-keyframes hop { 0%, 100% { -webkit-transform: translateY(0); } 50% { -webkit-transform: translateY(-10px); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@-webkit-keyframes shake {
  0%, 100% { -webkit-transform: translateX(0); } 20% { -webkit-transform: translateX(-12px); }
  40% { -webkit-transform: translateX(12px); } 60% { -webkit-transform: translateX(-8px); } 80% { -webkit-transform: translateX(8px); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); } 20% { transform: translateX(-12px); }
  40% { transform: translateX(12px); } 60% { transform: translateX(-8px); } 80% { transform: translateX(8px); }
}

/* ---- wąski ekran (tablet pionowo) ---- */
@media (max-width: 860px) {
  .top .title { font-size: 24px; left: 130px; right: 130px; }
  .tile { width: 220px; margin: 10px; }
  .tbtn { width: 110px; margin: 0 5px; }
  .tbtn.go { width: 150px; }
  .bubble { font-size: 24px; max-width: 420px; }
}
/* ---- telefon (rodzic sprawdza wyniki) ---- */
@media (max-width: 600px) {
  .top .title { left: 76px; right: 76px; font-size: 22px; }
  .stat { width: 31%; margin: 6px 1%; padding: 10px 4px; }
  .stat .v { font-size: 38px; line-height: 46px; }
  .stat .l, .stat .s { font-size: 15px; }
  .res-head .nm { font-size: 26px; margin: 0 10px; }
  .res-head .big { font-size: 34px; }
  .bar-row { white-space: normal; }
  .bar-row .t { display: block; width: auto; }
  .bar { width: 70%; }
  .sec, .row { padding: 12px 14px; }
  .field.big { width: 90%; }
}
/* ---- niski ekran (widoczny pasek przeglądarki, telefon) ---- */
@media (max-height: 680px) {
  .mq { bottom: 176px; }
  .pad { height: 176px; }
  .key { height: 74px; line-height: 74px; width: 88px; margin: 4px; font-size: 44px; }
  .key svg { margin-top: 12px; }
  .cbtn { height: 140px; } .cbtn b { font-size: 76px; line-height: 92px; }
  .expr { font-size: 62px; }
  .slot, .seq .box, .seq .slot { height: 88px; line-height: 78px; font-size: 62px; min-width: 100px; }
  .cmpnum .n { font-size: 70px; line-height: 84px; }
  .owlbox, .owlbox svg { width: 100px; height: 100px; }
}
