body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image: url('/1_nbjNPvUi0OAw-6e2VXPwqw.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    font-family: 'Arial', sans-serif;
    color: #F0E68C;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto; /* Allow scrolling inside King's Room */
}

.room-container {
    background-color: rgba(139, 69, 19, 0.85);
    border: 5px solid #DAA520;
    border-radius: 15px;
    padding: 25px;
    width: 90%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
    position: relative;
    margin-bottom: 40px;
    min-height: 600px;
    overflow-y: auto;
}

h1 {
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    margin-top: 0;
    text-align: center;
}

.computer-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.computer-screen {
    background-color: #000;
    border: 8px solid #333;
    border-radius: 10px 10px 0 0;
    width: 100%;
    height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.screen-header {
    background-color: #222;
    color: #ddd;
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #444;
    font-family: monospace;
    font-size: 14px;
}

.screen-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow: hidden;
}

.chat-area {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 5px;
    font-family: monospace;
    color: #0F0;
    background-color: rgba(0, 0, 0, 0.8);
}

.system-message {
    color: #AAA;
    margin-bottom: 10px;
}

.user-message {
    color: #00BFFF;
    margin-bottom: 10px;
    text-align: right;
}

.king-message {
    color: #FFD700;
    margin-bottom: 10px;
    text-align: left;
}

.message-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preset-messages {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.preset-button {
    background-color: #333;
    color: #ddd;
    border: 1px solid #555;
    border-radius: 15px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: monospace;
}

.preset-button:hover {
    background-color: #444;
    transform: translateY(-2px);
}

.preset-button:active {
    transform: translateY(1px);
}

.input-area {
    display: flex;
    gap: 10px;
}

.input-field {
    flex-grow: 1;
    background-color: #333;
    color: #ddd;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #555;
    min-height: 20px;
    max-height: 80px;
    overflow-y: auto;
    font-family: monospace;
}

.input-field[contenteditable]:empty:before {
    content: attr(placeholder);
    color: #888;
    font-style: italic;
}

#send-button {
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#send-button:hover {
    background-color: #0056b3;
}

.computer-base {
    background-color: #333;
    height: 20px;
    width: 80%;
    border-radius: 0 0 10px 10px;
    position: relative;
}

.computer-base:after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 20px;
    background-color: #222;
    border-radius: 0 0 5px 5px;
}

.sticky-note {
    background-color: #FFFF88;
    width: 250px;
    padding: 15px;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
    color: #333;
    position: absolute;
    transform: rotate(-3deg);
    z-index: 10;
}

.sticky-note.about-me {
    top: 70px;
    right: 80px;
    background-color: #FFCF8C;
}

.sticky-note.zoom-note {
    top: 70px;
    left: 80px;
    background-color: #a6e3a1; /* A nice green */
    transform: rotate(4deg);
}

.sticky-note.stats-note {
    top: 300px;
    right: 50px;
    background-color: #C8F5FF;
    transform: rotate(2deg);
    cursor: grab;
    user-select: none;
    position: absolute;
    z-index: 100;
}

.sticky-note.hidden {
    display: none;
}

.sticky-note.dragging {
    opacity: 0.8;
    z-index: 1000;
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.6);
    cursor: grabbing;
}

.sticky-header {
    display: flex;
    justify-content: center;
    position: relative;
    margin-bottom: 10px;
}

.sticky-header h3 {
    margin: 0;
    text-align: center;
    font-family: 'Comic Sans MS', cursive;
    color: #333;
}

.pin {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #FF3D3D;
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}

.sticky-content {
    font-family: 'Comic Sans MS', cursive;
    line-height: 1.4;
}

.stat-item {
    margin-bottom: 8px;
}

.stat-label {
    font-weight: bold;
    margin-bottom: 3px;
}

.stat-bar-container {
    background-color: #ddd;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    line-height: 20px;
    text-align: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
    transition: width 1s ease-in-out;
}

.stat-bar.happiness {
    background-color: #4CAF50;
}

.stat-bar.sadness {
    background-color: #2196F3;
}

.stat-bar.boredom {
    background-color: #9E9E9E;
}

.stat-bar.darkness {
    background-color: #4A148C;
}

.stat-bar.stress {
    background-color: #FF9800;
}

.stat-bar.anger {
    background-color: #F44336;
}

.stat-bar.fear {
    background-color: #FFEB3B;
    color: #333;
}

.home-button {
    display: inline-block;
    background-color: #B8860B;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    border: 2px solid #F0E68C;
    transition: background-color 0.3s;
    margin-top: 10px;
    z-index: 20;
}

.home-button:hover {
    background-color: #DAA520;
}

.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: all;
}

.page-transition.hidden {
    display: none;
}

.honeycomb-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.honeycomb {
    position: absolute;
    background-color: #FFD700;
    opacity: 0;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    animation: honeycomb-animate 1.5s forwards;
}

@keyframes honeycomb-animate {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        transform: scale(1.5) rotate(120deg);
        opacity: 0;
    }
}

.transition-bee {
    width: 100px;
    height: auto;
    z-index: 1;
    animation: transition-bee-zoom 1.5s forwards;
}

@keyframes transition-bee-zoom {
    0% {
        transform: scale(0.2) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: scale(3) rotate(720deg);
        opacity: 0;
    }
}

.sellsman-container {
    background-color: rgba(0, 0, 0, 0.75);
    border: 4px solid #00BFFF;
    border-radius: 10px;
    padding: 20px;
    width: 95%;
    max-width: 800px;
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.sellsman-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.1),
        rgba(0, 0, 0, 0.1) 10px,
        rgba(0, 0, 0, 0.2) 10px,
        rgba(0, 0, 0, 0.2) 20px
    );
    z-index: -1;
}

.sellsman-header {
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #00BFFF;
    padding-bottom: 10px;
}

.sellsman-header h2 {
    color: #00BFFF;
    margin: 0 0 5px 0;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px #00BFFF;
}

.sellsman-header p {
    margin: 0;
    color: #AAA;
    font-style: italic;
}

.sellsman-character {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #00BFFF;
}

.sellsman-image {
    width: 100px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 5px #00BFFF);
}

.sellsman-speech {
    background-color: #1D1D1D;
    color: #FFD700;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #444;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    position: relative;
    animation: glitch 2s infinite;
}

.sellsman-speech::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 10px 10px 10px 0;
    border-style: solid;
    border-color: transparent #1D1D1D transparent transparent;
}

@keyframes glitch {
    0% { text-shadow: 0 0 0 #fff; }
    2% { text-shadow: 2px 0 0 #f00, -2px 0 0 #0ff; }
    4% { text-shadow: 0 0 0 #fff; }
    50% { text-shadow: 0 0 0 #fff; }
    52% { text-shadow: 1px 0 0 #f0f, -1px 0 0 #0f0; }
    54% { text-shadow: 0 0 0 #fff; }
    100% { text-shadow: 0 0 0 #fff; }
}

.game-listings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-item {
    display: flex;
    justify-content: space-between;
    background-color: rgba(20, 20, 20, 0.9);
    border: 2px solid #00BFFF;
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-item:hover:not(.disabled) {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 191, 255, 0.4);
}

.game-item.disabled {
    opacity: 0.6;
    border-color: #666;
}

.game-info {
    flex: 1;
}

.game-info h3 {
    margin: 0 0 10px 0;
    color: #00BFFF;
}

.game-info p {
    margin: 0 0 10px 0;
    color: #CCC;
    font-size: 0.9em;
}

.game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.game-tag {
    background-color: #333;
    color: #00BFFF;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    border: 1px solid #00BFFF;
}

.game-price {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-width: 120px;
}

.price-tag {
    color: #FFD700;
    font-weight: bold;
}

.buy-button {
    background-color: #FF0000;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    transition: background-color 0.2s, transform 0.1s;
}

.buy-button:hover:not(:disabled) {
    background-color: #FF4500;
    transform: scale(1.05);
}

.buy-button:active:not(:disabled) {
    transform: scale(0.95);
}

.buy-button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-overlay.hidden {
    display: none;
}

/* Home button styles for bee clicker game */
#home-button-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.home-button {
    background-color: #FFD700;
    color: #8B4513;
    border: 3px solid #8B4513;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    display: inline-block;
}

.home-button:hover {
    background-color: #FFC125;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.home-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.game-container {
    background-color: #1B1B1B;
    border: 3px solid #FFD700;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    height: 90%;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.game-header {
    background-color: #000;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #FFD700;
}

.game-header h2 {
    color: #FFD700;
    margin: 0;
}

.game-controls {
    display: flex;
    gap: 15px;
}

.game-controls > div {
    background-color: #222;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    border: 1px solid #444;
}

.close-game {
    background-color: #F44336;
    color: white;
    border: 2px solid white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 31px;
    text-align: center;
    padding: 0;
    transition: transform 0.2s, background-color 0.2s;
}

.close-game:hover {
    background-color: #D32F2F;
    transform: scale(1.1);
}

.game-board {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.player-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    background-color: #222;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #444;
}

.player-stats > div {
    font-size: 1.2em;
    font-weight: bold;
}

.chips-display {
    color: #4CAF50;
}

.mult-display {
    color: #2196F3;
}

.cash-display {
    color: #FFD700;
}

.card-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.player-hand {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 150px;
    width: 100%;
}

.playing-card {
    width: 100px;
    height: 140px;
    background-color: #FFF;
    border-radius: 10px;
    border: 2px solid #000;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}

.playing-card.selected {
    transform: translateY(-20px);
    border-color: #4CAF50;
    box-shadow: 0 0 10px #4CAF50;
}

.card-value {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 1.5em;
    font-weight: bold;
}

.card-value.red {
    color: #F44336;
}

.card-value.black {
    color: #000;
}

.card-suit {
    position: absolute;
    top: 30px;
    left: 5px;
    font-size: 1.5em;
}

.card-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
}

.hand-value {
    background-color: #333;
    padding: 10px 15px;
    border-radius: 5px;
    text-align: center;
    width: 60%;
}

.hand-value #hand-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 5px;
}

.hand-value #hand-score {
    font-size: 1em;
    color: #4CAF50;
}

.game-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.game-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.game-button:hover {
    background-color: #45a049;
}

.game-button:active {
    transform: scale(0.95);
}

.game-button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

.jokers-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.jokers-area h3 {
    margin: 0;
    color: #FFD700;
    text-align: center;
}

.active-jokers {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.joker-card {
    width: 120px;
    height: 160px;
    background-color: #222;
    border: 2px solid #FFD700;
    border-radius: 10px;
    padding: 10px;
    position: relative;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.joker-title {
    color: #FFD700;
    font-weight: bold;
    font-size: 0.9em;
    text-align: center;
    margin-bottom: 10px;
}

.joker-effect {
    color: #fff;
    font-size: 0.8em;
    text-align: center;
}

.shop-interface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    z-index: 10;
}

.shop-interface.hidden {
    display: none;
}

.shop-interface h2 {
    color: #FFD700;
    text-align: center;
    margin-top: 0;
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    overflow-y: auto;
    padding: 10px;
    margin-bottom: 20px;
}

.shop-item {
    background-color: #222;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.2s;
    cursor: pointer;
}

.shop-item:hover {
    transform: translateY(-5px);
    border-color: #FFD700;
}

.shop-item-name {
    color: #FFD700;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

.shop-item-description {
    color: #fff;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.shop-item-price {
    color: #4CAF50;
    font-weight: bold;
    text-align: right;
}

.shop-actions {
    display: flex;
    justify-content: center;
}

.game-message {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.game-message.visible {
    opacity: 1;
}

#super-sticky-canvas {
    background-color: #FFFFFF;
    border: 3px solid #333;
    border-radius: 5px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.2);
}

.game-instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    color: #FFFFFF;
    width: 80%;
    max-width: 400px;
}

.game-instructions h3 {
    font-size: 2em;
    margin-top: 0;
    color: #FF0000;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    animation: glitch 1s infinite;
}

.game-instructions p {
    font-size: 1.2em;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
}

.game-over, .level-complete {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    color: #FFFFFF;
    width: 80%;
    max-width: 400px;
}

.game-over h3 {
    font-size: 2em;
    margin-top: 0;
    color: #FF0000;
}

.level-complete h3 {
    font-size: 2em;
    margin-top: 0;
    color: #00FF00;
}

/* Fake Windows overlay */
.fake-windows {
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 90%;
    max-height: 680px;
    background: linear-gradient(#1b4b9b, #0f2e62);
    border: 4px solid #0c2347;
    border-radius: 8px;
    box-shadow: 0 0 25px rgba(0,0,0,0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.fw-desktop {
    flex: 1;
    position: relative;
    background: radial-gradient(ellipse at top left, rgba(255,255,255,0.08), transparent 60%);
}

/* Improved icon hitbox and layout */
.fw-icon {
    position: absolute;
    top: 40px;
    left: 40px;
    width: 90px;
    height: 90px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    color: #fff;
    font-family: Arial, sans-serif;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    outline: none;
}
.fw-icon:nth-child(2) { left: 150px; }
.fw-icon:nth-child(3) { left: 260px; }
.fw-icon:nth-child(4) { left: 370px; }
.fw-icon:nth-child(5) { left: 480px; }
.fw-icon:nth-child(6) { left: 590px; }
.fw-icon:nth-child(7) { left: 700px; }

.fw-icon:hover, .fw-icon:focus {
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.15) inset;
}

.fw-icon-img {
    font-size: 40px;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.4));
    pointer-events: none;
}
.fw-icon-label {
    font-size: 13px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    pointer-events: none;
}

/* Calculator grid */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.calc-grid button {
    padding: 10px;
    font-size: 16px;
    background: #1e5bd6;
    color: #fff;
    border: 1px solid #0b3c9c;
    border-radius: 4px;
    cursor: pointer;
}
.calc-grid button:hover { background: #2a6df7; }
.calc-eq {
    grid-column: span 4;
    background: #2ecc71;
    border-color: #1c9e52;
}
.calc-eq:hover { background: #39d67f; }

.fw-taskbar {
    height: 40px;
    background: #0c2347;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    color: #fff;
    border-top: 2px solid #06132a;
}

.fw-start, .fw-close-all {
    background: #1e5bd6;
    border: 1px solid #0b3c9c;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}
.fw-start:hover, .fw-close-all:hover {
    background: #2a6df7;
}

.fw-tasks {
    flex: 1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.fw-window {
    position: absolute;
    top: 80px;
    left: 80px;
    width: 520px;
    background: #dfe8ff;
    border: 2px solid #0b3c9c;
    border-radius: 6px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.fw-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e5bd6;
    color: #fff;
    padding: 6px 10px;
    border-bottom: 2px solid #0b3c9c;
    border-radius: 4px 4px 0 0;
}

.fw-close {
    background: #e74c3c;
    border: none;
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
}
.fw-close:hover { background: #ff6b5a; }

.fw-content {
    padding: 10px;
}

.fw-hint {
    font-family: monospace;
    font-size: 12px;
    color: #333;
    margin-top: 6px;
}

.fw-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.fw-exit {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #f39c12;
    border: 1px solid #a56805;
    color: #000;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}
.fw-exit:hover { background: #f7b84c; }

.hidden {
    display: none;
}

#sticky-time-bar-container {
    width: 100%;
    height: 10px;
    background-color: #555;
    margin-top: 10px;
    border-radius: 5px;
    overflow: hidden;
}

#sticky-time-bar {
    height: 100%;
    width: 100%;
    background-color: #FF0000;
    transition: width 0.2s linear;
}

.sticky-hud {
    position: absolute;
    color: #FF0000;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.5em;
    pointer-events: none;
}

#sticky-ammo {
    top: 20px;
    right: 20px;
}

#sticky-enemies {
    bottom: 20px;
    left: 20px;
}

#sticky-pause-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    z-index: 10;
}

#sticky-pause-menu h3 {
    color: #FF0000;
    margin-top: 0;
}

/* --- Cat Bee King Section --- */
#cat-king-section {
    position: relative;
    width: 100%;
    max-width: 980px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -10px;
}

.king-pedestal {
    position: relative;
    width: min(520px, 90%);
    height: 280px;
    background: radial-gradient(120% 70% at 50% 100%, rgba(0,0,0,0.45), rgba(0,0,0,0) 60%);
    border: 2px solid rgba(218,165,32,0.35);
    border-radius: 14px;
    box-shadow: 0 0 28px rgba(218,165,32,0.25) inset, 0 10px 24px rgba(0,0,0,0.35);
    display: grid;
    grid-template-rows: 1fr auto auto;
    place-items: center;
    padding: 16px 16px 22px;
    overflow: visible;
}

/* New: Wrap sprite and crown so crown stays above and floats with sprite */
.king-figure {
    position: relative;
    display: inline-block;
    animation: kingFloat 4.2s ease-in-out infinite; /* Move the whole figure together */
    z-index: 2;
}

.king-aura {
    position: absolute;
    inset: -12px -12px -16px -12px;
    background:
        radial-gradient(60% 45% at 50% 35%, rgba(255,215,0,0.25), transparent 70%),
        radial-gradient(45% 30% at 50% 35%, rgba(255,255,255,0.18), transparent 70%);
    filter: blur(2px);
    pointer-events: none;
    border-radius: 14px;
    animation: kingAuraPulse 3.6s ease-in-out infinite;
}
@keyframes kingAuraPulse {
    0%,100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.03); }
}

.king-sprite {
    width: 140px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255,215,0,0.4));
    z-index: 2;
    pointer-events: none;
}

.king-crown {
    position: absolute;
    left: 50%;
    bottom: calc(100% - 10px); /* Sit just above the sprite's head */
    width: 60px;
    height: 40px;
    transform: translateX(-50%) rotate(-2deg);
    background:
      linear-gradient(180deg, #ffe066, #ffcc33),
      conic-gradient(from 0deg, #FFD700 0 20%, #ffec8b 20% 55%, #b8860b 55% 85%, #FFD700 85% 100%);
    clip-path: polygon(0% 100%, 10% 40%, 25% 80%, 40% 35%, 50% 80%, 60% 35%, 75% 80%, 90% 40%, 100% 100%);
    box-shadow: 0 0 16px rgba(255,215,0,0.65);
    z-index: 3;
    animation: kingCrownShimmy 5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes kingCrownShimmy {
    0%,100% { transform: translateX(-50%) rotate(-2deg) }
    50% { transform: translateX(-50%) rotate(2deg) }
}

.king-title {
    margin-top: 8px;
    color: #FFD700;
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255,215,0,0.7);
    z-index: 2;
}

.king-speech {
    margin-top: 8px;
    background: rgba(255,255,255,0.9);
    color: #4b2e10;
    border: 2px solid #8B4513;
    border-radius: 10px;
    padding: 8px 12px;
    font-family: "Courier New", monospace;
    font-weight: bold;
    min-height: 32px;
    max-width: 90%;
    text-align: center;
    position: relative;
    z-index: 2;
}
.king-speech::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    border-width: 0 8px 10px 8px;
    border-style: solid;
    border-color: transparent transparent rgba(255,255,255,0.9) transparent;
}

.king-action {
    margin-top: 10px;
    background: #B8860B;
    color: #fff;
    border: 2px solid #F0E68C;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.08s ease, background 0.2s ease;
    z-index: 2;
}
.king-action:hover { background: #DAA520; }
.king-action:active { transform: translateY(1px); }

/* Attention animation when hailed or summoned */
.king-attention .king-aura {
    animation: kingAuraPulse 1.2s ease-in-out 3;
}
.king-attention .king-sprite {
    animation: kingFloat 0.9s ease-in-out 3;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    body {
        overflow-y: auto; /* Keep scroll on mobile too */
    }
    .room-container {
        width: 100%;
        max-width: 100%;
        padding: 15px;
        margin: 0;
        max-height: none;
        overflow-y: auto;
    }
    .computer-container {
        width: 100%;
        overflow-x: auto;
    }
    .computer-screen {
        width: 100%;
        height: auto;
    }
    .screen-content {
        padding: 5px;
    }
    .preset-messages {
        flex-direction: column;
        gap: 5px;
    }
    .input-area {
        flex-direction: column;
    }
    .sticky-note {
        position: relative;
        top: auto;
        right: auto;
        left: auto;
        transform: none;
        margin: 10px auto;
        width: 100%;
        max-width: 280px;
    }
    .stats-note {
        width: 100%;
        max-width: 280px;
    }
    .sellsman-container {
        flex-direction: column;
        align-items: center;
        padding: 12px;
    }
    .sellsman-character {
        flex-direction: column;
        align-items: center;
    }
    .game-listings, .game-item {
        flex-direction: column;
        align-items: stretch;
    }
    .game-price {
        width: 100%;
        margin-top: 10px;
    }
    #super-sticky-canvas {
        width: 100%;
        height: auto;
    }
    #clickable-bee {
        width: 120px;
    }
    #upgrade-sidebar,
    #game-overlay .upgrade-container .upgrade-button,
    .home-button,
    .buy-button,
    .upgrade-button {
        width: 100%;
        box-sizing: border-box;
    }
    .upgrade-container {
        flex-direction: column;
    }
    .help-button {
        margin-top: 5px;
    }
    .fake-windows {
        width: 96%;
        height: 92%;
    }
    .fw-window {
        width: 90%;
        left: 5%;
        top: 70px;
    }
}

/* Mobile Navigation Bar - Hidden on desktop */
.mobile-nav {
    display: none;
}

.mobile-menu-toggle {
    display: none;
}

.mobile-home-button {
    display: none;
}

.mobile-quick-actions {
    display: none;
}

.mobile-chat-interface {
    display: none;
}

.mobile-instructions {
    display: none;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .room-container {
        margin-top: 120px; /* Space for mobile controls */
        padding: 15px;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }

    .computer-container {
        margin-bottom: 30px;
        transform: scale(0.9); /* Make PC interface slightly smaller but still usable */
        transform-origin: top center;
    }

    .computer-screen {
        max-width: 100%;
        height: 350px; /* Reduced height for better mobile fit */
        border-radius: 15px;
    }

    .screen-content {
        padding: 12px;
    }

    .chat-area {
        height: 200px; /* Reduced height for mobile */
        font-size: 14px; /* Smaller font for better fit */
    }

    .preset-messages {
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 12px;
    }

    .preset-button {
        font-size: 0.8em;
        padding: 6px 10px;
        min-width: 100px;
        font-size: 12px;
    }

    .input-area {
        flex-direction: column;
        gap: 8px;
    }

    .input-field {
        min-height: 50px;
        font-size: 14px; /* Prevent zoom on iOS */
        padding: 8px;
    }

    #send-button {
        width: 100%;
        padding: 10px;
        font-size: 1em;
    }

    .sticky-note {
        margin: 15px 0;
        padding: 15px;
        transform: scale(0.95); /* Make sticky notes slightly smaller */
        transform-origin: top left;
    }

    .sticky-note h3 {
        font-size: 1.1em;
    }

    .sticky-content {
        font-size: 0.85em;
        line-height: 1.3;
    }

    .king-pedestal {
        margin: 20px 0;
        padding: 20px;
        transform: scale(0.9); /* Make king section smaller */
        transform-origin: center;
    }

    .king-title {
        font-size: 1.3em;
    }

    .king-speech {
        font-size: 0.9em;
        margin: 12px 0;
    }

    .king-action {
        padding: 10px 20px;
        font-size: 1em;
    }

    .sellsman-container {
        margin: 20px 0;
        padding: 20px;
        transform: scale(0.95); /* Make sellsman section slightly smaller */
        transform-origin: top center;
    }

    .sellsman-header h2 {
        font-size: 1.3em;
    }

    .game-item {
        flex-direction: column;
        gap: 12px;
        padding: 18px;
    }

    .game-info h3 {
        font-size: 1.2em;
    }

    .game-tags {
        flex-wrap: wrap;
        gap: 6px;
    }

    .game-tag {
        font-size: 0.75em;
        padding: 3px 6px;
    }

    .home-button {
        margin-top: 30px;
        padding: 15px 30px;
        font-size: 1.1em;
    }

    /* Mobile Navigation */
    .mobile-nav {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 2px solid #FFD700;
        z-index: 1000;
        padding: 15px 0;
    }

    .mobile-nav-buttons {
        display: flex;
        justify-content: space-around;
        align-items: center;
        gap: 20px;
        padding: 0 20px;
    }

    .mobile-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        background: none;
        border: none;
        color: #FFD700;
        font-size: 12px;
        cursor: pointer;
        padding: 12px;
        border-radius: 8px;
        transition: all 0.2s ease;
        min-width: 80px;
        min-height: 70px;
        justify-content: center;
    }

    .mobile-nav-btn:hover,
    .mobile-nav-btn:active {
        background: rgba(255, 215, 0, 0.2);
        transform: scale(1.05);
    }

    .mobile-nav-btn .icon {
        font-size: 24px;
        margin-bottom: 6px;
    }

    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 20px;
        right: 20px;
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid #FFD700;
        color: #FFD700;
        font-size: 20px;
        padding: 12px;
        border-radius: 8px;
        cursor: pointer;
        z-index: 1001;
        transition: all 0.2s ease;
    }

    .mobile-menu-toggle:hover,
    .mobile-menu-toggle:active {
        background: rgba(255, 215, 0, 0.2);
        transform: scale(1.05);
    }

    /* Mobile Home Button */
    .mobile-home-button {
        display: block;
        position: fixed;
        top: 20px;
        left: 20px;
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid #FFD700;
        color: #FFD700;
        font-size: 14px;
        padding: 12px 18px;
        border-radius: 8px;
        cursor: pointer;
        z-index: 1001;
        text-decoration: none;
        transition: all 0.2s ease;
        min-width: 80px;
        text-align: center;
    }

    .mobile-home-button:hover,
    .mobile-home-button:active {
        background: rgba(255, 215, 0, 0.2);
        transform: scale(1.05);
    }

    /* Mobile Quick Actions */
    .mobile-quick-actions {
        display: flex;
        position: fixed;
        top: 80px;
        right: 20px;
        flex-direction: column;
        gap: 10px;
        z-index: 1000;
    }

    .mobile-action-btn {
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid #FFD700;
        color: #FFD700;
        font-size: 12px;
        padding: 8px 12px;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;
        white-space: nowrap;
    }

    .mobile-action-btn:hover,
    .mobile-action-btn:active {
        background: rgba(255, 215, 0, 0.2);
        transform: scale(1.05);
    }

    /* Mobile Chat Interface */
    .mobile-chat-interface {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        z-index: 2000;
        overflow-y: auto;
    }

    .mobile-chat-interface.active {
        display: block;
    }

    .mobile-chat-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
        border-bottom: 2px solid #FFD700;
        background: rgba(255, 215, 0, 0.1);
    }

    .mobile-chat-header h3 {
        color: #FFD700;
        margin: 0;
        font-size: 1.5em;
    }

    .close-mobile-chat {
        background: none;
        border: none;
        color: #FFD700;
        font-size: 24px;
        cursor: pointer;
        padding: 5px;
        border-radius: 5px;
        transition: all 0.2s ease;
    }

    .close-mobile-chat:hover,
    .close-mobile-chat:active {
        background: rgba(255, 215, 0, 0.2);
        transform: scale(1.05);
    }

    .mobile-chat-messages {
        padding: 20px;
        height: 300px;
        overflow-y: auto;
    }

    .mobile-chat-input {
        display: flex;
        gap: 10px;
        padding: 20px;
        border-top: 1px solid rgba(255, 215, 0, 0.3);
    }

    .mobile-chat-input input {
        flex: 1;
        padding: 12px;
        border: 1px solid #FFD700;
        border-radius: 6px;
        background: rgba(0, 0, 0, 0.8);
        color: #FFD700;
        font-size: 16px;
    }

    .mobile-chat-input button {
        padding: 12px 20px;
        background: #FFD700;
        border: none;
        color: #000;
        border-radius: 6px;
        cursor: pointer;
        font-weight: bold;
        transition: all 0.2s ease;
    }

    .mobile-chat-input button:hover,
    .mobile-chat-input button:active {
        background: #FFA500;
        transform: scale(1.05);
    }

    .mobile-preset-messages {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 20px;
        border-top: 1px solid rgba(255, 215, 0, 0.3);
    }

    .mobile-preset-btn {
        background: rgba(255, 215, 0, 0.2);
        border: 1px solid #FFD700;
        color: #FFD700;
        padding: 8px 12px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.9em;
        transition: all 0.2s ease;
    }

    .mobile-preset-btn:hover,
    .mobile-preset-btn:active {
        background: rgba(255, 215, 0, 0.4);
        transform: scale(1.05);
    }

    /* Mobile Instructions */
    .mobile-instructions {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border: 2px solid #FFD700;
        border-radius: 15px;
        padding: 20px;
        max-width: 90%;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 1002;
        color: #FFD700;
    }

    .mobile-instructions.active {
        display: block;
    }

    .mobile-instructions h3 {
        margin-top: 0;
        color: #FFD700;
        text-align: center;
    }

    .mobile-instructions p {
        margin: 10px 0;
        line-height: 1.4;
    }

    .close-mobile-instructions {
        position: absolute;
        top: 10px;
        right: 15px;
        background: none;
        border: none;
        color: #FFD700;
        font-size: 20px;
        cursor: pointer;
        padding: 5px;
        border-radius: 5px;
        transition: all 0.2s ease;
    }

    .close-mobile-instructions:hover,
    .close-mobile-instructions:active {
        background: rgba(255, 215, 0, 0.2);
        transform: scale(1.05);
    }

    /* Hide desktop elements on mobile */
    .computer-container {
        margin-bottom: 30px;
    }

    .sticky-note {
        margin: 15px 0;
    }

    .king-pedestal {
        margin: 20px 0;
    }

    .sellsman-container {
        margin: 20px 0;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .room-container {
        margin-top: 100px;
        padding: 10px;
    }

    h1 {
        font-size: 1.6em;
    }

    .computer-screen {
        height: 350px;
    }

    .chat-area {
        height: 200px;
    }

    .preset-button {
        font-size: 0.8em;
        padding: 6px 10px;
        min-width: 100px;
    }

    .mobile-nav-btn {
        min-width: 70px;
        min-height: 60px;
        font-size: 11px;
    }

    .mobile-nav-btn .icon {
        font-size: 20px;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .room-container {
        margin-top: 80px;
    }

    .mobile-quick-actions {
        top: 70px;
    }

    .mobile-home-button {
        top: 15px;
        left: 15px;
    }
}

/* Desktop-only styles - hide mobile elements */
@media (min-width: 769px) {
    .mobile-nav,
    .mobile-menu-toggle,
    .mobile-home-button,
    .mobile-quick-actions,
    .mobile-chat-interface,
    .mobile-instructions {
        display: none !important;
    }
}