body {
    margin: 0;
    padding: 0;
    /*background*/
    background: linear-gradient(to bottom, #0b0f19 0%, #1a1c3a 40%, #39285c 75%, #683253 90%, #d97443 100%);
    font-family: 'Georgia', serif;
    color: #e3def2;
    overflow: hidden;
    position: relative;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: 
        150px 80px #fff, 320px 120px rgba(255,255,255,0.6), 450px 40px #fff, 
        720px 200px rgba(255,255,255,0.4), 810px 90px #fff, 1100px 150px #fff, 
        1350px 70px rgba(255,255,255,0.7), 1500px 250px #fff, 250px 400px #fff,
        600px 320px rgba(255,255,255,0.5), 950px 450px #fff, 1250px 380px #fff;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    opacity: 0.85;
    z-index: 1;
    pointer-events: none;
}

#app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 2; 
}

/* sidebar*/
#sidebar {
    width: 280px;
    background: linear-gradient(180deg, rgba(14, 18, 31, 0.93) 0%, rgba(26, 21, 41, 0.95) 100%);
    border-right: 3px solid #3c2a4d;
    padding: 20px;
    box-shadow: 8px 0 25px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 24px;
    backdrop-filter: blur(4px); /* Slight frosted glass aesthetic over the background stars */
}

/*title*/
.title {
    color: #ff9d6e;
    font-size: 1.8rem;
    letter-spacing: 2px;
    margin: 0;
    text-align: center;
    text-shadow: 0 0 12px rgba(255, 157, 110, 0.5);
}

.subtitle {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #a496b8;
    text-align: center;
    margin-top: -20px;
    letter-spacing: 3px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hidden {
    display: none !important;
}

label {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #cbbada;
    letter-spacing: 1px;
}

/*buttons*/
.tool-btn, .danger-btn {
    background: #1c1829;
    color: #e0d9f0;
    border: 2px solid #4a3b63;
    padding: 12px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    text-align: left;
    margin-bottom: 5px;
}

.tool-btn:hover {
    background: #2b2240;
    border-color: #9253a1;
}

.tool-btn.active {
    background: #39244d;
    border-color: #ff9d6e;
    color: #fff;
    box-shadow: inset 0 0 10px rgba(255, 157, 110, 0.3);
}

.selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.grid-option input[type="radio"] {
    display: none;
}

.ui-card {
    display: block;
    padding: 10px 4px;
    background: #1c1829;
    border: 2px solid #4a3b63;
    border-radius: 4px;
    font-size: 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.grid-option input[type="radio"]:checked + .ui-card {
    border-color: #ff9d6e;
    background: #2f1d3a;
    color: #fff;
    box-shadow: 0 0 6px rgba(255, 157, 110, 0.2);
}


.danger-btn {
    margin-top: auto;
    background: #421c24;
    border-color: #7a2b37;
    text-align: center;
}

.danger-btn:hover {
    background: #61232e;
    border-color: #ff576d;
}

input[type="range"] {
    accent-color: #ff9d6e;
    background: #1c1829;
}

#canvas-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
}

/* canvas*/
canvas {
    background: #dfd3c3;
    border: 4px solid #48345c;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
    cursor: crosshair;
}
#landing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 15, 25, 0.9);
    z-index: 999; 
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    backdrop-filter: blur(8px);
}

/* fading screen*/
#landing-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.portal-card {
    background: linear-gradient(145deg, #1d172e 0%, #110e1c 100%);
    border: 3px solid #6b4d91;
    border-radius: 8px;
    width: 90%;
    max-width: 580px;
    padding: 35px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    text-align: center;
    box-sizing: border-box;
}

.portal-title {
    color: #ff9d6e;
    font-size: 2.2rem;
    margin: 0 0 15px 0;
    letter-spacing: 3px;
    text-shadow: 0 0 15px rgba(255, 157, 110, 0.4);
}

.portal-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #cbbada;
    margin-bottom: 25px;
}

.guide-section {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #4a3b63;
    border-radius: 4px;
    padding: 20px;
    text-align: left;
    margin-bottom: 30px;
}

.guide-section h3 {
    margin-top: 0;
    color: #ff9d6e;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.guide-list {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guide-list li {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #e0d9f0;
}

.guide-list li span {
    font-weight: bold;
    color: #ff9d6e;
}

.portal-btn-gold {
    background: linear-gradient(to bottom, #d97443 0%, #b85425 100%);
    color: #fff;
    border: 2px solid #ff9d6e;
    padding: 14px 40px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(217, 116, 67, 0.3);
}

.portal-btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 116, 67, 0.5);
    border-color: #fff;
}

.portal-btn-gold:active {
    transform: translateY(0);
}
