:root {
    --bg-color: #050a15;
    --neon-green: #ccff00;
    --neon-green-glow: rgba(204, 255, 0, 0.4);
    --bubble-red: #ff3333;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10,10 Q50,90 100,50 T190,10' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='1'/%3E%3Cpath d='M10,50 Q60,120 120,80 T190,50' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='1'/%3E%3Cpath d='M10,90 Q70,150 140,110 T190,90' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='1'/%3E%3Cpath d='M10,130 Q80,180 160,140 T190,130' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 200px;
    z-index: -1;
}

.app-container {
    width: 100%;
    height: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    position: relative;
    background: radial-gradient(circle at top center, rgba(204, 255, 0, 0.08) 0%, transparent 70%);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 10, 21, 0.95);
    backdrop-filter: blur(15px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 30px;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.overlay-content h1 {
    color: var(--neon-green);
    margin-bottom: 20px;
    font-size: 32px;
    font-weight: 700;
    text-shadow: 0 0 20px var(--neon-green-glow);
}

.overlay-content p {
    margin-bottom: 40px;
    color: #a0aabf;
    line-height: 1.6;
    font-size: 16px;
}

#btn-start {
    background: var(--neon-green);
    color: #050a15;
    border: none;
    padding: 16px 48px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 25px var(--neon-green-glow);
    transition: transform 0.2s, box-shadow 0.2s;
}

#btn-start:active {
    transform: scale(0.95);
    box-shadow: 0 0 15px var(--neon-green-glow);
}

header {
    padding: 40px 20px 20px;
    text-align: center;
}

.app-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

main {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* Tabs System */
.tab-content {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.tab-content.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Center Stage for Bullseye + Vertical Level */
.center-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
}

/* Levels General */
.tubular-level-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    box-shadow: inset 0 8px 20px rgba(0,0,0,0.6), 0 5px 20px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.tubular-level {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tubular-bubble {
    width: 38px;
    height: 38px;
    background: radial-gradient(circle at 35% 35%, #ff6b6b, var(--bubble-red));
    border-radius: 50%;
    position: absolute;
    box-shadow: inset -3px -3px 8px rgba(0,0,0,0.5), 0 0 15px rgba(255,51,51,0.7);
    transition: background 0.3s, box-shadow 0.3s;
    z-index: 1;
}

/* Horizontal Level */
.tubular-level-container.horiz {
    width: 250px;
    height: 56px;
}
.tubular-level-container.horiz .center-marks {
    width: 44px;
    height: 100%;
    border-left: 2px solid var(--neon-green);
    border-right: 2px solid var(--neon-green);
    position: absolute;
    box-shadow: 0 0 12px var(--neon-green-glow);
    z-index: 2;
}

/* Vertical Level */
.tubular-level-container.vert {
    width: 56px;
    height: 250px;
}
.tubular-level-container.vert .center-marks {
    width: 100%;
    height: 44px;
    border-top: 2px solid var(--neon-green);
    border-bottom: 2px solid var(--neon-green);
    position: absolute;
    box-shadow: 0 0 12px var(--neon-green-glow);
    z-index: 2;
}

/* Circular Bullseye Level */
.bullseye-level-container {
    width: 250px;
    height: 250px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    box-shadow: inset 0 15px 35px rgba(0,0,0,0.6), 0 10px 40px rgba(0,0,0,0.4);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.bullseye-level {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inner-circle {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--neon-green);
    box-shadow: 0 0 12px var(--neon-green-glow), inset 0 0 12px var(--neon-green-glow);
}

.inner-circle-1 {
    width: 160px;
    height: 160px;
    border-color: rgba(204, 255, 0, 0.3);
    box-shadow: 0 0 8px rgba(204, 255, 0, 0.2), inset 0 0 8px rgba(204, 255, 0, 0.2);
}

.inner-circle-2 {
    width: 70px;
    height: 70px;
    border-width: 3px;
    z-index: 2;
}

.crosshair-x {
    position: absolute;
    width: 100%;
    height: 1px;
    background: rgba(204, 255, 0, 0.2);
}

.crosshair-y {
    position: absolute;
    width: 1px;
    height: 100%;
    background: rgba(204, 255, 0, 0.2);
}

.bullseye-bubble {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 35% 35%, #ff6b6b, var(--bubble-red));
    border-radius: 50%;
    position: absolute;
    box-shadow: inset -4px -4px 10px rgba(0,0,0,0.5), 0 0 20px rgba(255,51,51,0.7);
    transition: background 0.3s, box-shadow 0.3s;
    z-index: 1;
}

/* Perfect Level State Styles */
.bubble.level-perfect {
    background: radial-gradient(circle at 35% 35%, #e6ff66, var(--neon-green));
    box-shadow: inset -4px -4px 10px rgba(0,0,0,0.5), 0 0 25px var(--neon-green);
}

/* Coordinates */
.coordinates {
    display: flex;
    gap: 20px;
}

.coord {
    font-size: 32px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.2);
    padding: 12px 20px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    transition: color 0.3s, text-shadow 0.3s, box-shadow 0.3s;
}

.coord.level-perfect-text {
    color: var(--neon-green);
    text-shadow: 0 0 15px var(--neon-green-glow);
    box-shadow: inset 0 0 20px rgba(204, 255, 0, 0.1);
    border-color: rgba(204, 255, 0, 0.3);
}

/* Tab Ángulo / Transportador */
.angle-header {
    font-size: 22px;
    color: var(--neon-green);
    font-weight: 600;
    text-shadow: 0 0 10px var(--neon-green-glow);
    margin-bottom: 20px;
}

.protractor-container {
    width: 100%;
    max-width: 320px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: inset 0 5px 20px rgba(0,0,0,0.5), 0 10px 30px rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
}

.protractor-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

#angle-arc {
    transition: transform 0.05s linear;
}

.angle-display {
    font-size: 56px;
    font-weight: 700;
    color: #fff;
    margin-top: -10px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 15px var(--neon-green-glow);
}

.angle-instructions {
    text-align: center;
    color: #a0aabf;
    font-size: 15px;
    line-height: 1.5;
    max-width: 85%;
    margin-top: 20px;
}

/* Tabs: Calibrar y Ajustes */
.coming-soon {
    text-align: center;
    color: #a0aabf;
}
.coming-soon h2 {
    color: var(--neon-green);
    margin-bottom: 15px;
    font-size: 28px;
    text-shadow: 0 0 15px var(--neon-green-glow);
}

/* Tab Bar */
.bottom-nav {
    background: rgba(5, 10, 21, 0.95);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    padding: 15px 0 30px;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.4);
    backdrop-filter: blur(15px);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #5d6b89;
    transition: all 0.3s ease;
    width: 60px;
}

.nav-item span {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.nav-item.active {
    color: var(--neon-green);
    text-shadow: 0 0 12px var(--neon-green-glow);
}

.nav-item.active svg {
    filter: drop-shadow(0 0 10px var(--neon-green-glow));
    stroke: var(--neon-green);
}

.nav-item:hover:not(.active) {
    color: #8fa0c4;
}
