﻿/* =============================================================================
   «Игры» ученика (MyGames.aspx, 09.11.2026) — поверх css/tgame.css и css/quiz.css.
   Цвета механик — как у учителя в css/gamehub.css: викторина — синий, захват — зелёный, квест — золотой;
   тренажёр — фиолетовый, студия — бирюзовый, арена — кирпичный.
   ============================================================================= */
.mg { --mg-c: var(--tg-navy); --mg-soft: #e9f0f8; }
.mg .mg-k-quiz   { --mg-c: #2f5578; --mg-soft: #e9f0f8; }
.mg .mg-k-game   { --mg-c: #1e7a46; --mg-soft: #e4f3ea; }
.mg .mg-k-quest  { --mg-c: #b07612; --mg-soft: #fbf0d6; }
.mg .mg-k-kb     { --mg-c: #6a3f9e; --mg-soft: #f1e9fa; }
.mg .mg-k-studio { --mg-c: #0e7c86; --mg-soft: #e0f2f3; }
.mg .mg-k-arena  { --mg-c: #a23b2b; --mg-soft: #fdecea; }

/* обычные ссылки в тексте (кнопки tg-btn / tgd-act задают цвет сами) */
.mg .mg-empty a, .mg .tg-muted a, .mg .mg-foot-note a, .mg .mg-foot a { color: var(--tg-navy); }

/* ---------- вход по PIN ---------- */
.mg-pin { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mg-pin-hint { font-size: 12px; color: var(--tg-mute); text-align: right; }

/* ---------- сводка ---------- */
.mg-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.mg-tile {
    display: flex; flex-direction: column; padding: 12px 16px; color: var(--tg-ink);
    background: #fff; border: 1px solid var(--tg-line); border-left: 4px solid var(--tg-line);
}
.mg a.mg-tile { color: var(--tg-ink); text-decoration: none; }
.mg a.mg-tile:hover { border-color: var(--tg-accent); text-decoration: none; }
.mg-tile b { font: 800 28px/1.1 "Nunito Sans", system-ui, sans-serif; color: var(--tg-navy); }
.mg-tile span { font-weight: 700; font-size: 14px; }
.mg-tile small { margin-top: 2px; font-size: 12.5px; color: var(--tg-mute); }
.mg-tile-hot { border-left-color: var(--tg-danger); }
.mg-tile-hot b { color: var(--tg-danger); }

/* ---------- строки «Ждут вас» и «Последние игры» ---------- */
.mg-ico {
    display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px;
    font-size: 16px; color: var(--mg-c); background: var(--mg-soft); border-radius: 9px;
}
.mg-list { border-top: 1px solid var(--tg-line); }
.mg-row {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px 16px; align-items: center;
    padding: 12px 4px; border-bottom: 1px solid var(--tg-line);
}
.mg-row:last-child { border-bottom: 0; }
.mg-row-urgent { background: #fffaf0; }
.mg-row-live { background: #f1faf4; }
.mg-row-name { font-weight: 800; font-size: 15.5px; line-height: 1.25; overflow-wrap: anywhere; }
.mg-row-kind { font-weight: 700; color: var(--mg-c); }
.mg-row .tgd-chips { justify-content: flex-end; }
.mg-row .tgd-acts { justify-content: flex-end; }
.mg-row .tgd-act { white-space: nowrap; }
.mg .qzp-st { white-space: normal; }
.mg-st-live { color: #fff; background: var(--tg-ok); }
.mg-st-live i { animation: mg-blink 1.6s ease-in-out infinite; }
@keyframes mg-blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .mg-st-live i { animation: none; } }
.mg-empty { padding: 24px 16px 18px; }
.mg-empty p { max-width: 560px; margin: 0 auto; }
.mg-foot-note { margin: 10px 0 0; font-size: 12.5px; color: var(--tg-mute); }

/* ---------- карточки механик ---------- */
.mg-title { margin: 22px 0 10px; font: 800 18px/1.2 "Nunito Sans", system-ui, sans-serif; color: var(--tg-ink); }
.mg-title .mg-beta { vertical-align: 3px; }
.mg-beta {
    display: inline-block; padding: 1px 8px; font: 700 11px/1.5 "Nunito Sans", sans-serif; color: var(--tg-mute);
    background: var(--tg-cream); border: 1px solid var(--tg-line); border-radius: 999px;
}
.mg-mechs-make { align-items: start; }
.mg-mechs { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 8px; }
.mg-mech {
    display: flex; flex-direction: column; padding: 16px 16px 14px; background: #fff;
    border: 1px solid var(--tg-line); border-top: 4px solid var(--mg-c);
}
.mg-mech-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.mg-mech-ico {
    display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px;
    font-size: 20px; color: var(--mg-c); background: var(--mg-soft); border-radius: 12px;
}
.mg-mech-t { min-width: 0; }
.mg-mech-head h3 { margin: 0; font: 800 17px/1.2 "Nunito Sans", system-ui, sans-serif; }
.mg .mg-mech-head h3 a { color: var(--tg-ink); text-decoration: none; }
.mg .mg-mech-head h3 a:hover { color: var(--mg-c); }
.mg .mg-rules-link { font-size: 12.5px; font-weight: 700; color: var(--mg-c); text-decoration: none; white-space: nowrap; }
.mg .mg-rules-link:hover { text-decoration: underline; }
.mg-lead { margin: 0 0 12px; font-size: 13.5px; color: var(--tg-ink-soft); }
.mg-mech-foot { margin-top: auto; }
.mg-nums { display: flex; margin: 0 0 12px; border: 1px solid var(--tg-line); border-radius: 8px; }
.mg-nums > div {
    display: flex; flex-direction: column; justify-content: space-between; flex: 1 1 0; min-width: 0;
    padding: 6px 9px; border-left: 1px solid var(--tg-line);
}
.mg-nums > div:first-child { border-left: 0; }
.mg-nums dt { font-size: 11px; font-weight: 600; line-height: 1.2; color: var(--tg-mute); }
.mg-nums dd { margin: 2px 0 0; font: 800 19px/1.1 "Nunito Sans", sans-serif; color: var(--tg-ink); white-space: nowrap; }
.mg-nums .mg-hot dd { color: var(--tg-danger); }
.mg-note { margin: 0 0 12px; padding: 8px 10px; font-size: 12.5px; color: var(--tg-warn); background: #fff7e3; border-radius: 6px; }
.mg-projects { margin: 0 0 12px; padding: 0; list-style: none; font-size: 13.5px; }
.mg-projects li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dashed var(--tg-line); }
.mg-projects li:last-child { border-bottom: 0; }
.mg .mg-projects a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--tg-ink); }
.mg .mg-projects a i { color: var(--mg-c); }
.mg .mg-projects a:hover { color: var(--mg-c); }
.mg-projects span { flex: none; font-size: 12px; color: var(--tg-mute); }
.mg-mech-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.mg .mg-mech-acts .tg-btn { padding: 8px 13px; font-size: 14px; }
.mg .mg-mech-acts .tg-btn-primary { background: var(--mg-c); color: #fff; }
.mg .mg-mech-acts .tg-btn-primary:hover { filter: brightness(.9); }
.mg .mg-mech-acts .tg-btn-ghost { color: var(--tg-ink); }

/* ---------- гость, подвал ---------- */
.mg-guest p { margin: 0 0 12px; color: var(--tg-ink-soft); }
.mg-history { margin-top: 18px; }
.mg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; margin: 4px 0 0; font-size: 13px; color: var(--tg-mute); }
.mg-foot > span + span { margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--tg-line); }
.mg .mg-foot a { font-weight: 700; text-decoration: none; }
.mg .mg-foot a:hover { text-decoration: underline; }

@media (max-width: 760px) {
    .mg-pin { align-items: stretch; width: 100%; }
    .mg-pin-hint { text-align: left; }
    .mg-row { grid-template-columns: auto minmax(0, 1fr); }
    .mg-row .tgd-chips, .mg-row .tgd-acts { grid-column: 2; justify-content: flex-start; }
    .mg-foot { flex-direction: column; align-items: flex-start; }
    .mg-foot > span + span { margin-left: 0; padding-left: 0; border-left: 0; }
}
