/* ============================================================
   main.css — стили Astralida HTML-порта
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #fff;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* --- Игровой контейнер --- */
#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 800px;
}

/* --- 3D Flip-контейнер --- */
.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.flip-front {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.flip-back {
    display: none;
}

/* --- Canvas игрового поля --- */
#game-canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- Панели игроков --- */
.player-panel {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #555;
    border-radius: 10px;
    padding: 8px 14px;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.3s, top 1s cubic-bezier(0.4, 0.0, 0.2, 1), left 1s cubic-bezier(0.4, 0.0, 0.2, 1), right 1s cubic-bezier(0.4, 0.0, 0.2, 1), bottom 1s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.player-panel.inactive {
    opacity: 1;
    border-color: #333;
}
.player-panel.active {
    opacity: 1;
    border-color: rgba(255,255,255,0.6);
}

.player-panel .planet-circle {
    width: 64px;
    height: 64px;
    min-width: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    border: 2px solid #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    color: #fff;
}

.player-panel .player-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.player-panel .player-name {
    font-size: 16px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-panel .player-status {
    font-size: 21px;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 5px;
    white-space: nowrap;
}

/* --- Модальные окна (алерты) --- */
.modal-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
    z-index: 100;
}

.modal-dialog {
    background: #1a1a1a;
    border: 1px solid #555;
    border-radius: 12px;
    padding: 24px;
    min-width: 320px;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    white-space: pre-line;
}

.modal-message {
    font-size: 13px;
    color: #ccc;
    text-align: center;
    white-space: pre-line;
    line-height: 1.5;
}
.modal-message .aspect-text {
    display: block;
    text-align: left;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.4;
}

.modal-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.modal-btn {
    padding: 8px 16px;
    border: 1px solid #666;
    border-radius: 6px;
    background: #333;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.modal-btn:hover {
    background: #555;
}
.modal-btn.primary {
    background: #0066cc;
    border-color: #0088ff;
}
.modal-btn.primary:hover {
    background: #0088ff;
}
.modal-btn.danger {
    background: #660000;
    border-color: #ff0000;
}
.modal-btn.cancel {
    background: #444;
    border-color: #888;
}

.modal-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #555;
    border-radius: 6px;
    background: #000;
    color: #fff;
    font-size: 14px;
    outline: none;
}
.modal-input:focus {
    border-color: #0088ff;
}

/* --- Экран игрока (player info) --- */
#player-screen {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 200;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
#player-screen.visible {
    opacity: 1;
    pointer-events: auto;
}

#player-screen .ps-header {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    gap: 10px;
    border-bottom: 1px solid #333;
}

#player-screen .ps-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #cc0000;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#player-screen .ps-title {
    font-size: 16px;
    font-weight: 300;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#player-screen .ps-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* Карточки аспектов в экране игрока */
.aspect-card {
    display: inline-block;
    width: 160px;
    height: 280px;
    margin: 5px;
    border-radius: 6px;
    border: 1px solid;
    overflow: hidden;
    vertical-align: top;
    font-size: 10px;
}

.aspect-card.harmonic {
    background: #7A0C00;
    border-color: #fff;
}
.aspect-card.strained {
    background: #01147E;
    border-color: #fff;
}

.aspect-card .ac-inner {
    padding: 6px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.aspect-card .ac-symbols {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: bold;
}

.aspect-card .ac-title {
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    margin: 2px 0;
}

.aspect-card .ac-subtitle {
    text-align: center;
    font-size: 9px;
    font-style: italic;
    margin-bottom: 4px;
}

.aspect-card .ac-text {
    flex: 1;
    font-size: 8px;
    line-height: 1.25;
    overflow: hidden;
}


/* --- Инфолейбл --- */
#info-label-wrap {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 8px;
    padding: 12px 24px;
    z-index: 90;
    display: none;
    pointer-events: none;
    max-width: 500px;
}
#info-label-wrap.visible {
    display: block;
}
#info-label {
    color: #fff;
    font-size: 16px;
    text-align: center;
    white-space: pre-line;
}

/* --- Экран карт (Admin) --- */
#cards-screen {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #000;
    z-index: 300;
    overflow-y: auto;
    display: none;
    padding: 10px;
}
#cards-screen.visible {
    display: block;
}

.card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.power-card {
    width: 120px;
    height: 200px;
    background: #fff;
    border-radius: 5px;
    border: 1px solid #000;
    padding: 8px;
    color: #000;
    font-size: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.power-card .pc-sign {
    font-size: 24px;
}

.power-card .pc-power {
    font-size: 14px;
    font-weight: bold;
}

/* --- Нижняя панель с кнопками --- */
.bottom-bar {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 85;
}

.domino-board-btn {
    padding: 8px 22px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid #888;
    border-radius: 20px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s, border-color 0.2s;
    letter-spacing: 1px;
    white-space: nowrap;
}
.domino-board-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #ccc;
}

