/* PequeCoders · estilos de los mini-juegos (.gk) */
.gk { max-width: 920px; margin: 0 auto; font-family: "Fredoka", "Segoe UI", system-ui, sans-serif; color: #1e293b; }
.gk * { box-sizing: border-box; }
.gk-hidden { display: none !important; }

.gk-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.gk-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.gk-tab { border: 3px solid transparent; background: #fff; border-radius: 16px; padding: 8px 14px; font: 600 1rem inherit; font-family: inherit; cursor: pointer; color: #4338ca; box-shadow: 0 3px 0 #c7d2fe; text-align: left; line-height: 1.2; }
.gk-tab b { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: #4338ca; color: #fff; align-items: center; justify-content: center; font-size: .85rem; margin-right: 4px; }
.gk-tab small { display: block; font-size: .8rem; margin-top: 2px; }
.gk-tab.on { border-color: #4338ca; background: #eef2ff; }
.gk-total { font-weight: 700; background: #fde68a; color: #78350f; padding: 8px 14px; border-radius: 999px; }

.gk-card { background: #fff; border-radius: 28px; padding: 22px; box-shadow: 0 10px 30px rgba(49, 46, 129, .15); }
.gk-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.gk-lvl { font-weight: 700; color: #6366f1; font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; }
.gk-prog { display: flex; gap: 6px; }
.gk-prog i { width: 14px; height: 14px; border-radius: 50%; background: #e2e8f0; }
.gk-prog i.ok { background: #22c55e; }
.gk-prog i.now { background: #fbbf24; box-shadow: 0 0 0 3px #fef3c7; }
.gk-q { font-size: 1.45rem; font-weight: 700; margin: 10px 0 14px; line-height: 1.3; color: #312e81; }
.gk-q code, .gk-say code, .gk-code { font-family: Consolas, "Courier New", monospace; }
.gk-q code { background: #eef2ff; padding: 1px 8px; border-radius: 8px; font-size: 1.1rem; }

.gk-stage { min-height: 150px; padding: 8px 0 14px; }
.gk-stage.shake { animation: gk-shake .35s; }
@keyframes gk-shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

.gk-bit { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding-top: 14px; border-top: 3px dashed #e0e7ff; flex-wrap: wrap; }
.gk-bit img { flex: none; }
.gk-say { flex: 1; min-width: 200px; background: #eef2ff; border-radius: 18px; padding: 12px 16px; font-size: 1.05rem; position: relative; }
.gk-say.good { background: #dcfce7; color: #14532d; }
.gk-say.bad { background: #fee2e2; color: #7f1d1d; }
.gk-say code { background: rgba(255,255,255,.7); padding: 0 6px; border-radius: 6px; }

.gk-btn { font: 700 1.1rem "Fredoka", system-ui, sans-serif; border: 0; border-radius: 16px; padding: 12px 22px; background: #22c55e; color: #fff; cursor: pointer; box-shadow: 0 4px 0 #15803d; transition: transform .08s; }
.gk-btn:hover { filter: brightness(1.07); }
.gk-btn:active { transform: translateY(3px); box-shadow: none; }
.gk-btn.alt { background: #6366f1; box-shadow: 0 4px 0 #3730a3; }
.gk-btn.next { background: #f59e0b; box-shadow: 0 4px 0 #b45309; animation: gk-pop .4s; }
@keyframes gk-pop { from { transform: scale(.8); } to { transform: scale(1); } }
.gk-btn:disabled { opacity: .5; cursor: not-allowed; }

.gk-choices { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.gk-btn.choice { background: #fff; color: #312e81; border: 3px solid #c7d2fe; box-shadow: 0 4px 0 #c7d2fe; font-family: Consolas, "Courier New", monospace; font-weight: 700; }
.gk-btn.choice.txt { font-family: "Fredoka", system-ui, sans-serif; }
.gk-btn.choice.good { background: #bbf7d0; border-color: #16a34a; box-shadow: 0 4px 0 #16a34a; }
.gk-btn.choice.bad { background: #fecaca; border-color: #dc2626; box-shadow: 0 4px 0 #dc2626; }
.gk-btn.choice.yes { border-color: #16a34a; box-shadow: 0 4px 0 #16a34a; font-family: "Fredoka", system-ui, sans-serif; min-width: 150px; }
.gk-btn.choice.no { border-color: #dc2626; box-shadow: 0 4px 0 #dc2626; font-family: "Fredoka", system-ui, sans-serif; min-width: 150px; }
.gk-btn.choice.big { font-size: 1.4rem; padding: 14px 30px; }

.gk-number { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 14px; }
.gk-number input { width: 140px; font: 700 1.6rem Consolas, monospace; text-align: center; padding: 10px; border: 3px solid #a5b4fc; border-radius: 16px; background: #eef2ff; color: #312e81; }
.gk-number input:focus { outline: none; border-color: #4338ca; background: #fff; }

.gk-code { background: #1e1b4b; color: #e0e7ff; border-radius: 16px; padding: 14px 18px; font-size: 1.1rem; line-height: 1.7; margin: 8px 0; display: inline-block; min-width: min(100%, 320px); max-width: 100%; overflow-x: auto; }
.gk-code .gk-line b { color: #fcd34d; }
.gk-code .gk-line em { color: #86efac; font-style: normal; }
.gk-code .gk-line i { color: #a5b4fc; font-style: normal; }

.gk-vars { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }
.gk-var { border: 3px solid #1d4ed8; border-radius: 14px; background: #dbeafe; padding: 4px 14px 8px; text-align: center; min-width: 96px; }
.gk-var .n { display: block; font-weight: 700; font-size: .9rem; color: #1e3a8a; }
.gk-var .v { display: block; font: 700 1.5rem Consolas, monospace; background: #fff; border-radius: 8px; padding: 2px 10px; }
.gk-var.calc { border-color: #d97706; background: #fef3c7; }
.gk-var.bool { border-color: #c026d3; background: #fae8ff; }
.gk-var.bool .v { font-size: 1.1rem; color: #86198f; }
.gk-var.txt { border-color: #16a34a; background: #dcfce7; }

.gk-cells { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.gk-cellw { text-align: center; }
.gk-cell { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border: 3px solid #4338ca; border-radius: 12px; background: #eef2ff; font: 700 1.6rem Consolas, "Segoe UI Emoji", sans-serif; color: #1e1b4b; padding: 0; }
button.gk-cell { cursor: pointer; transition: transform .1s; }
button.gk-cell:hover { transform: translateY(-3px); background: #e0e7ff; }
.gk-cell.good, .gk-cell.hit { background: #bbf7d0; border-color: #16a34a; }
.gk-cell.bad { background: #fecaca; border-color: #dc2626; }
.gk-cell.miss { background: #bae6fd; border-color: #0284c7; font-size: 1.3rem; }
.gk-cell.sq { width: 100%; max-width: 76px; aspect-ratio: 1; height: auto; }
.gk-idx { font: 700 .95rem Consolas, monospace; color: #4338ca; margin-top: 3px; }
.gk-idx.hide { visibility: hidden; }

.gk-matrix { display: inline-grid; gap: 6px; align-items: center; margin: 12px 0; max-width: 100%; }
.gk-ax { font: 700 1rem Consolas, monospace; color: #fff; background: #4338ca; border-radius: 10px; min-width: 34px; padding: 4px 8px; text-align: center; }
.gk-ax small { display: block; font-size: .72rem; color: #fde68a; }

.gk-track { display: flex; gap: 4px; margin: 14px 0; }
.gk-tile { flex: 1; max-width: 70px; aspect-ratio: 1; border-radius: 12px; background: #e0e7ff; border: 3px solid #a5b4fc; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; position: relative; }
.gk-tile.goal { background: #fef9c3; border-color: #f59e0b; }
.gk-tile small { position: absolute; bottom: -22px; font: 700 .8rem Consolas, monospace; color: #6366f1; }
.gk-track-wrap { padding-bottom: 24px; }
.gk-loop { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #fde68a; border: 3px solid #d97706; border-radius: 16px; padding: 12px 16px; font-weight: 700; margin: 8px 0; }
.gk-loop .stepper { display: inline-flex; align-items: center; gap: 6px; }
.gk-loop .stepper button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #4338ca; color: #fff; font: 700 1.4rem inherit; cursor: pointer; }
.gk-loop .stepper output { font: 700 1.6rem Consolas, monospace; min-width: 40px; text-align: center; background: #fff; border-radius: 10px; padding: 2px 8px; }

.gk-diamond { display: inline-block; background: #fef3c7; border: 4px solid #d97706; border-radius: 14px; padding: 10px 22px; font: 700 1.4rem Consolas, monospace; margin: 6px 0; }
.gk-person { display: inline-flex; align-items: center; gap: 14px; background: #eef2ff; border-radius: 20px; padding: 10px 20px; margin: 8px 12px 8px 0; font-size: 1.1rem; }
.gk-person .face { font-size: 2.6rem; }

.gk-machine { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; }
.gk-pair { background: #fef3c7; border: 3px solid #d97706; border-radius: 14px; padding: 8px 16px; font: 700 1.2rem Consolas, monospace; }

.gk-result { text-align: center; padding: 10px 0; }
.gk-result .big { font-size: 3rem; letter-spacing: 6px; }
.gk-result p { font-size: 1.15rem; margin-top: 6px; }
.gk-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 10px; }
.gk-after { text-align: center; margin: 10px 0; font-size: 1.05rem; }
.gk-after a { color: #4338ca; font-weight: 700; text-decoration: underline; }

@media (max-width: 560px) {
  .gk-card { padding: 16px; }
  .gk-q { font-size: 1.2rem; }
  .gk-cell { width: 52px; height: 52px; font-size: 1.3rem; }
  .gk-tab { padding: 6px 10px; font-size: .9rem; }
}
