/* Version 8.0: Complete visual and thematic overhaul to "Dolly Parton". */

/* --- General Setup --- */
:root {
    /* ANNOTATION: Version 8.0 - New Dolly Parton-themed color palette. */
    --main-bg: #fdf6e9; /* Warm parchment / off-white */
    --text-color: #4a2c2a; /* Rich, dark brown */
    --primary-border: #e7a3b3; /* Soft, rosy pink */
    --accent-pink: #d81b60; /* Vibrant Dolly pink */
    --accent-gold: #fbc02d; /* Sparkly gold */
    --container-bg: rgba(255, 255, 255, 0.6); /* Soft white glass */
}

body {
    background-color: var(--main-bg);
    color: var(--text-color);
    /* ANNOTATION: Version 8.0 - Font updated to a classic, readable serif. */
    font-family: 'Lora', serif;
    font-size: 19px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    /* ANNOTATION: Version 8.0 - New subtle background texture. */
    background-image: url('https://www.transparenttextures.com/patterns/subtle-white-feathers.png');
}

/* --- Main Layout --- */
#game-container {
    width: 95vw;
    max-width: 700px;
    height: 90vh;
    border: 2px solid var(--primary-border);
    background-color: var(--container-bg);
    backdrop-filter: blur(5px);
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.5s, border-color 0.5s;
    border-radius: 15px; /* ANNOTATION: Version 8.0 - Softened corners. */
}

header h1 {
    text-align: center;
    margin: 0 0 15px 0;
    color: var(--accent-pink);
    /* ANNOTATION: Version 8.0 - New script font for the header for a signature feel. */
    font-family: 'Pacifico', cursive;
    font-weight: normal;
    font-size: 2.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

#main-content {
    display: flex;
    flex-grow: 1;
    gap: 20px;
    height: calc(100% - 60px);
    min-height: 0; 
}

#ui-container {
    flex: 1;
    border: 1px solid var(--primary-border);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;
    border-radius: 10px;
}

/* --- Stage Display --- */
/* ANNOTATION: Version 8.0 - Renamed and restyled for the new theme. */
#stage-display {
    border: 1px dashed var(--primary-border);
    border-radius: 8px;
    height: 150px; 
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background-color: rgba(255, 255, 255, 0.4);
    overflow: hidden;
    transition: height 0.3s;
}

/* ANNOTATION: Version 8.0 - Placeholder is now a guitar/butterfly icon. */
#stage-icon {
    width: 80px;
    height: 80px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23d81b60"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z"/></svg>'); /* Simple play icon as placeholder, ideally a guitar or butterfly SVG */
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    opacity: 0.5;
}


/* --- Dialogue Box & Log --- */
#dialogue-box {
    border: 1px solid #e0e0e0;
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.05);
}

.user-message { color: #777; margin: 0; padding-left: 5px; font-style: italic; }
.max-message { position: relative; }
.max-message p { margin: 0; white-space: pre-wrap; word-wrap: break-word; line-height: 1.6; }
.copy-btn { position: absolute; top: -10px; right: 0; background-color: var(--primary-border); color: #fff; border: none; font-family: 'Lora', serif; border-radius: 5px; font-size: 12px; padding: 3px 8px; cursor: pointer; display: none; opacity: 0; transition: all 0.3s; }
.max-message:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background-color: var(--accent-pink); }
.copy-btn.copied { background-color: var(--accent-gold); color: var(--text-color); }
#dialogue-box::-webkit-scrollbar { width: 10px; }
#dialogue-box::-webkit-scrollbar-track { background: var(--main-bg); }
#dialogue-box::-webkit-scrollbar-thumb { background-color: var(--primary-border); border-radius: 5px; }
#dialogue-box::-webkit-scrollbar-thumb:hover { background-color: var(--accent-pink); }
.cursor { animation: blink 1s step-end infinite; color: var(--accent-pink); }

/* --- Player HUD & Controls --- */
#controls { border-top: 1px dashed var(--primary-border); padding-top: 15px; margin-top: auto; }
#talk-btn { width: 100%; padding: 12px; background-color: var(--accent-pink); border: none; color: #fff; font-family: 'Lora', serif; font-weight: bold; font-size: 18px; cursor: pointer; text-transform: uppercase; transition: background-color 0.2s, transform 0.1s; margin-bottom: 10px; letter-spacing: 1px; border-radius: 8px; }
#talk-btn:hover { background-color: #c2185b; }
#talk-btn:active { transform: scale(0.98); }
#text-input-container { display: flex; gap: 10px; width: 100%; }
#memo-input { flex-grow: 1; background-color: #fff; border: 1px solid #ccc; color: var(--text-color); font-family: 'Lora', serif; font-size: 17px; padding: 8px 12px; border-radius: 8px; }
#memo-input:focus { outline: none; border-color: var(--accent-pink); box-shadow: 0 0 5px var(--accent-pink); }
#send-text-btn { padding: 8px 20px; background-color: var(--primary-border); border: none; color: #fff; font-family: 'Lora', serif; font-size: 16px; font-weight: bold; cursor: pointer; text-transform: uppercase; transition: background-color 0.2s; border-radius: 8px; }
#send-text-btn:hover { background-color: var(--accent-pink); }
.controls-info { font-size: 14px; text-align: center; margin-top: 10px; color: #888; }

/* --- Dormant Mode Styles --- */
#ui-container.dormant-mode #stage-display { height: 250px; }
#ui-container.dormant-mode #dialogue-box { flex-grow: 0.1; }

/* --- Animations & Effects --- */
/* ANNOTATION: Version 8.0 - Glitch effect replaced with a gentle sparkle effect. */
.sparkle { position: relative; }
@keyframes sparkle-effect-anim {
  0% { text-shadow: 0 0 1px var(--accent-gold), 0 0 3px var(--accent-gold); }
  50% { text-shadow: 0 0 5px var(--accent-gold), 0 0 15px var(--accent-gold); }
  100% { text-shadow: 0 0 1px var(--accent-gold), 0 0 3px var(--accent-gold); }
}
.sparkle-effect {
    animation: sparkle-effect-anim 1s 5;
}
.heartstrings-effect {
    box-shadow: 0 0 25px var(--accent-pink), inset 0 0 25px var(--accent-pink);
    border-color: var(--accent-pink);
}

@keyframes blink { 50% { opacity: 0; } }

/* --- Responsive Design --- */
@media (max-width: 768px) {
    body { font-size: 17px; overflow: auto; height: auto; padding: 10px 0; }
    #game-container { height: auto; width: 95vw; padding: 10px; }
    #main-content { flex-direction: column; }
    #stage-display { height: 120px; }
    #dialogue-box { min-height: 200px; max-height: 50vh; }
    header h1 { font-size: 2rem; }
}