/* === Стили для favicon === */
link[rel="icon"], link[rel="shortcut icon"], link[rel="apple-touch-icon"] {
    display: block;
}

/* === QR модальное окно === */
#qr-modal {
    display: none;
}

/* === Базовые переменные и цвета для современного индивидуального стиля === */
:root {
  --main-bg: #f5f5f7;
  --main-fg: #23272f;
  --main-accent: #e5e5ea;
  --main-accent-hover: #d1d1d6;
  --main-border: #d1d1d6;
  --main-radius: 7px;
  --main-shadow: 0 4px 24px rgba(80, 60, 160, 0.07);
  --main-shadow-hover: 0 2px 8px rgba(60,60,60,0.10);
  --main-header-bg: #fff;
  --main-footer-bg: #fff;
  --tab-active-bg: #fff;
  --tab-inactive-bg: #f5f5f7;
  --tab-active-fg: #007aff;
  --tab-inactive-fg: #23272f;
  --btn-bg: #f5f5f7;
  --btn-fg: #222;
  --btn-hover-bg: #e5e5ea;
  --btn-disabled-bg: #ececec;
  --btn-disabled-fg: #b0b3bb;
  --arrow-color: #22c55e;
  --input-bg: #fff;
  --input-border: #e0e4ea;
  --input-focus: #a259e6;
  --danger-color: #d1d1d6;
  --success-color: #34c759;
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', Arial, sans-serif;
}

body, main {
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: var(--main-bg);
  color: var(--main-fg);
  font-family: var(--font-main);
}

/* Сброс базовых отступов для заголовков */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em 0;
  font-weight: 600;
}

/* Ссылки */
a {
  color: var(--main-accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--main-accent-hover);
}

/* --- Основные панели --- */
#app-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
    box-sizing: border-box;
    position: relative;
}

#left-column {
    width: 320px;
    min-width: 260px;
    max-width: 340px;
    height: 100vh;
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid #e2e6ea;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
}

#right-column {
    width: 340px;
    min-width: 260px;
    max-width: 380px;
    height: 100vh;
    overflow-y: auto;
    background: #fff;
    border-left: 1px solid #e2e6ea;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
}

#center-column {
    flex: 1 1 0;
    margin-left: 340px;
    margin-right: 340px;
    max-width: 900px;
    min-width: 400px;
    height: 100vh;
    overflow-y: auto;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

/* --- Универсальный стиль macOS для всех кнопок --- */
.btn, .btn-success, .btn-danger, .btn-secondary,
.load-game-btn, .setup-btn-new, .undo-btn, .game-btn,
.player-tab-btn, .save-contact-btn, .modal-list-item-btn, .modal-close-btn,
.small-control-btn, .audio-btn, .glass-btn, .neumorph-btn {
    background: #f5f5f7;
    color: #222;
    border-radius: 8px;
    border: 1.5px solid #d1d1d6;
    box-shadow: 0 2px 6px rgba(60,60,60,0.07);
    padding: 10px 18px;
    font-size: 15px;
    margin: 4px 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', Arial, sans-serif;
    font-weight: 500;
}
.btn:hover, .btn:focus,
.btn-success:hover, .btn-success:focus,
.btn-danger:hover, .btn-danger:focus,
.btn-secondary:hover, .btn-secondary:focus,
.load-game-btn:hover, .load-game-btn:focus,
.setup-btn-new:hover, .setup-btn-new:focus,
.undo-btn:hover, .undo-btn:focus,
.game-btn:hover, .game-btn:focus,
.player-tab-btn:hover, .player-tab-btn:focus,
.save-contact-btn:hover, .save-contact-btn:focus,
.modal-list-item-btn:hover, .modal-list-item-btn:focus,
.modal-close-btn:hover, .modal-close-btn:focus,
.small-control-btn:hover, .small-control-btn:focus,
.audio-btn:hover, .audio-btn:focus,
.glass-btn:hover, .glass-btn:focus,
.neumorph-btn:hover, .neumorph-btn:focus {
    background: #e5e5ea;
    color: #222;
    box-shadow: 0 4px 12px rgba(60,60,60,0.10);
    border-color: #bdbdbd;
}
.btn[disabled], .btn-success[disabled], .btn-danger[disabled], .btn-secondary[disabled],
.load-game-btn[disabled], .setup-btn-new[disabled], .undo-btn[disabled], .game-btn[disabled],
.player-tab-btn[disabled], .save-contact-btn[disabled], .modal-list-item-btn[disabled], .modal-close-btn[disabled],
.small-control-btn[disabled], .audio-btn[disabled], .glass-btn[disabled], .neumorph-btn[disabled] {
    background: #ececec;
    color: #b0b3bb;
    border-color: #e0e0e0;
    cursor: not-allowed;
    box-shadow: none;
}

/* --- Универсальный стиль macOS для всех <button> --- */
button {
    background: #f5f5f7;
    color: #222;
    border-radius: 8px;
    border: 1.5px solid #d1d1d6;
    box-shadow: 0 2px 6px rgba(60,60,60,0.07);
    padding: 10px 18px;
    font-size: 15px;
    margin: 4px 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', Arial, sans-serif;
    font-weight: 500;
}
button:hover, button:focus {
    background: #e5e5ea;
    color: #222;
    box-shadow: 0 4px 12px rgba(60,60,60,0.10);
    border-color: #bdbdbd;
}
button[disabled] {
    background: #ececec;
    color: #b0b3bb;
    border-color: #e0e0e0;
    cursor: not-allowed;
    box-shadow: none;
}

/* --- QR-код и модалка --- */
#session-qr-code {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}
#show-qr-btn {
    width: 100%;
    margin-bottom: 8px;
}
#qr-modal .qr-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}
#qr-modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
    color: #333;
    cursor: pointer;
}
#qr-modal-canvas {
    background: yellow !important;
    min-width: 200px;
    min-height: 200px;
    max-width: 400px;
    max-height: 400px;
    width: auto;
    height: auto;
    border: 2px solid red !important;
    object-fit: contain;
}
#qr-modal-canvas img {
    display: block !important;
    max-width: 400px !important;
    max-height: 400px !important;
    width: auto !important;
    height: auto !important;
    border: 2px solid blue !important;
    background: white !important;
    object-fit: contain !important;
}

/* --- Списки билетов и статусов --- */
.status-list {
    margin-bottom: 12px;
}
.ticket-badge {
    display: inline-block;
    background: #e9ecef;
    color: #333;
    border-radius: 5px;
    padding: 4px 10px;
    margin: 2px 4px 2px 0;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.ticket-badge.winning-badge {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}
.ticket-badge.prewinning-badge {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

/* --- Футер статистики --- */
#game-stats {
    background: #f1f3f4;
    border-radius: 8px;
    padding: 14px 20px;
    margin: 18px auto 0 auto;
    font-size: 16px;
    color: #333;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    max-width: 400px;
}

/* --- Билеты --- */
.ticket {
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    margin: 24px auto;
    padding: 24px 18px 18px 18px;
    max-width: 440px;
    min-width: 340px;
    border: 1px solid #e2e6ea;
    aspect-ratio: 1.4 / 1;
    width: 350px;
    max-width: 100%;
    height: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
}
.ticket .header {
    display: flex;
    align-items: center;
}
.ticket .logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e2e6ea;
}
.ticket .game-name {
    flex: 1;
    text-align: center;
    width: auto;
    display: block;
}
.ticket .ticket-number {
    margin-left: auto;
    text-align: right;
    font-weight: bold;
    color: #007bff;
    font-size: 18px;
}
.ticket table {
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    table-layout: fixed;
    margin-bottom: 12px;
}
.ticket td {
    border: 1px solid #dee2e6;
    min-width: 48px;
    min-height: 48px;
    width: 48px;
    height: unset !important;
    text-align: center;
    font-size: 22px;
    background: #fff;
    border-radius: 4px;
    transition: background 0.2s;
    padding: 0;
    vertical-align: top !important;
}
.ticket .number {
    font-weight: bold;
    font-size: 22px;
    line-height: 1.2;
}
.ticket .text {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}
.ticket .footer {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* --- Статусы билетов --- */
.winning-line {
    background: #d4edda !important;
    border: 2px solid #28a745 !important;
    color: #155724 !important;
}
.pre-winning-line {
    background: #fff3cd !important;
    border: 2px solid #28a745 !important;
    color: #856404 !important;
}
.pre-winning-missing {
    border: 3px solid #28a745 !important;
    box-shadow: 0 0 0 2px #b6f5c2 !important;
    z-index: 2;
}
/* .dropped-number {
    background: #e2e3e5 !important;
    color: #6c757d !important;
    opacity: 0.5 !important;
}
*/

/* --- Мелкие правки --- */
input, select {
    border-radius: 5px;
    border: 1px solid #ced4da;
    padding: 7px 10px;
    font-size: 15px;
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
}
label {
    font-size: 14px;
    color: #333;
    margin-bottom: 3px;
    display: block;
}
.form-group {
    margin-bottom: 14px;
}
.file-upload-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.file-name {
    font-size: 13px;
    color: #888;
}
hr.form-divider {
    border: none;
    border-top: 1px solid #e2e6ea;
    margin: 18px 0;
}

/* --- СТИЛИ ДЛЯ КАСТОМНОЙ КНОПКИ ЗАГРУЗКИ ФАЙЛА --- */
.file-input-hidden {
    display: none; /* Прячем стандартную кнопку */
}

/* --- Стили для выравнивания кнопок --- */
.file-upload-group {
    margin-bottom: 10px;
}
.file-upload-group:last-child {
    margin-bottom: 0;
}
#media-panel .btn {
    flex-shrink: 0; /* Запрещаем кнопке сжиматься */
}

#media-panel .btn {
    flex-shrink: 0; /* Запрещаем кнопке сжиматься */
}

/* --- Стили для модального окна загрузки --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--panel-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    text-align: center;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.modal-list {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
    max-height: 300px;
    overflow-y: auto;
}

.modal-list-item-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    background-color: #fff;
    color: var(--primary-color);
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.modal-list-item-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.modal-close-btn {
    margin-top: 10px;
}

.modal-close-btn {
    margin-top: 10px;
}

/* --- СТИЛИ ДЛЯ ЭКРАНА ВЕДУЩЕГО --- */
#presenter-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #1a1a1a;
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 2000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#presenter-screen.hidden {
    display: none;
}

/* ШАПКА ЭКРАНА ВЕДУЩЕГО */
.presenter-header {
    flex-shrink: 0;
    padding: 20px 30px;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.presenter-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    flex: 1;
    max-width: 100%;
}

#presenter-logo { 
    max-height: 60px;
    max-width: 120px;
    object-fit: contain;
}

.presenter-header-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#presenter-game-name {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

.presenter-host-info {
    display: flex;
    gap: 20px;
    font-size: 1.1rem;
}

/* ЦЕНТРАЛЬНАЯ ЧАСТЬ ЭКРАНА ВЕДУЩЕГО */
.presenter-main {
    flex-grow: 1;
    display: flex;
    gap: 30px;
    padding: 30px;
    overflow: hidden;
}

/* ЛЕВАЯ ЧАСТЬ: QR-код или медиаконтент */
.presenter-left-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#presenter-qr-area {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.presenter-media {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    transform: none !important;
    transform-origin: center center !important;
}

.presenter-media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 10px;
    box-sizing: border-box;
}

/* ПРАВАЯ ЧАСТЬ: Бочонок, последние шары и название композиции - 30% ширины */
.presenter-right-area {
    flex: 0 0 30%;
    width: 30%;
    min-width: 0;
    max-width: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    justify-content: flex-start;
    padding: 20px;
    box-sizing: border-box;
}

#presenter-barrel-display {
    width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

#barrel-image {
    height: 250px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: none;
}

/* ПОСЛЕДНИЕ ВЫПАВШИЕ ШАРЫ */
#presenter-last-balls {
    text-align: center;
    flex-shrink: 0;
}

#presenter-last-balls h3 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

#presenter-last-balls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: relative;
    height: 80px;
}

/* НАЗВАНИЕ КОМПОЗИЦИИ И ИСПОЛНИТЕЛЯ */
#presenter-media-title {
    text-align: center;
    margin-top: auto;
    padding: 20px;
    width: 100%;
    flex-shrink: 0;
}

#presenter-media-artist {
    font-size: 2.5rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    line-height: 1.2;
}

#presenter-media-track {
    font-size: 2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    line-height: 1.2;
}

.last-ball-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    transition: transform 0.3s ease;
    position: relative;
}

.last-ball-image:hover {
    transform: scale(1.1);
}
/* ОБЛАСТЬ СТАТУСА ПРЕДВЫИГРЫШНЫХ/ВЫИГРЫШНЫХ БИЛЕТОВ */
.presenter-status-area {
    display: none;
    flex-shrink: 0;
    padding: 20px 30px;
    background-color: rgba(0, 0, 0, 0.4);
    text-align: center;
}

#presenter-status-message {
    font-size: 1.5rem;
    font-weight: bold;
}

.winning-status {
    color: #28a745;
}

.pre-winning-status {
    color: #ffc107;
}

.waiting-status {
    color: #6c757d;
}

/* --- Новый компактный футер и стили шаров --- */
.presenter-footer {
    height: 250px;
    min-height: 250px;
    max-height: 250px;
    background: #041d35;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
}
#presenter-ball-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    row-gap: 10px;
    column-gap: 10px;
    align-items: center;
    justify-items: center;
    position: relative;
    padding: 8px;
    box-sizing: border-box;
}
.grid-ball {
    aspect-ratio: 1/1;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    min-width: 40px;
    min-height: 40px;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #222;
    font-weight: 700;
    color: #222;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    overflow: hidden;
}
.grid-ball.dropped {
    background: #ffe082;
    color: #b26a00;
    border: 2px solid #b26a00;
    box-shadow: 0 2px 8px rgba(255,193,7,0.18);
}
/* Убираю изменение размера шаров при изменении масштаба */
@media (max-width: 900px) {
    .grid-ball { font-size: 1.25em; max-width: 48px; }
}
@media (max-width: 600px) {
    .grid-ball { font-size: 1.25em; max-width: 40px; }
}

#close-presenter-screen {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 2010;
}

/* === Кастомный футер билета === */
.ticket-footer-custom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 0 10px 0;
  background: var(--main-footer-bg, #fff);
  border-top: 2px solid #e5e5ea;
}
.ticket-host-label {
  font-size: 1.45em;
  font-weight: 700;
  color: #23272f;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
  text-align: center;
}
.ticket-host-title {
  color: #007aff;
  font-weight: 800;
  font-size: 1.1em;
  margin-right: 8px;
  text-transform: uppercase;
}
.ticket-host-name {
  color: #23272f;
  font-weight: 700;
  font-size: 1.1em;
}
.ticket-host-phone {
  font-size: 1.25em;
  font-weight: 600;
  color: #007aff;
  margin-top: 2px;
  letter-spacing: 0.03em;
  text-align: center;
}

/* Анимация для спиннера загрузки */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #007bff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Стили для сообщения об отсутствии билетов */
.no-tickets-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
    margin: 20px 0;
}

.no-tickets-message:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transition: all 0.3s ease;
}

/* === Стиль подсказки о формате аудиофайлов === */
.audio-format-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: #f0f6ff;
  border-radius: 10px;
  border: 1.5px solid #b6d4fe;
  margin-top: 0;
  font-size: 13.5px;
  color: #1a2330;
  box-shadow: 0 2px 8px rgba(80, 160, 255, 0.06);
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}
.load-action-row .audio-format-hint {
  margin-left: 8px;
}
.hint-icon {
  font-size: 18px;
  color: #2196f3;
  flex-shrink: 0;
  margin-top: 2px;
}
.hint-content {
  line-height: 1.5;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
.audio-format-hint strong {
  color: #1976d2;
  font-weight: 700;
  font-size: 1.08em;
}
.audio-format-hint span {
  color: #1a2330;
}

/* --- Вертикальный список кнопок загрузки с подсказками --- */
.load-actions-row-vertical {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0 auto;
  max-width: 600px;
}
.load-action-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  width: 100%;
}
.load-action-row .neumorph-btn {
  min-width: 180px;
  flex-shrink: 0;
}
.load-action-row .audio-format-hint {
  flex: 1;
  margin: 0 0 0 8px;
  min-width: 0;
}
@media (max-width: 700px) {
  .load-action-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .load-action-row .audio-format-hint {
    margin: 0;
  }
}

/* --- Баннеры на вкладке Скачать --- */
.download-banners-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
  margin: 0 auto 0 auto;
}
.download-banner-link {
  position: relative;
  width: 200px;
  height: 320px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(80,160,255,0.10);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s, transform 0.2s;
}
.download-banner-link:hover {
  box-shadow: 0 6px 24px rgba(80,160,255,0.18);
  transform: translateY(-4px) scale(1.03);
  z-index: 2;
}
.download-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  display: block;
}
.banner-lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  border-radius: 18px;
  z-index: 2;
}
.banner-lock-icon {
  font-size: 2.2em;
  color: #fff;
}
.banner-lock-text {
  color: #fff;
  font-size: 1.08em;
  margin-top: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
@media (max-width: 600px) {
  .download-banners-row {
    flex-direction: column;
    gap: 18px;
  }
  .download-banner-link {
    width: 100%;
    max-width: 340px;
    height: 180px;
    margin: 0 auto;
  }
}




/* --- ФИНАЛЬНЫЕ СТИЛИ ДЛЯ ПЕЧАТИ --- */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 1. Скрываем ВСЁ */
    body * {
        visibility: hidden !important;
    }

    /* 2. Показываем ТОЛЬКО контейнер с билетами */
    #tickets-container, #tickets-container * {
        visibility: visible !important;
    }

    /* 3. Позиционируем контейнер */
    #tickets-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100%;
    }

    /* Общие стили для билета при печати */
    .ticket {
        page-break-inside: avoid;
        margin-top: 32mm;
        margin-bottom: 16mm;
        box-shadow: none !important;
        border: 1px solid #000 !important;
        background: #fff !important;
        margin: 0 !important;
    }

    .ticket:first-child {
        margin-top: 0;
    }

    /* Режим 1 билет на страницу (5x5, 6x6) - ИСПРАВЛЕНО */
    body.print-1-up #tickets-container {
        display: block !important; /* Не flex, а обычный блок */
    }
    body.print-1-up .ticket {
        width: 200mm !important;
        height: 280mm !important;
        margin: 5mm auto !important; /* Центрируем билет на странице */
        page-break-after: always !important; /* Каждый билет на новой странице */
    }
    body.print-1-up .ticket:last-child {
        page-break-after: auto !important;
    }

    /* Режим 2 билета на страницу (3x3) */
    body.print-2-up #tickets-container {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center;
        align-items: center;
        width: 210mm;
        height: 297mm;
    }
    body.print-2-up .ticket {
        width: 190mm !important;
        height: 135mm !important;
        margin: 5mm 0 !important;
    }
        body.print-2-up .ticket:nth-child(odd) {
            margin-right: 5mm !important;
        }
    }

        #player-container {
        display: flex;
        flex-direction: column;
            height: 100vh;
            padding: 10px;
    }
    
    #player-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
    }
    
    #player-logo {
            width: 40px;
            height: 40px;
        }

        .player-header-info {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        #player-game-name {
            font-size: 1.1rem;
            margin: 0;
        }

        #player-ticket-id {
            font-size: 0.9rem;
            color: #666;
        }

        /* ВКЛАДКИ ИГРОКА */
        .player-tabs {
            display: flex;
            margin-bottom: 15px;
            border-bottom: 1px solid #ddd;
        }

        .player-tab-btn {
            flex: 1;
            padding: 10px;
            background: none;
            border: none;
            border-bottom: 3px solid transparent;
            cursor: pointer;
            font-size: 1rem;
            transition: all 0.3s ease;
        }

        .player-tab-btn.active {
            border-bottom-color: var(--primary-color);
            color: var(--primary-color);
            font-weight: bold;
        }

        .player-tab-content {
            display: none;
            flex-grow: 1;
        }

        .player-tab-content.active {
            display: flex;
            flex-direction: column;
        }

        /* ВКЛАДКА ИГРЫ */
        #player-game-tab {
            justify-content: center;
    }
    
    #player-ticket {
            flex-grow: 1;
            display: flex;
            justify-content: center;
            align-items: center;
    }
    
    #ticket-grid {
        width: 100%;
            max-width: 400px;
    }
    
    #ticket-grid td {
        padding: 8px;
            font-size: 1.2rem;
            border: 1px solid #ccc;
    }
    
    #ticket-grid td.highlight {
            background-color: #d1ecf1;
    }
    
    #player-footer {
            margin-top: 15px;
        text-align: center;
        }

        /* ВКЛАДКА ВЕДУЩЕГО */
        .host-profile {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
            padding: 20px;
        }

        .host-photo {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            overflow: hidden;
            border: 3px solid var(--primary-color);
        }

        .host-photo img {
        width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .host-info {
            text-align: center;
            width: 100%;
        }

        #host-name {
            font-size: 1.5rem;
            margin: 0 0 15px 0;
            color: var(--primary-color);
        }

        .host-contacts {
        display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .host-phone {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }

        .phone-link {
            font-size: 1.2rem;
            color: var(--primary-color);
            text-decoration: none;
            font-weight: bold;
        }

        .save-contact-btn {
            padding: 8px 16px;
            background-color: #28a745;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.9rem;
        }

        .save-contact-btn:hover {
            background-color: #218838;
        }

        .host-social h3 {
            margin: 0 0 10px 0;
            font-size: 1.1rem;
        }

        .social-links {
            display: flex;
        justify-content: center;
            gap: 15px;
        }

        .social-link {
            padding: 8px 16px;
            text-decoration: none;
            color: white;
            border-radius: 4px;
            font-size: 0.9rem;
            transition: opacity 0.3s ease;
        }

        .social-link:hover {
            opacity: 0.8;
        }

        .social-link.vk {
            background-color: #4a76a8;
        }

        .social-link.telegram {
            background-color: #0088cc;
        }

        .social-link.instagram {
            background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
        }
        
/* СТИЛИ ДЛЯ ИНТЕРФЕЙСА ИГРОКА (ДЕСКТОП) */
#player-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

#player-header {
        display: flex;
        align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

#player-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.player-header-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#player-game-name {
    font-size: 1.5rem;
    margin: 0;
    font-weight: bold;
}

#player-ticket-id {
    font-size: 1rem;
    color: #666;
}

/* ВКЛАДКИ ИГРОКА */
.player-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.player-tab-btn {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.player-tab-btn:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.player-tab-btn.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
}

.player-tab-content {
    display: none;
    flex-grow: 1;
}

.player-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* ВКЛАДКА ИГРЫ */
#player-game-tab {
        justify-content: center;
}

#player-ticket {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
#ticket-grid {
    width: 100%;
    max-width: 500px;
    border-collapse: collapse;
}

#ticket-grid td {
    padding: 15px;
    font-size: 1.5rem;
    border: 2px solid var(--border-color);
    text-align: center;
    vertical-align: middle;
    transition: background-color 0.3s ease;
}

#ticket-grid td.highlight {
    background-color: #d1ecf1;
    color: #0c5460;
        font-weight: bold;
}

#player-footer {
    margin-top: 20px;
    text-align: center;
    padding: 15px;
    background-color: var(--panel-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

#current-ball-info {
        display: flex;
    flex-direction: column;
    gap: 5px;
}

#current-ball-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

#current-ball-media {
    font-size: 1rem;
    color: #666;
}

/* ВКЛАДКА ВЕДУЩЕГО */
.host-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 40px;
    text-align: center;
}

.host-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.host-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.host-info {
    text-align: center;
    width: 100%;
    max-width: 400px;
}

#host-name {
    font-size: 2rem;
    margin: 0 0 20px 0;
    color: var(--primary-color);
    font-weight: bold;
}

.host-contacts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.host-phone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.phone-link {
    font-size: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.phone-link:hover {
    background-color: var(--primary-color);
    color: white;
}

.save-contact-btn {
    padding: 12px 24px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.save-contact-btn:hover {
    background-color: #218838;
}

.host-social h3 {
    margin: 0 0 15px 0;
    font-size: 1.3rem;
    color: #333;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-link {
    padding: 12px 24px;
    text-decoration: none;
    color: white;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.social-link.vk {
    background-color: #4a76a8;
}

.social-link.telegram {
    background-color: #0088cc;
}

.social-link.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

/* --- Оформление билета --- */
.ticket {
    background: white;
    padding: 25px;
    width: 200mm;
    height: 285mm;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-radius: 10px;
    margin-bottom: 30px;
    position: relative;
    border: 1px solid #555;
}

.header {
    height: 15%;
    border-bottom: 2px solid #555;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
        justify-content: space-between;
}

.logo {
    max-height: 80%;
    max-width: 40%;
}

.ticket-number {
    font-size: 24px;
    color: #3498db;
    font-weight: bold;
}

.ticket table {
    width: 100%;
    height: 70%;
    border-collapse: collapse;
    table-layout: fixed;
}

.ticket td {
    border: 2px solid #555;
    padding: 10px;
    position: relative;
    transition: all 0.3s;
    height: 60px;
    text-align: center;
    vertical-align: top !important;
    background: white;
}

.cell-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    height: 100%;
    width: 100%;
}

.number {
    font-weight: bold;
    font-size: 36px;
    line-height: 1;
    margin-bottom: 5px;
    width: 100%;
    text-align: center;
    color: #333;
}

.text {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

.footer {
    height: 10%;
    text-align: center;
    padding-top: 15px;
    font-size: 14px;
    color: #777;
    border-top: 1px solid #555;
}

/* --- Подсветка ячеек только для td --- */
td.dropped-number {
    background: #e2e3e5 !important;
    color: #6c757d !important;
    opacity: 0.5 !important;
    transition: background 0.3s;
}
td.pre-winning-line:not(.dropped-number) {
    background: #fffacd !important;
    border: 2px solid #f39c12 !important;
    color: #856404 !important;
    opacity: 1 !important;
}
td.winning-line:not(.dropped-number) {
    background: #d4edda !important;
    border: 2px solid #28a745 !important;
    color: #155724 !important;
    opacity: 1 !important;
    animation: pulse 1s infinite;
}
/* --- Стили для печати --- */
/* === Стили для favicon === */
link[rel="icon"], link[rel="shortcut icon"], link[rel="apple-touch-icon"] {
    display: block;
}

/* === QR модальное окно === */
#qr-modal {
    display: none;
}

/* === Базовые переменные и цвета для современного индивидуального стиля === */
:root {
  --main-bg: #f5f5f7;
  --main-fg: #23272f;
  --main-accent: #e5e5ea;
  --main-accent-hover: #d1d1d6;
  --main-border: #d1d1d6;
  --main-radius: 7px;
  --main-shadow: 0 4px 24px rgba(80, 60, 160, 0.07);
  --main-shadow-hover: 0 2px 8px rgba(60,60,60,0.10);
  --main-header-bg: #fff;
  --main-footer-bg: #fff;
  --tab-active-bg: #fff;
  --tab-inactive-bg: #f5f5f7;
  --tab-active-fg: #007aff;
  --tab-inactive-fg: #23272f;
  --btn-bg: #f5f5f7;
  --btn-fg: #222;
  --btn-hover-bg: #e5e5ea;
  --btn-disabled-bg: #ececec;
  --btn-disabled-fg: #b0b3bb;
  --arrow-color: #22c55e;
  --input-bg: #fff;
  --input-border: #e0e4ea;
  --input-focus: #a259e6;
  --danger-color: #d1d1d6;
  --success-color: #34c759;
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', Arial, sans-serif;
}

body, main {
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: var(--main-bg);
  color: var(--main-fg);
  font-family: var(--font-main);
}

/* Сброс базовых отступов для заголовков */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em 0;
  font-weight: 600;
}

/* Ссылки */
a {
  color: var(--main-accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--main-accent-hover);
}

/* --- Основные панели --- */
#app-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
    box-sizing: border-box;
    position: relative;
}

#left-column {
    width: 320px;
    min-width: 260px;
    max-width: 340px;
    height: 100vh;
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid #e2e6ea;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
}

#right-column {
    width: 340px;
    min-width: 260px;
    max-width: 380px;
    height: 100vh;
    overflow-y: auto;
    background: #fff;
    border-left: 1px solid #e2e6ea;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
}

#center-column {
    flex: 1 1 0;
    margin-left: 340px;
    margin-right: 340px;
    max-width: 900px;
    min-width: 400px;
    height: 100vh;
    overflow-y: auto;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

/* --- Универсальный стиль macOS для всех кнопок --- */
.btn, .btn-success, .btn-danger, .btn-secondary,
.load-game-btn, .setup-btn-new, .undo-btn, .game-btn,
.player-tab-btn, .save-contact-btn, .modal-list-item-btn, .modal-close-btn,
.small-control-btn, .audio-btn, .glass-btn, .neumorph-btn {
    background: #f5f5f7;
    color: #222;
    border-radius: 8px;
    border: 1.5px solid #d1d1d6;
    box-shadow: 0 2px 6px rgba(60,60,60,0.07);
    padding: 10px 18px;
    font-size: 15px;
    margin: 4px 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', Arial, sans-serif;
    font-weight: 500;
}
.btn:hover, .btn:focus,
.btn-success:hover, .btn-success:focus,
.btn-danger:hover, .btn-danger:focus,
.btn-secondary:hover, .btn-secondary:focus,
.load-game-btn:hover, .load-game-btn:focus,
.setup-btn-new:hover, .setup-btn-new:focus,
.undo-btn:hover, .undo-btn:focus,
.game-btn:hover, .game-btn:focus,
.player-tab-btn:hover, .player-tab-btn:focus,
.save-contact-btn:hover, .save-contact-btn:focus,
.modal-list-item-btn:hover, .modal-list-item-btn:focus,
.modal-close-btn:hover, .modal-close-btn:focus,
.small-control-btn:hover, .small-control-btn:focus,
.audio-btn:hover, .audio-btn:focus,
.glass-btn:hover, .glass-btn:focus,
.neumorph-btn:hover, .neumorph-btn:focus {
    background: #e5e5ea;
    color: #222;
    box-shadow: 0 4px 12px rgba(60,60,60,0.10);
    border-color: #bdbdbd;
}
.btn[disabled], .btn-success[disabled], .btn-danger[disabled], .btn-secondary[disabled],
.load-game-btn[disabled], .setup-btn-new[disabled], .undo-btn[disabled], .game-btn[disabled],
.player-tab-btn[disabled], .save-contact-btn[disabled], .modal-list-item-btn[disabled], .modal-close-btn[disabled],
.small-control-btn[disabled], .audio-btn[disabled], .glass-btn[disabled], .neumorph-btn[disabled] {
    background: #ececec;
    color: #b0b3bb;
    border-color: #e0e0e0;
    cursor: not-allowed;
    box-shadow: none;
}

/* --- Универсальный стиль macOS для всех <button> --- */
button {
    background: #f5f5f7;
    color: #222;
    border-radius: 8px;
    border: 1.5px solid #d1d1d6;
    box-shadow: 0 2px 6px rgba(60,60,60,0.07);
    padding: 10px 18px;
    font-size: 15px;
    margin: 4px 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', Arial, sans-serif;
    font-weight: 500;
}
button:hover, button:focus {
    background: #e5e5ea;
    color: #222;
    box-shadow: 0 4px 12px rgba(60,60,60,0.10);
    border-color: #bdbdbd;
}
button[disabled] {
    background: #ececec;
    color: #b0b3bb;
    border-color: #e0e0e0;
    cursor: not-allowed;
    box-shadow: none;
}

/* --- QR-код и модалка --- */
#session-qr-code {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}
#show-qr-btn {
    width: 100%;
    margin-bottom: 8px;
}
#qr-modal .qr-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}
#qr-modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
    color: #333;
    cursor: pointer;
}
#qr-modal-canvas {
    background: yellow !important;
    min-width: 200px;
    min-height: 200px;
    max-width: 400px;
    max-height: 400px;
    width: auto;
    height: auto;
    border: 2px solid red !important;
    object-fit: contain;
}
#qr-modal-canvas img {
    display: block !important;
    max-width: 400px !important;
    max-height: 400px !important;
    width: auto !important;
    height: auto !important;
    border: 2px solid blue !important;
    background: white !important;
    object-fit: contain !important;
}

/* --- Списки билетов и статусов --- */
.status-list {
    margin-bottom: 12px;
}
.ticket-badge {
    display: inline-block;
    background: #e9ecef;
    color: #333;
    border-radius: 5px;
    padding: 4px 10px;
    margin: 2px 4px 2px 0;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.ticket-badge.winning-badge {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}
.ticket-badge.prewinning-badge {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

/* --- Футер статистики --- */
#game-stats {
    background: #f1f3f4;
    border-radius: 8px;
    padding: 14px 20px;
    margin: 18px auto 0 auto;
    font-size: 16px;
    color: #333;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    max-width: 400px;
}

/* --- Билеты --- */
.ticket {
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    margin: 24px auto;
    padding: 24px 18px 18px 18px;
    max-width: 440px;
    min-width: 340px;
    border: 1px solid #e2e6ea;
    aspect-ratio: 1.4 / 1;
    width: 350px;
    max-width: 100%;
    height: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
}
.ticket .header {
    display: flex;
    align-items: center;
}
.ticket .logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e2e6ea;
}
.ticket .game-name {
    flex: 1;
    text-align: center;
    width: auto;
    display: block;
}
.ticket .ticket-number {
    margin-left: auto;
    text-align: right;
    font-weight: bold;
    color: #007bff;
    font-size: 18px;
}
.ticket table {
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    table-layout: fixed;
    margin-bottom: 12px;
}
.ticket td {
    border: 1px solid #dee2e6;
    min-width: 48px;
    min-height: 48px;
    width: 48px;
    height: unset !important;
    text-align: center;
    font-size: 22px;
    background: #fff;
    border-radius: 4px;
    transition: background 0.2s;
    padding: 0;
    vertical-align: top !important;
}
.ticket .number {
    font-weight: bold;
    font-size: 22px;
    line-height: 1.2;
}
.ticket .text {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}
.ticket .footer {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* --- Статусы билетов --- */
.winning-line {
    background: #d4edda !important;
    border: 2px solid #28a745 !important;
    color: #155724 !important;
}
.pre-winning-line {
    background: #fff3cd !important;
    border: 2px solid #28a745 !important;
    color: #856404 !important;
}
.pre-winning-missing {
    border: 3px solid #28a745 !important;
    box-shadow: 0 0 0 2px #b6f5c2 !important;
    z-index: 2;
}
/* .dropped-number {
    background: #e2e3e5 !important;
    color: #6c757d !important;
    opacity: 0.5 !important;
}
*/

/* --- Мелкие правки --- */
input, select {
    border-radius: 5px;
    border: 1px solid #ced4da;
    padding: 7px 10px;
    font-size: 15px;
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
}
label {
    font-size: 14px;
    color: #333;
    margin-bottom: 3px;
    display: block;
}
.form-group {
    margin-bottom: 14px;
}
.file-upload-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.file-name {
    font-size: 13px;
    color: #888;
}
hr.form-divider {
    border: none;
    border-top: 1px solid #e2e6ea;
    margin: 18px 0;
}

/* --- СТИЛИ ДЛЯ КАСТОМНОЙ КНОПКИ ЗАГРУЗКИ ФАЙЛА --- */
.file-input-hidden {
    display: none; /* Прячем стандартную кнопку */
}

/* --- Стили для выравнивания кнопок --- */
.file-upload-group {
    margin-bottom: 10px;
}
.file-upload-group:last-child {
    margin-bottom: 0;
}
#media-panel .btn {
    flex-shrink: 0; /* Запрещаем кнопке сжиматься */
}

#media-panel .btn {
    flex-shrink: 0; /* Запрещаем кнопке сжиматься */
}

/* --- Стили для модального окна загрузки --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--panel-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    text-align: center;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.modal-list {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
    max-height: 300px;
    overflow-y: auto;
}

.modal-list-item-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    background-color: #fff;
    color: var(--primary-color);
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.modal-list-item-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.modal-close-btn {
    margin-top: 10px;
}

.modal-close-btn {
    margin-top: 10px;
}

/* --- СТИЛИ ДЛЯ ЭКРАНА ВЕДУЩЕГО --- */
#presenter-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #1a1a1a;
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 2000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#presenter-screen.hidden {
    display: none;
}

/* ШАПКА ЭКРАНА ВЕДУЩЕГО */
.presenter-header {
    flex-shrink: 0;
    padding: 20px 30px;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.presenter-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    flex: 1;
    max-width: 100%;
}

#presenter-logo { 
    max-height: 60px;
    max-width: 120px;
    object-fit: contain;
}

.presenter-header-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#presenter-game-name {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

.presenter-host-info {
    display: flex;
    gap: 20px;
    font-size: 1.1rem;
}

/* ЦЕНТРАЛЬНАЯ ЧАСТЬ ЭКРАНА ВЕДУЩЕГО */
.presenter-main {
    flex-grow: 1;
    display: flex;
    gap: 30px;
    padding: 30px;
    overflow: hidden;
}

/* ЛЕВАЯ ЧАСТЬ: QR-код или медиаконтент */
.presenter-left-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#presenter-qr-area {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.presenter-media {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    transform: none !important;
    transform-origin: center center !important;
}

.presenter-media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 10px;
    box-sizing: border-box;
}

/* ПРАВАЯ ЧАСТЬ: Бочонок, последние шары и название композиции - 30% ширины */
.presenter-right-area {
    flex: 0 0 30%;
    width: 30%;
    min-width: 0;
    max-width: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    justify-content: flex-start;
    padding: 20px;
    box-sizing: border-box;
}

#presenter-barrel-display {
    width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

#barrel-image {
    height: 250px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: none;
}

/* ПОСЛЕДНИЕ ВЫПАВШИЕ ШАРЫ */
#presenter-last-balls {
    text-align: center;
    flex-shrink: 0;
}

#presenter-last-balls h3 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

#presenter-last-balls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: relative;
    height: 80px;
}

/* НАЗВАНИЕ КОМПОЗИЦИИ И ИСПОЛНИТЕЛЯ */
#presenter-media-title {
    text-align: center;
    margin-top: auto;
    padding: 20px;
    width: 100%;
    flex-shrink: 0;
}

#presenter-media-artist {
    font-size: 2.5rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    line-height: 1.2;
}

#presenter-media-track {
    font-size: 2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    line-height: 1.2;
}

.last-ball-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    transition: transform 0.3s ease;
    position: relative;
}

.last-ball-image:hover {
    transform: scale(1.1);
}
/* ОБЛАСТЬ СТАТУСА ПРЕДВЫИГРЫШНЫХ/ВЫИГРЫШНЫХ БИЛЕТОВ */
.presenter-status-area {
    display: none;
    flex-shrink: 0;
    padding: 20px 30px;
    background-color: rgba(0, 0, 0, 0.4);
    text-align: center;
}

#presenter-status-message {
    font-size: 1.5rem;
    font-weight: bold;
}

.winning-status {
    color: #28a745;
}

.pre-winning-status {
    color: #ffc107;
}

.waiting-status {
    color: #6c757d;
}

/* --- Новый компактный футер и стили шаров --- */
.presenter-footer {
    height: 250px;
    min-height: 250px;
    max-height: 250px;
    background: #041d35;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
}
#presenter-ball-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    row-gap: 10px;
    column-gap: 10px;
    align-items: center;
    justify-items: center;
    position: relative;
    padding: 8px;
    box-sizing: border-box;
}
.grid-ball {
    aspect-ratio: 1/1;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    min-width: 40px;
    min-height: 40px;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #222;
    font-weight: 700;
    color: #222;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    overflow: hidden;
}
.grid-ball.dropped {
    background: #ffe082;
    color: #b26a00;
    border: 2px solid #b26a00;
    box-shadow: 0 2px 8px rgba(255,193,7,0.18);
}
/* Убираю изменение размера шаров при изменении масштаба */
@media (max-width: 900px) {
    .grid-ball { font-size: 1.25em; max-width: 48px; }
}
@media (max-width: 600px) {
    .grid-ball { font-size: 1.25em; max-width: 40px; }
}

#close-presenter-screen {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 2010;
}

/* === Кастомный футер билета === */
.ticket-footer-custom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 0 10px 0;
  background: var(--main-footer-bg, #fff);
  border-top: 2px solid #e5e5ea;
}
.ticket-host-label {
  font-size: 1.45em;
  font-weight: 700;
  color: #23272f;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
  text-align: center;
}
.ticket-host-title {
  color: #007aff;
  font-weight: 800;
  font-size: 1.1em;
  margin-right: 8px;
  text-transform: uppercase;
}
.ticket-host-name {
  color: #23272f;
  font-weight: 700;
  font-size: 1.1em;
}
.ticket-host-phone {
  font-size: 1.25em;
  font-weight: 600;
  color: #007aff;
  margin-top: 2px;
  letter-spacing: 0.03em;
  text-align: center;
}

/* === Стиль подсказки о формате аудиофайлов === */
.audio-format-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: #f0f6ff;
  border-radius: 10px;
  border: 1.5px solid #b6d4fe;
  margin-top: 0;
  font-size: 13.5px;
  color: #1a2330;
  box-shadow: 0 2px 8px rgba(80, 160, 255, 0.06);
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}
.load-action-row .audio-format-hint {
  margin-left: 8px;
}
.hint-icon {
  font-size: 18px;
  color: #2196f3;
  flex-shrink: 0;
  margin-top: 2px;
}
.hint-content {
  line-height: 1.5;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
.audio-format-hint strong {
  color: #1976d2;
  font-weight: 700;
  font-size: 1.08em;
}
.audio-format-hint span {
  color: #1a2330;
}

/* --- Вертикальный список кнопок загрузки с подсказками --- */
.load-actions-row-vertical {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0 auto;
  max-width: 600px;
}
.load-action-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  width: 100%;
}
.load-action-row .neumorph-btn {
  min-width: 180px;
  flex-shrink: 0;
}
.load-action-row .audio-format-hint {
  flex: 1;
  margin: 0 0 0 8px;
  min-width: 0;
}
@media (max-width: 700px) {
  .load-action-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .load-action-row .audio-format-hint {
    margin: 0;
  }
}

/* --- Баннеры на вкладке Скачать --- */
.download-banners-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
  margin: 0 auto 0 auto;
}
.download-banner-link {
  position: relative;
  width: 200px;
  height: 320px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(80,160,255,0.10);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s, transform 0.2s;
}
.download-banner-link:hover {
  box-shadow: 0 6px 24px rgba(80,160,255,0.18);
  transform: translateY(-4px) scale(1.03);
  z-index: 2;
}
.download-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  display: block;
}
.banner-lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  border-radius: 18px;
  z-index: 2;
}
.banner-lock-icon {
  font-size: 2.2em;
  color: #fff;
}
.banner-lock-text {
  color: #fff;
  font-size: 1.08em;
  margin-top: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
@media (max-width: 600px) {
  .download-banners-row {
    flex-direction: column;
    gap: 18px;
  }
  .download-banner-link {
    width: 100%;
    max-width: 340px;
    height: 180px;
    margin: 0 auto;
  }
}




/* --- ФИНАЛЬНЫЕ СТИЛИ ДЛЯ ПЕЧАТИ --- */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 1. Скрываем ВСЁ */
    body * {
        visibility: hidden !important;
    }

    /* 2. Показываем ТОЛЬКО контейнер с билетами */
    #tickets-container, #tickets-container * {
        visibility: visible !important;
    }

    /* 3. Позиционируем контейнер */
    #tickets-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100%;
    }

    /* Общие стили для билета при печати */
    .ticket {
        page-break-inside: avoid;
        margin-top: 32mm;
        margin-bottom: 16mm;
        box-shadow: none !important;
        border: 1px solid #000 !important;
        background: #fff !important;
        margin: 0 !important;
    }

    .ticket:first-child {
        margin-top: 0;
    }

    /* Режим 1 билет на страницу (5x5, 6x6) - ИСПРАВЛЕНО */
    body.print-1-up #tickets-container {
        display: block !important; /* Не flex, а обычный блок */
    }
    body.print-1-up .ticket {
        width: 200mm !important;
        height: 280mm !important;
        margin: 5mm auto !important; /* Центрируем билет на странице */
        page-break-after: always !important; /* Каждый билет на новой странице */
    }
    body.print-1-up .ticket:last-child {
        page-break-after: auto !important;
    }

    /* Режим 2 билета на страницу (3x3) */
    body.print-2-up #tickets-container {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center;
        align-items: center;
        width: 210mm;
        height: 297mm;
    }
    body.print-2-up .ticket {
        width: 190mm !important;
        height: 135mm !important;
        margin: 5mm 0 !important;
    }
        body.print-2-up .ticket:nth-child(odd) {
            margin-right: 5mm !important;
        }
    }

        #player-container {
        display: flex;
        flex-direction: column;
            height: 100vh;
            padding: 10px;
    }
    
    #player-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
    }
    
    #player-logo {
            width: 40px;
            height: 40px;
        }

        .player-header-info {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        #player-game-name {
            font-size: 1.1rem;
            margin: 0;
        }

        #player-ticket-id {
            font-size: 0.9rem;
            color: #666;
        }

        /* ВКЛАДКИ ИГРОКА */
        .player-tabs {
            display: flex;
            margin-bottom: 15px;
            border-bottom: 1px solid #ddd;
        }

        .player-tab-btn {
            flex: 1;
            padding: 10px;
            background: none;
            border: none;
            border-bottom: 3px solid transparent;
            cursor: pointer;
            font-size: 1rem;
            transition: all 0.3s ease;
        }

        .player-tab-btn.active {
            border-bottom-color: var(--primary-color);
            color: var(--primary-color);
            font-weight: bold;
        }

        .player-tab-content {
            display: none;
            flex-grow: 1;
        }

        .player-tab-content.active {
            display: flex;
            flex-direction: column;
        }

        /* ВКЛАДКА ИГРЫ */
        #player-game-tab {
            justify-content: center;
    }
    
    #player-ticket {
            flex-grow: 1;
            display: flex;
            justify-content: center;
            align-items: center;
    }
    
    #ticket-grid {
        width: 100%;
            max-width: 400px;
    }
    
    #ticket-grid td {
        padding: 8px;
            font-size: 1.2rem;
            border: 1px solid #ccc;
    }
    
    #ticket-grid td.highlight {
            background-color: #d1ecf1;
    }
    
    #player-footer {
            margin-top: 15px;
        text-align: center;
        }

        /* ВКЛАДКА ВЕДУЩЕГО */
        .host-profile {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
            padding: 20px;
        }

        .host-photo {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            overflow: hidden;
            border: 3px solid var(--primary-color);
        }

        .host-photo img {
        width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .host-info {
            text-align: center;
            width: 100%;
        }

        #host-name {
            font-size: 1.5rem;
            margin: 0 0 15px 0;
            color: var(--primary-color);
        }

        .host-contacts {
        display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .host-phone {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }

        .phone-link {
            font-size: 1.2rem;
            color: var(--primary-color);
            text-decoration: none;
            font-weight: bold;
        }

        .save-contact-btn {
            padding: 8px 16px;
            background-color: #28a745;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.9rem;
        }

        .save-contact-btn:hover {
            background-color: #218838;
        }

        .host-social h3 {
            margin: 0 0 10px 0;
            font-size: 1.1rem;
        }

        .social-links {
            display: flex;
        justify-content: center;
            gap: 15px;
        }

        .social-link {
            padding: 8px 16px;
            text-decoration: none;
            color: white;
            border-radius: 4px;
            font-size: 0.9rem;
            transition: opacity 0.3s ease;
        }

        .social-link:hover {
            opacity: 0.8;
        }

        .social-link.vk {
            background-color: #4a76a8;
        }

        .social-link.telegram {
            background-color: #0088cc;
        }

        .social-link.instagram {
            background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
        }
        
/* СТИЛИ ДЛЯ ИНТЕРФЕЙСА ИГРОКА (ДЕСКТОП) */
#player-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

#player-header {
        display: flex;
        align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

#player-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.player-header-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#player-game-name {
    font-size: 1.5rem;
    margin: 0;
    font-weight: bold;
}

#player-ticket-id {
    font-size: 1rem;
    color: #666;
}

/* ВКЛАДКИ ИГРОКА */
.player-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.player-tab-btn {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.player-tab-btn:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.player-tab-btn.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
}

.player-tab-content {
    display: none;
    flex-grow: 1;
}

.player-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* ВКЛАДКА ИГРЫ */
#player-game-tab {
        justify-content: center;
}

#player-ticket {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
#ticket-grid {
    width: 100%;
    max-width: 500px;
    border-collapse: collapse;
}

#ticket-grid td {
    padding: 15px;
    font-size: 1.5rem;
    border: 2px solid var(--border-color);
    text-align: center;
    vertical-align: middle;
    transition: background-color 0.3s ease;
}

#ticket-grid td.highlight {
    background-color: #d1ecf1;
    color: #0c5460;
        font-weight: bold;
}

#player-footer {
    margin-top: 20px;
    text-align: center;
    padding: 15px;
    background-color: var(--panel-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

#current-ball-info {
        display: flex;
    flex-direction: column;
    gap: 5px;
}

#current-ball-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

#current-ball-media {
    font-size: 1rem;
    color: #666;
}

/* ВКЛАДКА ВЕДУЩЕГО */
.host-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 40px;
    text-align: center;
}

.host-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.host-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.host-info {
    text-align: center;
    width: 100%;
    max-width: 400px;
}

#host-name {
    font-size: 2rem;
    margin: 0 0 20px 0;
    color: var(--primary-color);
    font-weight: bold;
}

.host-contacts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.host-phone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.phone-link {
    font-size: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.phone-link:hover {
    background-color: var(--primary-color);
    color: white;
}

.save-contact-btn {
    padding: 12px 24px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.save-contact-btn:hover {
    background-color: #218838;
}

.host-social h3 {
    margin: 0 0 15px 0;
    font-size: 1.3rem;
    color: #333;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-link {
    padding: 12px 24px;
    text-decoration: none;
    color: white;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.social-link.vk {
    background-color: #4a76a8;
}

.social-link.telegram {
    background-color: #0088cc;
}

.social-link.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

/* --- Оформление билета --- */
.ticket {
    background: white;
    padding: 25px;
    width: 200mm;
    height: 285mm;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-radius: 10px;
    margin-bottom: 30px;
    position: relative;
    border: 1px solid #555;
}

.header {
    height: 15%;
    border-bottom: 2px solid #555;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
        justify-content: space-between;
}

.logo {
    max-height: 80%;
    max-width: 40%;
}

.ticket-number {
    font-size: 24px;
    color: #3498db;
    font-weight: bold;
}

.ticket table {
    width: 100%;
    height: 70%;
    border-collapse: collapse;
    table-layout: fixed;
}

.ticket td {
    border: 2px solid #555;
    padding: 10px;
    position: relative;
    transition: all 0.3s;
    height: 60px;
    text-align: center;
    vertical-align: top !important;
    background: white;
}

.cell-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    height: 100%;
    width: 100%;
}

.number {
    font-weight: bold;
    font-size: 36px;
    line-height: 1;
    margin-bottom: 5px;
    width: 100%;
    text-align: center;
    color: #333;
}

.text {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

.footer {
    height: 10%;
    text-align: center;
    padding-top: 15px;
    font-size: 14px;
    color: #777;
    border-top: 1px solid #555;
}

/* --- Подсветка ячеек только для td --- */
td.dropped-number {
    background: #e2e3e5 !important;
    color: #6c757d !important;
    opacity: 0.5 !important;
    transition: background 0.3s;
}
td.pre-winning-line:not(.dropped-number) {
    background: #fffacd !important;
    border: 2px solid #f39c12 !important;
    color: #856404 !important;
    opacity: 1 !important;
}
td.winning-line:not(.dropped-number) {
    background: #d4edda !important;
    border: 2px solid #28a745 !important;
    color: #155724 !important;
    opacity: 1 !important;
    animation: pulse 1s infinite;
}
/* --- Стили для печати --- */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    .ticket {
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 auto !important;
        padding: 15mm !important;
        box-shadow: none !important;
        page-break-after: always;
        position: static !important;
        background: white !important;
        color: black !important;
        border: 2px solid #000 !important;
    }
    .ticket:not(:first-child),
    .ticket:not(:first-child)::before {
        margin: 0 !important;
        padding: 0 !important;
        content: none !important;
        height: auto !important;
        display: block !important;
    }
    .ticket table {
        table-layout: fixed;
    }
    .ticket td {
        border: 2px solid #000 !important;
        background: white !important;
        color: black !important;
    }
    .number {
        color: black !important;
        font-weight: bolder;
    }
    .text {
        color: #555 !important;
        font-size: 10px !important;
    }
    .header, .footer {
        border-color: #000 !important;
        border-width: 2px !important;
    }
    @page {
        size: A4 portrait;
        margin: 0;
    }
}

@media print {
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    #tickets-container {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        display: block !important;
    }
}

#left-column, #right-column {
    max-height: 95vh;
    overflow-y: auto;
}

#media-panel {
    max-height: none;
    overflow-y: visible;
    height: auto;
    margin-bottom: 16px;
}

/* --- Стили для печати билетов --- */
@media print {
    body, #app-container {
        background: #fff !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .panel, #left-column, #right-column, #center-column {
        background: none !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    #tickets-container {
        margin: 0 !important;
        padding: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    .ticket {
        background: #fff !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
        margin: 8px 0 !important;
        padding: 8px 4px 4px 4px !important;
        page-break-inside: avoid;
        max-width: 100% !important;
    }
    .ticket .header, .ticket .footer {
        color: #000 !important;
        background: none !important;
        border: none !important;
    }
    .ticket .logo {
        filter: none !important;
        background: none !important;
        border: none !important;
    }
    .ticket table, .ticket td {
        border: 1px solid #000 !important;
        background: #fff !important;
        color: #000 !important;
    }
    .ticket .number, .ticket .text {
        color: #000 !important;
    }
    .winning-line, .pre-winning-line, .dropped-number {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        opacity: 1 !important;
    }
    /* Скрыть все панели управления, кнопки, QR-коды, футер статистики */
    #left-column, #right-column, #game-stats, .btn, #session-qr-code, #show-qr-btn, #status-panel, #media-panel, #session-panel, #game-panel, .panel-header, .button-group, .file-upload-group, .form-group, .status-list, #active-session-panel, #presenter-mode-btn, #save-game-btn, #load-game-btn, #new-game-btn {
        display: none !important;
    }
    }

.panel {
    padding: 24px 20px 20px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    margin-bottom: 24px;
    background: #fff;
}

#qr-modal {
    display: none;
}

/* === Базовые переменные и цвета для современного индивидуального стиля === */
:root {
  --main-bg: #f5f5f7;
  --main-fg: #23272f;
  --main-accent: #007aff;
  --main-accent-hover: #0056b3;
  --main-border: #e5e7eb;
  --main-radius: 16px;
  --main-shadow: 0 4px 24px rgba(80, 60, 160, 0.07);
  --main-shadow-hover: 0 8px 32px rgba(80, 60, 160, 0.12);
  --main-header-bg: #fff;
  --main-footer-bg: #fff;
  --tab-active-bg: #fff;
  --tab-inactive-bg: #f5f5f7;
  --tab-active-fg: #007aff;
  --tab-inactive-fg: #23272f;
  --btn-bg: #fff;
  --btn-fg: #23272f;
  --btn-hover-bg: #f0f1f3;
  --btn-disabled-bg: #e5e7eb;
  --btn-disabled-fg: #b0b3bb;
  --arrow-color: #22c55e;
  --input-bg: #fff;
  --input-border: #e0e4ea;
  --input-focus: #a259e6;
  --danger-color: #ff3b30;
  --success-color: #34c759;
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', Arial, sans-serif;
}

body, main {
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: var(--main-bg);
  color: var(--main-fg);
  font-family: var(--font-main);
}

/* Сброс базовых отступов для заголовков */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em 0;
  font-weight: 600;
}

/* Ссылки */
a {
  color: var(--main-accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--main-accent-hover);
}

/* --- Основные панели --- */
#app-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
    box-sizing: border-box;
    position: relative;
}

#left-column {
    width: 320px;
    min-width: 260px;
    max-width: 340px;
    height: 100vh;
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid #e2e6ea;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
}

#right-column {
    width: 340px;
    min-width: 260px;
    max-width: 380px;
    height: 100vh;
    overflow-y: auto;
    background: #fff;
    border-left: 1px solid #e2e6ea;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
}

#center-column {
    flex: 1 1 0;
    margin-left: 340px;
    margin-right: 340px;
    max-width: 900px;
    min-width: 400px;
    height: 100vh;
    overflow-y: auto;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

/* --- Списки билетов и статусов --- */
.status-list {
    margin-bottom: 12px;
}
.ticket-badge {
    display: inline-block;
    background: #e9ecef;
    color: #333;
    border-radius: 5px;
    padding: 4px 10px;
    margin: 2px 4px 2px 0;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.ticket-badge.winning-badge {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}
.ticket-badge.prewinning-badge {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

/* --- Футер статистики --- */
#game-stats {
    background: #f1f3f4;
    border-radius: 8px;
    padding: 14px 20px;
    margin: 18px auto 0 auto;
    font-size: 16px;
    color: #333;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    max-width: 400px;
}

/* --- Билеты --- */
.ticket {
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    margin: 24px auto;
    padding: 24px 18px 18px 18px;
    max-width: 440px;
    min-width: 340px;
    border: 1px solid #e2e6ea;
    aspect-ratio: 1.4 / 1;
    width: 350px;
    max-width: 100%;
    height: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
}
.ticket .header {
    display: flex;
    align-items: center;
}
.ticket .logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e2e6ea;
}
.ticket .game-name {
    flex: 1;
    text-align: center;
    width: auto;
    display: block;
}
.ticket .ticket-number {
    margin-left: auto;
    text-align: right;
    font-weight: bold;
    color: #007bff;
    font-size: 18px;
}
.ticket table {
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    table-layout: fixed;
    margin-bottom: 12px;
}
.ticket td {
    border: 1px solid #dee2e6;
    min-width: 48px;
    min-height: 48px;
    width: 48px;
    height: unset !important;
    text-align: center;
    font-size: 22px;
    background: #fff;
    border-radius: 4px;
    transition: background 0.2s;
    padding: 0;
    vertical-align: top !important;
}
.ticket .number {
    font-weight: bold;
    font-size: 22px;
    line-height: 1.2;
}
.ticket .text {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}
.ticket .footer {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* --- Статусы билетов --- */
.winning-line {
    background: #d4edda !important;
    border: 2px solid #28a745 !important;
    color: #155724 !important;
}
.pre-winning-line {
    background: #fff3cd !important;
    border: 2px solid #ffc107 !important;
    color: #856404 !important;
}

/* .dropped-number {
    background: #e2e3e5 !important;
    color: #6c757d !important;
    opacity: 0.5 !important;
}
*/

/* --- Мелкие правки --- */
input, select {
    border-radius: 5px;
    border: 1px solid #ced4da;
    padding: 7px 10px;
    font-size: 15px;
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
}
label {
    font-size: 14px;
    color: #333;
    margin-bottom: 3px;
    display: block;
}
.form-group {
    margin-bottom: 14px;
}
.file-upload-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.file-name {
    font-size: 13px;
    color: #888;
}
hr.form-divider {
    border: none;
    border-top: 1px solid #e2e6ea;
    margin: 18px 0;
}

/* --- СТИЛИ ДЛЯ КАСТОМНОЙ КНОПКИ ЗАГРУЗКИ ФАЙЛА --- */
.file-input-hidden {
    display: none; /* Прячем стандартную кнопку */
}

/* --- Стили для выравнивания кнопок --- */
.file-upload-group {
    margin-bottom: 10px;
}
.file-upload-group:last-child {
    margin-bottom: 0;
}
#media-panel .btn {
    flex-shrink: 0; /* Запрещаем кнопке сжиматься */
}

#media-panel .btn {
    flex-shrink: 0; /* Запрещаем кнопке сжиматься */
}

/* --- Стили для модального окна загрузки --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--panel-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    text-align: center;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.modal-list {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
    max-height: 300px;
    overflow-y: auto;
}

.modal-list-item-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    background-color: #fff;
    color: var(--primary-color);
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.modal-list-item-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.modal-close-btn {
    margin-top: 10px;
}

.modal-close-btn {
    margin-top: 10px;
}

/* --- СТИЛИ ДЛЯ ЭКРАНА ВЕДУЩЕГО --- */
#presenter-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #1a1a1a;
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 2000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#presenter-screen.hidden {
    display: none;
}

/* ШАПКА ЭКРАНА ВЕДУЩЕГО */
.presenter-header {
    flex-shrink: 0;
    padding: 20px 30px;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.presenter-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    flex: 1;
    max-width: 100%;
}

#presenter-logo { 
    max-height: 60px;
    max-width: 120px;
    object-fit: contain;
}

.presenter-header-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#presenter-game-name {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

.presenter-host-info {
    display: flex;
    gap: 20px;
    font-size: 1.1rem;
}

/* ЦЕНТРАЛЬНАЯ ЧАСТЬ ЭКРАНА ВЕДУЩЕГО */
.presenter-main {
    flex-grow: 1;
    display: flex;
    gap: 30px;
    padding: 30px;
    overflow: hidden;
}

/* ЛЕВАЯ ЧАСТЬ: QR-код или медиаконтент */
.presenter-left-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#presenter-qr-area {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.presenter-media {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    transform: none !important;
    transform-origin: center center !important;
}

.presenter-media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 10px;
    box-sizing: border-box;
}

/* ПРАВАЯ ЧАСТЬ: Бочонок, последние шары и название композиции - 30% ширины */
.presenter-right-area {
    flex: 0 0 30%;
    width: 30%;
    min-width: 0;
    max-width: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    justify-content: flex-start;
    padding: 20px;
    box-sizing: border-box;
}

#presenter-barrel-display {
    width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

#barrel-image {
    height: 250px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: none;
}

/* ПОСЛЕДНИЕ ВЫПАВШИЕ ШАРЫ */
#presenter-last-balls {
    text-align: center;
    flex-shrink: 0;
}

#presenter-last-balls h3 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

#presenter-last-balls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: relative;
    height: 80px;
}

/* НАЗВАНИЕ КОМПОЗИЦИИ И ИСПОЛНИТЕЛЯ */
#presenter-media-title {
    text-align: center;
    margin-top: auto;
    padding: 20px;
    width: 100%;
    flex-shrink: 0;
}

#presenter-media-artist {
    font-size: 2.5rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    line-height: 1.2;
}

#presenter-media-track {
    font-size: 2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    line-height: 1.2;
}

.last-ball-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    transition: transform 0.3s ease;
    position: relative;
}

.last-ball-image:hover {
    transform: scale(1.1);
}

/* ОБЛАСТЬ СТАТУСА ПРЕДВЫИГРЫШНЫХ/ВЫИГРЫШНЫХ БИЛЕТОВ */
.presenter-status-area {
    display: none;
    flex-shrink: 0;
    padding: 20px 30px;
    background-color: rgba(0, 0, 0, 0.4);
    text-align: center;
}

#presenter-status-message {
    font-size: 1.5rem;
    font-weight: bold;
}

.winning-status {
    color: #28a745;
}

.pre-winning-status {
    color: #ffc107;
}

.waiting-status {
    color: #6c757d;
}

/* --- Новый компактный футер и стили шаров --- */
.presenter-footer {
    height: 250px;
    min-height: 250px;
    max-height: 250px;
    background: #041d35;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
}
#presenter-ball-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    row-gap: 10px;
    column-gap: 10px;
    align-items: center;
    justify-items: center;
    position: relative;
    padding: 8px;
    box-sizing: border-box;
}
.grid-ball {
    aspect-ratio: 1/1;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    min-width: 40px;
    min-height: 40px;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #222;
    font-weight: 700;
    color: #222;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    overflow: hidden;
}
.grid-ball.dropped {
    background: #ffe082;
    color: #b26a00;
    border: 2px solid #b26a00;
    box-shadow: 0 2px 8px rgba(255,193,7,0.18);
}
/* Убираю изменение размера шаров при изменении масштаба */
@media (max-width: 900px) {
    .grid-ball { font-size: 1.25em; max-width: 48px; }
}
@media (max-width: 600px) {
    .grid-ball { font-size: 1.25em; max-width: 40px; }
}

#close-presenter-screen {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 2010;
}
/* --- ФИНАЛЬНЫЕ СТИЛИ ДЛЯ ПЕЧАТИ --- */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 1. Скрываем ВСЁ */
    body * {
        visibility: hidden !important;
    }

    /* 2. Показываем ТОЛЬКО контейнер с билетами */
    #tickets-container, #tickets-container * {
        visibility: visible !important;
    }

    /* 3. Позиционируем контейнер */
    #tickets-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100%;
    }

    /* Общие стили для билета при печати */
    .ticket {
        page-break-inside: avoid;
        margin-top: 32mm;
        margin-bottom: 16mm;
        box-shadow: none !important;
        border: 1px solid #000 !important;
        background: #fff !important;
        margin: 0 !important;
    }

    .ticket:first-child {
        margin-top: 0;
    }

    /* Режим 1 билет на страницу (5x5, 6x6) - ИСПРАВЛЕНО */
    body.print-1-up #tickets-container {
        display: block !important; /* Не flex, а обычный блок */
    }
    body.print-1-up .ticket {
        width: 200mm !important;
        height: 280mm !important;
        margin: 5mm auto !important; /* Центрируем билет на странице */
        page-break-after: always !important; /* Каждый билет на новой странице */
    }
    body.print-1-up .ticket:last-child {
        page-break-after: auto !important;
    }

    /* Режим 2 билета на страницу (3x3) */
    body.print-2-up #tickets-container {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center;
        align-items: center;
        width: 210mm;
        height: 297mm;
    }
    body.print-2-up .ticket {
        width: 190mm !important;
        height: 135mm !important;
        margin: 5mm 0 !important;
    }
        body.print-2-up .ticket:nth-child(odd) {
            margin-right: 5mm !important;
        }
    }

        #player-container {
        display: flex;
        flex-direction: column;
            height: 100vh;
            padding: 10px;
    }
    
    #player-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
    }
    
    #player-logo {
            width: 40px;
            height: 40px;
        }

        .player-header-info {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        #player-game-name {
            font-size: 1.1rem;
            margin: 0;
        }

        #player-ticket-id {
            font-size: 0.9rem;
            color: #666;
        }

        /* ВКЛАДКИ ИГРОКА */
        .player-tabs {
            display: flex;
            margin-bottom: 15px;
            border-bottom: 1px solid #ddd;
        }

        .player-tab-btn {
            flex: 1;
            padding: 10px;
            background: none;
            border: none;
            border-bottom: 3px solid transparent;
            cursor: pointer;
            font-size: 1rem;
            transition: all 0.3s ease;
        }

        .player-tab-btn.active {
            border-bottom-color: var(--primary-color);
            color: var(--primary-color);
            font-weight: bold;
        }

        .player-tab-content {
            display: none;
            flex-grow: 1;
        }

        .player-tab-content.active {
            display: flex;
            flex-direction: column;
        }

        /* ВКЛАДКА ИГРЫ */
        #player-game-tab {
            justify-content: center;
    }
    
    #player-ticket {
            flex-grow: 1;
            display: flex;
            justify-content: center;
            align-items: center;
    }
    
    #ticket-grid {
        width: 100%;
            max-width: 400px;
    }
    
    #ticket-grid td {
        padding: 8px;
            font-size: 1.2rem;
            border: 1px solid #ccc;
    }
    
    #ticket-grid td.highlight {
            background-color: #d1ecf1;
    }
    
    #player-footer {
            margin-top: 15px;
        text-align: center;
        }

        /* ВКЛАДКА ВЕДУЩЕГО */
        .host-profile {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
            padding: 20px;
        }

        .host-photo {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            overflow: hidden;
            border: 3px solid var(--primary-color);
        }

        .host-photo img {
        width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .host-info {
            text-align: center;
            width: 100%;
        }

        #host-name {
            font-size: 1.5rem;
            margin: 0 0 15px 0;
            color: var(--primary-color);
        }

        .host-contacts {
        display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .host-phone {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }

        .phone-link {
            font-size: 1.2rem;
            color: var(--primary-color);
            text-decoration: none;
            font-weight: bold;
        }

        .save-contact-btn {
            padding: 8px 16px;
            background-color: #28a745;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.9rem;
        }

        .save-contact-btn:hover {
            background-color: #218838;
        }

        .host-social h3 {
            margin: 0 0 10px 0;
            font-size: 1.1rem;
        }

        .social-links {
            display: flex;
        justify-content: center;
            gap: 15px;
        }

        .social-link {
            padding: 8px 16px;
            text-decoration: none;
            color: white;
            border-radius: 4px;
            font-size: 0.9rem;
            transition: opacity 0.3s ease;
        }

        .social-link:hover {
            opacity: 0.8;
        }

        .social-link.vk {
            background-color: #4a76a8;
        }

        .social-link.telegram {
            background-color: #0088cc;
        }

        .social-link.instagram {
            background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
        }
        
/* СТИЛИ ДЛЯ ИНТЕРФЕЙСА ИГРОКА (ДЕСКТОП) */
#player-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

#player-header {
        display: flex;
        align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

#player-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.player-header-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#player-game-name {
    font-size: 1.5rem;
    margin: 0;
    font-weight: bold;
}

#player-ticket-id {
    font-size: 1rem;
    color: #666;
}

/* ВКЛАДКИ ИГРОКА */
.player-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.player-tab-btn {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.player-tab-btn:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.player-tab-btn.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
}

.player-tab-content {
    display: none;
    flex-grow: 1;
}

.player-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* ВКЛАДКА ИГРЫ */
#player-game-tab {
        justify-content: center;
}

#player-ticket {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#ticket-grid {
    width: 100%;
    max-width: 500px;
    border-collapse: collapse;
}

#ticket-grid td {
    padding: 15px;
    font-size: 1.5rem;
    border: 2px solid var(--border-color);
    text-align: center;
    vertical-align: middle;
    transition: background-color 0.3s ease;
}

#ticket-grid td.highlight {
    background-color: #d1ecf1;
    color: #0c5460;
        font-weight: bold;
}

#player-footer {
    margin-top: 20px;
    text-align: center;
    padding: 15px;
    background-color: var(--panel-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

#current-ball-info {
        display: flex;
    flex-direction: column;
    gap: 5px;
}

#current-ball-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

#current-ball-media {
    font-size: 1rem;
    color: #666;
}

/* ВКЛАДКА ВЕДУЩЕГО */
.host-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 40px;
    text-align: center;
}

.host-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.host-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.host-info {
    text-align: center;
    width: 100%;
    max-width: 400px;
}

#host-name {
    font-size: 2rem;
    margin: 0 0 20px 0;
    color: var(--primary-color);
    font-weight: bold;
}

.host-contacts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.host-phone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.phone-link {
    font-size: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.phone-link:hover {
    background-color: var(--primary-color);
    color: white;
}

.save-contact-btn {
    padding: 12px 24px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.save-contact-btn:hover {
    background-color: #218838;
}

.host-social h3 {
    margin: 0 0 15px 0;
    font-size: 1.3rem;
    color: #333;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-link {
    padding: 12px 24px;
    text-decoration: none;
    color: white;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.social-link.vk {
    background-color: #4a76a8;
}

.social-link.telegram {
    background-color: #0088cc;
}

.social-link.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

/* --- Оформление билета --- */
.ticket {
    background: white;
    padding: 25px;
    width: 200mm;
    height: 285mm;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-radius: 10px;
    margin-bottom: 30px;
    position: relative;
    border: 1px solid #555;
}

.header {
    height: 15%;
    border-bottom: 2px solid #555;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
        justify-content: space-between;
}

.logo {
    max-height: 80%;
    max-width: 40%;
}

.ticket-number {
    font-size: 24px;
    color: #3498db;
    font-weight: bold;
}

.ticket table {
    width: 100%;
    height: 70%;
    border-collapse: collapse;
    table-layout: fixed;
}

.ticket td {
    border: 2px solid #555;
    padding: 10px;
    position: relative;
    transition: all 0.3s;
    height: 60px;
    text-align: center;
    vertical-align: top !important;
    background: white;
}

.cell-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    height: 100%;
    width: 100%;
}

.number {
    font-weight: bold;
    font-size: 36px;
    line-height: 1;
    margin-bottom: 5px;
    width: 100%;
    text-align: center;
    color: #333;
}

.text {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

.footer {
    height: 10%;
    text-align: center;
    padding-top: 15px;
    font-size: 14px;
    color: #777;
    border-top: 1px solid #555;
}

/* --- Подсветка ячеек только для td --- */
td.dropped-number {
    background: #e2e3e5 !important;
    color: #6c757d !important;
    opacity: 0.5 !important;
    transition: background 0.3s;
}
td.pre-winning-line:not(.dropped-number) {
    background: #fffacd !important;
    border: 2px solid #f39c12 !important;
    color: #856404 !important;
    opacity: 1 !important;
}
td.winning-line:not(.dropped-number) {
    background: #d4edda !important;
    border: 2px solid #28a745 !important;
    color: #155724 !important;
    opacity: 1 !important;
    animation: pulse 1s infinite;
}

/* --- Стили для печати --- */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    .ticket {
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 auto !important;
        padding: 15mm !important;
        box-shadow: none !important;
        page-break-after: always;
        position: static !important;
        background: white !important;
        color: black !important;
        border: 2px solid #000 !important;
    }
    .ticket:not(:first-child),
    .ticket:not(:first-child)::before {
        margin: 0 !important;
        padding: 0 !important;
        content: none !important;
        height: auto !important;
        display: block !important;
    }
    .ticket table {
        table-layout: fixed;
    }
    .ticket td {
        border: 2px solid #000 !important;
        background: white !important;
        color: black !important;
    }
    .number {
        color: black !important;
        font-weight: bolder;
    }
    .text {
        color: #555 !important;
        font-size: 10px !important;
    }
    .header, .footer {
        border-color: #000 !important;
        border-width: 2px !important;
    }
    @page {
        size: A4 portrait;
        margin: 0;
    }
}

@media print {
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    #tickets-container {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        display: block !important;
    }
}

#left-column, #right-column {
    max-height: 95vh;
    overflow-y: auto;
}

#media-panel {
    max-height: none;
    overflow-y: visible;
    height: auto;
    margin-bottom: 16px;
}

/* --- Стили для печати билетов --- */
@media print {
    body, #app-container {
        background: #fff !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .panel, #left-column, #right-column, #center-column {
        background: none !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    #tickets-container {
        margin: 0 !important;
        padding: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    .ticket {
        background: #fff !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
        margin: 8px 0 !important;
        padding: 8px 4px 4px 4px !important;
        page-break-inside: avoid;
        max-width: 100% !important;
    }
    .ticket .header, .ticket .footer {
        color: #000 !important;
        background: none !important;
        border: none !important;
    }
    .ticket .logo {
        filter: none !important;
        background: none !important;
        border: none !important;
    }
    .ticket table, .ticket td {
        border: 1px solid #000 !important;
        background: #fff !important;
        color: #000 !important;
    }
    .ticket .number, .ticket .text {
        color: #000 !important;
    }
    .winning-line, .pre-winning-line, .dropped-number {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        opacity: 1 !important;
    }
    /* Скрыть все панели управления, кнопки, QR-коды, футер статистики */
    #left-column, #right-column, #game-stats, .btn, #session-qr-code, #show-qr-btn, #status-panel, #media-panel, #session-panel, #game-panel, .panel-header, .button-group, .file-upload-group, .form-group, .status-list, #active-session-panel, #presenter-mode-btn, #save-game-btn, #load-game-btn, #new-game-btn {
        display: none !important;
    }
    }

.panel {
    padding: 24px 20px 20px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    margin-bottom: 24px;
    background: #fff;
}
.panel h3, .panel h4 {
    margin-top: 0;
    margin-bottom: 18px;
    padding-left: 2px;
}

.button-group,
.form-group,
.status-list,
.file-upload-group {
    margin-bottom: 14px;
    padding-left: 2px;
    padding-right: 2px;
}

.btn {
    margin-top: 6px;
    margin-bottom: 6px;
    margin-left: 2px;
    margin-right: 2px;
    }

/* --- Дизайнерские фоны и крупные бочонки для экрана ведущего --- */
/* --- Усиленная шапка и крупный пустой бочонок --- */
.presenter-header {
    background: rgba(10, 10, 10, 0.85);
    border-bottom: 3px solid #bfa14a;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
    padding: 18px 32px 12px 32px;
}
.presenter-header-info, .presenter-host-info {
        color: #fff;
    text-shadow: 0 2px 8px #000;
}
.presenter-main {
    background: linear-gradient(135deg, #0a2342 0%, #1e355d 60%, #3a2c60 100%);
}
.presenter-footer {
    height: 160px;
    min-height: 120px;
    max-height: 180px;
    background: linear-gradient(90deg, #041d35 0%, #bfa14a 100%);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.18);
    border-top: 3px solid #bfa14a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
}
#barrel-image {
    height: 250px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: none;
}
.last-ball-image {
    width: 80px;
    height: 80px;
}

/* --- Общий дизайнерский фон для всех основных блоков экрана ведущего --- */
.presenter-header, .presenter-main, .presenter-footer {
    background-image: url('../img/background.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

/* Убираем белый фон и лишние отступы у вложенных элементов шапки ведущего */
#presenter-logo, .presenter-header-info, .presenter-host-info, .presenter-header {
    background: transparent !important;
    box-shadow: none !important;
}
.presenter-header {
    padding-top: 12px;
    padding-bottom: 12px;
}

/* --- Индивидуальные дизайнерские фоны для шапки, центра и футера ведущего --- */
.presenter-header {
    position: relative;
    background-image: url('../img/header-bar.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}
.presenter-footer {
    position: relative;
    background-image: url('../img/footer-bar.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}
.presenter-main {
    background-image: url('../img/background.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

/* --- Фон-картинка и затемнение для шапки и футера ведущего --- */
.presenter-header, .presenter-footer {
    position: relative;
    background-image: url('../img/background.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}
.presenter-header::before, .presenter-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10,10,10,0.3);
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
}
.presenter-header > *, .presenter-footer > * {
    position: relative;
    z-index: 1;
}

/* --- ЧИСТЫЕ стили для экрана ведущего --- */
.presenter-header {
    position: relative;
    background-image: url('../img/header-bar.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent !important;
    border-bottom: 3px solid #bfa14a;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
    padding: 18px 32px 12px 32px;
}
.presenter-footer {
    position: relative;
    background-image: url('../img/footer-bar.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent !important;
    border-top: 3px solid #bfa14a;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    height: auto;
    min-height: 60px;
    max-height: 15vh;
    font-size: 1.5vw;
}
.presenter-main {
    background-image: url('../img/background.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent !important;
}
.presenter-header::before, .presenter-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10,10,10,0.3);
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
}
.presenter-header > *, .presenter-footer > * {
    position: relative;
    z-index: 1;
}

/* --- Окончательная чистка конфликтующих стилей для экрана ведущего --- */
.presenter-header,
.presenter-footer,
.presenter-main,
.presenter-header::before,
.presenter-footer::before {
    background: none !important;
    background-image: none !important;
    box-shadow: none !important;
}
.presenter-header {
    position: relative;
    background: linear-gradient(135deg, 
        #d4af37 0%, 
        #bfa14a 25%, 
        #8b7355 50%, 
        #bfa14a 75%, 
        #d4af37 100%) !important;
    background-size: 200% 200% !important;
    animation: headerGradient 8s ease infinite !important;
    background-image: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    border-bottom: 3px solid #d4af37 !important;
    padding: 18px 32px 12px 32px;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

@keyframes headerGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.presenter-footer {
    position: relative;
    background-image: url('../img/footer-bar.png') !important;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border-top: 3px solid #bfa14a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    height: auto;
    min-height: 60px;
    max-height: 15vh;
    font-size: 1.5vw;
}
.presenter-main {
    background-image: url('../img/background.jpg') !important;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}
.presenter-header::before, .presenter-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10,10,10,0.3);
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
}
.presenter-header > *, .presenter-footer > * {
    position: relative;
    z-index: 1;
}

/* === ДОБАВЛЕНО ИЗ styles.css (уникальные стили) === */

/* Панель управления (controls) — если используется где-то в проекте */
.controls {
    position: fixed;
    left: 10px;
    top: 10px;
    width: 280px;
    max-height: 95vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1000;
    font-size: 14px;
    border: 1px solid var(--border-color);
}
.controls h2 {
    font-size: 1.3em;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-color);
}
.controls label {
    display: block;
    margin: 8px 0;
    color: var(--text-color);
}
.controls input, 
.controls select, 
.controls textarea {
    width: 100%;
    padding: 8px;
    margin: 3px 0 8px 0;
    box-sizing: border-box;
    font-size: 13px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
}
.controls textarea {
    min-height: 80px;
    resize: vertical;
}
.controls button {
    padding: 10px 12px;
    margin: 5px 0;
    width: 100%;
    font-size: 13px;
    background: var(--primary-color);
    color: rgb(140, 92, 198);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(80, 60, 160, 0.06);
    border: 1px solid #d1d5db;
}
.controls button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.undo-btn {
    background: var(--warning-color) !important;
}
.undo-btn:hover {
    background: #e67e22 !important;
}
.game-btn {
    background: #9b59b6 !important;
}
.game-btn:hover {
    background: #8e44ad !important;
}
.win-options {
    background: rgba(240, 240, 240, 0.7);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}
.win-options h4 {
    margin: 0 0 10px 0;
    text-align: center;
    color: var(--primary-color);
    padding: 12px;
    background: rgba(240, 240, 240, 0.9);
}
.win-options-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.win-options-checkboxes label {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 5px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 3px;
}
.win-options-checkboxes input {
    width: auto;
    margin: 0 8px 0 0;
}
.win-options h3 {
    margin: 10px 0 5px 0;
    font-size: 1.1em;
    color: var(--primary-color);
}
.win-options label {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 5px;
}
.controls::-webkit-scrollbar {
    width: 6px;
}
.controls::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
}
.controls::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}
.controls::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Если в проекте используется #ticketsContainer (альтернативный контейнер билетов) */
#ticketsContainer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-left: 320px;
    padding: 20px;
    width: calc(100% - 340px);
    box-sizing: border-box;
    transform: scale(1);
}
@media (max-width: 1600px) {
    #ticketsContainer {
        grid-template-columns: 1fr;
    }
}
@media print {
    #ticketsContainer {
        display: block !important;
    }
    .ticket {
        transform: none !important;
        margin: 0 !important;
        width: 200mm !important;
        height: 285mm !important;
    }
}

/* Статусная панель (если используется) */
.statusPanel {
    position: fixed;
    top: 20px;
    right: 15px;
    width: 400px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 999;
    border: 1px solid var(--border-color);
    max-height: 90vh;
    overflow-y: auto;
    padding: 15px;
}
.statusPanel h3 {
    color: var(--primary-color);
    margin-top: 0;
    text-align: center;
}
.status-category {
    margin-bottom: 20px;
}
.status-category h4 {
    margin-bottom: 8px;
    color: var(--text-color);
    text-align: center;
}
.ticket-list {
    max-height: 120px;
    overflow-y: auto;
    margin: 10px 0;
    padding: 5px;
    background: rgba(240, 240, 240, 0.7);
    border-radius: 5px;
}
.ticket-badge {
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 2px;
    display: inline-block;
    font-size: 12px;
}
.winning-badge {
    background: var(--success-color);
    color: white;
}
.prewinning-badge {
    background: var(--warning-color);
    color: white;
}

/* Модальные окна (альтернативные) */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}
.modal-content {
    background: white;
    margin: 10% auto;
    padding: 20px;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.close {
    float: right;
    cursor: pointer;
    font-size: 24px;
}

/* Для мобильных устройств */
@media (max-width: 1400px) {
    .game-management {
        grid-template-columns: 1fr;
    }
    }

.dropped-number {
    background: #cccccc !important; /* серый */
    color: #666666 !important;
    transition: background 0.3s;
}

.dropped-number .number {
    background: #cccccc !important;
    color: #666666 !important;
    border-radius: 4px;
}
.cell-content, .number {
    background: none !important;
}
.number-dropped {
    color: #6c757d !important;
    border: 2px solid #8be78b;
    border-radius: 4px;
    padding: 2px 5px;
    font-weight: bold;
    background: none !important;
}

@media print {
    /* Выигрышная линия */
    .winning-line {
        background: #d4edda !important;
        color: #155724 !important;
        border: 2px solid #28a745 !important;
        opacity: 1 !important;
    }
    /* Предвыигрышная линия */
    .pre-winning-line {
        background: #fffacd !important;
        color: #856404 !important;
        border: 2px solid #f39c12 !important;
        opacity: 1 !important;
    }
    /* Выпавший номер */
    .dropped-number {
        background: #cccccc !important; /* серый */
        color: #666666 !important;
        border: 2px solid #b0b0b0 !important;
        opacity: 1 !important;
    }
    .dropped-number .number,
    .dropped-number .number-dropped {
        color: #6c757d !important;
        border: 1.5px solid #b0b0b0;
        border-radius: 4px;
        padding: 2px 5px;
        font-weight: bold;
        background: none !important;
    }
    /* Если ячейка одновременно выпавшая и в линии — оставляем серый фон! */
    .dropped-number.pre-winning-line,
    .dropped-number.winning-line {
        background: #cccccc !important; /* серый */
        color: #666666 !important;
        border: 2px solid #b0b0b0 !important;
        opacity: 1 !important;
    }
}

/* --- Усиленная подсветка линий для td --- */
td.pre-winning-line {
    background: #fffacd !important;   /* светло-жёлтый фон */
    border: 2px solid #f39c12 !important;
    color: #856404 !important;
}

/* Специальный стиль для невыпавшего шара в предвыигрышной линии */
td.pre-winning-line.pre-winning-missing {
    border: 4px solid #28a745 !important;  /* более толстая зелёная обводка */
    box-shadow: 0 0 0 3px #b6f5c2, 0 0 10px rgba(40, 167, 69, 0.5) !important;  /* двойная тень для заметности */
    background: #fffacd !important;  /* сохраняем жёлтый фон */
    animation: pulse-missing 2s ease-in-out infinite !important;  /* пульсирующая анимация */
    z-index: 10 !important;
}

@keyframes pulse-missing {
    0%, 100% {
        box-shadow: 0 0 0 3px #b6f5c2, 0 0 10px rgba(40, 167, 69, 0.5);
    }
    50% {
        box-shadow: 0 0 0 3px #b6f5c2, 0 0 20px rgba(40, 167, 69, 0.8);
    }
}
td.winning-line {
    background: #e0ffe0 !important;   /* светло-зелёный фон */
    border: 2px solid #27ae60 !important;
    color: #155724 !important;
}
/* Убираю фон у цифры, чтобы не перекрывать фон td */
.number-dropped {
    color: #6c757d !important;
    border: 2px solid #8be78b;
    border-radius: 4px;
    padding: 2px 5px;
    font-weight: bold;
    background: none !important;
}

/* --- Стили для стрелок между шагами --- */
/* Удалено - стрелки больше не нужны */

/* --- Центрирование и визуальное отделение центральной панели --- */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 70vh;
}

/* Удалено конфликтующее определение для #tab-content-setup.tab-content.active */

#setupForm {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.setup-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 0;
  justify-content: flex-start;
}
.setup-row label {
  min-width: 210px;
  font-size: 1.08em;
  font-weight: 500;
  color: var(--main-fg);
  text-align: right;
}
#setupForm input[type="text"],
#setupForm input[type="number"],
#setupForm select {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 320px;
}

/* Кнопки в одну линию */
.setup-buttons {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 32px;
  margin-bottom: 0;
}
.setup-btn-new {
  min-width: 260px;
}

/* Адаптивность для мобильных */
@media (max-width: 700px) {
  .setup-row label {
    min-width: 120px;
    font-size: 1em;
  }
  .setup-btn-new {
    min-width: 220px;
    font-size: 14px;
    padding: 16px 20px;
  }
  
  .btn-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .local-storage-notice {
    padding: 12px;
    margin-bottom: 16px;
  }
  
  .local-storage-notice .notice-content h4 {
    font-size: 16px;
  }
  
  .local-storage-notice .notice-content p {
    font-size: 13px;
  }
}

/* --- Современные крупные вкладки по центру --- */
.tabs {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  background: transparent;
  padding: 0;
  margin: 32px 0 0 0;
  position: relative;
  z-index: 2;
  border-bottom: 1.5px solid #e5e7eb;
}
.tab {
  background: #f3f4f6;
  color: #888;
  border: none;
  border-radius: 10px 10px 0 0;
  padding: 14px 40px 12px 40px;
  font-size: 1.08em;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  outline: none;
  margin-right: 2px;
  position: relative;
  top: 0;
  border-bottom: 1.5px solid #e5e7eb;
}
.tab.active {
  background: #fff;
  color: #23272f;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.10);
  z-index: 3;
  border-bottom: none;
}
.tab:not(.active):hover {
  background: #e5e7eb;
  color: #23272f;
}

/* Панель (консоль) под вкладками */
.tab-content {
  background: #f5f5f7;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(80, 60, 160, 0.10);
  padding: 48px;
  margin-top: 0;
  min-height: 600px;
  max-width: 1200px;
  width: 100%;
  display: none;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
}

.tab-content.active {
  display: block;
}

/* --- Glassmorphism кнопка с голубой подсветкой --- */
.glass-btn {
  position: relative;
  display: inline-block;
  padding: 14px 38px;
  font-size: 1.12em;
  font-weight: 600;
  color: #eaf6ff;
  background: rgba(255, 255, 255, 0.18);
  border: 2.5px solid #7fd6ff;
  border-radius: 18px;
  box-shadow:
    0 2px 16px 0 rgba(0, 180, 255, 0.18),
    0 0 0 2px #b3e6ff inset,
    0 1.5px 8px 0 rgba(0, 180, 255, 0.10) inset;
  backdrop-filter: blur(7px);
  transition: box-shadow 0.2s, border 0.2s, background 0.2s, color 0.2s;
  overflow: hidden;
  cursor: pointer;
}
.glass-btn:before {
  content: '';
  position: absolute;
  left: 10%;
  top: 8%;
  width: 80%;
  height: 40%;
  background: linear-gradient(120deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.12) 100%);
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}
.glass-btn:hover, .glass-btn:focus {
  background: rgba(255,255,255,0.28);
  border-color: #4fd0ff;
  color: #fff;
  box-shadow:
    0 4px 32px 0 rgba(0, 180, 255, 0.28),
    0 0 0 3px #b3e6ff inset,
    0 2px 12px 0 rgba(0, 180, 255, 0.18) inset;
}
.glass-btn:active {
  background: rgba(200,240,255,0.22);
  border-color: #00bfff;
  color: #eaf6ff;
}

/* --- Neumorphism кнопка --- */
.neumorph-btn {
  background: #f7f8fa;
  color: #23272f;
  border: none;
  border-radius: 14px;
  font-size: 1.12em;
  font-family: 'Inter', 'Segoe UI', 'Roboto', Arial, sans-serif;
  font-weight: 600;
  padding: 14px 36px;
  box-shadow:
    8px 8px 24px #e0e4ea,
    -8px -8px 24px #fff,
    inset 2px 2px 8px #e0e4ea,
    inset -2px -2px 8px #fff;
  transition: box-shadow 0.2s, background 0.2s, color 0.2s;
  cursor: pointer;
  outline: none;
  margin: 0;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 3px rgba(80, 60, 160, 0.06);
  border: 1px solid #d1d5db;
}
.neumorph-btn:hover, .neumorph-btn:focus {
  background: #edeef2;
  color: #23272f;
  box-shadow:
    4px 4px 12px #e0e4ea,
    -4px -4px 12px #fff,
    inset 1px 1px 4px #e0e4ea,
    inset -1px -1px 4px #fff;
}

/* --- Стили для вкладки 'Открыть игру' --- */
.open-game-panel {
  display: grid;
  grid-template-columns: 1.1fr 2fr 1.1fr;
  gap: 32px;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  min-height: 340px;
  padding: 32px 0 0 0;
}
.open-game-left, .open-game-right {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: none;
}
.open-game-left label {
  font-size: 1.08em;
  font-weight: 500;
  margin-bottom: 4px;
}
.open-game-left select {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--main-border);
  font-size: 1.08em;
  margin-bottom: 10px;
}
.open-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.open-game-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}
.open-game-right {
  align-items: flex-start;
}
.open-game-saved-label {
  font-size: 1.08em;
  font-weight: 500;
  margin-bottom: 6px;
}
.open-game-right button.audio-btn {
  min-width: 220px;
  margin-bottom: 6px;
  text-align: left;
  font-size: 1.05em;
  font-weight: 500;
}
@media (max-width: 900px) {
  .open-game-panel {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 12px 0 0 0;
  }
  .open-game-left, .open-game-right, .open-game-center {
    align-items: stretch;
  }
  .open-game-right button.audio-btn {
    min-width: 0;
    width: 100%;
  }
}

/* --- Центральная панель для вкладки 'Открыть игру' --- */
.open-game-main-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
.open-game-flex {
  display: grid;
  grid-template-columns: 1.1fr 2fr 1.1fr;
  gap: 32px;
  align-items: flex-start;
  width: 100%;
}
.open-game-left, .open-game-right {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: none;
  align-items: flex-start;
}
.open-game-left label {
  font-size: 1.08em;
  font-weight: 500;
  margin-bottom: 4px;
}
.open-game-left select {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--main-border);
  font-size: 1.08em;
  margin-bottom: 10px;
}
.open-game-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}
.open-game-saved-label {
  font-size: 1.08em;
  font-weight: 500;
  margin-bottom: 6px;
}
.open-game-right button.audio-btn {
  min-width: 220px;
  margin-bottom: 6px;
  text-align: left;
  font-size: 1.05em;
  font-weight: 500;
}
@media (max-width: 900px) {
  .open-game-main-panel {
    padding: 18px 4vw 18px 4vw;
    max-width: 98vw;
  }
  .open-game-flex {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .open-game-left, .open-game-right, .open-game-center {
    align-items: stretch;
  }
  .open-game-right button.audio-btn {
    min-width: 0;
    width: 100%;
  }
}

/* --- Показывать только активную вкладку --- */
/* Удалено дублирующее определение .tab-content */

/* === Стили для вкладки "Открыть игру" === */
.load-game-layout {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.game-selection-panel,
.load-actions-panel {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e0e4ea;
  box-shadow: 0 2px 12px rgba(80, 60, 160, 0.06);
  padding: 32px;
}

.panel-header {
  margin-bottom: 24px;
}

.panel-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: #23272f;
  margin: 0 0 8px 0;
}

.panel-header p {
  font-size: 14px;
  color: #666;
  margin: 0;
}

.game-selector {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.select-wrapper label {
  font-size: 14px;
  font-weight: 500;
  color: #23272f;
}

.modern-select {
  padding: 12px 16px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: #23272f;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modern-select:focus {
  outline: none;
  border-color: #503ca0;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.recent-games h4 {
  font-size: 16px;
  font-weight: 600;
  color: #23272f;
  margin: 0 0 16px 0;
}

.recent-games-list {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.recent-game-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e4ea;
  transition: background 0.2s, border-color 0.2s;
}

.recent-game-item:hover {
  background: #f0f1f3;
  border-color: #d1d5db;
}

.game-info {
  flex: 1;
}

.game-name {
  font-size: 13px;
  font-weight: 500;
  color: #23272f;
  margin-bottom: 3px;
}

.game-date {
  font-size: 11px;
  color: #666;
}

.load-game-btn {
  padding: 6px 12px;
  background: #007aff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.load-game-btn:hover {
  background: #0056cc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.recent-game-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.delete-game-btn {
  padding: 6px 12px;
  background: #ff3b30;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.delete-game-btn:hover {
  background: #d70015;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.load-actions-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
/* Удалено - теперь используются setup-btn-new стили */
/* Адаптивность для вкладки "Открыть игру" */
@media (max-width: 700px) {
  .load-game-layout {
    gap: 24px;
  }
  
  .game-selection-panel,
  .load-actions-panel {
    padding: 24px;
  }
  
  .load-actions-row {
    gap: 12px;
  }
  
  .load-actions-row .setup-btn-new {
    min-width: 200px;
    font-size: 14px;
    padding: 16px 20px;
  }
  
  .load-actions-row .btn-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .recent-game-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .recent-game-actions {
    align-self: flex-end;
    gap: 6px;
  }
  
  .load-game-btn,
  .delete-game-btn {
    padding: 6px 12px;
    font-size: 11px;
  }
  

  
  /* Адаптивность для тарифов */
  .pricing-cards {
    flex-direction: column;
    gap: 8px;
  }
  
  .pricing-card {
    padding: 12px;
  }
  
  .plan-price {
    font-size: 18px;
  }
}

.saved-game-link {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 18px;
  font-size: 0.95em;
  color: #23272f;
  background: #f7f8fa;
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  font-weight: 500;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  box-shadow: 0 1px 6px rgba(80,60,160,0.04);
  border: 1.5px solid var(--main-border);
  cursor: pointer;
  margin-bottom: 10px;
  white-space: nowrap;
}
.saved-game-link:hover, .saved-game-link:focus {
  background: var(--tab-active-bg);
  color: var(--main-accent-hover);
  box-shadow: 0 2px 12px rgba(80,60,160,0.10);
  text-decoration: none;
}

.game-controls-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
  margin: 24px 0 18px 0;
}

.undo-ball-row {
  display: flex;
  justify-content: center;
  margin: 8px 0 10px 0 !important;
}

.control-container {
  width: 284px;
  height: 100px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(80,60,160,0.12), 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e0e4ea;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-bottom: 10px;
}

.auto-mode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

.auto-mode {
  font-weight: 600;
  color: #888;
  background: #ffffff;
  border-radius: 8px;
  padding: 6px 18px;
  margin-right: 0;
  display: inline-block;
  box-shadow: 0 2px 6px rgba(80,60,160,0.08);
  border: 1px solid #e0e4ea;
}
.mode-checkbox {
  font-size: 1em;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.mode-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #22c55e;
}
.manual-input-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#manualBallInput {
  padding: 14px 36px;
  border-radius: 14px;
  border: 1.5px solid var(--main-border);
  font-size: 1.12em;
  text-align: center;
  font-family: 'Inter', 'Segoe UI', 'Roboto', Arial, sans-serif;
  font-weight: 600;
  min-width: 180px;
  /* Убираем стрелочки */
  -moz-appearance: textfield;
  appearance: textfield;
}

#manualBallInput::-webkit-outer-spin-button,
#manualBallInput::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.drawn-balls-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  background: #ffffff;
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 120px;
  max-width: 260px;
  font-size: 1.1em;
  box-shadow: 0 2px 8px rgba(80,60,160,0.08);
  border: 1px solid #e0e4ea;
}
.ball-number {
  background: #e0e4ea;
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 600;
  color: #23272f;
}
@media (max-width: 700px) {
  .game-controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .drawn-balls-list {
    max-width: 100%;
  }
}

/* === Стили для вкладки ИГРА === */
.game-layout {
  display: flex;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Кнопка "Показать подсказку" - такая же ширина, как и блок подсказки (max-width: 900px), выровнена по центру */
#show-tip-btn,
.show-tip-btn {
  display: block;
  width: 100%;
  max-width: 900px;
  margin: 0 auto 18px auto;
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 8px;
  padding: 10px 0;
  font-size: 15px;
  color: #b8860b;
  cursor: pointer;
  box-sizing: border-box;
  position: relative;
}

.game-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 280px;
  flex-shrink: 0;
}

.game-center {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

/* Переопределяем gap между undo-ball-row и tickets-container-row */
.game-center > .undo-ball-row + .tickets-container-row {
  margin-top: -6px !important; /* Компенсируем gap: 16px - 10px желаемый = -6px */
}

.game-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 280px;
  flex-shrink: 0;
}

.win-conditions {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px 18px 14px 38px;
  box-shadow: 0 4px 20px rgba(80,60,160,0.12), 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e0e4ea;
  font-size: 1.08em;
  min-height: 248px;
  height: 248px;
  max-height: 248px;
}
.win-title {
  font-weight: 600;
  margin-bottom: 10px;
}
.win-conditions label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.qr-panel {
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 14px;
  padding: 18px 18px 14px 18px;
  box-shadow: 0 4px 20px rgba(80,60,160,0.12), 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e0e4ea;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  align-self: flex-start;
  margin-top: 0 !important;
}
.qr-img-placeholder {
  width: 120px;
  height: 120px;
  background: #e0e4ea;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 1.1em;
  margin: 8px 0;
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: 1;
  object-fit: contain;
}
.saved-game-link {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 14px 18px;
  font-size: 1.08em;
  color: var(--main-accent);
  background: #f7f8fa;
  border-radius: 10px;
  text-decoration: none;
  text-align: left;
  font-weight: 500;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  box-shadow: 0 1px 6px rgba(80,60,160,0.04);
  border: 1.5px solid var(--main-border);
  cursor: pointer;
}
.game-center {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.media-row {
  display: flex;
  gap: 18px;
  justify-content: stretch;
  width: 100%;
  max-width: none;
  margin: 0;
}
.media-block {
  flex: 1 1 0;
  min-width: 160px;
  min-height: 80px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(80,60,160,0.12), 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e0e4ea;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.08em;
  color: #888;
}
.tickets-row {
  display: flex;
  gap: 18px;
  justify-content: center;
}
.ticket-view {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(80,60,160,0.04);
  min-width: 180px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  color: #888;
}
.game-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 280px;
  flex-shrink: 0;
}
.status-block {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.08);
  padding: 16px;
  min-height: 80px;
  width: 100%;
  box-sizing: border-box;
}
.win-block .status-title {
  color: #22c55e;
  font-weight: 600;
}
.prewin-block .status-title {
  color: #bfa14a;
  font-weight: 600;
}
.status-title {
  margin-bottom: 6px;
}
.status-list {
  font-size: 1.08em;
  color: #23272f;
  margin-bottom: 2px;
}
.view-ticket-row {
  margin-bottom: 8px;
}
@media (max-width: 1100px) {
  .game-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "left center"
      "right center";
    gap: 18px;
  }
  .game-right {
    grid-column: 1 / span 2;
    flex-direction: row;
    gap: 18px;
    justify-content: flex-start;
  }
}
@media (max-width: 800px) {
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "center"
      "right";
    gap: 12px;
    padding: 8px 0 24px 0;
  }
  .game-left, .game-center, .game-right {
    max-width: 100vw;
  }
  .media-row, .tickets-row {
    flex-direction: column;
    gap: 10px;
  }
}

.media-block.video-block, .media-block.image-block {
  min-width: 160px;
  max-width: 100%;
  width: 100%;
  height: 180px;
}
.media-block img {
  width: 100%;
  height: 180px;
  object-fit: contain;
}
.media-controls-row {
  display: flex;
  gap: 18px;
  margin: 10px 0 18px 0;
  align-items: flex-start;
}
.video-controls, .audio-controls {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 320px;
}

/* Маленькие кнопки управления для видео и аудио */
.small-control-btn {
  background: #f7f8fa;
  color: #23272f;
  border: none;
  border-radius: 8px;
  font-size: 0.9em;
  font-family: 'Inter', 'Segoe UI', 'Roboto', Arial, sans-serif;
  font-weight: 500;
  padding: 6px 10px;
  box-shadow:
    4px 4px 12px #e0e4ea,
    -4px -4px 12px #fff,
    inset 1px 1px 3px #e0e4ea,
    inset -1px -1px 3px #fff;
  transition: box-shadow 0.2s, background 0.2s, color 0.2s;
  cursor: pointer;
  outline: none;
  margin: 0;
  min-width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.small-control-btn:hover, .small-control-btn:focus {
  background: #edeef2;
  color: #23272f;
  box-shadow:
    2px 2px 6px #e0e4ea,
    -2px -2px 6px #fff,
    inset 1px 1px 2px #e0e4ea,
    inset -1px -1px 2px #fff;
}

/* Надписи управления */
.controls-label {
  font-size: 0.85em;
  color: #666;
  text-align: center;
  margin-top: 8px;
  margin-bottom: 4px;
  font-weight: 500;
}

/* Отступ для кнопок управления под медиа */
.controls-under-media {
  margin-top: 8px;
}
.manual-mode {
  font-weight: 600;
  color: #22c55e;
  background: #eafbe7;
  border-radius: 8px;
  padding: 6px 18px;
  margin-right: 12px;
  display: inline-block;
}
.manual-mode:not(.active) {
  color: #888;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(80,60,160,0.08);
  border: 1px solid #e0e4ea;
}
.tickets-scroll-block {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(80,60,160,0.12), 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e0e4ea;
  padding: 12px 10px 10px 10px;
  margin-top: 18px;
  max-height: 500px;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Контейнер для двух блоков билетов */
.tickets-container-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 0 !important;
  align-items: center;
}

/* Печатные билеты */
.print-tickets-block {
  flex: 1;
  margin-top: 0;
  width: calc(100% - 25px) !important;
  max-width: calc(100% - 25px) !important;
  margin-left: auto;
  margin-right: auto;
}

/* Электронные билеты */
.electronic-tickets-block {
  flex: 1;
  margin-top: 0;
}

/* Статистика электронных билетов */
.electronic-tickets-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 12px;
  color: #666;
}

.electronic-tickets-stats div {
  display: flex;
  align-items: center;
  gap: 4px;
}

.electronic-tickets-stats span {
  font-weight: 600;
  color: #333;
}

/* Стили для электронных билетов в списке */
.electronic-ticket-item {
  background: #e8f4fd;
  border: 1px solid #b3d9ff;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

/* Статусы билетов */
.electronic-ticket-item.active {
  background: #e8f4fd;
  border-color: #b3d9ff;
}

.electronic-ticket-item.winning {
  background: #d4edda;
  border-color: #4caf50;
  border-width: 2px;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.electronic-ticket-item.pre-winning {
  background: #fff3cd;
  border-color: #ff9800;
  border-width: 2px;
  box-shadow: 0 0 8px rgba(255, 152, 0, 0.3);
}

.electronic-ticket-item.empty {
  background: #f8f9fa;
  border-color: #dee2e6;
  text-align: center;
}

/* Статусы текста */
.electronic-ticket-item .ticket-status.active {
  color: #2196f3;
  font-weight: 600;
}

.electronic-ticket-item .ticket-status.winning {
  color: #4caf50;
  font-weight: 700;
}

.electronic-ticket-item .ticket-status.pre-winning {
  color: #ff9800;
  font-weight: 700;
}

.electronic-ticket-item .ticket-id {
  font-weight: 600;
  color: #333;
}

.electronic-ticket-item .ticket-status {
  color: #6c757d;
  font-size: 11px;
}

/* Сетка билета */
.ticket-grid {
  margin-top: 8px;
}

.ticket-row {
  display: flex;
  gap: 2px;
  margin-bottom: 2px;
  justify-content: center;
}

.ticket-cell {
  width: 20px;
  height: 20px;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  background: #fff;
  transition: all 0.2s ease;
}

.ticket-cell:hover {
  border-color: #999;
}

/* Информация о выигрышных линиях */
.ticket-win-info,
.ticket-prewin-info {
  margin-top: 5px;
  font-size: 10px;
  font-weight: bold;
  text-align: center;
}

.ticket-win-info {
  color: #4caf50;
}

.ticket-prewin-info {
  color: #ff9800;
}

/* Стили для печатных билетов в вертикальном списке */
.print-tickets-block .ticket-view {
  width: auto;
  margin-bottom: 8px;
  box-sizing: border-box;
}
.tickets-list {
  overflow-x: auto;
  overflow-y: auto;
  display: flex;
  gap: 12px;
  padding-bottom: 4px;
  max-width: 100%;
  min-height: 120px;
}

/* Вертикальная прокрутка для всех билетов */
.print-tickets-block .tickets-list,
.electronic-tickets-block .tickets-list {
  flex-direction: column;
  gap: 6px;
  max-height: 450px;
  overflow-y: auto;
  overflow-x: hidden;
  align-items: center;
}
.ticket-view {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(80,60,160,0.04);
  min-width: 120px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  color: #888;
}
.balls-block {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(80,60,160,0.12), 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e0e4ea;
  padding: 10px 14px 10px 14px;
  margin: 10px 0;
}
.balls-title {
  font-weight: 600;
  margin-bottom: 6px;
}
.balls-list {
  font-size: 1.08em;
  color: #23272f;
  white-space: normal;
  word-break: break-all;
  line-height: 1.5;
}
.game-end-btn-row {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}
.view-ticket-row {
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.view-ticket-title {
  font-size: 1em;
  font-weight: 500;
  margin-bottom: 2px;
}
.view-ticket-input {
  width: 80px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1.5px solid var(--main-border);
  font-size: 1em;
}
@media (max-width: 1100px) {
  .media-block.video-block, .media-block.image-block {
    min-width: 180px;
    height: 120px;
  }
  .media-block img {
    height: 120px;
  }
  .tickets-list {
    min-height: 80px;
    max-height: 120px;
  }
}
@media (max-width: 800px) {
  .media-row {
    flex-direction: column;
    gap: 10px;
  }
  .media-block.video-block, .media-block.image-block {
    width: 100%;
    min-width: 100%;
    height: 120px;
  }
  .media-block img {
    height: 120px;
  }
  .tickets-scroll-block {
    max-height: 160px;
  }
  .tickets-list {
    min-height: 60px;
    max-height: 80px;
  }
}

.win-conditions-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.win-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
}
.win-label {
  flex: 1 1 0;
  text-align: left;
  padding-left: 6px;
  font-size: 1em;
  color: #23272f;
}
.win-row input[type="checkbox"] {
  margin: 0 0 0 0;
  width: 18px;
  height: 18px;
  accent-color: #22c55e;
}
.balls-block-center {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.08);
  padding: 16px;
  min-height: 120px;
  max-height: 120px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px !important;
}
.balls-block-center .balls-title {
  font-weight: 600;
  margin-bottom: 6px;
}
.balls-block-center .balls-list {
  font-size: 0.98em;
  color: #23272f;
  white-space: normal;
  word-break: break-all;
  line-height: 1.3;
  letter-spacing: 0.02em;
  font-family: 'Inter', 'Segoe UI', 'Roboto', Arial, sans-serif;
  max-width: 100%;
  padding-right: 2px;
}
@media (max-width: 1100px) {
  .balls-block-center {
    padding: 8px 6px 8px 6px;
  }
}
@media (max-width: 800px) {
  .balls-block-center {
    padding: 6px 2px 6px 2px;
  }
  .balls-block-center .balls-list {
    font-size: 0.92em;
  }
}

.media-row {
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
}
.video-container, .image-container {
  width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(80,60,160,0.12), 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e0e4ea;
  padding: 12px 10px 10px 10px;
}
.equal-height-block {
  min-height: 260px;
  height: 260px;
}

/* === Стили для вкладки Войти/Регистрация === */
.auth-main-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.auth-form {
  width: 100%;
  max-width: 400px;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 32px;
  color: var(--main-fg);
  font-size: 1.5em;
  font-weight: 600;
}

.auth-input-group {
  margin-bottom: 20px;
}

.auth-input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--main-fg);
  font-size: 0.95em;
}

.auth-input-group input {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid var(--main-border);
  border-radius: 10px;
  font-size: 1em;
  font-family: var(--font-main);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-input-group input:focus {
  outline: none;
  border-color: var(--main-accent);
  box-shadow: 0 0 0 3px rgba(162, 89, 230, 0.1);
}

.auth-btn {
  width: 100%;
  margin-top: 8px;
  margin-bottom: 24px;
  padding: 16px 24px;
  font-size: 1.1em;
  font-weight: 600;
}

.auth-switch {
  text-align: center;
  margin: 0;
  color: #666;
  font-size: 0.95em;
}

.auth-switch a {
  color: var(--main-accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  color: var(--main-accent-hover);
  text-decoration: underline;
}

/* Личный кабинет */
.user-info {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  padding: 20px;
  background: #f7f8fa;
  border-radius: 12px;
}

.user-details h3 {
  margin: 0 0 4px 0;
  color: var(--main-fg);
  font-size: 1.3em;
}

.user-details p {
  margin: 0;
  color: #666;
  font-size: 0.95em;
}

.user-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  justify-content: center;
}

.stat-item {
  text-align: center;
  padding: 16px 20px;
  background: #f7f8fa;
  border-radius: 10px;
  min-width: 100px;
}

.stat-number {
  display: block;
  font-size: 1.8em;
  font-weight: 700;
  color: var(--main-accent);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85em;
  color: #666;
  font-weight: 500;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.secondary-btn {
  background: #6c757d;
}

.secondary-btn:hover, .secondary-btn:focus {
  background: #495057;
}

.danger-btn {
  background: var(--danger-color);
}

.danger-btn:hover, .danger-btn:focus {
  background: #c53030;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 600px) {
  .auth-main-panel {
    padding: 24px 20px;
    margin: 20px auto 0 auto;
  }
  
  .auth-form {
    max-width: 100%;
  }
  
  .user-info {
    flex-direction: column;
    text-align: center;
  }
  
  .user-stats {
    flex-direction: column;
    gap: 12px;
  }
  
  .stat-item {
    min-width: auto;
  }
}

.game-action-btn {
  height: auto;
  min-height: auto;
  max-height: none;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-sizing: border-box;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(60,60,60,0.07);
  border: 1.5px solid #d1d1d6;
  width: auto;
  min-width: auto;
  max-width: none;
  white-space: nowrap;
  background: #f5f5f7;
  color: #222;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', Arial, sans-serif;
  text-transform: none;
  letter-spacing: normal;
}

.game-center .media-row,
.game-center .tickets-scroll-block,
.game-controls-row,
.tickets-list,
.balls-block,
.status-block,
.view-ticket-row {
  margin-bottom: 10px !important;
  gap: 10px !important;
}

.game-controls-row {
  margin-top: -24px !important; /* 28px (gap) - 4px (желаемый отступ) = -24px */
}

.media-row {
  margin-bottom: 2px !important;
  margin-top: 0 !important;
}

.balls-block-center {
  min-height: 120px;
  max-height: 120px;
  margin-top: 4px !important;
}
.balls-list {
  min-height: 100px;
  max-height: 100px;
}

.game-controls-row {
  margin-bottom: 2px !important;
}
.balls-block-center {
  margin-top: 0 !important;
}

.balls-block-center {
  padding-top: 0 !important;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0 !important;
}
.tickets-scroll-block {
  margin-top: 0 !important;
}

.tickets-scroll-block input[type="number"]::-webkit-outer-spin-button,
.tickets-scroll-block input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.tickets-scroll-block input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.saved-game-link,
.saved-game-link:visited,
.saved-game-link:hover,
.saved-game-link:focus,
.saved-game-link:active {
  color: #23272f !important;
}

/* === Стили для вкладки НАСТРОЙКА ИГРЫ === */
.setup-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}



/* Уведомление о локальном хранении */
.local-storage-notice {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border-radius: 12px;
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.notice-content h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}

.notice-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.9;
}

.setup-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.setup-row label {
  min-width: 200px;
  font-weight: 500;
  color: #333;
}

.setup-row input,
.setup-row select {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.setup-row input:focus,
.setup-row select:focus {
  outline: none;
  border-color: #503ca0;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.setup-buttons {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  width: 100%;
}

.setup-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.setup-btn-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 260px;
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}

.setup-btn-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.15);
}

.setup-btn-new.disabled,
.setup-btn-new:disabled {
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-fg);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

.setup-btn-new.disabled:hover,
.setup-btn-new:disabled:hover {
  transform: none;
  box-shadow: none;
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-fg);
}

/* Секция начала игры */
.start-game-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.activation-conditions {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 20px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.activation-conditions::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

.conditions-title {
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 16px;
  font-size: 14px;
  letter-spacing: -0.2px;
  position: relative;
  padding-left: 12px;
}

.conditions-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  border-radius: 2px;
}

.conditions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.condition-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.condition-item:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.condition-item.completed {
  background: rgba(52, 199, 89, 0.1);
  border-color: rgba(52, 199, 89, 0.2);
  color: #34C759;
}

.condition-item.completed .condition-icon {
  opacity: 1;
  transform: scale(1.1);
}

.condition-item.completed::after {
  content: '✓';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: bold;
  color: #34C759;
  background: rgba(52, 199, 89, 0.1);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.condition-item:not(.completed) {
  color: #86868b;
  background: rgba(248, 248, 248, 0.8);
}

.condition-item:not(.completed) .condition-icon {
  opacity: 0.6;
}

.condition-icon {
  font-size: 18px;
  min-width: 24px;
  text-align: center;
  transition: all 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.condition-text {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: -0.1px;
  flex: 1;
}

/* Секция печати */
.print-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.print-warning {
  background: rgba(255, 149, 0, 0.1);
  border: 1px solid rgba(255, 149, 0, 0.2);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.print-warning::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 149, 0, 0.3), transparent);
}

.warning-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.warning-icon {
  font-size: 16px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.warning-text {
  color: #FF9500;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.1px;
}
.btn-icon {
  width: 48px;
  height: 48px;
  background-image: url('../img/border.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-weight: bold;
  font-size: 20px;
  flex-shrink: 0;
}

.btn-text {
  text-align: center;
}

.btn-status {
  font-size: 12px;
  color: #666;
  font-weight: 500;
  line-height: 1.3;
  max-width: 180px;
}

.audio-info {
  margin-left: 16px;
  color: #666;
  font-size: 14px;
}

/* === Стили для вкладки ВОЙТИ/РЕГИСТРАЦИЯ === */
.auth-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 500px;
  box-sizing: border-box;
}

.auth-main-panel {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-form {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.08);
  padding: 32px;
  border: 1px solid #e0e4ea;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 24px;
  color: #333;
  font-size: 24px;
  font-weight: 600;
}

.auth-input-group {
  margin-bottom: 20px;
}

.auth-input-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.auth-input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.auth-input-group input:focus {
  outline: none;
  border-color: #503ca0;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 500;
}

.auth-switch {
  text-align: center;
  margin: 0;
  color: #666;
  font-size: 14px;
}

.auth-switch a {
  color: #503ca0;
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Стили для тарифов */
.pricing-info {
  margin-bottom: 24px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e0e4ea;
}

.pricing-info h3 {
  text-align: center;
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #23272f;
}

.pricing-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.pricing-card {
  flex: 1;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e4ea;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(80, 60, 160, 0.1);
}

.pricing-card.featured {
  border-color: #503ca0;
  background: linear-gradient(135deg, #503ca0 0%, #422d85 100%);
  color: white;
}

.plan-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.plan-features {
  font-size: 12px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.plan-price-per-game {
  font-size: 11px;
  opacity: 0.7;
}

.pricing-note {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin: 0;
  font-style: italic;
}

/* Стили для уведомлений */

.notification-content,
.limit-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
}

.notification-icon,
.limit-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.notification-text,
.limit-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
}

.notification-close,
.limit-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.notification-close:hover,
.limit-close:hover {
  background: #f0f0f0;
  color: #666;
}



@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Убираем старые стили панелей, чтобы они не конфликтовали с общей консолью */
.open-game-main-panel,
.auth-main-panel,
.game-center-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

/* --- Центральная панель для вкладки 'Открыть игру' --- */
.open-game-main-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.game-name {
    text-align: center;
    width: 100%;
    display: block;
}

/* --- macOS/iMac стиль для профиля и личного кабинета --- */
body {
    background: #f5f5f7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a1a;
}
#user-profile {
    /* margin-left: auto; */
    /* margin-right: auto; */
    margin-top: 40px;
    margin-bottom: 0;
    width: 420px;
    max-width: 98vw;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e0e4ea;
    box-shadow: 0 2px 12px rgba(80, 60, 160, 0.06);
    padding: 32px;
}
.user-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-left: 32px;
    max-width: 320px;
    /* добавлено ограничение ширины для внутренних полей */
}
.profile-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    color: #222;
    white-space: nowrap;
}
.profile-label {
    min-width: 170px;
    max-width: 170px;
    font-weight: bold;
    white-space: nowrap;
    text-align: left;
    margin-right: 0;
}
.profile-value {
    white-space: nowrap;
    text-align: left;
    overflow: visible;
}
#user-email-view, #user-name-view, #user-phone-view {
    font-size: 17px;
    color: #222;
    margin-left: 0;
    white-space: nowrap;
}
#user-details-view {
    display: block;
    margin-bottom: 10px;
    word-break: break-word;
    text-align: left;
}
#user-details-view > div {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 6px;
    white-space: normal;
    text-align: left;
}
#user-email-view {
    max-width: 260px;
    word-break: break-all;
    display: inline-block;
    /* уменьшена ширина, чтобы email переносился и не выходил за границы */
}
.phone-public-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 4px;
    text-align: left;
}
.phone-public-block > div:first-child {
    margin-bottom: 2px;
    text-align: left;
}
.phone-public-block input[type="checkbox"] {
    margin: 0;
}

/* Стили для отображения состояния телефона */
.phone-public-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 500;
    text-align: center;
    min-width: 120px;
}

.phone-public-status.visible {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.phone-public-status.hidden {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.user-details h3 {
  margin: 0 0 4px 0;
  color: var(--main-fg);
  font-size: 1.3em;
}

.user-details p {
  margin: 0;
  color: #666;
  font-size: 0.95em;
}

.user-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  justify-content: center;
}

.stat-item {
  text-align: center;
  padding: 16px 20px;
  background: #f7f8fa;
  border-radius: 10px;
  min-width: 100px;
}

.stat-number {
  display: block;
  font-size: 1.8em;
  font-weight: 700;
  color: var(--main-accent);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85em;
  color: #666;
  font-weight: 500;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.secondary-btn {
  background: #6c757d;
}

.secondary-btn:hover, .secondary-btn:focus {
  background: #495057;
}

.danger-btn {
  background: var(--danger-color);
}

.danger-btn:hover, .danger-btn:focus {
  background: #c53030;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 600px) {
  .auth-main-panel {
    padding: 24px 20px;
    margin: 20px auto 0 auto;
  }
  
  .auth-form {
    max-width: 100%;
  }
  
  .user-info {
    flex-direction: column;
    text-align: center;
  }
  
  .user-stats {
    flex-direction: column;
    gap: 12px;
  }
  
  .stat-item {
    min-width: auto;
  }
}

.game-action-btn {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-sizing: border-box;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(80, 60, 160, 0.06);
  border: 1px solid #d1d5db;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  white-space: nowrap;
}

.game-center .media-row,
.game-center .tickets-scroll-block,
.game-controls-row,
.tickets-list,
.balls-block,
.status-block,
.view-ticket-row {
  margin-bottom: 10px !important;
  gap: 10px !important;
}

.game-controls-row {
  margin-top: -24px !important; /* 28px (gap) - 4px (желаемый отступ) = -24px */
}

.media-row {
  margin-bottom: 2px !important;
  margin-top: 0 !important;
}

.balls-block-center {
  min-height: 120px;
  max-height: 120px;
  margin-top: 4px !important;
}
.balls-list {
  min-height: 100px;
  max-height: 100px;
}

.game-controls-row {
  margin-bottom: 2px !important;
}
.balls-block-center {
  margin-top: 0 !important;
}

.balls-block-center {
  padding-top: 0 !important;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0 !important;
}
.tickets-scroll-block {
  margin-top: 0 !important;
}

.tickets-scroll-block input[type="number"]::-webkit-outer-spin-button,
.tickets-scroll-block input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.tickets-scroll-block input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.saved-game-link,
.saved-game-link:visited,
.saved-game-link:hover,
.saved-game-link:focus,
.saved-game-link:active {
  color: #23272f !important;
}

/* === Стили для вкладки НАСТРОЙКА ИГРЫ === */
.setup-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}



/* Уведомление о локальном хранении */
.local-storage-notice {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border-radius: 12px;
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.notice-content h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}

.notice-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.9;
}

.setup-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.setup-row label {
  min-width: 200px;
  font-weight: 500;
  color: #333;
}

.setup-row input,
.setup-row select {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}
.setup-row input:focus,
.setup-row select:focus {
  outline: none;
  border-color: #503ca0;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.setup-buttons {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  width: 100%;
}

.setup-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.setup-btn-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 260px;
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}

.setup-btn-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.15);
}

.setup-btn-new.disabled,
.setup-btn-new:disabled {
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-fg);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

.setup-btn-new.disabled:hover,
.setup-btn-new:disabled:hover {
  transform: none;
  box-shadow: none;
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-fg);
}

/* Секция начала игры */
.start-game-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.activation-conditions {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 20px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.activation-conditions::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

.conditions-title {
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 16px;
  font-size: 14px;
  letter-spacing: -0.2px;
  position: relative;
  padding-left: 12px;
}

.conditions-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  border-radius: 2px;
}

.conditions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.condition-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.condition-item:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.condition-item.completed {
  background: rgba(52, 199, 89, 0.1);
  border-color: rgba(52, 199, 89, 0.2);
  color: #34C759;
}

.condition-item.completed .condition-icon {
  opacity: 1;
  transform: scale(1.1);
}
.condition-item.completed::after {
  content: '✓';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: bold;
  color: #34C759;
  background: rgba(52, 199, 89, 0.1);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.condition-item:not(.completed) {
  color: #86868b;
  background: rgba(248, 248, 248, 0.8);
}

.condition-item:not(.completed) .condition-icon {
  opacity: 0.6;
}

.condition-icon {
  font-size: 18px;
  min-width: 24px;
  text-align: center;
  transition: all 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.condition-text {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: -0.1px;
  flex: 1;
}

/* Секция печати */
.print-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.print-warning {
  background: rgba(255, 149, 0, 0.1);
  border: 1px solid rgba(255, 149, 0, 0.2);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.print-warning::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 149, 0, 0.3), transparent);
}

.warning-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.warning-icon {
  font-size: 16px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.warning-text {
  color: #FF9500;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.1px;
}

.btn-icon {
  width: 48px;
  height: 48px;
  background-image: url('../img/border.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-weight: bold;
  font-size: 20px;
  flex-shrink: 0;
}

.btn-text {
  text-align: center;
}

.btn-status {
  font-size: 12px;
  color: #666;
  font-weight: 500;
  line-height: 1.3;
  max-width: 180px;
}

.audio-info {
  margin-left: 16px;
  color: #666;
  font-size: 14px;
}

/* === Стили для вкладки ВОЙТИ/РЕГИСТРАЦИЯ === */
.auth-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 500px;
  box-sizing: border-box;
}

.auth-main-panel {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-form {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.08);
  padding: 32px;
  border: 1px solid #e0e4ea;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 24px;
  color: #333;
  font-size: 24px;
  font-weight: 600;
}

.auth-input-group {
  margin-bottom: 20px;
}

.auth-input-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.auth-input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.auth-input-group input:focus {
  outline: none;
  border-color: #503ca0;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 500;
}

.auth-switch {
  text-align: center;
  margin: 0;
  color: #666;
  font-size: 14px;
}

.auth-switch a {
  color: #503ca0;
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Стили для тарифов */
.pricing-info {
  margin-bottom: 24px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e0e4ea;
}

.pricing-info h3 {
  text-align: center;
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #23272f;
}

.pricing-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.pricing-card {
  flex: 1;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e4ea;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(80, 60, 160, 0.1);
}

.pricing-card.featured {
  border-color: #503ca0;
  background: linear-gradient(135deg, #503ca0 0%, #422d85 100%);
  color: white;
}

.plan-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.plan-features {
  font-size: 12px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.plan-price-per-game {
  font-size: 11px;
  opacity: 0.7;
}

.pricing-note {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin: 0;
  font-style: italic;
}

/* Убираем старые стили панелей, чтобы они не конфликтовали с общей консолью */
.open-game-main-panel,
.auth-main-panel,
.game-center-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

/* --- Центральная панель для вкладки 'Открыть игру' --- */
.open-game-main-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.game-name {
    text-align: center;
    width: 100%;
    display: block;
}

/* --- macOS/iMac стиль для профиля и личного кабинета --- */
body {
    background: #f5f5f7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a1a;
}
#user-profile {
    /* margin-left: auto; */
    /* margin-right: auto; */
    margin-top: 40px;
    margin-bottom: 0;
    width: 420px;
    max-width: 98vw;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e0e4ea;
    box-shadow: 0 2px 12px rgba(80, 60, 160, 0.06);
    padding: 32px;
}
.user-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-left: 32px;
    max-width: 320px;
    /* добавлено ограничение ширины для внутренних полей */
}
.profile-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    color: #222;
    white-space: nowrap;
}
.profile-label {
    min-width: 170px;
    max-width: 170px;
    font-weight: bold;
    white-space: nowrap;
    text-align: left;
    margin-right: 0;
}
.profile-value {
    white-space: nowrap;
    text-align: left;
    overflow: visible;
}
#user-email-view, #user-name-view, #user-phone-view {
    font-size: 17px;
    color: #222;
    margin-left: 0;
    white-space: nowrap;
}
#user-details-view {
    display: block;
    margin-bottom: 10px;
    word-break: break-word;
    text-align: left;
}
#user-details-view > div {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 6px;
    white-space: normal;
    text-align: left;
}
#user-email-view {
    max-width: 260px;
    word-break: break-all;
    display: inline-block;
    /* уменьшена ширина, чтобы email переносился и не выходил за границы */
}
.phone-public-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 4px;
    text-align: left;
}
.phone-public-block > div:first-child {
    margin-bottom: 2px;
    text-align: left;
}
.phone-public-block input[type="checkbox"] {
    margin: 0;
}
.user-details h3 {
  margin: 0 0 4px 0;
  color: var(--main-fg);
  font-size: 1.3em;
}

.user-details p {
  margin: 0;
  color: #666;
  font-size: 0.95em;
}

.user-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  justify-content: center;
}

.stat-item {
  text-align: center;
  padding: 16px 20px;
  background: #f7f8fa;
  border-radius: 10px;
  min-width: 100px;
}

.stat-number {
  display: block;
  font-size: 1.8em;
  font-weight: 700;
  color: var(--main-accent);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85em;
  color: #666;
  font-weight: 500;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.secondary-btn {
  background: #6c757d;
}

.secondary-btn:hover, .secondary-btn:focus {
  background: #495057;
}

.danger-btn {
  background: var(--danger-color);
}

.danger-btn:hover, .danger-btn:focus {
  background: #c53030;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 600px) {
  .auth-main-panel {
    padding: 24px 20px;
    margin: 20px auto 0 auto;
  }
  
  .auth-form {
    max-width: 100%;
  }
  
  .user-info {
    flex-direction: column;
    text-align: center;
  }
  
  .user-stats {
    flex-direction: column;
    gap: 12px;
  }
  
  .stat-item {
    min-width: auto;
  }
}
.game-action-btn {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-sizing: border-box;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(80, 60, 160, 0.06);
  border: 1px solid #d1d5db;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  white-space: nowrap;
}

.game-center .media-row,
.game-center .tickets-scroll-block,
.game-controls-row,
.tickets-list,
.balls-block,
.status-block,
.view-ticket-row {
  margin-bottom: 10px !important;
  gap: 10px !important;
}

.game-controls-row {
  margin-top: -24px !important; /* 28px (gap) - 4px (желаемый отступ) = -24px */
}

.media-row {
  margin-bottom: 2px !important;
  margin-top: 0 !important;
}

.balls-block-center {
  min-height: 120px;
  max-height: 120px;
  margin-top: 4px !important;
}
.balls-list {
  min-height: 100px;
  max-height: 100px;
}

.game-controls-row {
  margin-bottom: 2px !important;
}
.balls-block-center {
  margin-top: 0 !important;
}

.balls-block-center {
  padding-top: 0 !important;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0 !important;
}
.tickets-scroll-block {
  margin-top: 0 !important;
}

.tickets-scroll-block input[type="number"]::-webkit-outer-spin-button,
.tickets-scroll-block input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.tickets-scroll-block input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.saved-game-link,
.saved-game-link:visited,
.saved-game-link:hover,
.saved-game-link:focus,
.saved-game-link:active {
  color: #23272f !important;
}

/* === Стили для вкладки НАСТРОЙКА ИГРЫ === */
.setup-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}



/* Уведомление о локальном хранении */
.local-storage-notice {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border-radius: 12px;
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.notice-content h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}

.notice-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.9;
}

.setup-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.setup-row label {
  min-width: 200px;
  font-weight: 500;
  color: #333;
}

.setup-row input,
.setup-row select {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.setup-row input:focus,
.setup-row select:focus {
  outline: none;
  border-color: #503ca0;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.setup-buttons {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  width: 100%;
}

.setup-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.setup-btn-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 260px;
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}

.setup-btn-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.15);
}

.setup-btn-new.disabled,
.setup-btn-new:disabled {
  background: #f5f5f7;
  color: #333;
  border-color: #d1d1d6;
  cursor: not-allowed;
  box-shadow: none;
}

.setup-btn-new.disabled:hover,
.setup-btn-new:disabled:hover {
  background: #f5f5f7;
  color: #333;
  border-color: #d1d1d6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Секция начала игры */
.start-game-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.activation-conditions {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 20px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.activation-conditions::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

.conditions-title {
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 16px;
  font-size: 14px;
  letter-spacing: -0.2px;
  position: relative;
  padding-left: 12px;
}

.conditions-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  border-radius: 2px;
}

.conditions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.condition-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.condition-item:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.condition-item.completed {
  background: rgba(52, 199, 89, 0.1);
  border-color: rgba(52, 199, 89, 0.2);
  color: #34C759;
}
.condition-item.completed .condition-icon {
  opacity: 1;
  transform: scale(1.1);
}

.condition-item.completed::after {
  content: '✓';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: bold;
  color: #34C759;
  background: rgba(52, 199, 89, 0.1);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.condition-item:not(.completed) {
  color: #86868b;
  background: rgba(248, 248, 248, 0.8);
}

.condition-item:not(.completed) .condition-icon {
  opacity: 0.6;
}

.condition-icon {
  font-size: 18px;
  min-width: 24px;
  text-align: center;
  transition: all 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.condition-text {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: -0.1px;
  flex: 1;
}

/* Секция печати */
.print-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.print-warning {
  background: rgba(255, 149, 0, 0.1);
  border: 1px solid rgba(255, 149, 0, 0.2);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.print-warning::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 149, 0, 0.3), transparent);
}

.warning-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.warning-icon {
  font-size: 16px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.warning-text {
  color: #FF9500;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.1px;
}

.btn-icon {
  width: 48px;
  height: 48px;
  background-image: url('../img/border.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-weight: bold;
  font-size: 20px;
  flex-shrink: 0;
}

.btn-text {
  text-align: center;
}

.btn-status {
  font-size: 12px;
  color: #666;
  font-weight: 500;
  line-height: 1.3;
  max-width: 180px;
}

.audio-info {
  margin-left: 16px;
  color: #666;
  font-size: 14px;
}

/* === Стили для вкладки ВОЙТИ/РЕГИСТРАЦИЯ === */
.auth-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 500px;
  box-sizing: border-box;
}

.auth-main-panel {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-form {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.08);
  padding: 32px;
  border: 1px solid #e0e4ea;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 24px;
  color: #333;
  font-size: 24px;
  font-weight: 600;
}

.auth-input-group {
  margin-bottom: 20px;
}

.auth-input-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.auth-input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.auth-input-group input:focus {
  outline: none;
  border-color: #503ca0;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 500;
}

.auth-switch {
  text-align: center;
  margin: 0;
  color: #666;
  font-size: 14px;
}

.auth-switch a {
  color: #503ca0;
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Стили для тарифов */
.pricing-info {
  margin-bottom: 24px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e0e4ea;
}

.pricing-info h3 {
  text-align: center;
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #23272f;
}

.pricing-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.pricing-card {
  flex: 1;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e4ea;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(80, 60, 160, 0.1);
}

.pricing-card.featured {
  border-color: #503ca0;
  background: linear-gradient(135deg, #503ca0 0%, #422d85 100%);
  color: white;
}

.plan-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.plan-features {
  font-size: 12px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.plan-price-per-game {
  font-size: 11px;
  opacity: 0.7;
}

.pricing-note {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin: 0;
  font-style: italic;
}

/* Стили для уведомлений */

.notification-content,
.limit-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
}

.notification-icon,
.limit-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.notification-text,
.limit-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
}
.notification-close,
.limit-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.notification-close:hover,
.limit-close:hover {
  background: #f0f0f0;
  color: #666;
}



@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Убираем старые стили панелей, чтобы они не конфликтовали с общей консолью */
.open-game-main-panel,
.auth-main-panel,
.game-center-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

/* --- Центральная панель для вкладки 'Открыть игру' --- */
.open-game-main-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.game-name {
    text-align: center;
    width: 100%;
    display: block;
}

/* --- macOS/iMac стиль для профиля и личного кабинета --- */
body {
    background: #f5f5f7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a1a;
}
#user-profile {
    /* margin-left: auto; */
    /* margin-right: auto; */
    margin-top: 40px;
    margin-bottom: 0;
    width: 420px;
    max-width: 98vw;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e0e4ea;
    box-shadow: 0 2px 12px rgba(80, 60, 160, 0.06);
    padding: 32px;
}
.user-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-left: 32px;
    max-width: 320px;
    /* добавлено ограничение ширины для внутренних полей */
}
.profile-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    color: #222;
    white-space: nowrap;
}
.profile-label {
    min-width: 170px;
    max-width: 170px;
    font-weight: bold;
    white-space: nowrap;
    text-align: left;
    margin-right: 0;
}
.profile-value {
    white-space: nowrap;
    text-align: left;
    overflow: visible;
}
#user-email-view, #user-name-view, #user-phone-view {
    font-size: 17px;
    color: #222;
    margin-left: 0;
    white-space: nowrap;
}
#user-details-view {
    display: block;
    margin-bottom: 10px;
    word-break: break-word;
    text-align: left;
}
#user-details-view > div {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 6px;
    white-space: normal;
    text-align: left;
}
#user-email-view {
    max-width: 260px;
    word-break: break-all;
    display: inline-block;
    /* уменьшена ширина, чтобы email переносился и не выходил за границы */
}
.phone-public-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 4px;
    text-align: left;
}
.phone-public-block > div:first-child {
    margin-bottom: 2px;
    text-align: left;
}
.phone-public-block input[type="checkbox"] {
    margin: 0;
}
.user-details h3 {
  margin: 0 0 4px 0;
  color: var(--main-fg);
  font-size: 1.3em;
}

.user-details p {
  margin: 0;
  color: #666;
  font-size: 0.95em;
}

.user-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  justify-content: center;
}

.stat-item {
  text-align: center;
  padding: 16px 20px;
  background: #f7f8fa;
  border-radius: 10px;
  min-width: 100px;
}

.stat-number {
  display: block;
  font-size: 1.8em;
  font-weight: 700;
  color: var(--main-accent);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85em;
  color: #666;
  font-weight: 500;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.secondary-btn {
  background: #f5f5f7;
  color: #333;
  border: 1.5px solid #d1d1d6;
  box-shadow: 0 2px 6px rgba(60,60,60,0.07);
  border-radius: 4px;
  margin: 0 6px 0 0;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.secondary-btn:hover, .secondary-btn:focus {
  background: #e5e5ea;
  color: #222;
  border-color: #bdbdbd;
  box-shadow: 0 4px 12px rgba(60,60,60,0.10);
}

.danger-btn {
  background: #f5f5f7;
  color: #333;
  border: 1.5px solid #d1d1d6;
  box-shadow: 0 2px 6px rgba(60,60,60,0.07);
  border-radius: 4px;
  margin: 0 6px 0 0;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.danger-btn:hover, .danger-btn:focus {
  background: #e5e5ea;
  color: #222;
  border-color: #bdbdbd;
  box-shadow: 0 4px 12px rgba(60,60,60,0.10);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 600px) {
  .auth-main-panel {
    padding: 24px 20px;
    margin: 20px auto 0 auto;
  }
  
  .auth-form {
    max-width: 100%;
  }
  
  .user-info {
    flex-direction: column;
    text-align: center;
  }
  
  .user-stats {
    flex-direction: column;
    gap: 12px;
  }
  
  .stat-item {
    min-width: auto;
  }
}

.game-action-btn {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-sizing: border-box;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(80, 60, 160, 0.06);
  border: 1px solid #d1d5db;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  white-space: nowrap;
}

.game-center .media-row,
.game-center .tickets-scroll-block,
.game-controls-row,
.tickets-list,
.balls-block,
.status-block,
.view-ticket-row {
  margin-bottom: 10px !important;
  gap: 10px !important;
}

.game-controls-row {
  margin-top: -24px !important; /* 28px (gap) - 4px (желаемый отступ) = -24px */
}

.media-row {
  margin-bottom: 2px !important;
  margin-top: 0 !important;
}

.balls-block-center {
  min-height: 120px;
  max-height: 120px;
  margin-top: 4px !important;
}
.balls-list {
  min-height: 100px;
  max-height: 100px;
}

.game-controls-row {
  margin-bottom: 2px !important;
}
.balls-block-center {
  margin-top: 0 !important;
}

.balls-block-center {
  padding-top: 0 !important;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0 !important;
}
.tickets-scroll-block {
  margin-top: 0 !important;
}

.tickets-scroll-block input[type="number"]::-webkit-outer-spin-button,
.tickets-scroll-block input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.tickets-scroll-block input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.saved-game-link,
.saved-game-link:visited,
.saved-game-link:hover,
.saved-game-link:focus,
.saved-game-link:active {
  color: #23272f !important;
}

/* === Стили для вкладки НАСТРОЙКА ИГРЫ === */
.setup-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}



/* Уведомление о локальном хранении */
.local-storage-notice {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border-radius: 12px;
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.notice-content h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}

.notice-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.9;
}

.setup-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.setup-row label {
  min-width: 200px;
  font-weight: 500;
  color: #333;
}

.setup-row input,
.setup-row select {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.setup-row input:focus,
.setup-row select:focus {
  outline: none;
  border-color: #503ca0;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.setup-buttons {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  width: 100%;
}

.setup-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.setup-btn-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 260px;
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}
.setup-btn-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.15);
}
.setup-btn-new.disabled,
.setup-btn-new:disabled {
  background: #f5f5f7;
  color: #333;
  border-color: #d1d1d6;
  cursor: not-allowed;
  box-shadow: none;
}

.setup-btn-new.disabled:hover,
.setup-btn-new:disabled:hover {
  background: #f5f5f7;
  color: #333;
  border-color: #d1d1d6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Секция начала игры */
.start-game-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.activation-conditions {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 20px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.activation-conditions::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

.conditions-title {
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 16px;
  font-size: 14px;
  letter-spacing: -0.2px;
  position: relative;
  padding-left: 12px;
}

.conditions-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  border-radius: 2px;
}

.conditions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.condition-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.condition-item:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.condition-item.completed {
  background: rgba(52, 199, 89, 0.1);
  border-color: rgba(52, 199, 89, 0.2);
  color: #34C759;
}

.condition-item.completed .condition-icon {
  opacity: 1;
  transform: scale(1.1);
}

.condition-item.completed::after {
  content: '✓';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: bold;
  color: #34C759;
  background: rgba(52, 199, 89, 0.1);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.condition-item:not(.completed) {
  color: #86868b;
  background: rgba(248, 248, 248, 0.8);
}

.condition-item:not(.completed) .condition-icon {
  opacity: 0.6;
}

.condition-icon {
  font-size: 18px;
  min-width: 24px;
  text-align: center;
  transition: all 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.condition-text {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: -0.1px;
  flex: 1;
}

/* Секция печати */
.print-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.print-warning {
  background: rgba(255, 149, 0, 0.1);
  border: 1px solid rgba(255, 149, 0, 0.2);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.print-warning::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 149, 0, 0.3), transparent);
}
.warning-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.warning-icon {
  font-size: 16px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.warning-text {
  color: #FF9500;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.1px;
}

.btn-icon {
  width: 48px;
  height: 48px;
  background-image: url('../img/border.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-weight: bold;
  font-size: 20px;
  flex-shrink: 0;
}

.btn-text {
  text-align: center;
}

.btn-status {
  font-size: 12px;
  color: #666;
  font-weight: 500;
  line-height: 1.3;
  max-width: 180px;
}

.audio-info {
  margin-left: 16px;
  color: #666;
  font-size: 14px;
}

/* === Стили для вкладки ВОЙТИ/РЕГИСТРАЦИЯ === */
.auth-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 500px;
  box-sizing: border-box;
}

.auth-main-panel {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-form {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.08);
  padding: 32px;
  border: 1px solid #e0e4ea;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 24px;
  color: #333;
  font-size: 24px;
  font-weight: 600;
}

.auth-input-group {
  margin-bottom: 20px;
}

.auth-input-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.auth-input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.auth-input-group input:focus {
  outline: none;
  border-color: #503ca0;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 500;
}

.auth-switch {
  text-align: center;
  margin: 0;
  color: #666;
  font-size: 14px;
}

.auth-switch a {
  color: #503ca0;
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Стили для тарифов */
.pricing-info {
  margin-bottom: 24px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e0e4ea;
}

.pricing-info h3 {
  text-align: center;
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #23272f;
}

.pricing-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.pricing-card {
  flex: 1;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e4ea;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(80, 60, 160, 0.1);
}

.pricing-card.featured {
  border-color: #503ca0;
  background: linear-gradient(135deg, #503ca0 0%, #422d85 100%);
  color: white;
}

.plan-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.plan-features {
  font-size: 12px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.plan-price-per-game {
  font-size: 11px;
  opacity: 0.7;
}

.pricing-note {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin: 0;
  font-style: italic;
}

/* Стили для уведомлений */

.notification-content,
.limit-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
}

.notification-icon,
.limit-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.notification-text,
.limit-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
}

.notification-close,
.limit-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.notification-close:hover,
.limit-close:hover {
  background: #f0f0f0;
  color: #666;
}



@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Убираем старые стили панелей, чтобы они не конфликтовали с общей консолью */
.open-game-main-panel,
.auth-main-panel,
.game-center-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

/* --- Центральная панель для вкладки 'Открыть игру' --- */
.open-game-main-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.game-name {
    text-align: center;
    width: 100%;
    display: block;
}

/* --- macOS/iMac стиль для профиля и личного кабинета --- */
body {
    background: #f5f5f7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a1a;
}
#user-profile {
    /* margin-left: auto; */
    /* margin-right: auto; */
    margin-top: 40px;
    margin-bottom: 0;
    width: 420px;
    max-width: 98vw;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e0e4ea;
    box-shadow: 0 2px 12px rgba(80, 60, 160, 0.06);
    padding: 32px;
}
.user-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-left: 32px;
    max-width: 320px;
    /* добавлено ограничение ширины для внутренних полей */
}
.profile-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    color: #222;
    white-space: nowrap;
}
.profile-label {
    min-width: 170px;
    max-width: 170px;
    font-weight: bold;
    white-space: nowrap;
    text-align: left;
    margin-right: 0;
}
.profile-value {
    white-space: nowrap;
    text-align: left;
    overflow: visible;
}
#user-email-view, #user-name-view, #user-phone-view {
    font-size: 17px;
    color: #222;
    margin-left: 0;
    white-space: nowrap;
}
#user-details-view {
    display: block;
    margin-bottom: 10px;
    word-break: break-word;
    text-align: left;
}
#user-details-view > div {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 6px;
    white-space: normal;
    text-align: left;
}
#user-email-view {
    max-width: 260px;
    word-break: break-all;
    display: inline-block;
    /* уменьшена ширина, чтобы email переносился и не выходил за границы */
}
.phone-public-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 4px;
    text-align: left;
}
.phone-public-block > div:first-child {
    margin-bottom: 2px;
    text-align: left;
}
.phone-public-block input[type="checkbox"] {
    margin: 0;
}
.user-details h3 {
  margin: 0 0 4px 0;
  color: var(--main-fg);
  font-size: 1.3em;
}

.user-details p {
  margin: 0;
  color: #666;
  font-size: 0.95em;
}

.user-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  justify-content: center;
}

.stat-item {
  text-align: center;
  padding: 16px 20px;
  background: #f7f8fa;
  border-radius: 10px;
  min-width: 100px;
}

.stat-number {
  display: block;
  font-size: 1.8em;
  font-weight: 700;
  color: var(--main-accent);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85em;
  color: #666;
  font-weight: 500;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.secondary-btn {
  background: #f5f5f7;
  color: #333;
  border: 1.5px solid #d1d1d6;
  box-shadow: 0 2px 6px rgba(60,60,60,0.07);
  border-radius: 4px;
  margin: 0 6px 0 0;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.secondary-btn:hover, .secondary-btn:focus {
  background: #e5e5ea;
  color: #222;
  border-color: #bdbdbd;
  box-shadow: 0 4px 12px rgba(60,60,60,0.10);
}

.danger-btn {
  background: #f5f5f7;
  color: #333;
  border: 1.5px solid #d1d1d6;
  box-shadow: 0 2px 6px rgba(60,60,60,0.07);
  border-radius: 4px;
  margin: 0 6px 0 0;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.danger-btn:hover, .danger-btn:focus {
  background: #e5e5ea;
  color: #222;
  border-color: #bdbdbd;
  box-shadow: 0 4px 12px rgba(60,60,60,0.10);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 600px) {
  .auth-main-panel {
    padding: 24px 20px;
    margin: 20px auto 0 auto;
  }
  
  .auth-form {
    max-width: 100%;
  }
  
  .user-info {
    flex-direction: column;
    text-align: center;
  }
  
  .user-stats {
    flex-direction: column;
    gap: 12px;
  }
  
  .stat-item {
    min-width: auto;
  }
}

.game-action-btn {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-sizing: border-box;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(80, 60, 160, 0.06);
  border: 1px solid #d1d5db;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  white-space: nowrap;
}

.game-center .media-row,
.game-center .tickets-scroll-block,
.game-controls-row,
.tickets-list,
.balls-block,
.status-block,
.view-ticket-row {
  margin-bottom: 10px !important;
  gap: 10px !important;
}

.game-controls-row {
  margin-top: -24px !important; /* 28px (gap) - 4px (желаемый отступ) = -24px */
}

.media-row {
  margin-bottom: 2px !important;
  margin-top: 0 !important;
}

.balls-block-center {
  min-height: 120px;
  max-height: 120px;
  margin-top: 4px !important;
}
.balls-list {
  min-height: 100px;
  max-height: 100px;
}

.game-controls-row {
  margin-bottom: 2px !important;
}
.balls-block-center {
  margin-top: 0 !important;
}

.balls-block-center {
  padding-top: 0 !important;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0 !important;
}
.tickets-scroll-block {
  margin-top: 0 !important;
}

.tickets-scroll-block input[type="number"]::-webkit-outer-spin-button,
.tickets-scroll-block input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.tickets-scroll-block input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.saved-game-link,
.saved-game-link:visited,
.saved-game-link:hover,
.saved-game-link:focus,
.saved-game-link:active {
  color: #23272f !important;
}

/* === Стили для вкладки НАСТРОЙКА ИГРЫ === */
.setup-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}


/* Уведомление о локальном хранении */
.local-storage-notice {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border-radius: 12px;
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.notice-content h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}
.notice-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.9;
}

.setup-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.setup-row label {
  min-width: 200px;
  font-weight: 500;
  color: #333;
}

.setup-row input,
.setup-row select {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.setup-row input:focus,
.setup-row select:focus {
  outline: none;
  border-color: #503ca0;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.setup-buttons {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  width: 100%;
}

.setup-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.setup-btn-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 260px;
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}

.setup-btn-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.15);
}

.setup-btn-new.disabled,
.setup-btn-new:disabled {
  background: #f5f5f7;
  color: #333;
  border-color: #d1d1d6;
  cursor: not-allowed;
  box-shadow: none;
}

.setup-btn-new.disabled:hover,
.setup-btn-new:disabled:hover {
  background: #f5f5f7;
  color: #333;
  border-color: #d1d1d6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Секция начала игры */
.start-game-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.activation-conditions {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 20px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.activation-conditions::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

.conditions-title {
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 16px;
  font-size: 14px;
  letter-spacing: -0.2px;
  position: relative;
  padding-left: 12px;
}

.conditions-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  border-radius: 2px;
}

.conditions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.condition-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.condition-item:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.condition-item.completed {
  background: rgba(52, 199, 89, 0.1);
  border-color: rgba(52, 199, 89, 0.2);
  color: #34C759;
}

.condition-item.completed .condition-icon {
  opacity: 1;
  transform: scale(1.1);
}

.condition-item.completed::after {
  content: '✓';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: bold;
  color: #34C759;
  background: rgba(52, 199, 89, 0.1);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.condition-item:not(.completed) {
  color: #86868b;
  background: rgba(248, 248, 248, 0.8);
}

.condition-item:not(.completed) .condition-icon {
  opacity: 0.6;
}

.condition-icon {
  font-size: 18px;
  min-width: 24px;
  text-align: center;
  transition: all 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.condition-text {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: -0.1px;
  flex: 1;
}

/* Секция печати */
.print-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.print-warning {
  background: rgba(255, 149, 0, 0.1);
  border: 1px solid rgba(255, 149, 0, 0.2);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.print-warning::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 149, 0, 0.3), transparent);
}

.warning-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.warning-icon {
  font-size: 16px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.warning-text {
  color: #FF9500;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.1px;
}

.btn-icon {
  width: 48px;
  height: 48px;
  background-image: url('../img/border.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-weight: bold;
  font-size: 20px;
  flex-shrink: 0;
}

.btn-text {
  text-align: center;
}

.btn-status {
  font-size: 12px;
  color: #666;
  font-weight: 500;
  line-height: 1.3;
  max-width: 180px;
}

.audio-info {
  margin-left: 16px;
  color: #666;
  font-size: 14px;
}

/* === Стили для вкладки ВОЙТИ/РЕГИСТРАЦИЯ === */
.auth-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 500px;
  box-sizing: border-box;
}

.auth-main-panel {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-form {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.08);
  padding: 32px;
  border: 1px solid #e0e4ea;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 24px;
  color: #333;
  font-size: 24px;
  font-weight: 600;
}

.auth-input-group {
  margin-bottom: 20px;
}

.auth-input-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.auth-input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.auth-input-group input:focus {
  outline: none;
  border-color: #503ca0;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 500;
}

.auth-switch {
  text-align: center;
  margin: 0;
  color: #666;
  font-size: 14px;
}

.auth-switch a {
  color: #503ca0;
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Стили для тарифов */
.pricing-info {
  margin-bottom: 24px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e0e4ea;
}

.pricing-info h3 {
  text-align: center;
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #23272f;
}

.pricing-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.pricing-card {
  flex: 1;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e4ea;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(80, 60, 160, 0.1);
}

.pricing-card.featured {
  border-color: #503ca0;
  background: linear-gradient(135deg, #503ca0 0%, #422d85 100%);
  color: white;
}

.plan-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.plan-features {
  font-size: 12px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.plan-price-per-game {
  font-size: 11px;
  opacity: 0.7;
}

.pricing-note {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin: 0;
  font-style: italic;
}

/* Убираем старые стили панелей, чтобы они не конфликтовали с общей консолью */
.open-game-main-panel,
.auth-main-panel,
.game-center-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

/* --- Центральная панель для вкладки 'Открыть игру' --- */
.open-game-main-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.game-name {
    text-align: center;
    width: 100%;
    display: block;
}

/* --- macOS/iMac стиль для профиля и личного кабинета --- */
body {
    background: #f5f5f7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a1a;
}
#user-profile {
    /* margin-left: auto; */
    /* margin-right: auto; */
    margin-top: 40px;
    margin-bottom: 0;
    width: 420px;
    max-width: 98vw;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e0e4ea;
    box-shadow: 0 2px 12px rgba(80, 60, 160, 0.06);
    padding: 32px;
}
.user-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-left: 32px;
    max-width: 320px;
    /* добавлено ограничение ширины для внутренних полей */
}
.profile-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    color: #222;
    white-space: nowrap;
}
.profile-label {
    min-width: 170px;
    max-width: 170px;
    font-weight: bold;
    white-space: nowrap;
    text-align: left;
    margin-right: 0;
}
.profile-value {
    white-space: nowrap;
    text-align: left;
    overflow: visible;
}
#user-email-view, #user-name-view, #user-phone-view {
    font-size: 17px;
    color: #222;
    margin-left: 0;
    white-space: nowrap;
}
#user-details-view {
    display: block;
    margin-bottom: 10px;
    word-break: break-word;
    text-align: left;
}
#user-details-view > div {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 6px;
    white-space: normal;
    text-align: left;
}
#user-email-view {
    max-width: 260px;
    word-break: break-all;
    display: inline-block;
    /* уменьшена ширина, чтобы email переносился и не выходил за границы */
}
.phone-public-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 4px;
    text-align: left;
}
.phone-public-block > div:first-child {
    margin-bottom: 2px;
    text-align: left;
}
.phone-public-block input[type="checkbox"] {
    margin: 0;
}
.user-details h3 {
  margin: 0 0 4px 0;
  color: var(--main-fg);
  font-size: 1.3em;
}

.user-details p {
  margin: 0;
  color: #666;
  font-size: 0.95em;
}

.user-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  justify-content: center;
}

.stat-item {
  text-align: center;
  padding: 16px 20px;
  background: #f7f8fa;
  border-radius: 10px;
  min-width: 100px;
}

.stat-number {
  display: block;
  font-size: 1.8em;
  font-weight: 700;
  color: var(--main-accent);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85em;
  color: #666;
  font-weight: 500;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.secondary-btn {
  background: #f5f5f7;
  color: #333;
  border: 1.5px solid #d1d1d6;
  box-shadow: 0 2px 6px rgba(60,60,60,0.07);
  border-radius: 4px;
  margin: 0 6px 0 0;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.secondary-btn:hover, .secondary-btn:focus {
  background: #e5e5ea;
  color: #222;
  border-color: #bdbdbd;
  box-shadow: 0 4px 12px rgba(60,60,60,0.10);
}
.danger-btn {
  background: #f5f5f7;
  color: #333;
  border: 1.5px solid #d1d1d6;
  box-shadow: 0 2px 6px rgba(60,60,60,0.07);
  border-radius: 4px;
  margin: 0 6px 0 0;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.danger-btn:hover, .danger-btn:focus {
  background: #e5e5ea;
  color: #222;
  border-color: #bdbdbd;
  box-shadow: 0 4px 12px rgba(60,60,60,0.10);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 600px) {
  .auth-main-panel {
    padding: 24px 20px;
    margin: 20px auto 0 auto;
  }
  
  .auth-form {
    max-width: 100%;
  }
  
  .user-info {
    flex-direction: column;
    text-align: center;
  }
  
  .user-stats {
    flex-direction: column;
    gap: 12px;
  }
  
  .stat-item {
    min-width: auto;
  }
}

.game-action-btn {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-sizing: border-box;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(80, 60, 160, 0.06);
  border: 1px solid #d1d5db;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  white-space: nowrap;
}

.game-center .media-row,
.game-center .tickets-scroll-block,
.game-controls-row,
.tickets-list,
.balls-block,
.status-block,
.view-ticket-row {
  margin-bottom: 10px !important;
  gap: 10px !important;
}

.game-controls-row {
  margin-top: -24px !important; /* 28px (gap) - 4px (желаемый отступ) = -24px */
}

.media-row {
  margin-bottom: 2px !important;
  margin-top: 0 !important;
}

.balls-block-center {
  min-height: 120px;
  max-height: 120px;
  margin-top: 4px !important;
}
.balls-list {
  min-height: 100px;
  max-height: 100px;
}

.game-controls-row {
  margin-bottom: 2px !important;
}
.balls-block-center {
  margin-top: 0 !important;
}

.balls-block-center {
  padding-top: 0 !important;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0 !important;
}

.tickets-scroll-block {
  margin-top: 0 !important;
}

.tickets-scroll-block input[type="number"]::-webkit-outer-spin-button,
.tickets-scroll-block input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.tickets-scroll-block input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.saved-game-link,
.saved-game-link:visited,
.saved-game-link:hover,
.saved-game-link:focus,
.saved-game-link:active {
  color: #23272f !important;
}

/* === Стили для вкладки НАСТРОЙКА ИГРЫ === */
.setup-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}



/* Уведомление о локальном хранении */
.local-storage-notice {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border-radius: 12px;
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.notice-content h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}

.notice-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.9;
}

.setup-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.setup-row label {
  min-width: 200px;
  font-weight: 500;
  color: #333;
}

.setup-row input,
.setup-row select {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.setup-row input:focus,
.setup-row select:focus {
  outline: none;
  border-color: #503ca0;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.setup-buttons {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  width: 100%;
}

.setup-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.setup-btn-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 260px;
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}

.setup-btn-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.15);
}

.setup-btn-new.disabled,
.setup-btn-new:disabled {
  background: #f5f5f7;
  color: #333;
  border-color: #d1d1d6;
  cursor: not-allowed;
  box-shadow: none;
}

.setup-btn-new.disabled:hover,
.setup-btn-new:disabled:hover {
  background: #f5f5f7;
  color: #333;
  border-color: #d1d1d6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Секция начала игры */
.start-game-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.activation-conditions {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 20px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.activation-conditions::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

.conditions-title {
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 16px;
  font-size: 14px;
  letter-spacing: -0.2px;
  position: relative;
  padding-left: 12px;
}

.conditions-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  border-radius: 2px;
}

.conditions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.condition-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.condition-item:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.condition-item.completed {
  background: rgba(52, 199, 89, 0.1);
  border-color: rgba(52, 199, 89, 0.2);
  color: #34C759;
}

.condition-item.completed .condition-icon {
  opacity: 1;
  transform: scale(1.1);
}

.condition-item.completed::after {
  content: '✓';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: bold;
  color: #34C759;
  background: rgba(52, 199, 89, 0.1);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.condition-item:not(.completed) {
  color: #86868b;
  background: rgba(248, 248, 248, 0.8);
}

.condition-item:not(.completed) .condition-icon {
  opacity: 0.6;
}

.condition-icon {
  font-size: 18px;
  min-width: 24px;
  text-align: center;
  transition: all 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.condition-text {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: -0.1px;
  flex: 1;
}

/* Секция печати */
.print-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.print-warning {
  background: rgba(255, 149, 0, 0.1);
  border: 1px solid rgba(255, 149, 0, 0.2);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.print-warning::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 149, 0, 0.3), transparent);
}

.warning-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.warning-icon {
  font-size: 16px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.warning-text {
  color: #FF9500;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.1px;
}

.btn-icon {
  width: 48px;
  height: 48px;
  background-image: url('../img/border.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-weight: bold;
  font-size: 20px;
  flex-shrink: 0;
}

.btn-text {
  text-align: center;
}

.btn-status {
  font-size: 12px;
  color: #666;
  font-weight: 500;
  line-height: 1.3;
  max-width: 180px;
}

.audio-info {
  margin-left: 16px;
  color: #666;
  font-size: 14px;
}

/* === Стили для вкладки ВОЙТИ/РЕГИСТРАЦИЯ === */
.auth-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 500px;
  box-sizing: border-box;
}

.auth-main-panel {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-form {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.08);
  padding: 32px;
  border: 1px solid #e0e4ea;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 24px;
  color: #333;
  font-size: 24px;
  font-weight: 600;
}

.auth-input-group {
  margin-bottom: 20px;
}

.auth-input-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.auth-input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.auth-input-group input:focus {
  outline: none;
  border-color: #503ca0;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 500;
}

.auth-switch {
  text-align: center;
  margin: 0;
  color: #666;
  font-size: 14px;
}

.auth-switch a {
  color: #503ca0;
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Стили для тарифов */
.pricing-info {
  margin-bottom: 24px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e0e4ea;
}

.pricing-info h3 {
  text-align: center;
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #23272f;
}

.pricing-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.pricing-card {
  flex: 1;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e4ea;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(80, 60, 160, 0.1);
}

.pricing-card.featured {
  border-color: #503ca0;
  background: linear-gradient(135deg, #503ca0 0%, #422d85 100%);
  color: white;
}

.plan-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.plan-features {
  font-size: 12px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.plan-price-per-game {
  font-size: 11px;
  opacity: 0.7;
}

.pricing-note {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin: 0;
  font-style: italic;
}
/* Стили для подсказки о форматах аудио */
.audio-format-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: #f0f6ff;
  border-radius: 10px;
  border: 1.5px solid #b6d4fe;
  margin-top: 0;
  font-size: 13.5px;
  color: #1a2330;
  box-shadow: 0 2px 8px rgba(80, 160, 255, 0.06);
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}
.load-action-row .audio-format-hint {
  margin-left: 8px;
}
.hint-icon {
  font-size: 18px;
  color: #2196f3;
  flex-shrink: 0;
  margin-top: 2px;
}
.hint-content {
  line-height: 1.5;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
.audio-format-hint strong {
  color: #1976d2;
  font-weight: 700;
  font-size: 1.08em;
}
.audio-format-hint span {
  color: #1a2330;
}


/* Стили для уведомлений */

.notification-content,
.limit-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
}

.notification-icon,
.limit-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.notification-text,
.limit-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
}

.notification-close,
.limit-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.notification-close:hover,
.limit-close:hover {
  background: #f0f0f0;
  color: #666;
}



@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Убираем старые стили панелей, чтобы они не конфликтовали с общей консолью */
.open-game-main-panel,
.auth-main-panel,
.game-center-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

/* --- Центральная панель для вкладки 'Открыть игру' --- */
.open-game-main-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.game-name {
    text-align: center;
    width: 100%;
    display: block;
}

/* --- macOS/iMac стиль для профиля и личного кабинета --- */
body {
    background: #f5f5f7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a1a;
}
#user-profile {
    /* margin-left: auto; */
    /* margin-right: auto; */
    margin-top: 40px;
    margin-bottom: 0;
    width: 420px;
    max-width: 98vw;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e0e4ea;
    box-shadow: 0 2px 12px rgba(80, 60, 160, 0.06);
    padding: 32px;
}
.user-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-left: 32px;
    max-width: 320px;
    /* добавлено ограничение ширины для внутренних полей */
}
.profile-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    color: #222;
    white-space: nowrap;
}
.profile-label {
    min-width: 170px;
    max-width: 170px;
    font-weight: bold;
    white-space: nowrap;
    text-align: left;
    margin-right: 0;
}
.profile-value {
    white-space: nowrap;
    text-align: left;
    overflow: visible;
}
#user-email-view, #user-name-view, #user-phone-view {
    font-size: 17px;
    color: #222;
    margin-left: 0;
    white-space: nowrap;
}
#user-details-view {
    display: block;
    margin-bottom: 10px;
    word-break: break-word;
    text-align: left;
}
#user-details-view > div {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 6px;
    white-space: normal;
    text-align: left;
}
#user-email-view {
    max-width: 260px;
    word-break: break-all;
    display: inline-block;
    /* уменьшена ширина, чтобы email переносился и не выходил за границы */
}
.phone-public-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 4px;
    text-align: left;
}
.phone-public-block > div:first-child {
    margin-bottom: 2px;
    text-align: left;
}
.phone-public-block input[type="checkbox"] {
    margin: 0;
}
.user-details h3 {
  margin: 0 0 4px 0;
  color: var(--main-fg);
  font-size: 1.3em;
}

.user-details p {
  margin: 0;
  color: #666;
  font-size: 0.95em;
}

.user-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  justify-content: center;
}

.stat-item {
  text-align: center;
  padding: 16px 20px;
  background: #f7f8fa;
  border-radius: 10px;
  min-width: 100px;
}

.stat-number {
  display: block;
  font-size: 1.8em;
  font-weight: 700;
  color: var(--main-accent);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85em;
  color: #666;
  font-weight: 500;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.secondary-btn {
  background: #f5f5f7;
  color: #333;
  border: 1.5px solid #d1d1d6;
  box-shadow: 0 2px 6px rgba(60,60,60,0.07);
  border-radius: 4px;
  margin: 0 6px 0 0;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.secondary-btn:hover, .secondary-btn:focus {
  background: #e5e5ea;
  color: #222;
  border-color: #bdbdbd;
  box-shadow: 0 4px 12px rgba(60,60,60,0.10);
}

.danger-btn {
  background: #f5f5f7;
  color: #333;
  border: 1.5px solid #d1d1d6;
  box-shadow: 0 2px 6px rgba(60,60,60,0.07);
  border-radius: 4px;
  margin: 0 6px 0 0;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.danger-btn:hover, .danger-btn:focus {
  background: #e5e5ea;
  color: #222;
  border-color: #bdbdbd;
  box-shadow: 0 4px 12px rgba(60,60,60,0.10);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 600px) {
  .auth-main-panel {
    padding: 24px 20px;
    margin: 20px auto 0 auto;
  }
  
  .auth-form {
    max-width: 100%;
  }
  
  .user-info {
    flex-direction: column;
    text-align: center;
  }
  
  .user-stats {
    flex-direction: column;
    gap: 12px;
  }
  
  .stat-item {
    min-width: auto;
  }
}

.game-action-btn {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-sizing: border-box;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(80, 60, 160, 0.06);
  border: 1px solid #d1d5db;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  white-space: nowrap;
}

.game-center .media-row,
.game-center .tickets-scroll-block,
.game-controls-row,
.tickets-list,
.balls-block,
.status-block,
.view-ticket-row {
  margin-bottom: 10px !important;
  gap: 10px !important;
}

.game-controls-row {
  margin-top: -24px !important; /* 28px (gap) - 4px (желаемый отступ) = -24px */
}

.media-row {
  margin-bottom: 2px !important;
  margin-top: 0 !important;
}

.balls-block-center {
  min-height: 120px;
  max-height: 120px;
  margin-top: 4px !important;
}
.balls-list {
  min-height: 100px;
  max-height: 100px;
}

.game-controls-row {
  margin-bottom: 2px !important;
}
.balls-block-center {
  margin-top: 0 !important;
}

.balls-block-center {
  padding-top: 0 !important;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0 !important;
}
.tickets-scroll-block {
  margin-top: 0 !important;
}

.tickets-scroll-block input[type="number"]::-webkit-outer-spin-button,
.tickets-scroll-block input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.tickets-scroll-block input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.saved-game-link,
.saved-game-link:visited,
.saved-game-link:hover,
.saved-game-link:focus,
.saved-game-link:active {
  color: #23272f !important;
}

/* === Стили для вкладки НАСТРОЙКА ИГРЫ === */
.setup-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}



/* Уведомление о локальном хранении */
.local-storage-notice {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border-radius: 12px;
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.notice-content h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}

.notice-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.9;
}

.setup-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.setup-row label {
  min-width: 200px;
  font-weight: 500;
  color: #333;
}

.setup-row input,
.setup-row select {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.setup-row input:focus,
.setup-row select:focus {
  outline: none;
  border-color: #503ca0;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.setup-buttons {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  width: 100%;
}

.setup-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.setup-btn-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 260px;
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}

.setup-btn-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.15);
}

.setup-btn-new.disabled,
.setup-btn-new:disabled {
  background: #f5f5f7;
  color: #333;
  border-color: #d1d1d6;
  cursor: not-allowed;
  box-shadow: none;
}

.setup-btn-new.disabled:hover,
.setup-btn-new:disabled:hover {
  background: #f5f5f7;
  color: #333;
  border-color: #d1d1d6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Секция начала игры */
.start-game-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.activation-conditions {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 20px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.activation-conditions::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

.conditions-title {
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 16px;
  font-size: 14px;
  letter-spacing: -0.2px;
  position: relative;
  padding-left: 12px;
}

.conditions-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  border-radius: 2px;
}

.conditions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.condition-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.condition-item:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.condition-item.completed {
  background: rgba(52, 199, 89, 0.1);
  border-color: rgba(52, 199, 89, 0.2);
  color: #34C759;
}
.condition-item.completed .condition-icon {
  opacity: 1;
  transform: scale(1.1);
}

.condition-item.completed::after {
  content: '✓';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: bold;
  color: #34C759;
  background: rgba(52, 199, 89, 0.1);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.condition-item:not(.completed) {
  color: #86868b;
  background: rgba(248, 248, 248, 0.8);
}

.condition-item:not(.completed) .condition-icon {
  opacity: 0.6;
}

.condition-icon {
  font-size: 18px;
  min-width: 24px;
  text-align: center;
  transition: all 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.condition-text {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: -0.1px;
  flex: 1;
}

/* Секция печати */
.print-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.print-warning {
  background: rgba(255, 149, 0, 0.1);
  border: 1px solid rgba(255, 149, 0, 0.2);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.print-warning::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 149, 0, 0.3), transparent);
}

.warning-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.warning-icon {
  font-size: 16px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.warning-text {
  color: #FF9500;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.1px;
}

.btn-icon {
  width: 48px;
  height: 48px;
  background-image: url('../img/border.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-weight: bold;
  font-size: 20px;
  flex-shrink: 0;
}

.btn-text {
  text-align: center;
}

.btn-status {
  font-size: 12px;
  color: #666;
  font-weight: 500;
  line-height: 1.3;
  max-width: 180px;
}

.audio-info {
  margin-left: 16px;
  color: #666;
  font-size: 14px;
}

/* === Стили для вкладки ВОЙТИ/РЕГИСТРАЦИЯ === */
.auth-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 500px;
  box-sizing: border-box;
}

.auth-main-panel {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: c5nter;
}

.auth-form {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.08);
  padding: 32px;
  border: 1px solid #e0e4ea;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 24px;
  color: #333;
  font-size: 24px;
  font-weight: 600;
}

.auth-input-group {
  margin-bottom: 20px;
}

.auth-input-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.auth-input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.auth-input-group input:focus {
  outline: none;
  border-color: #503ca0;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 500;
}

.auth-switch {
  text-align: center;
  margin: 0;
  color: #666;
  font-size: 14px;
}

.auth-switch a {
  color: #503ca0;
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Стили для тарифов */
.pricing-info {
  margin-bottom: 24px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e0e4ea;
}

.pricing-info h3 {
  text-align: center;
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #23272f;
}

.pricing-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.pricing-card {
  flex: 1;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ddd;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.pricing-card.featured {
  border-color: #007aff;
  background: linear-gradient(135deg, #007aff 0%, #006ae6 100%);
  color: #fff;
}

.plan-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.plan-features {
  font-size: 12px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.plan-price-per-game {
  font-size: 11px;
  opacity: 0.7;
}

.pricing-note {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin: 0;
  font-style: italic;
}

/* Стили для подсказки о форматах аудио */
.audio-format-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: #f0f6ff;
  border-radius: 10px;
  border: 1.5px solid #b6d4fe;
  margin-top: 0;
  font-size: 13.5px;
  color: #1a2330;
  box-shadow: 0 2px 8px rgba(80, 160, 255, 0.06);
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}
.load-action-row .audio-format-hint {
  margin-left: 8px;
}
.hint-icon {
  font-size: 18px;
  color: #2196f3;
  flex-shrink: 0;
  margin-top: 2px;
}
.hint-content {
  line-height: 1.5;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
.audio-format-hint strong {
  color: #1976d2;
  font-weight: 700;
  font-size: 1.08em;
}
.audio-format-hint span {
  color: #1a2330;
}

/* Стили для уведомлений */

.notification-content,
.limit-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
}

.notification-icon,
.limit-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.notification-text,
.limit-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
}

.notification-close,
.limit-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.notification-close:hover,
.limit-close:hover {
  background: #f0f1f3;
  color: #333;
}



@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Убираем старые стили панелей, чтобы они не конфликтовали с общей консолью */
.open-game-main-panel,
.auth-main-panel,
.game-center-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

/* --- Центральная панель для вкладки 'Открыть игру' --- */
.open-game-main-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
.game-name {
    text-align: center;
    width: 100%;
    display: block;
}

/* --- macOS/iMac стиль для профиля и личного кабинета --- */
body {
    background: #f0f1f3;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
}
#user-profile {
    margin-top: 40px;
    margin-bottom: 0;
    width: 700px;
    max-width: 98vw;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 32px;
}
.user-info {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}
.user-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-width: 0;
    margin-left: 0;
    max-width: none;
}
.profile-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    font-size: 16px;
    color: #333;
    white-space: normal;
}
.profile-row-inline {
    flex-wrap: nowrap;
}
.profile-row-inline .profile-label,
.profile-row-inline .profile-value {
    white-space: nowrap;
}
.profile-label {
    min-width: 120px;
    max-width: 180px;
    font-weight: 700;
    white-space: normal;
    text-align: left;
    margin-right: 0;
}
.profile-value {
    white-space: normal;
    text-align: left;
    overflow: visible;
    word-break: break-word;
}
#user-email-view, #user-name-view, #user-phone-view {
    font-size: 17px;
    color: #333;
    margin-left: 0;
    white-space: nowrap;
}
#user-details-view {
    display: block;
    margin-bottom: 10px;
    word-break: break-word;
    text-align: left;
}
#user-details-view > div {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 6px;
    white-space: normal;
    text-align: left;
}
#user-email-view {
    max-width: none;
    word-break: break-word;
    display: inline-block;
}
.profile-row-checkbox {
    margin-top: 12px;
}
.profile-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
}
.profile-checkbox input {
    margin: 0;
    cursor: pointer;
}
.profile-socials {
    margin-top: 16px;
}
.profile-section-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
}
.profile-socials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}
.profile-social-field label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}
.profile-social-field input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 0;
}
.profile-social-field small {
    color: #666;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}
.profile-socials-save {
    margin-top: 12px;
    padding: 10px 20px;
    align-self: flex-start;
}
.profile-socials-note {
    color: #666;
    font-size: 12px;
    display: block;
    margin-top: 4px;
    white-space: nowrap;
}
.phone-public-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 4px;
    text-align: left;
}
.phone-public-block > div:first-child {
    margin-bottom: 2px;
    text-align: left;
}
.phone-public-block input[type="checkbox"] {
    margin: 0;
}
.user-details h3 {
  margin: 0 0 4px 0;
  color: #333;
  font-size: 1.3em;
}

.user-details p {
  margin: 0;
  color: #666;
  font-size: 0.95em;
}

.user-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  justify-content: center;
}

.stat-item {
  text-align: center;
  padding: 16px 20px;
  background: #f0f1f3;
  border-radius: 8px;
  min-width: 100px;
}

.stat-number {
  display: block;
  font-size: 1.8em;
  font-weight: 700;
  color: #007aff;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85em;
  color: #666;
  font-weight: 500;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.secondary-btn {
  background: #f5f5f7;
  color: #333;
  border: 1.5px solid #d1d1d6;
  box-shadow: 0 2px 6px rgba(60,60,60,0.07);
  border-radius: 4px;
  margin: 0 6px 0 0;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.secondary-btn:hover, .secondary-btn:focus {
  background: #e5e5ea;
  color: #222;
  border-color: #bdbdbd;
  box-shadow: 0 4px 12px rgba(60,60,60,0.10);
}

.danger-btn {
  background: #f5f5f7;
  color: #333;
  border: 1.5px solid #d1d1d6;
  box-shadow: 0 2px 6px rgba(60,60,60,0.07);
  border-radius: 4px;
  margin: 0 6px 0 0;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.danger-btn:hover, .danger-btn:focus {
  background: #e5e5ea;
  color: #222;
  border-color: #bdbdbd;
  box-shadow: 0 4px 12px rgba(60,60,60,0.10);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 600px) {
  .auth-main-panel {
    padding: 24px 20px;
    margin: 20px auto 0 auto;
  }
  
  .auth-form {
    max-width: 100%;
  }
  
  .user-info {
    flex-direction: column;
    text-align: center;
  }
  
  .user-stats {
    flex-direction: column;
    gap: 12px;
  }
  
  .stat-item {
    min-width: auto;
  }
}

.game-action-btn {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-sizing: border-box;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border: 1px solid #ddd;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  white-space: nowrap;
}
.game-center .media-row,
.game-center .tickets-scroll-block,
.game-controls-row,
.tickets-list,
.balls-block,
.status-block,
.view-ticket-row {
  margin-bottom: 10px !important;
  gap: 10px !important;
}

.game-controls-row {
  margin-top: -24px !important;
}

.media-row {
  margin-bottom: 2px !important;
  margin-top: 0 !important;
}

.balls-block-center {
  min-height: 120px;
  max-height: 120px;
  margin-top: 4px !important;
}
.balls-list {
  min-height: 100px;
  max-height: 100px;
}

.game-controls-row {
  margin-bottom: 2px !important;
}
.balls-block-center {
  margin-top: 0 !important;
}

.balls-block-center {
  padding-top: 0 !important;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0 !important;
}
.tickets-scroll-block {
  margin-top: 0 !important;
}

.tickets-scroll-block input[type="number"]::-webkit-outer-spin-button,
.tickets-scroll-block input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.tickets-scroll-block input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.saved-game-link,
.saved-game-link:visited,
.saved-game-link:hover,
.saved-game-link:focus,
.saved-game-link:active {
  color: #333 !important;
}

/* === Стили для вкладки НАСТРОЙКА ИГРЫ === */
.setup-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}



/* Уведомление о локальном хранении */
.local-storage-notice {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border-radius: 8px;
  color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.notice-content h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}

.notice-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.9;
}

.setup-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.setup-row label {
  min-width: 200px;
  font-weight: 500;
  color: #333;
}

.setup-row input,
.setup-row select {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #ddd;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.setup-row input:focus,
.setup-row select:focus {
  outline: none;
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(80, 60, 160, 0.1);
}

.setup-buttons {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  width: 100%;
}

.setup-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.setup-btn-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 260px;
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}

.setup-btn-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(80, 60, 160, 0.15);
}

.setup-btn-new.disabled,
.setup-btn-new:disabled {
  background: #f5f5f7;
  color: #333;
  border-color: #d1d1d6;
  cursor: not-allowed;
  box-shadow: none;
}

.setup-btn-new.disabled:hover,
.setup-btn-new:disabled:hover {
  background: #f5f5f7;
  color: #333;
  border-color: #d1d1d6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Секция начала игры */
.start-game-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.activation-conditions {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 20px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.activation-conditions::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

.conditions-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  font-size: 14px;
  letter-spacing: -0.2px;
  position: relative;
  padding-left: 12px;
}

.conditions-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background: linear-gradient(135deg, #007aff, #006ae6);
  border-radius: 2px;
}

.conditions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.condition-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.condition-item:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.condition-item.completed {
  background: rgba(52, 199, 89, 0.1);
  border-color: rgba(52, 199, 89, 0.2);
  color: #22c55e;
}

.condition-item.completed .condition-icon {
  opacity: 1;
  transform: scale(1.1);
}

.condition-item.completed::after {
  content: '✓';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: bold;
  color: #22c55e;
  background: rgba(52, 199, 89, 0.1);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.condition-item:not(.completed) {
  color: #86868b;
  background: rgba(248, 248, 248, 0.8);
}

.condition-item:not(.completed) .condition-icon {
  opacity: 0.6;
}

.condition-icon {
  font-size: 18px;
  min-width: 24px;
  text-align: center;
  transition: all 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.condition-text {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: -0.1px;
  flex: 1;
}

/* Секция печати */
.print-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.print-warning {
  background: rgba(255, 149, 0, 0.1);
  border: 1px solid rgba(255, 149, 0, 0.2);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.print-warning::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 149, 0, 0.3), transparent);
}

.warning-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.warning-icon {
  font-size: 16px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.warning-text {
  color: #FF9500;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.1px;
}

.btn-icon {
  width: 48px;
  height: 48px;
  background-image: url('../img/border.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-weight: bold;
  font-size: 20px;
  flex-shrink: 0;
}

.btn-text {
  text-align: center;
}

.btn-status {
  font-size: 12px;
  color: #666;
  font-weight: 500;
  line-height: 1.3;
  max-width: 180px;
}

.audio-info {
  margin-left: 16px;
  color: #666;
  font-size: 14px;
}

/* === Стили для вкладки ВОЙТИ/РЕГИСТРАЦИЯ === */
.auth-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 500px;
  box-sizing: border-box;
}

.auth-main-panel {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-form {
  width: 100%;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 32px;
  border: 1px solid #ddd;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 24px;
  color: #333;
  font-size: 24px;
  font-weight: 600;
}

.auth-input-group {
  margin-bottom: 20px;
}

.auth-input-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.auth-input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  box-sizing: border-box;
  color: #333;
  transition: border 0.2s, box-shadow 0.2s;
}

.auth-input-group input:focus {
  outline: none;
  border-color: #007aff;
  box-shadow: 0 0 0 2px rgba(80, 60, 160, 0.1);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 500;
  background: #007aff;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-btn:hover {
  background: #006ae6;
}

.auth-switch {
  text-align: center;
  margin: 0;
  color: #666;
  font-size: 14px;
}

.auth-switch a {
  color: #007aff;
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Стили для тарифов */
.pricing-info {
  margin-bottom: 24px;
  padding: 20px;
  background: #f0f1f3;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.pricing-info h3 {
  text-align: center;
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.pricing-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.pricing-card {
  flex: 1;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ddd;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.pricing-card.featured {
  border-color: #007aff;
  background: linear-gradient(135deg, #007aff 0%, #006ae6 100%);
  color: #fff;
}

.plan-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.plan-features {
  font-size: 12px;
  margin-bottom: 8px;
  opacity: 0.8;
}
.plan-price-per-game {
  font-size: 11px;
  opacity: 0.7;
}
.pricing-note {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin: 0;
  font-style: italic;
}

/* Стили для уведомлений */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #fff;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-width: 300px;
}

.notification-warning {
  border-left: 4px solid #ff9500;
}

.notification-info {
  border-left: 4px solid #007aff;
}

/* Анимации */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes ticketHighlight {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.highlighted-ticket {
  animation: ticketHighlight 0.3s ease-in-out;
}

/* Дополнительные стили для игровых кнопок */
.game-action-btn {
  padding: 12px 24px;
  background: #f5f5f7;
  color: #222;
  border: 1.5px solid #d1d1d6;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: 0 2px 6px rgba(60,60,60,0.07);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', Arial, sans-serif;
  text-transform: none;
  letter-spacing: normal;
}

.game-action-btn:hover {
  background: #e5e5ea;
  color: #222;
  box-shadow: 0 4px 12px rgba(60,60,60,0.10);
  border-color: #bdbdbd;
  transform: none;
}

/* Адаптивность для недостающих стилей */
@media (max-width: 700px) {
  .custom-game-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .custom-game-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .current-ball {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  .mode-switcher {
    flex-direction: column;
  }
  
  .notification {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* Убираем старые стили панелей, чтобы они не конфликтовали с общей консолью */
.open-game-main-panel,
.auth-main-panel,
.game-center-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

/* --- Центральная панель для вкладки 'Открыть игру' --- */
.open-game-main-panel {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.game-name {
    text-align: center;
    width: 100%;
    display: block;
}

/* --- macOS/iMac стиль для профиля и личного кабинета --- */
body {
    background: #f0f1f3;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
}
#user-profile {
    margin-top: 40px;
    margin-bottom: 0;
    width: 420px;
    max-width: 98vw;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 32px;
}
.user-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-left: 32px;
    max-width: 320px;
}
.profile-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    color: #333;
    white-space: nowrap;
}
.profile-label {
    min-width: 170px;
    max-width: 170px;
    font-weight: bold;
    white-space: nowrap;
    text-align: left;
    margin-right: 0;
}
.profile-value {
    white-space: nowrap;
    text-align: left;
    overflow: visible;
}
#user-email-view, #user-name-view, #user-phone-view {
    font-size: 17px;
    color: #333;
    margin-left: 0;
    white-space: nowrap;
}
#user-details-view {
    display: block;
    margin-bottom: 10px;
    word-break: break-word;
    text-align: left;
}
#user-details-view > div {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 6px;
    white-space: normal;
    text-align: left;
}
#user-email-view {
    max-width: 260px;
    word-break: break-all;
    display: inline-block;
}
.phone-public-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 4px;
    text-align: left;
}
.phone-public-block > div:first-child {
    margin-bottom: 2px;
    text-align: left;
}
.phone-public-block input[type="checkbox"] {
    margin: 0;
}
.user-details h3 {
  margin: 0 0 4px 0;
  color: #333;
  font-size: 1.3em;
}

.user-details p {
  margin: 0;
  color: #666;
  font-size: 0.95em;
}

.user-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  justify-content: center;
}

.stat-item {
  text-align: center;
  padding: 16px 20px;
  background: #f0f1f3;
  border-radius: 8px;
  min-width: 100px;
}

.stat-number {
  display: block;
  font-size: 1.8em;
  font-weight: 700;
  color: #007aff;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85em;
  color: #666;
  font-weight: 500;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.secondary-btn {
  background: #f5f5f7;
  color: #333;
  border: 1.5px solid #d1d1d6;
  box-shadow: 0 2px 6px rgba(60,60,60,0.07);
  border-radius: 4px;
  margin: 0 6px 0 0;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.secondary-btn:hover, .secondary-btn:focus {
  background: #e5e5ea;
  color: #222;
  border-color: #bdbdbd;
  box-shadow: 0 4px 12px rgba(60,60,60,0.10);
}

.danger-btn {
  background: #f5f5f7;
  color: #333;
  border: 1.5px solid #d1d1d6;
  box-shadow: 0 2px 6px rgba(60,60,60,0.07);
  border-radius: 4px;
  margin: 0 6px 0 0;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.danger-btn:hover, .danger-btn:focus {
  background: #e5e5ea;
  color: #222;
  border-color: #bdbdbd;
  box-shadow: 0 4px 12px rgba(60,60,60,0.10);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 600px) {
  .auth-main-panel {
    padding: 24px 20px;
    margin: 20px auto 0 auto;
  }
  
  .auth-form {
    max-width: 100%;
  }
  
  .user-info {
    flex-direction: column;
    text-align: center;
  }
  
  .user-stats {
    flex-direction: column;
    gap: 12px;
  }
  
  .stat-item {
    min-width: auto;
  }
}

.game-action-btn {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-sizing: border-box;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border: 1px solid #ddd;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  white-space: nowrap;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.game-action-btn:hover {
  background: #f0f1f3;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.game-center .media-row,
.game-center .tickets-scroll-block,
.game-controls-row,
.tickets-list,
.balls-block,
.status-block,
.view-ticket-row {
  margin-bottom: 10px !important;
  gap: 10px !important;
}

.game-controls-row {
  margin-top: -24px !important;
}

.media-row {
  margin-bottom: 2px !important;
  margin-top: 0 !important;
}

.balls-block-center {
  min-height: 120px;
  max-height: 120px;
  margin-top: 4px !important;
}
.balls-list {
  min-height: 100px;
  max-height: 100px;
}

.game-controls-row {
  margin-bottom: 2px !important;
}
.balls-block-center {
  margin-top: 0 !important;
}

.balls-block-center {
  padding-top: 0 !important;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
}

.balls-block-center {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0 !important;
}
.tickets-scroll-block {
  margin-top: 0 !important;
}

.tickets-scroll-block input[type="number"]::-webkit-outer-spin-button,
.tickets-scroll-block input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.tickets-scroll-block input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.saved-game-link,
.saved-game-link:visited,
.saved-game-link:hover,
.saved-game-link:focus,
.saved-game-link:active {
  color: #333 !important;
}

/* === Дополнительные стили для игрового интерфейса === */

/* Текущий шар */
.current-ball-block {
    background: #fff;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
}

.current-ball-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
}

.current-ball-display {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffd700, #c5a000);
    color: #2a1b00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    border: 3px solid #daa520;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    animation: ballAppear 0.5s ease-out;
}

.ball-placeholder {
    color: #999;
    font-style: italic;
}

@keyframes ballAppear {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Улучшенные стили для кнопок управления */
.manual-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.manual-input-container input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e4ea;
    border-radius: 6px;
    font-size: 14px;
}

.manual-input-container button {
    padding: 8px 16px;
    background: #007aff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.manual-input-container button:hover {
    background: #0056cc;
}

/* Стили для режимов */
.manual-mode, .auto-mode {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.manual-mode.active {
    background: #007aff;
    color: white;
}

.auto-mode.active {
    background: #34c759;
    color: white;
}

.manual-mode:not(.active), .auto-mode:not(.active) {
    background: #f5f5f7;
    color: #666;
}

/* Улучшенные стили для списка билетов */
.tickets-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e4ea;
    border-radius: 6px;
    background: #fff;
}

.ticket-view {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.ticket-view:hover {
    background: #f5f5f7;
}

.ticket-view:last-child {
    border-bottom: none;
}

/* Стили для статусных блоков */
.status-block {
    background: #fff;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    padding: 15px;
    margin: 0px 0;
}

.win-block {
    border-left: 4px solid #34c759;
}

.prewin-block {
    border-left: 4px solid #ff9500;
}

.status-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.status-list {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Стили для медиа контейнеров */
.video-container, .image-container {
    background: #fff;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    overflow: hidden;
}

.video-container video, .image-container img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: #f5f5f7;
}

/* Стили для кнопок управления медиа */
.controls-under-media {
    padding: 10px;
    background: #f8f9fa;
    border-top: 1px solid #e0e4ea;
}

.small-control-btn {
    padding: 6px 10px;
    margin: 0 2px;
    background: #fff;
    border: 1px solid #e0e4ea;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.small-control-btn:hover {
    background: #f5f5f7;
    border-color: #007aff;
}

/* Стили для QR кода */
.qr-img-placeholder {
    background: #fff;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    min-height: 200px;
    min-width: 200px;
    max-width: 300px;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
}

.qr-img-placeholder canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .game-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .game-left, .game-center, .game-right {
        width: 100%;
    }
    
    .media-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .video-container, .image-container {
        width: 100%;
    }
    
    .manual-input-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .manual-input-container input,
    .manual-input-container button {
        width: 100%;
    }
}

/* Стили для превью билетов */
.ticket-preview {
  margin: 8px 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ticket-preview:hover {
  transform: scale(1.02);
}

.ticket-preview-container {
  background: #ffffff;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: auto;
  min-width: 200px;
}

/* ИСПРАВЛЕНО: Стили для печатных и электронных билетов с цветными рамками */
.print-ticket .ticket-preview-container {
  border: 2px solid #9ca3af; /* Серая рамка для печатных билетов */
  box-shadow: 0 2px 4px rgba(156, 163, 175, 0.2);
}

.electronic-ticket .ticket-preview-container {
  border: 2px solid #3b82f6; /* Синяя рамка для электронных билетов */
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.ticket-preview-header {
  font-size: 0.85em;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  text-align: center;
}

.ticket-preview-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ticket-preview-row {
  display: flex;
  gap: 3px;
  justify-content: center;
}

.ticket-preview-cell {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85em;
  font-weight: 600;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 3px;
  color: #333;
  transition: all 0.2s ease;
}

.ticket-preview-cell.dropped {
  background: #cccccc; /* серый */
  color: #666666;
  border-color: #cccccc;
}
.ticket-preview-cell.winning {
  background: #e0ffe0; /* светло-зелёный */
  color: #155724;
  border-color: #27ae60;
  animation: pulse 1s infinite;
}

.ticket-preview-cell.pre-winning {
  background: #fffacd; /* светло-жёлтый */
  color: #856404;
  border-color: #f39c12;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* === НЕДОСТАЮЩИЕ СТИЛИ ИЗ РЕЗЕРВНОГО ФАЙЛА === */

/* Стили для списка пользовательских игр */
.custom-game-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid #e0e4ea;
  border-radius: 6px;
  background: #fff;
}

.custom-game-list::-webkit-scrollbar {
  width: 6px;
}

.custom-game-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.custom-game-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.custom-game-list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
.custom-game-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e4ea;
  margin-bottom: 8px;
  transition: background 0.2s, border-color 0.2s;
}

.custom-game-item:hover {
  background: #f0f1f3;
  border-color: #d1d5db;
}

.custom-game-item:last-child {
  margin-bottom: 0;
}

.custom-game-info {
  flex: 1;
}

.custom-game-name {
  font-size: 13px;
  font-weight: 500;
  color: #23272f;
  margin-bottom: 3px;
}

.custom-game-date {
  font-size: 11px;
  color: #666;
}
.custom-game-actions {
  display: flex;
  gap: 6px;
}

.custom-game-load-btn {
  padding: 6px 12px;
  background: #007aff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.custom-game-load-btn:hover {
  background: #0056cc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.custom-game-del-btn {
  padding: 6px 12px;
  background: #ff3b30;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.custom-game-del-btn:hover {
  background: #d70015;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Стили для кнопок управления режимами */
.manual-control, .auto-control {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #23272f;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.manual-control:hover, .auto-control:hover {
  background: #f8f9fa;
  border-color: #007aff;
}

.manual-control.active {
  background: #007aff;
  color: #fff;
  border-color: #007aff;
}

.auto-control.active {
  background: #007aff;
  color: #fff;
  border-color: #007aff;
}

.manual-control.disabled, .auto-control.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.manual-control.disabled:hover, .auto-control.disabled:hover {
  background: #fff;
  border-color: #d1d5db;
}

.mode-label {
  font-size: 14px;
  font-weight: 500;
  color: #23272f;
  margin-bottom: 8px;
  display: block;
}

/* Стили для блока текущего шара */
.current-ball-block {
  background: #f8f9fa;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.current-ball-title {
  font-size: 14px;
  font-weight: 600;
  color: #23272f;
  margin-bottom: 12px;
}

.current-ball-display {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.current-ball {
  font-size: 2rem;
  font-weight: bold;
  color: #007aff;
  background: #fff;
  border: 2px solid #007aff;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ballAppear 0.3s ease-in-out;
}

.ball-placeholder {
  color: #999;
  font-style: italic;
}

@keyframes ballAppear {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Стили для переключателя режимов */
.mode-switcher-container {
  margin-bottom: 16px;
}

.mode-switcher {
  display: flex;
  gap: 8px;
}

.mode-btn {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #23272f;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.mode-btn:hover {
  background: #f8f9fa;
  border-color: #007aff;
}

.mode-btn.active {
  background: #007aff;
  color: #fff;
  border-color: #007aff;
}

.mode-btn.active:hover {
  background: #0056cc;
}

.mode-switcher-container.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.mode-switcher-container.disabled .mode-btn {
  cursor: not-allowed;
}

.mode-switcher.disabled .mode-btn.active {
  background: #007aff;
  color: #fff;
}

/* Стили для уведомлений */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #fff;
  border: 1px solid #e0e4ea;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-width: 300px;
}

.notification-warning {
  border-left: 4px solid #ff9500;
}

.notification-info {
  border-left: 4px solid #007aff;
}

/* Анимации */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes ticketHighlight {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.highlighted-ticket {
  animation: ticketHighlight 0.3s ease-in-out;
}

/* Дополнительные стили для игровых кнопок */
.game-action-btn {
  padding: 12px 24px;
  background: #f5f5f7;
  color: #222;
  border: 1.5px solid #d1d1d6;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: 0 2px 6px rgba(60,60,60,0.07);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', Arial, sans-serif;
  text-transform: none;
  letter-spacing: normal;
}

.game-action-btn:hover {
  background: #e5e5ea;
  color: #222;
  box-shadow: 0 4px 12px rgba(60,60,60,0.10);
  border-color: #bdbdbd;
  transform: none;
}

/* Адаптивность для недостающих стилей */
@media (max-width: 700px) {
  .custom-game-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .custom-game-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .current-ball {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  .mode-switcher {
    flex-direction: column;
  }
  
  .notification {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* === СТИЛИ ДЛЯ НОВОЙ СИСТЕМЫ ГЕНЕРАЦИИ БИЛЕТОВ === */

/* Кнопка генерации билетов */
.generate-tickets-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 15px 0;
  width: 100%;
  justify-content: center;
}

.generate-tickets-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.generate-tickets-btn:active {
  transform: translateY(0);
}

.generate-tickets-btn.loading {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  cursor: not-allowed;
  animation: pulse 1.5s infinite;
}

.generate-tickets-btn .btn-icon {
  font-size: 16px;
}

.generate-tickets-btn .btn-text {
  font-size: 14px;
  font-weight: 600;
}

/* Контейнер статистики генерации */
.generation-stats {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin: 15px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stats-header {
  margin-bottom: 16px;
  text-align: center;
}

.stats-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.stat-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.stat-value {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

.stats-footer {
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.stats-footer small {
  color: #6b7280;
  font-size: 11px;
}

/* Уведомления */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-width: 400px;
  animation: slideInRight 0.3s ease;
}

.notification.success {
  border-left: 4px solid #10b981;
}

.notification.error {
  border-left: 4px solid #ef4444;
}

.notification-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.notification-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.notification-text {
  flex: 1;
  line-height: 1.4;
}

.notification-text strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

/* Анимации */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Адаптивность */
@media (max-width: 768px) {
  .generate-tickets-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .generate-tickets-btn .btn-icon {
    font-size: 14px;
  }
  
  .generate-tickets-btn .btn-text {
    font-size: 13px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-item {
    padding: 6px 10px;
  }
  
  .stat-label {
    font-size: 11px;
  }
  
  .stat-value {
    font-size: 13px;
  }
}

/* === СТИЛИ ДЛЯ УВЕДОМЛЕНИЙ О ГЕНЕРАЦИИ БИЛЕТОВ === */

.generation-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

.generation-notification.success {
    background: #4CAF50;
    color: white;
}

.generation-notification.error {
    background: #f44336;
    color: white;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-text {
    flex: 1;
}

.notification-text h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.notification-text p {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.4;
}

.ticket-ranges {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.range-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.range-label {
    font-weight: 500;
}

.range-value {
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

/* === СТИЛИ ДЛЯ СТАТИСТИКИ ГЕНЕРАЦИИ === */

.generation-stats {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.stats-header {
    margin-bottom: 12px;
}

.stats-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.stats-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #e9ecef;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
    color: #666;
    font-size: 14px;
}

.stat-value {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

/* === АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ === */

@media (max-width: 768px) {
    .generation-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification-content {
        gap: 10px;
    }
    
    .notification-text h4 {
        font-size: 15px;
    }
    
    .notification-text p {
        font-size: 13px;
    }
    
    .range-item {
        font-size: 12px;
    }
    
    .generation-stats {
        margin-top: 10px;
        padding: 12px;
    }
    
    .stats-header h4 {
        font-size: 15px;
    }
    
    .stat-item {
        padding: 5px 0;
    }
    
    .stat-label,
    .stat-value {
        font-size: 13px;
    }
}

/* === ИСПРАВЛЕНИЯ ДЛЯ СЕТКИ 5x5 === */

/* Специальные стили для сетки 5x5 */
#ticket-grid[data-size="5x5"] td {
    padding: 6px;
    font-size: 1.1rem;
    min-width: 35px;
    min-height: 35px;
    text-align: center;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 600px) {
    #ticket-grid[data-size="5x5"] td {
        padding: 4px;
        font-size: 1rem;
        min-width: 30px;
        min-height: 30px;
    }
}

/* Улучшенные стили для всех размеров сетки */
#ticket-grid {
    table-layout: fixed;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

#ticket-grid td {
    text-align: center;
    vertical-align: middle;
    position: relative;
}

#ticket-grid td .number {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 1.2;
}