#word-game,
#word-game * {
  font-family: "MUNI", "Inter", "Segoe UI", Roboto, Arial, Helvetica, sans-serif !important;
  letter-spacing: 0 !important;
}

.word-game-head {
  border-left: 14px solid var(--muni-blue) !important;
}

.word-game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.word-game-arena,
.word-game-leaderboard {
  background: #fff;
  border: 1px solid var(--muni-line);
  box-shadow: none;
}

.word-game-arena {
  padding: 18px;
}

.word-game-player-row {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.word-game-name-form label {
  display: block;
  color: #111827;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 7px;
}

.word-game-name-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.word-game-name-controls input,
.word-game-name-controls button,
.word-game-actions button,
.word-game-controls button,
.word-game-leaderboard-head button {
  border-radius: 0;
  border: 1px solid var(--muni-blue);
  min-height: 44px;
  font-weight: 950;
}

.word-game-name-controls input {
  width: 100%;
  background: #fff;
  color: #000;
  padding: 11px 12px;
  outline: none;
}

.word-game-name-controls input:focus {
  border-color: var(--muni-blue);
  box-shadow: 0 0 0 3px rgba(0, 0, 220, .14);
}

.word-game-name-controls button,
.word-game-actions button:first-child {
  background: var(--muni-blue);
  color: #fff;
  cursor: pointer;
  padding: 0 14px;
}

.word-game-score-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--muni-line);
  background: #f7f7f7;
}

.word-game-score-strip div {
  min-height: 62px;
  padding: 10px 12px;
  border-right: 1px solid var(--muni-line);
}

.word-game-score-strip div:last-child {
  border-right: 0;
}

.word-game-score-strip span,
.word-game-panel-block span,
.word-game-progress span,
.word-game-leaderboard-head p {
  display: block;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

.word-game-score-strip strong,
.word-game-panel-block strong {
  display: block;
  color: #000;
  font-size: 22px;
  font-weight: 950;
  line-height: 1.1;
  margin-top: 4px;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

.word-game-core {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(220px, 300px);
  gap: 16px;
  align-items: start;
}

.word-game-board-shell {
  position: relative;
  width: min(100%, 420px);
  border: 10px solid #111827;
  background: #111827;
  justify-self: center;
}

#wordGameCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 10 / 18;
  background: #f8fafc;
  touch-action: none;
  user-select: none;
}

.word-game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, .82);
  color: #fff;
  text-align: center;
}

.word-game-overlay[hidden] {
  display: none;
}

.word-game-overlay strong {
  display: block;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 950;
}

.word-game-overlay p {
  margin: 8px auto 0;
  max-width: 260px;
  color: #e5e7eb;
  line-height: 1.42;
}

.word-game-panel {
  display: grid;
  gap: 10px;
}

.word-game-panel-block,
.word-game-progress {
  border: 1px solid var(--muni-line);
  background: #fff;
  padding: 12px;
}

.word-game-panel-block.next {
  border-left: 10px solid #007b69;
}

.word-game-panel-block.next strong {
  color: var(--muni-blue);
  font-size: 20px;
}

.word-game-progress-bar {
  width: 100%;
  height: 12px;
  margin-top: 9px;
  border: 1px solid var(--muni-line);
  background: #f1f5f9;
  overflow: hidden;
}

.word-game-progress-bar i {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--muni-blue), #007b69);
  transition: width .18s ease;
}

.word-game-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.word-game-controls button,
.word-game-actions button:nth-child(2),
.word-game-leaderboard-head button {
  background: #fff;
  color: var(--muni-blue);
  cursor: pointer;
  font-size: 20px;
}

.word-game-controls button:active,
.word-game-actions button:active,
.word-game-leaderboard-head button:active {
  transform: translateY(1px);
}

.word-game-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.word-game-actions button {
  cursor: pointer;
}

.word-game-actions button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.word-game-leaderboard {
  padding: 0;
  overflow: hidden;
}

.word-game-leaderboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  background: var(--muni-blue);
  color: #fff;
}

.word-game-leaderboard-head h3 {
  margin: 0;
  color: #fff;
  font-size: 22px;
  font-weight: 950;
}

.word-game-leaderboard-head p {
  margin: 3px 0 0;
  color: #e8e8ff;
}

.word-game-leaderboard-head button {
  width: 44px;
  min-width: 44px;
  border-color: #fff;
  color: #fff;
  background: transparent;
}

.word-game-score-table {
  min-height: 340px;
  background: #fff;
}

.word-game-score-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 76px;
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--muni-line);
}

.word-game-score-row:nth-child(even) {
  background: #f7f7f7;
}

.word-game-score-rank {
  color: #64748b;
  font-weight: 950;
  text-align: right;
}

.word-game-score-name {
  min-width: 0;
}

.word-game-score-name strong {
  display: block;
  overflow: hidden;
  color: #000;
  font-size: 15px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-game-score-name span {
  display: block;
  color: #64748b;
  font-size: 12px;
  line-height: 1.25;
  margin-top: 2px;
}

.word-game-score-value {
  color: var(--muni-blue);
  font-size: 18px;
  font-weight: 950;
  text-align: right;
}

.word-game-score-empty {
  padding: 24px;
  color: #475569;
  line-height: 1.5;
}

body.theme-dark #word-game .word-game-arena,
body.theme-dark #word-game .word-game-leaderboard,
body.theme-dark #word-game .word-game-panel-block,
body.theme-dark #word-game .word-game-progress,
body.theme-dark #word-game .word-game-score-table,
body.theme-dark #word-game .word-game-name-controls input,
body.theme-dark #word-game .word-game-score-strip {
  background: #171f29 !important;
  border-color: rgba(255, 255, 255, .14) !important;
  color: #f3f7fc !important;
}

body.theme-dark #word-game .word-game-score-strip strong,
body.theme-dark #word-game .word-game-panel-block strong,
body.theme-dark #word-game .word-game-name-form label,
body.theme-dark #word-game .word-game-score-name strong {
  color: #f3f7fc !important;
}

body.theme-dark #word-game .word-game-score-strip span,
body.theme-dark #word-game .word-game-panel-block span,
body.theme-dark #word-game .word-game-progress span,
body.theme-dark #word-game .word-game-score-name span,
body.theme-dark #word-game .word-game-score-empty {
  color: #dbe5ef !important;
}

body.theme-dark #word-game .word-game-score-row:nth-child(even) {
  background: #10161e !important;
}

body.theme-dark #word-game .word-game-controls {
  background: rgba(16, 22, 30, .96) !important;
  border-color: rgba(255, 255, 255, .16) !important;
}

body.word-game-active .theme-toggle-btn {
  display: none !important;
}

@media (max-width: 1180px) {
  .word-game-layout {
    grid-template-columns: 1fr;
  }

  .word-game-leaderboard {
    max-width: 760px;
  }
}

@media (max-width: 900px) {
  .word-game-player-row,
  .word-game-core {
    grid-template-columns: 1fr;
  }

  .word-game-board-shell {
    width: min(100%, 390px);
  }
}

@media (max-width: 760px) {
  body {
    --bottom-nav-height: 176px !important;
  }

  body.word-game-active {
    --bottom-nav-height: 92px !important;
  }

  body.mobile-sidebar-condensed {
    --bottom-nav-height: 92px !important;
  }

  body.word-game-active .hero,
  body.word-game-active #examCountdown,
  body.word-game-active .promo-banner,
  body.word-game-active .footer {
    display: none !important;
  }

  body.word-game-active main {
    padding: 8px 8px 76px !important;
  }

  body.word-game-active .toast {
    bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 72px) !important;
  }

  body.word-game-active .word-game-head {
    margin: 0 0 8px !important;
    padding: 13px 14px !important;
  }

  body.word-game-active .word-game-head h2 {
    font-size: 26px !important;
    line-height: 1 !important;
  }

  body.word-game-active .word-game-head p {
    font-size: 13px !important;
    line-height: 1.3 !important;
  }

  .sidebar {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    min-height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)) !important;
  }

  body.word-game-active .sidebar-extra,
  body.word-game-active .local-progress-card {
    display: none !important;
  }

  .nav-btn {
    min-height: 58px !important;
    font-size: 9.5px !important;
    padding: 7px 3px !important;
  }

  .word-game-arena {
    padding: 8px;
  }

  .word-game-player-row {
    gap: 8px;
    margin-bottom: 8px;
  }

  .word-game-name-form label {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .word-game-name-controls {
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 6px;
  }

  .word-game-name-controls input,
  .word-game-name-controls button {
    min-height: 42px;
    padding: 8px 9px;
    font-size: 15px;
  }

  .word-game-score-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .word-game-actions {
    grid-template-columns: 1fr;
  }

  .word-game-score-strip div {
    min-height: 48px;
    padding: 7px 8px;
    border-right: 1px solid var(--muni-line);
    border-bottom: 0;
  }

  .word-game-score-strip div:last-child {
    border-right: 0;
  }

  .word-game-score-strip span,
  .word-game-panel-block span,
  .word-game-progress span {
    font-size: 10.5px;
  }

  .word-game-score-strip strong,
  .word-game-panel-block strong {
    font-size: 16px;
  }

  .word-game-core {
    gap: 8px;
  }

  .word-game-board-shell {
    width: min(100%, 320px, calc(100dvh - var(--bottom-nav-height) - 300px));
    min-width: 280px;
    border-width: 7px;
  }

  .word-game-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .word-game-panel-block,
  .word-game-progress {
    padding: 8px;
  }

  .word-game-panel-block.next,
  .word-game-progress,
  .word-game-controls,
  .word-game-actions {
    grid-column: 1 / -1;
  }

  .word-game-controls {
    order: -3;
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 8px);
    z-index: 1260;
    padding: 7px;
    border: 1px solid var(--muni-line);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -8px 20px rgba(15, 23, 42, .10);
  }

  .word-game-actions {
    order: -2;
  }

  .word-game-panel-block.next {
    order: -1;
  }

  .word-game-panel-block.next strong {
    font-size: 18px;
  }

  .word-game-controls {
    gap: 7px;
  }

  .word-game-controls button {
    min-height: 54px;
    font-size: 22px;
  }

  .word-game-actions {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .word-game-actions button {
    min-height: 48px;
  }

  .word-game-leaderboard {
    margin-top: 10px;
  }

  .word-game-leaderboard-head {
    padding: 12px;
  }

  .word-game-leaderboard-head h3 {
    font-size: 19px;
  }

  .word-game-score-table {
    min-height: 220px;
  }

  .word-game-score-row {
    grid-template-columns: 28px minmax(0, 1fr) 66px;
    padding: 8px 10px;
  }
}

/* ===== PoliTETRIS mobile stability polish ===== */
.word-game-board-shell,
#wordGameCanvas{
  max-width:100%!important;
}
.word-game-controls button,
.word-game-actions button,
#wordGameCanvas{
  touch-action:manipulation!important;
}
#wordGameCanvas{
  touch-action:none!important;
}
@media (max-width: 760px) {
  body.word-game-active{
    overscroll-behavior:contain!important;
  }
  body.word-game-active .word-game-layout{
    gap:10px!important;
  }
  body.word-game-active .word-game-board-shell{
    width:min(100%, 340px)!important;
    min-width:0!important;
    max-height:calc(100dvh - var(--bottom-nav-height) - 250px)!important;
  }
  body.word-game-active #wordGameCanvas{
    max-height:calc(100dvh - var(--bottom-nav-height) - 264px)!important;
    object-fit:contain!important;
  }
  body.word-game-active .word-game-leaderboard{
    margin-bottom:18px!important;
  }
  body.word-game-active .word-game-controls{
    padding-bottom:calc(7px + env(safe-area-inset-bottom))!important;
  }
}


/* ===== PoliTETRIS: rotace a pět ovládacích tlačítek ===== */
.word-game-controls button[data-word-game-action="rotate"]{
  background: var(--muni-blue);
  color: #fff;
}
.word-game-controls button:focus-visible{
  outline: 3px solid rgba(0, 0, 220, .28);
  outline-offset: 2px;
}
@media (max-width: 760px){
  .word-game-controls{
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
  .word-game-controls button{
    min-width: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* ===== PoliTETRIS compact one-screen layout ===== */
#word-game.active .word-game-head {
  margin: 0 0 10px !important;
  padding: 14px 16px !important;
}

#word-game.active .word-game-layout {
  grid-template-columns: minmax(0, 1fr) 300px !important;
  gap: 12px !important;
}

#word-game.active .word-game-arena {
  padding: 12px !important;
}

#word-game.active .word-game-player-row {
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr) !important;
  gap: 10px !important;
  margin-bottom: 10px !important;
}

#word-game.active .word-game-core {
  grid-template-columns: minmax(250px, auto) minmax(190px, 260px) !important;
  gap: 10px !important;
}

#word-game.active .word-game-board-shell {
  width: min(100%, 360px, calc((100dvh - 210px) * 10 / 18)) !important;
  min-width: 0 !important;
  border-width: 8px !important;
}

#word-game.active .word-game-score-strip div {
  min-height: 48px !important;
  padding: 7px 8px !important;
}

#word-game.active .word-game-score-strip span,
#word-game.active .word-game-panel-block span,
#word-game.active .word-game-progress span {
  font-size: 10px !important;
}

#word-game.active .word-game-score-strip strong,
#word-game.active .word-game-panel-block strong {
  font-size: 17px !important;
}

#word-game.active .word-game-panel {
  gap: 7px !important;
}

#word-game.active .word-game-panel-block,
#word-game.active .word-game-progress {
  padding: 8px !important;
}

#word-game.active .word-game-panel-block.next strong {
  font-size: 18px !important;
}

#word-game.active .word-game-progress-bar {
  height: 9px !important;
  margin-top: 6px !important;
}

#word-game.active .word-game-controls {
  gap: 6px !important;
}

#word-game.active .word-game-controls button,
#word-game.active .word-game-actions button {
  min-height: 40px !important;
}

#word-game.active .word-game-leaderboard {
  max-height: calc(100dvh - 86px) !important;
  overflow: auto !important;
}

#word-game.active .word-game-leaderboard-head {
  padding: 11px 12px !important;
}

#word-game.active .word-game-score-table {
  min-height: 0 !important;
}

#word-game.active .word-game-score-row {
  min-height: 46px !important;
  padding: 6px 10px !important;
}

@media (max-width: 1180px) {
  #word-game.active .word-game-layout {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 900px) {
  #word-game.active .word-game-player-row {
    grid-template-columns: 1fr !important;
  }

  #word-game.active .word-game-core {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 760px) {
  body.word-game-active {
    --bottom-nav-height: 74px !important;
    overflow: hidden !important;
  }

  body.word-game-active main {
    height: calc(100dvh - var(--bottom-nav-height)) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 5px 6px calc(56px + var(--bottom-nav-height) + env(safe-area-inset-bottom)) !important;
  }

  body.word-game-active .sidebar {
    min-height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)) !important;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom)) !important;
    gap: 5px !important;
  }

  body.word-game-active .nav-btn {
    min-height: 46px !important;
    padding: 4px 2px !important;
    font-size: 8.5px !important;
    line-height: 1.08 !important;
  }

  body.word-game-active .nav-btn span {
    font-size: 16px !important;
  }

  body.word-game-active .word-game-head {
    display: none !important;
  }

  body.word-game-active .word-game-layout {
    height: 100% !important;
    max-height: 100% !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  body.word-game-active .word-game-arena {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 5px !important;
  }

  body.word-game-active .word-game-player-row {
    display: grid !important;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr) !important;
    gap: 5px !important;
    align-items: stretch !important;
    margin-bottom: 5px !important;
  }

  body.word-game-active .word-game-name-form label {
    display: none !important;
  }

  body.word-game-active .word-game-name-controls {
    grid-template-columns: minmax(0, 1fr) 54px !important;
    gap: 4px !important;
  }

  body.word-game-active .word-game-name-controls input,
  body.word-game-active .word-game-name-controls button {
    min-height: 34px !important;
    padding: 5px 6px !important;
    font-size: 12px !important;
  }

  body.word-game-active .word-game-score-strip div {
    min-height: 34px !important;
    padding: 4px 5px !important;
  }

  body.word-game-active .word-game-score-strip span,
  body.word-game-active .word-game-panel-block span,
  body.word-game-active .word-game-progress span {
    font-size: 8.5px !important;
    line-height: 1.1 !important;
  }

  body.word-game-active .word-game-score-strip strong,
  body.word-game-active .word-game-panel-block strong {
    font-size: 13px !important;
    line-height: 1.05 !important;
    margin-top: 2px !important;
  }

  body.word-game-active .word-game-core {
    display: grid !important;
    grid-template-columns: minmax(168px, 56vw) minmax(102px, 1fr) !important;
    gap: 5px !important;
    align-items: start !important;
    min-height: 0 !important;
  }

  body.word-game-active .word-game-board-shell {
    width: min(56vw, 330px, calc((100dvh - var(--bottom-nav-height) - 128px) * 10 / 18)) !important;
    min-width: 168px !important;
    max-height: none !important;
    border-width: 5px !important;
    justify-self: start !important;
  }

  body.word-game-active #wordGameCanvas {
    max-height: none !important;
  }

  body.word-game-active .word-game-panel {
    grid-template-columns: 1fr !important;
    gap: 5px !important;
    min-width: 0 !important;
  }

  body.word-game-active .word-game-panel-block,
  body.word-game-active .word-game-progress {
    grid-column: auto !important;
    min-height: 31px !important;
    padding: 5px 6px !important;
  }

  body.word-game-active .word-game-panel-block.next,
  body.word-game-active .word-game-progress {
    order: 0 !important;
  }

  body.word-game-active .word-game-panel-block.next strong {
    font-size: 13px !important;
  }

  body.word-game-active .word-game-progress-bar {
    height: 6px !important;
    margin-top: 4px !important;
  }

  body.word-game-active .word-game-actions {
    grid-column: auto !important;
    grid-template-columns: 1fr !important;
    gap: 4px !important;
    order: 0 !important;
  }

  body.word-game-active .word-game-actions button {
    min-height: 32px !important;
    padding: 4px 5px !important;
    font-size: 11px !important;
  }

  body.word-game-active .word-game-controls {
    left: 6px !important;
    right: 6px !important;
    bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 5px) !important;
    gap: 5px !important;
    padding: 5px !important;
  }

  body.word-game-active .word-game-controls button {
    min-height: 44px !important;
    font-size: 18px !important;
  }

  body.word-game-active .word-game-leaderboard {
    display: none !important;
  }
}

body.word-game-active .hero,
body.word-game-active #examCountdown,
body.word-game-active .promo-banner,
body.word-game-active .donation-backdrop,
body.word-game-active .footer {
  display: none !important;
}

body.word-game-active {
  border-top-width: 0 !important;
  padding-bottom: 0 !important;
}

body.word-game-active main {
  padding-top: 16px !important;
  padding-bottom: 16px !important;
}

@media (max-width: 760px) {
  body.word-game-active #word-game.active .word-game-head {
    display: none !important;
  }

  body.word-game-active #word-game.active .word-game-layout {
    height: 100% !important;
    max-height: 100% !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  body.word-game-active #word-game.active .word-game-arena {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 5px !important;
  }

  body.word-game-active #word-game.active .word-game-player-row {
    display: grid !important;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr) !important;
    gap: 5px !important;
    align-items: stretch !important;
    margin-bottom: 5px !important;
  }

  body.word-game-active #word-game.active .word-game-name-form label {
    display: none !important;
  }

  body.word-game-active #word-game.active .word-game-name-controls {
    grid-template-columns: minmax(0, 1fr) 54px !important;
    gap: 4px !important;
  }

  body.word-game-active #word-game.active .word-game-name-controls input,
  body.word-game-active #word-game.active .word-game-name-controls button {
    min-height: 34px !important;
    padding: 5px 6px !important;
    font-size: 12px !important;
  }

  body.word-game-active #word-game.active .word-game-score-strip div {
    min-height: 34px !important;
    padding: 4px 5px !important;
  }

  body.word-game-active #word-game.active .word-game-score-strip span,
  body.word-game-active #word-game.active .word-game-panel-block span,
  body.word-game-active #word-game.active .word-game-progress span {
    font-size: 8.5px !important;
    line-height: 1.1 !important;
  }

  body.word-game-active #word-game.active .word-game-score-strip strong,
  body.word-game-active #word-game.active .word-game-panel-block strong {
    font-size: 13px !important;
    line-height: 1.05 !important;
    margin-top: 2px !important;
  }

  body.word-game-active #word-game.active .word-game-core {
    display: grid !important;
    grid-template-columns: minmax(168px, 56vw) minmax(102px, 1fr) !important;
    gap: 5px !important;
    align-items: start !important;
    min-height: 0 !important;
  }

  body.word-game-active #word-game.active .word-game-board-shell {
    width: min(56vw, 330px, calc((100dvh - var(--bottom-nav-height) - 128px) * 10 / 18)) !important;
    min-width: 168px !important;
    max-height: none !important;
    border-width: 5px !important;
    justify-self: start !important;
  }

  body.word-game-active #word-game.active #wordGameCanvas {
    max-height: none !important;
  }

  body.word-game-active #word-game.active .word-game-panel {
    grid-template-columns: 1fr !important;
    gap: 5px !important;
    min-width: 0 !important;
  }

  body.word-game-active #word-game.active .word-game-panel-block,
  body.word-game-active #word-game.active .word-game-progress {
    grid-column: auto !important;
    min-height: 31px !important;
    padding: 5px 6px !important;
  }

  body.word-game-active #word-game.active .word-game-panel-block.next,
  body.word-game-active #word-game.active .word-game-progress {
    order: 0 !important;
  }

  body.word-game-active #word-game.active .word-game-panel-block.next strong {
    font-size: 13px !important;
  }

  body.word-game-active #word-game.active .word-game-progress-bar {
    height: 6px !important;
    margin-top: 4px !important;
  }

  body.word-game-active #word-game.active .word-game-actions {
    grid-column: auto !important;
    grid-template-columns: 1fr !important;
    gap: 4px !important;
    order: 0 !important;
  }

  body.word-game-active #word-game.active .word-game-actions button {
    min-height: 32px !important;
    padding: 4px 5px !important;
    font-size: 11px !important;
  }

  body.word-game-active #word-game.active .word-game-controls {
    left: 6px !important;
    right: 6px !important;
    bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 5px) !important;
    gap: 5px !important;
    padding: 5px !important;
  }

  body.word-game-active #word-game.active .word-game-controls button {
    min-height: 44px !important;
    font-size: 18px !important;
  }

  body.word-game-active #word-game.active .word-game-leaderboard {
    display: none !important;
  }
}

/* ===== PoliTETRIS: vetsi klasicke ovladani drzenim ===== */
#word-game.active .word-game-controls {
  gap: 10px !important;
}

#word-game.active .word-game-controls button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 82px !important;
  padding: 0 !important;
  font-size: 36px !important;
  line-height: 1 !important;
  user-select: none !important;
  touch-action: none !important;
}

#word-game.active .word-game-controls button.is-held {
  background: #000 !important;
  color: #fff !important;
  transform: translateY(1px) !important;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .28) !important;
}

@media (max-width: 760px) {
  body.word-game-active main {
    padding: 5px 6px calc(114px + var(--bottom-nav-height) + env(safe-area-inset-bottom)) !important;
  }

  body.word-game-active #word-game.active .word-game-controls {
    gap: 6px !important;
    padding: 6px !important;
  }

  body.word-game-active #word-game.active .word-game-controls button {
    min-height: 88px !important;
    font-size: 34px !important;
  }
}
