:root {
    --primary: #a855f7;       /* Fiolet */
    --secondary: #ff6b9d;     /* Róż */
    --accent: #ffd700;        /* Złoto dla waluty */
    --bg-dark: #0a0a1a;       /* Ciemne tło */
    --panel-bg: rgba(20, 20, 40, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f0f0f0;
    --input-bg: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: radial-gradient(circle at center, #1a1a3a 0%, #0a0a1a 100%);
    color: var(--text-main);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    user-select: none;
}

/* KONTENER APLIKACJI */
.app-container {
    width: 100%;
    height: 100%;
    padding: 1.5vh 2vw;
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
}

/* NAGŁÓWEK */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--panel-bg);
    border-radius: 15px;
    padding: 12px 25px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--secondary);
}

.logo h1 {
    font-size: 1.4rem;
    font-family: 'Quicksand', sans-serif;
}

.logo h1 span { color: var(--primary); }

/* WALUTA */
.currency-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.4);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 700;
    color: var(--accent);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
}

.coin-icon {
    animation: coinSpin 3s infinite linear;
}

@keyframes coinSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.character-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    background: rgba(0,0,0,0.3);
    padding: 5px 10px;
    border-radius: 20px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #e74c3c;
    border-radius: 50%;
    box-shadow: 0 0 5px #e74c3c;
    transition: background-color 0.3s;
}

.status-dot.online {
    background-color: #2ed573;
    box-shadow: 0 0 5px #2ed573;
}

/* UKŁAD GŁÓWNY */
.main-layout {
    flex: 1;
    display: flex;
    gap: 20px;
    min-height: 0;
}

/* SEKCJA POSTACI (LEWA) */
.character-section {
    flex: 1.5;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 25px;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.stage-area {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    gap: 20px;
    overflow-x: auto;
}

.character-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s;
}

.player-label-tag {
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #fff;
    margin-bottom: -20px;
    z-index: 10;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.2);
}

/* WSKAŹNIK PREZENTU */
.surprise-alert {
    background: linear-gradient(45deg, #ff9a9e, #fad0c4);
    color: #333;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    position: absolute;
    top: -60px;
    animation: bounce 1s infinite;
    z-index: 15;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.4);
}
.surprise-alert.hidden { display: none; }

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* PANEL BOCZNY (PRAWY) */
.sidebar-section {
    flex: 0.8;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    padding-right: 5px;
}

.sidebar-section::-webkit-scrollbar { width: 6px; }
.sidebar-section::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.panel {
    background: var(--panel-bg);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.panel-header {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 10px;
}

.panel-header h2 {
    font-size: 1.1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ZAKŁADKI (TABS) */
.tabs-header {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    padding: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.3s;
    border-radius: 8px;
}

.tab-btn:hover { color: white; background: rgba(255,255,255,0.05); }
.tab-btn.active {
    color: var(--secondary);
    background: rgba(255, 107, 157, 0.15);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}
.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* KONTROLKI I INPUTY */
.control-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.control-group-column {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}
.control-group label {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 40px;
    height: 25px;
    border-radius: 4px;
    cursor: pointer;
    background: none;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(255,255,255,0.5); border-radius: 4px; }

input[type="text"] {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    padding: 10px;
    border-radius: 8px;
    color: white;
    font-family: 'Quicksand', sans-serif;
    outline: none;
    transition: 0.3s;
}
input[type="text"]:focus {
    border-color: var(--primary);
    background: rgba(0,0,0,0.5);
}

.mp-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.mp-btn:hover { filter: brightness(1.2); transform: translateY(-2px); }
.mp-btn:active { transform: translateY(0); }
.mp-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.status-info {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    margin-top: 8px;
}

/* SKLEP (SHOP) */
.shop-section h3 {
    margin: 15px 0 10px 0;
    font-size: 1rem;
    color: var(--accent);
}
.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.shop-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}
.shop-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}
.shop-item.owned {
    border-color: #2ed573;
    opacity: 0.7;
}
.shop-item.active-item {
    border-color: var(--primary);
    background: rgba(168, 85, 247, 0.15);
    opacity: 1;
}
.shop-item .price {
    display: block;
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 5px;
}
.shop-item .name {
    font-size: 0.9rem;
    font-weight: 600;
}

/* TRIKI (TRICKS) */
.tricks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}
.trick-btn {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}
.trick-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}
.hint-text {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    font-style: italic;
    margin-bottom: 5px;
}

/* PRZEDMIOTY SPECJALNE */
.items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 10px 0;
}
.interaction-item {
    background: rgba(255,255,255,0.05);
    padding: 10px 5px;
    border-radius: 12px;
    cursor: grab;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    transition: 0.3s;
    border: 1px solid transparent;
    position: relative;
}
.interaction-item:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--primary);
    transform: translateY(-3px);
}
.interaction-item.special-item {
    background: rgba(255, 215, 0, 0.05);
}
.interaction-item.special-item:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--accent);
}
.cost-tag {
    font-size: 0.6rem;
    color: var(--accent);
    background: rgba(0,0,0,0.5);
    padding: 2px 4px;
    border-radius: 4px;
}

.icon-box {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.icon-pink { background: rgba(255, 107, 157, 0.2); color: #ff6b9d; }
.icon-green { background: rgba(46, 213, 115, 0.2); color: #2ed573; }
.icon-orange { background: rgba(255, 165, 2, 0.2); color: #ffa502; }
.icon-purple { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.icon-gold { background: rgba(255, 215, 0, 0.2); color: #ffd700; }

.touch-actions-container { margin-top: 10px; }
.touch-buttons { display: flex; gap: 10px; }
.touch-btn {
    flex: 1;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-main);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
}
.touch-btn:hover { background: rgba(255,255,255,0.15); }

/* STATYSTYKI */
.stat-row { margin-bottom: 12px; }
.stat-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden;
}
.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    transition: width 0.8s ease-in-out;
}
.emotion-indicators {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.emotion {
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.3s;
}
.emotion:hover { opacity: 1; transform: scale(1.2); color: var(--secondary); }

/* MEDIA BROWSER */
.media-browser {
    display: none;
    flex: 1;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    flex-direction: column;
}
.main-layout.media-mode .character-section { flex: 0.4; }
.main-layout.media-mode .sidebar-section { display: none; }
.main-layout.media-mode .media-browser { display: flex; }

.browser-header {
    background: #f0f0f0;
    padding: 10px 20px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.close-media-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
}
.site-selector {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #2f3542;
    color: white;
}
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    width: 100%;
    margin-top: 20px;
}
.site-card {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
}
.site-card:hover { background: var(--primary); }
.site-card i { font-size: 2rem; margin-bottom: 10px; }
.iframe-container {
    flex: 1;
    width: 100%;
    height: 100%;
    position: relative;
    display: none;
}
iframe {
    width: 100%;
    height: 100%;
    border: none;
}
.app-footer {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    padding: 5px;
}
#interaction-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 20;
}

/* 
   ANIMACJE TRIKÓW (TRICK ANIMATIONS)
   Te klasy będą dodawane przez JS
*/

/* Obrót */
.trick-spin {
    animation: trickSpin 1s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
@keyframes trickSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

/* Podskok */
.trick-jump {
    animation: trickJump 0.6s ease-in-out;
}
@keyframes trickJump {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-80px) scale(1.1); }
}

/* Salto (Flip) */
.trick-flip {
    animation: trickFlip 1s ease-in-out;
}
@keyframes trickFlip {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Taniec (bujanie) */
.trick-dance {
    animation: trickDance 1s infinite alternate;
}
@keyframes trickDance {
    0% { transform: rotate(-10deg) translateY(0); }
    100% { transform: rotate(10deg) translateY(-10px); }
}