:root {
    --bg-base: #09090b;
    --accent: #ffb300; /* Baltic Amber */
    
    /* Responsive Circle Mathematics */
    --circle-radius: 41vmin; 
    --center-radius: 22vmin;
    --card-offset: 82px; /* Adjusted to fit the 145px cards */
}

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

body {
    background-color: var(--bg-base);
    color: #f4f4f5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    height: 100vh;
    width: 100vw;
    overflow: hidden; /* Strict 1-frame, no scrolling */
    background-image: 
        radial-gradient(circle at center, rgba(255, 179, 0, 0.03) 0%, transparent 60%),
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 100% 100%, 30px 30px, 30px 30px;
    -webkit-font-smoothing: antialiased;
}

/* Top Bar / Logo Area */
.top-bar {
    position: absolute;
    top: 40px;
    left: 40px;
    z-index: 50;
    pointer-events: none;
}

.top-bar * { pointer-events: auto; }

.logo-block {
    display: inline-flex;
    flex-direction: column;
    align-items: center; 
    text-align: center;
}

.logo-block .logo {
    font-family: "Courier New", Courier, monospace;
    font-size: 2.2rem;
    font-weight: bold;
    color: #fff;
    letter-spacing: 1px;
}

.logo-block .tagline {
    color: var(--accent);
    font-size: 1rem;
    margin-top: 5px;
    font-weight: 600;
    padding-bottom: 6px;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
}

/* Pure CSS Language Switcher (Baltic Flags) */
.lang-selector {
    position: absolute;
    top: 40px;
    right: 40px;
    display: flex;
    gap: 12px;
    z-index: 100;
}

.lang-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none; 
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    position: relative;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    overflow: hidden;
}

.lang-btn:hover {
    transform: scale(1.1);
}

.lang-btn.active {
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3), inset 0 0 0 2px #fff;
}

.lang-btn[data-lang="en"] {
    background: #27272a;
    color: #fff;
    font-family: "Courier New", Courier, monospace;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: -1px;
}
.lang-btn[data-lang="lt"] {
    background: linear-gradient(to bottom, #FDB913 0%, #FDB913 33.33%, #006A44 33.33%, #006A44 66.66%, #C1272D 66.66%, #C1272D 100%);
}
.lang-btn[data-lang="lv"] {
    background: linear-gradient(to bottom, #9E3039 0%, #9E3039 40%, #FFFFFF 40%, #FFFFFF 60%, #9E3039 60%, #9E3039 100%);
}
.lang-btn[data-lang="ee"] {
    background: linear-gradient(to bottom, #0072CE 0%, #0072CE 33.33%, #000000 33.33%, #000000 66.66%, #FFFFFF 66.66%, #FFFFFF 100%);
}

.lang-btn::after {
    content: attr(title);
    position: absolute;
    bottom: -25px;
    background: #18181b;
    color: #fff;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
}
.lang-btn:hover::after { opacity: 1; }

/* Container for the circular structure */
.circle-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Visual Connectors (Lines) */
.connector {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--circle-radius);
    height: 2px;
    transform-origin: 0 50%;
    transform: rotate(var(--angle)); /* Injected inline from PHP */
    display: flex;
    align-items: center;
    padding-left: calc(var(--center-radius) + 10px);
    padding-right: var(--card-offset);
    pointer-events: none;
    z-index: 1;
}

.connector .line {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    transition: all 0.4s ease;
}

.connector.active .line {
    background: var(--accent);
    height: 2px;
    box-shadow: 0 0 10px var(--accent);
}

.connector.active .line::after {
    content: '';
    position: absolute;
    top: -2px; left: 0;
    width: 15px; height: 6px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 0 10px #fff, 0 0 20px var(--accent);
    animation: data-flow 1.5s infinite ease-in-out;
}

@keyframes data-flow {
    0% { left: 0; opacity: 0; transform: scale(0.5); }
    20% { opacity: 1; transform: scale(1); }
    80% { opacity: 1; transform: scale(1); }
    100% { left: calc(100% - 15px); opacity: 0; transform: scale(0.5); }
}

/* Cards in Circular Layout */
.card-wrapper {
    position: absolute;
    top: 50%; left: 50%;
    transform: rotate(var(--angle)) translate(var(--circle-radius)) rotate(var(--counter-angle));
    width: 0; height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.card {
    width: 145px !important;
    height: 145px !important;
    min-width: 145px !important;
    min-height: 145px !important;
    max-width: 145px !important;
    max-height: 145px !important;
    flex-shrink: 0;
    overflow: hidden;
    
    background: rgba(15, 15, 18, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50% !important;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    backdrop-filter: blur(8px);
}

.card:hover {
    border-color: rgba(255, 179, 0, 0.5);
    transform: scale(1.05);
}

.card.active {
    border-color: var(--accent);
    box-shadow: 0 0 25px rgba(255, 179, 0, 0.15);
    transform: scale(1.1);
    background: rgba(255, 179, 0, 0.05);
}

.card-num {
    font-family: "Courier New", Courier, monospace;
    color: var(--accent);
    font-size: 1.5rem; 
    font-weight: bold;
    margin-bottom: 6px;
    opacity: 0.8;
    line-height: 1;
}

.card.active .card-num { opacity: 1; text-shadow: 0 0 8px rgba(255, 179, 0, 0.5); }

.card-title {
    font-size: 0.82rem;
    color: #d4d4d8;
    line-height: 1.25;
    pointer-events: none;
    padding: 0 5px;
}

/* Center Content Panel */
.center-panel {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: calc(var(--center-radius) * 2);
    height: calc(var(--center-radius) * 2.2);
    border-radius: 20px;
    background: rgba(12, 12, 14, 0.9);
    border: 1px solid rgba(255, 179, 0, 0.3);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.95), inset 0 0 30px rgba(255, 179, 0, 0.05);
    display: flex;
    flex-direction: column;
    padding: 45px;
    backdrop-filter: blur(20px);
    z-index: 5;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.panel-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-num {
    font-family: "Courier New", Courier, monospace;
    color: var(--accent);
    font-size: 2.2rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 179, 0, 0.3);
    line-height: 1;
}

.panel-title {
    font-size: 1.3rem; 
    color: #fff;
    margin-top: 10px;
    line-height: 1.4;
}

.panel-text {
    font-size: 1rem; 
    line-height: 1.6;
    color: #a1a1aa;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

.panel-text::-webkit-scrollbar { width: 4px; }
.panel-text::-webkit-scrollbar-track { background: transparent; }
.panel-text::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

/* Mobile Adjustments */
@media (max-width: 900px) {
    body { overflow-y: auto; }
    .top-bar {
        position: relative;
        top: 0; left: 0;
        width: 100%;
        padding: 20px 20px 0 20px;
        text-align: center;
        display: flex;
        justify-content: center;
    }
    .lang-selector {
        position: relative;
        top: 10px; right: 0;
        justify-content: center;
        margin-bottom: 20px;
    }
    
    :root {
        --circle-radius: 38vmin; 
        --center-radius: 35vmin; 
        --card-offset: 40px; 
    }
    .circle-container { min-height: 700px; margin-top: 20px; }

    .card { 
        width: 75px !important; 
        height: 75px !important; 
        min-width: 75px !important; 
        min-height: 75px !important;
        max-width: 75px !important;
        max-height: 75px !important;
        padding: 5px; 
    }
    .card-title { display: none; }
    .card-num { margin: 0; font-size: 1.2rem; }

    .center-panel {
        width: calc(var(--center-radius) * 2);
        height: calc(var(--center-radius) * 2);
        border-radius: 50%;
        padding: 30px;
    }

    .panel-header { margin-bottom: 15px; padding-bottom: 15px; }
    .panel-num { font-size: 1.5rem; }
    .panel-title { font-size: 1.1rem; }
    .panel-text { font-size: 0.9rem; line-height: 1.5; text-align: center; }
}
