/* Mood Play Hub — единая боковая панель (mobile ≤767px) */

.play-page-header-hub-mobile {
  display: none;
}

@media (max-width: 767px) {
  /* ——— Slim header ——— */
  .play-page-header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    grid-template-rows: auto;
    align-items: center;
    gap: 8px;
    flex: none;
    min-height: 48px;
    padding: max(6px, env(safe-area-inset-top, 0px)) 10px 6px;
  }

  .play-page-header-left {
    grid-column: 2;
    grid-row: 1;
    flex: none;
    min-width: 0;
    justify-content: center;
  }

  .play-page-header-left-inner,
  .play-page-game-tools-btn {
    display: none !important;
  }

  .play-page-header-title-block {
    max-width: none;
    padding: 0;
    text-align: center;
    align-items: center;
  }

  .play-page-header-title-block .play-page-frame-title {
    font-size: 14px;
    font-weight: 700;
    max-width: 100%;
  }

  .play-page-header-title-block .play-page-slot-info {
    display: none !important;
  }

  .play-page-header-center,
  .play-page-header-right,
  .play-page-actions-toggle,
  /* Баланс и депозит — в hub-панели; в шапке дубль ломает grid и раздувает высоту */
  .play-page-header-dock {
    display: none !important;
  }

  .play-page-header-close-mobile {
    grid-column: 1;
    grid-row: 1;
    display: flex !important;
  }

  .play-page-header-close-mobile .play-page-menu-btn {
    width: 44px;
    height: 44px;
  }

  .play-page-header-hub-mobile {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    justify-content: flex-end;
  }

  /* Старые overlay-меню на телефоне не используются */
  .play-page-game-tools-popover,
  .play-page-game-tools-backdrop {
    display: none !important;
  }

  /* ——— Hub button ——— */
  .play-page-hub-btn {
    position: relative;
    width: 44px;
    height: 44px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
  }

  .play-page-hub-btn svg {
    width: 22px;
    height: 22px;
  }

  body.play-page-hub-open .play-page-hub-btn {
    color: var(--accent);
    background: var(--accent-dim);
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  }

  .play-page-hub-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 0 2px var(--bg-deep);
  }

  .play-page-hub-badge.hidden {
    display: none !important;
  }

  /* ——— Hub panel ——— */
  .play-page-hub-backdrop {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-play) + 4);
    background: rgba(5, 8, 13, 0.62);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: mood-play-hub-fade-in 0.2s var(--ease-out);
  }

  .play-page-hub {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: calc(var(--z-play) + 5);
    display: flex;
    flex-direction: column;
    width: min(100vw, 360px);
    max-width: 100%;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    box-shadow: -12px 0 48px rgba(0, 0, 0, 0.45);
    animation: mood-play-hub-slide-in 0.28s var(--ease-out);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  @keyframes mood-play-hub-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes mood-play-hub-slide-in {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: none; }
  }

  .play-page-hub-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow: hidden;
  }

  .play-page-hub-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: none;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
  }

  .play-page-hub-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  .play-page-hub-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: pointer;
  }

  .play-page-hub-close svg {
    width: 18px;
    height: 18px;
  }

  .play-page-hub-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .play-page-hub-section-title {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
  }

  /* ——— Account cards ——— */
  .play-page-hub-account-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .play-page-hub-balance-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
  }

  .play-page-hub-balance-card--bonus {
    border-color: color-mix(in srgb, var(--accent-2) 35%, var(--border));
    background: color-mix(in srgb, var(--accent-2-dim) 40%, var(--surface));
  }

  .play-page-hub-balance-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
  }

  .play-page-hub-balance-value {
    font-family: var(--font-mono);
    font-size: clamp(18px, 5vw, 22px);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    color: var(--text);
    word-break: break-word;
  }

  .play-page-hub-balance-card--bonus .play-page-hub-balance-value {
    color: var(--accent-2);
  }

  .play-page-hub-wagering {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  }

  .play-page-hub-wagering-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
  }

  .play-page-hub-wagering-pct {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 800;
    color: var(--accent);
  }

  .play-page-hub-wagering-bar {
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    overflow: hidden;
  }

  .play-page-hub-wagering-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--grad-brand);
    transition: width 0.35s var(--ease-out);
  }

  .play-page-hub-wagering-remain {
    font-size: 12px;
    color: var(--text-muted);
  }

  .play-page-hub-deposit-btn {
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
    font-size: 15px;
    font-weight: 700;
  }

  .play-page-hub-guest-note {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
  }

  .play-page-hub-guest-note .btn {
    width: 100%;
    min-height: 44px;
    margin-top: 10px;
  }

  /* ——— Action rows ——— */
  .play-page-hub-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .play-page-hub-action {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--radius-md);
    background: none;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
  }

  .play-page-hub-action:hover,
  .play-page-hub-action:active {
    background: var(--surface-2);
  }

  .play-page-hub-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--accent);
  }

  .play-page-hub-action-icon svg {
    width: 18px;
    height: 18px;
  }

  .play-page-hub-action.active .play-page-hub-action-icon {
    color: var(--accent-2);
    border-color: color-mix(in srgb, var(--accent-2) 40%, var(--border));
    background: var(--accent-2-dim);
  }

  .play-page-hub-action--danger {
    color: var(--danger);
  }

  .play-page-hub-action--danger .play-page-hub-action-icon {
    color: var(--danger);
    background: var(--danger-dim);
    border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
  }

  .play-page-hub-divider {
    height: 1px;
    margin: 4px 0;
    background: var(--border);
  }

  /* ——— Winners sheet (mobile v2) ——— */
  .play-page-winners {
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-height: min(88dvh, 88vh) !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    z-index: calc(var(--z-play) + 6) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .play-page-winners-header {
    padding: 16px 16px 12px;
    position: relative;
  }

  .play-page-winners-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--border-strong);
  }

  .play-page-winners-title {
    font-size: 16px;
    padding-top: 8px;
  }

  .play-page-winners-close {
    width: 40px;
    height: 40px;
  }

  .play-page-winners-list {
    gap: 8px;
    padding: 8px 16px 16px;
  }

  .play-page-winner-item {
    padding: 12px;
    gap: 12px;
  }

  .play-page-winner-item-img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
  }

  .play-page-winner-item-name {
    font-size: 14px;
  }

  .play-page-winner-item-mult {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--accent-dim);
  }

  .play-page-winner-item-win {
    font-size: 15px !important;
  }

  .play-page-winners-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
  }

  .play-page-winners-empty-icon {
    font-size: 32px;
    opacity: 0.6;
  }

}

@media (min-width: 768px) {
  /* Меню справа нужно и на компьютере (макет v2). Скрытие только через .hidden. */
}
