* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #0a0a0a;
    color: #cccccc;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    font-size: 12px;
}

.main-container {
    width: 100%;
    max-width: 800px;
    background-color: #111;
    border: 1px solid #333;
    padding: 15px 10px 10px 10px;
    position: relative;
    overflow: hidden;
}

.content-grid {
    display: grid;
    grid-template-columns: 180px 1fr 180px;
    gap: 15px;
    margin-bottom: 15px;
}

.profile-pic-container {
    width: 100%;
    aspect-ratio: 1;
    background-color: #222;
    margin-bottom: 15px;
    border: 1px solid #333;
    padding: 5px;
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #1a1a1a;
    display: block;
    filter: contrast(110%) brightness(90%);
}

.links-section h3 {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #999999;
    border-bottom: 1px solid #333;
    padding-bottom: 2px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.link-box {
    border: 1px solid #333;
    padding: 4px;
    text-align: center;
    font-size: 10px;
    background: #1a1a1a;
    cursor: pointer;
    text-decoration: none;
    color: #999999;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 25px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

.link-box:hover {
    background-color: #222222;
    border-color: #555555;
    color: #ffffff;
}

.friend-list {
    margin-top: 15px;
    border: 1px solid #333;
    padding: 8px;
    background-color: #0a0a0a;
}

.friend-list h3 {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #999999;
    border-bottom: 1px solid #333;
    padding-bottom: 3px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.friend-item {
    font-size: 10px;
    color: #cccccc;
    padding: 3px 0;
    border-bottom: 1px dashed #222;
}

.friend-item:last-child {
    border-bottom: none;
}

.widgets-section {
    margin-top: 15px;
    border: 1px solid #333;
    padding: 8px;
    background-color: #0a0a0a;
}

.widgets-section h3 {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #999999;
    border-bottom: 1px solid #333;
    padding-bottom: 3px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.widgets-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
}

.widget-btn {
    border: 1px solid #333;
    padding: 8px;
    font-size: 10px;
    background: #1a1a1a;
    cursor: pointer;
    color: #999999;
    font-family: 'Courier New', Courier, monospace;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    width: 100%;
}

.widget-btn:hover {
    background-color: #222222;
    border-color: #555555;
    color: #ffffff;
}

.content-box {
    border: 1px solid #333;
    margin-bottom: 10px;
    background-color: #0a0a0a;
}

.box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 5px;
    border-bottom: 1px solid #333;
    background-color: #111;
}

.box-title {
    font-weight: normal;
    color: #999999;
    letter-spacing: 0.5px;
}

.box-content {
    padding: 10px;
    line-height: 1.4;
    color: #cccccc;
}

.box-content strong {
    color: #999999;
}

.weather-content {
    padding: 10px;
    display: flex;
    justify-content: space-around;
}

.mood-content {
    padding: 15px 10px;
}

.mood-row {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.mood-icon {
    font-size: 12px;
    color: #999999;
    cursor: pointer;
    border: 1px solid #333;
    padding: 10px 10px;
    background: #1a1a1a;
    min-width: 70px;
    text-align: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    flex: 1;
}

.mood-icon:hover {
    color: #ffffff;
    background-color: #222222;
    border-color: #555555;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 5px 5px 2px 5px;
    text-align: center;
    font-size: 9px;
    font-weight: bold;
    color: #ffffff;
    border-bottom: 1px solid #222;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 5px;
    text-align: center;
    font-size: 10px;
    color: #888888;
}

.footer-section {
    border: 1px solid #333;
    background-color: #0a0a0a;
}

.marquee-container {
    background-color: #111;
    padding: 5px;
    border-bottom: 1px solid #333;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-text {
    display: inline-block;
    animation: scroll 15s linear infinite;
    color: #999999;
}

@keyframes scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.footer-links {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background-color: #111;
}

.footer-col {
    text-align: center;
    flex: 1;
    border-right: 1px solid #222;
    color: #999999;
}

.footer-col:last-child {
    border-right: none;
}

.music-controls {
    margin-top: 10px;
    text-align: center;
    width: 100%;
}

.music-btn {
    border: 1px solid #333;
    padding: 8px;
    font-size: 10px;
    background: #1a1a1a;
    cursor: pointer;
    color: #999999;
    font-family: 'Courier New', Courier, monospace;
    width: 100%;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    margin: 0;
}

.music-btn:hover {
    background-color: #222222;
    border-color: #555555;
    color: #ffffff;
}

.music-status {
    font-size: 9px;
    color: #666666;
    margin-top: 5px;
    width: 100%;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: #111;
    border: 2px solid #333;
    padding: 20px;
    text-align: center;
    max-width: 300px;
    width: 80%;
}

.popup-text {
    font-size: 14px;
    margin-bottom: 15px;
    color: #cccccc;
}

.popup-close {
    border: 1px solid #333;
    padding: 5px 15px;
    font-size: 10px;
    background: #1a1a1a;
    cursor: pointer;
    color: #999999;
    font-family: 'Courier New', Courier, monospace;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

.popup-close:hover {
    background-color: #222222;
    border-color: #555555;
}

.guestbook-box {
    margin-bottom: 10px;
}

.guestbook-content {
    padding: 0;
    position: relative;
    min-height: 100px;
}

.guestbook-content iframe {
    display: block;
    border: none;
    background-color: #0a0a0a;
}

.guestbook-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    transition: opacity 0.5s ease;
}

.guestbook-loading {
    font-size: 12px;
    color: #999999;
}

.blinking-cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    margin-left: 2px;
    background-color: #cccccc;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

::selection {
    background-color: #333333;
    color: #ffffff;
}

::-moz-selection {
    background-color: #333333;
    color: #ffffff;
}

button:focus,
.link-box:focus,
.mood-icon:focus,
.popup-close:focus {
    outline: 1px solid #666666;
    outline-offset: 1px;
}

button:active,
.link-box:active,
.mood-icon:active,
.popup-close:active {
    background-color: #222222;
}

.guestbook-content {
    position: relative;
    min-height: 300px;
}

#characterCanvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    pointer-events: none;
}

#guestbookIframe {
    position: relative;
    z-index: 1;
}

@media (max-width: 600px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .guestbook-content {
        height: 300px;
        width: 100%;
        overflow: hidden;
    }
    
    #characterCanvas {
        width: 100%;
        height: 100%;
    }
    
    .mood-row {
        gap: 5px;
    }
    
    .mood-icon {
        min-width: 70px;
        padding: 10px 10px;
    }
    
    .link-box,
    .mood-icon,
    .music-btn,
    .popup-close {
        -webkit-tap-highlight-color: transparent;
        tap-highlight-color: transparent;
    }
}