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

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #1d2128;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.calculator {
    width: 100%;
    max-width: 380px;
    background: linear-gradient(145deg, #2a2e38, #1a1e27);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.5), -10px -10px 30px rgba(255, 255, 255, 0.05);
}

.display-container {
    background-color: #1c1f26;
    height: 100px;
    border-radius: 15px;
    margin-bottom: 25px;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: flex-end;
    box-shadow: inset 3px 3px 8px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.previous-operand {
    color: #a0a0a0;
    font-size: 1.2rem;
    min-height: 1.5rem;
    width: 100%;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.current-operand {
    color: #ffffff;
    font-size: 2.8rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    width: 100%;
    text-align: right;
    line-height: 1.1;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

button {
    height: 70px;
    font-size: 1.6rem;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    background-color: #2a2d37;
    color: #e0e0e0;
    transition: all 0.1s ease-in-out;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4), -4px -4px 10px rgba(255, 255, 255, 0.05);
}

button:active {
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.4);
    transform: scale(0.97);
}

.operator {
    background-color: #ff9f0a;
    color: #fff;
    font-weight: bold;
}

.equal {
    background-color: #ff9f0a;
    color: #fff;
    font-weight: bold;
}

.function {
    background-color: #6d6d6d;
    color: #fff;
}

.zero {
    grid-column: span 2;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(145deg, #2a2e38, #1a1e27);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    box-shadow: none;
}

.modal-content h2 {
    color: #ff9f0a;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    justify-items: center;
}

.photo-grid img {
    width: 180px;
    height: 220px;
    object-fit: cover;
    object-position: top;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 2px solid transparent;
}

.photo-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 159, 10, 0.7);
    border-color: #ff9f0a;
}

#photo-viewer-modal {
    cursor: pointer;
}

#photo-viewer-image {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(255, 159, 10, 0.5);
    border: 3px solid #ff9f0a;
    cursor: default;
    transition: transform 0.05s linear;
}

#photo-viewer-close {
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 1002;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
    text-shadow: 0 0 10px #000;
}

#patch-notes-modal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

#patch-notes-modal .changelog {
    color: #e0e0e0;
}

#patch-notes-modal h3 {
    color: #ff9f0a;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

#patch-notes-modal ul {
    list-style: none;
    padding-left: 0;
}

#patch-notes-modal li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

#patch-notes-modal li::before {
    content: '✓';
    color: #ff9f0a;
    position: absolute;
    left: 0;
    font-weight: bold;
}

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

#wow-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    padding: 10px 20px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    background-size: 300% 100%;
    background-image: linear-gradient(to right, #ff2400, #e81d1d, #e8b71d, #e3e81d, #1de840, #1ddde8, #2b1de8, #dd00f3, #ff2400);
    animation: rainbow-bg 5s linear infinite;
}

#wow-button:hover {
    transform: scale(1.1);
}

#wow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
    z-index: 1999;
}

.wow-window {
    position: absolute;
    width: 250px;
    height: 150px;
    background: #c0c0c0;
    border: 2px solid #fff;
    border-bottom-color: #404040;
    border-right-color: #404040;
    box-shadow: 2px 2px 0 #000;
    display: flex;
    flex-direction: column;
}

.wow-window-titlebar {
    background: linear-gradient(to right, #000080, #1084d0);
    color: #fff;
    padding: 3px 5px;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: left;
}

.wow-window-content {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #000;
    padding: 10px;
    text-align: center;
}

#owo-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 2000;
    padding: 10px 20px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #000;
    background: linear-gradient(45deg, #f8c3e8, #aed6f1);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

#owo-button:hover {
    transform: scale(1.1);
}

#owo-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
    z-index: 999;
}

@keyframes drip-down {
    from { height: 0; }
    to { height: 105vh; }
}

.slime-drip {
    position: absolute;
    top: -10px;
    background: linear-gradient(to bottom, #7cfc00, #32cd32, #228b22);
    border-bottom-left-radius: 50%;
    border-bottom-right-radius: 50%;
    animation-name: drip-down;
    animation-timing-function: ease-in;
}

.music-player {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 2000;
    background: rgba(42, 45, 55, 0.9);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    color: #e0e0e0;
    width: 280px;
}

.track-info {
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-player .controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 10px;
}

.music-player .controls button {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: none;
    height: auto;
    width: auto;
}

.music-player .volume-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.music-player input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 150px;
    height: 5px;
    background: #6d6d6d;
    border-radius: 5px;
    outline: none;
}

.music-player input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #ff9f0a;
    border-radius: 50%;
    cursor: pointer;
}

@media (max-width: 420px) {
    .calculator {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
        padding: 20px;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    button {
        height: auto;
        padding: 20px 0;
        font-size: 1.8rem;
    }

    .display-container {
        height: 120px;
    }
}