/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #000 0%, #002200 50%, #000 100%);
    color: #44dd44;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Scanlines Effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 0, 0.03) 2px,
        rgba(0, 255, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 1000;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.title-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title {
    font-size: 2.8rem;
    font-weight: 900;
    color: #00ff00;
    letter-spacing: 0.2em;
    margin-bottom: 10px;
    position: relative;
}

.title-link {
    color: #44dd44;
    text-decoration: none;
    display: inline-block;
    animation: glow 2s ease-in-out infinite alternate;
    background: linear-gradient(
        45deg,
        #44dd44 0%,
        #44dddd 20%,
        #8844dd 40%,
        #dd44dd 60%,
        #dddd44 80%,
        #44dd44 100%
    );
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 
        0 0 10px #44dddd,
        0 0 20px #44dddd,
        0 0 30px #44dddd;
    transition: all 0.3s ease;
}

.title-link:hover {
    filter: brightness(1.2);
}


.subtitle {
    font-size: 1.2rem;
    color: #44dddd;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #44dddd;
}

@keyframes glow {
    from {
        text-shadow: 
            0 0 10px #44dddd,
            0 0 20px #44dddd,
            0 0 30px #44dddd;
    }
    to {
        text-shadow: 
            0 0 20px #44dddd,
            0 0 30px #44dddd,
            0 0 40px #44dddd;
    }
}

/* Pixel Border */
.pixel-border {
    height: 4px;
    background: linear-gradient(90deg, 
        #44dd44 0%, 
        #44dddd 25%, 
        #dd44dd 50%, 
        #dddd44 75%, 
        #44dd44 100%);
    margin: 20px 0;
    box-shadow: 0 0 15px rgba(68, 221, 68, 0.5);
    animation: border-flow 3s ease-in-out infinite;
}

@keyframes border-flow {
    0%, 100% {
        background: linear-gradient(90deg, 
            #44dd44 0%, 
            #44dddd 25%, 
            #dd44dd 50%, 
            #dddd44 75%, 
            #44dd44 100%);
    }
    50% {
        background: linear-gradient(90deg, 
            #dd44dd 0%, 
            #dddd44 25%, 
            #44dd44 50%, 
            #44dddd 75%, 
            #dd44dd 100%);
    }
}

/* Game Interface */
.game-interface {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

/* Selection Panels */
.selection-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    align-items: start;
}

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

.center-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 300px;
    gap: 20px;
}

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

.panel {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #44dd44;
    border-radius: 0;
    padding: 20px;
    position: relative;
    box-shadow: 
        0 0 18px rgba(68, 221, 68, 0.3),
        inset 0 0 18px rgba(68, 221, 68, 0.1);
    transition: all 0.3s ease;
}

.panel:hover {
    border-color: #44dddd;
    box-shadow: 
        0 0 22px rgba(68, 221, 221, 0.35),
        inset 0 0 22px rgba(68, 221, 221, 0.1);
}

.panel::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #44dd44, #44dddd, #dd44dd, #44dd44);
    z-index: -1;
    border-radius: 0;
    opacity: 0.6;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #dddd44;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 0.1em;
    text-shadow: 0 0 10px #dddd44;
}

/* Selection Grid */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.selection-btn {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #44dd44;
    color: #44dd44;
    padding: 12px 8px;
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.selection-btn:hover {
    background: rgba(68, 221, 221, 0.1);
    border-color: #44dddd;
    box-shadow: 
        0 0 14px rgba(68, 221, 221, 0.45),
        inset 0 0 14px rgba(68, 221, 221, 0.1);
    transform: translateY(-2px);
    color: #44dddd;
}

.selection-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 0 10px rgba(68, 221, 68, 0.3),
        inset 0 0 10px rgba(68, 221, 68, 0.18);
}

.selection-btn.selected {
    background: rgba(221, 68, 221, 0.18);
    border-color: #dd44dd;
    color: #dd44dd;
    box-shadow: 
        0 0 18px rgba(221, 68, 221, 0.55),
        inset 0 0 18px rgba(221, 68, 221, 0.18);
    animation: pulse 1s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        box-shadow: 
            0 0 18px rgba(221, 68, 221, 0.55),
            inset 0 0 18px rgba(221, 68, 221, 0.18);
    }
    to {
        box-shadow: 
            0 0 26px rgba(221, 68, 221, 0.75),
            inset 0 0 26px rgba(221, 68, 221, 0.25);
    }
}

/* Current Selection Display */
.current-selection {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #44aadd;
    padding: 20px;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 
        0 0 18px rgba(68, 170, 221, 0.3),
        inset 0 0 18px rgba(68, 170, 221, 0.1);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 500px;
    min-height: 280px;
}

.current-selection:hover {
    border-color: #66bbff;
    box-shadow: 
        0 0 22px rgba(102, 187, 255, 0.35),
        inset 0 0 22px rgba(102, 187, 255, 0.1);
}

.selection-display {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 20px;
    align-items: center;
}

.selection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(68, 170, 221, 0.1);
    border: 1px solid rgba(68, 170, 221, 0.3);
    min-height: 32px;
}

.label {
    font-weight: 700;
    color: #44dddd;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
}

.value {
    font-weight: 700;
    color: #44dd44;
    text-shadow: 0 0 5px #44dd44;
    font-size: 0.9rem;
}

/* Interpret Button */
.interpret-btn {
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #dd44dd;
    color: #dd44dd;
    padding: 15px;
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    animation: pinball-flash 2s ease-in-out infinite;
}

.interpret-btn:hover:not(:disabled) {
    background: rgba(221, 68, 221, 0.1);
    border-color: #ff66ff;
    color: #ff66ff;
    box-shadow: 
        0 0 18px rgba(255, 102, 255, 0.45),
        inset 0 0 18px rgba(255, 102, 255, 0.1);
    transform: translateY(-2px);
}

.interpret-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #662266;
    color: #662266;
}

.interpret-btn:not(:disabled):active {
    transform: translateY(0);
}

/* Interpretation Panel */
.interpretation-panel {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #dd4444;
    padding: 30px;
    box-shadow: 
        0 0 18px rgba(221, 68, 68, 0.3),
        inset 0 0 18px rgba(221, 68, 68, 0.1);
    min-height: 200px;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

/* Additional Panels */
.additional-panels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 600px;
}

.additional-panels-row2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 600px;
}

.interpretation-panel:hover {
    border-color: #dd44dd;
    box-shadow: 
        0 0 22px rgba(221, 68, 221, 0.35),
        inset 0 0 22px rgba(221, 68, 221, 0.1);
}

.interpretation-content {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #66ccff;
    text-align: justify;
    text-shadow: 0 0 5px rgba(102, 204, 255, 0.3);
}

.placeholder {
    color: #44dddd;
    font-style: italic;
    text-align: center;
    opacity: 0.7;
}

.interpretation-text {
    animation: typewriter 2s ease-in-out;
}

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

/* Footer */
.footer {
    margin-top: 40px;
    text-align: center;
}

.footer-text {
    color: #44dddd;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.footer-link {
    color: #44dd44;
    text-decoration: none;
    font-weight: 700;
    text-shadow: 0 0 5px #44dd44;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: #44dd44;
    text-shadow: 
        0 0 10px #44dd44,
        0 0 20px #44dd44;
    transform: scale(1.05);
}

.website-description {
    color: #dd8844;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    margin-top: 10px;
    opacity: 0.9;
    font-style: italic;
    text-shadow: 0 0 5px rgba(221, 136, 68, 0.5);
    animation: subtle-glow 3s ease-in-out infinite alternate, shimmer-description 4s ease-in-out infinite;
    background: linear-gradient(
        45deg,
        #dd8844 0%,
        #ddaa44 25%,
        #dd8844 50%,
        #ddaa44 75%,
        #dd8844 100%
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}


@keyframes shimmer-description {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes subtle-glow {
    from {
        text-shadow: 0 0 5px rgba(221, 136, 68, 0.5);
    }
    to {
        text-shadow: 0 0 10px rgba(221, 136, 68, 0.7);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .selection-panels {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .left-column,
    .right-column {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .center-column {
        order: -1;
        margin-bottom: 20px;
    }
    
    .current-selection {
        max-width: 100%;
        min-height: 320px;
    }
    
    .selection-display {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .additional-panels,
    .additional-panels-row2 {
        grid-template-columns: 1fr;
        gap: 15px;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .header {
        padding-top: 3rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .selection-panels {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    .left-column,
    .right-column {
        flex-direction: column;
    }
    
    .center-column {
        order: 1;
        margin-bottom: 20px;
    }
    
    .selection-display {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .selection-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .selection-btn {
        font-size: 0.7rem;
        padding: 10px 6px;
    }
    
    .selection-display {
        grid-template-columns: 1fr;
    }
    
    /* Show both columns on mobile in priority order */
    .left-column {
        order: 1;
    }
    
    .right-column {
        order: 2;
    }
    
    /* Blue outline for priority panels */
    .priority-panels .panel,
    .left-column .panel {
        border-color: #44aadd !important;
        box-shadow: 0 0 15px rgba(68, 170, 221, 0.3) !important;
    }
    
    /* Orange outline for other panels */
    .additional-panels .panel,
    .additional-panels-row2 .panel,
    .right-column .panel {
        border-color: #ff8844 !important;
        box-shadow: 0 0 15px rgba(255, 136, 68, 0.3) !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding-top: 2.5rem;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .panel {
        padding: 15px;
    }
    
    .selection-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Special Effects */
.selection-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.2), transparent);
    transition: left 0.5s ease;
}

.selection-btn:hover::before {
    left: 100%;
}


@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}
@keyframes pinball-flash {
    0%, 100% {
        background: rgba(0, 0, 0, 0.9);
        border-color: #dd44dd;
        color: #dd44dd;
        box-shadow: 
            0 0 10px rgba(221, 68, 221, 0.3),
            inset 0 0 10px rgba(221, 68, 221, 0.1);
    }
    50% {
        background: rgba(221, 68, 221, 0.2);
        border-color: #ff66ff;
        color: #ff66ff;
        box-shadow: 
            0 0 20px rgba(255, 102, 255, 0.6),
            inset 0 0 20px rgba(255, 102, 255, 0.2);
    }
}

/* Home Button */
.home-button {
    position: fixed;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 0.35rem;
    transition: all 0.3s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: none;
    gap: 0.25rem;
}

.home-button:hover {
    background: transparent;
    transform: scale(1.05);
    box-shadow: none;
}

.home-crystal {
    width: 48px;
    height: 48px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.home-button:hover .home-crystal {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.home-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(68, 221, 68, 0.3);
    border-radius: 4px;
    color: #44dd44;
    font-family: 'Orbitron', monospace;
    font-size: 0.6rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(68, 221, 68, 0.3);
}

.home-button:hover .home-tooltip {
    opacity: 1;
}

.home-url {
    font-family: 'Orbitron', monospace;
    font-size: 0.5rem;
    color: #44dd44;
    text-shadow: 
        0 0 3px rgba(68, 221, 68, 0.8),
        0 0 6px rgba(68, 221, 68, 0.6);
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.home-button:hover .home-url {
    color: #44dd44;
    text-shadow: 
        0 0 5px rgba(68, 221, 68, 1),
        0 0 10px rgba(68, 221, 68, 0.8);
}

/* Mobile styles for home button */
@media (max-width: 768px) {
    .home-button {
        top: 0.1rem;
        right: 0.1rem;
        padding: 0.15rem;
        gap: 0.1rem;
    }
    
    .home-crystal {
        width: 24px;
        height: 24px;
    }
    
    .home-tooltip {
        font-size: 0.35rem;
        padding: 0.25rem 0.4rem;
        margin-bottom: 0.25rem;
    }
    
    .home-url {
        font-size: 0.3rem;
    }
}
