:root {
    --bg: #5c463d;
    --panel: #5c3833;
    --panel-raised: #a9896f;
    --border: #362e3d;
    --accent: #678972;
    --accent-dim: #434645;
    --live: #4ade80;
    --text: #f5f0e8;
    --text-dim: #9c93a3;
    --text-faint: #f5f0e8;
    --line: #2E323C;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--bg);
    background-image: url('images/CampBG.JPG');
    background-repeat: no-repeat;
    background-position: top center;
    background-size: cover;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    padding: 32px 20px 60px;
}

.wrap {
    max-width: 760px; margin: 0 auto;
}

/*------------------------------Header------------------------------*/
header {
    margin-bottom: 28px;
}

h1 {
    font-family: 'the bubble letters', sans-serif;
    font-weight: 700;
    font-size: 40px;
    line-height: 1.05;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

header p {
    color: var(--text-dim);
    font-size: 15px;
    margin: 0;
}

/*------------------------------Super-Panels------------------------------*/
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 18px;
}

.panel-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin: 0 0 14px;
}

.panel-warning {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: bold;
    color: var(--live);
}

.panel-warning-2 {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--live);
    opacity: 70%;
}

.panel-hint {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin: 0 0 14px;
    opacity: 50%;
}

/*------------------------------Voices Grid------------------------------*/
#voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.voice-btn {
    background: var(--panel-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 10px;
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.voice-btn:hover {
    border-color: var(--text-faint);
}

.voice-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.voice-btn.active {
    border-color: var(--accent);
    background: rgba(255,107,74,0.1);
}

.voice-btn .tag {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 10px;
    color: var(--text-faint);
}

.voice-btn.active .tag {
    color: var(--accent);
}

.voice-btn .icon-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.voice-btn .icon-row img {
    width: 72px;
    height: 90px;
    object-fit: contain;
    border-radius: 6px;
    margin-right: 15px;
}

/*------------------------------Preview Voice------------------------------*/
.controls-row {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    align-items: center;
}

button.primary {
    background: var(--accent);
    border: none;
    color: #1c0f09;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 14px;
    padding: 11px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

button.primary:hover {
     background: #ff7f61;
}

button.primary.playing {
    background: var(--panel-raised);
    color: var(--text);
    border: 1px solid var(--accent);
}

.vu {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 22px;
}

.vu span {
    width: 4px;
    background: var(--live);
    border-radius: 1px;
    height: 4px;
    opacity: 0.3;
}

.vu.playing span {
    animation: bounce 0.9s ease-in-out infinite;
    opacity: 1;
}

.vu span:nth-child(1) {
     animation-delay: 0s;
}

.vu span:nth-child(2) {
    animation-delay: 0.12s;
}

.vu span:nth-child(3) {
    animation-delay: 0.24s;
}

.vu span:nth-child(4) {
    animation-delay: 0.36s;
}

.vu span:nth-child(5) {
    animation-delay: 0.48s;
}

@keyframes bounce {
    0%,100% { height: 4px; } 50% { height: 20px; }
}

/*------------------------------Bits Panel------------------------------*/
.bitinputs-container {
    margin-left: auto;
    display:flex;
}

.bits-input {
    width: 150px;
    background: var(--panel-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    padding: 11px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bitsinput-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    padding-right: 8px;
}

.bits-input:hover {
    outline: 2px solid var(--border);
}

.bits-input:focus-visible {
    outline: 2px solid var(--accent);
}

.bits-input.active {
    border-color: var(--accent);
}

/*------------------------------Effects / Tag Panel------------------------------*/

.tag-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.tag-column {
    min-width: 0;
    height: 380px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
}

.tag-column::-webkit-scrollbar {
    width: 8px;
}

.tag-column::-webkit-scrollbar-track {
    background: transparent;
}

.tag-column::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 6px;
}

.tag-column::-webkit-scrollbar-thumb:hover {
    background: #3A3F4B;
}

.cat-label {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--accent);
    color: var(--text);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
}

.row {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #22252D;
    cursor: grab;
    user-select: none;
    transition: background .12s;
}

.row:hover {
    background: #23262F;
}

.row:active {
    cursor: grabbing;
}

.row:last-child {
    border-bottom: none;
}

.tag {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
}

.tag-column {
    min-width: 0;
    height: 380px;
    overflow-y: auto;

    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);

    overscroll-behavior: contain;
}

.row.dragging {
    opacity: 0.5;
}

/*------------------------------Text Entry------------------------------*/
.text-entry {
    width: 100%;
    min-height: 120px;
    box-sizing: border-box;
    background: var(--panel-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    padding: 10px;
    resize: vertical;
}

::placeholder {
    color: var(--text-faint);
    opacity: 0.3;
}

.text-entry:hover {
    outline: 2px solid var(--border);
}

.text-entry:focus-visible {
    outline: 2px solid var(--accent);
}

.row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.charcount {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--text-faint);
}

.charcount.over {
    color: var(--accent);
}

/*------------------------------Output Panel------------------------------*/
.output-panel {
    background: #0c0a0d;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 15px;
    color: var(--live);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: border-color 0.15s ease;
}

.output-panel:hover {
    border-color: var(--live);
}

.output-panel .cmd {
    word-break: break-word;
}

.output-panel .copy-hint {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: var(--text-faint);
    white-space: nowrap;
    flex-shrink: 0;
}

.output-panel.copied .copy-hint {
    color: var(--live);
}

/*------------------------------Mobile Formatting------------------------------*/
@media (max-width: 700px) {
    .controls-row {
        flex-wrap: wrap;
    }

    .bitinputs-container {
        width: 100%;
        margin-left: 0;
    }

    .bits-input {
        width: 100%;
        min-width: 0;
    }
}
