/* Base styles */
html, body {
    margin: 0;
    overflow: hidden;
    height: 100%;
}

/* SVG container */
svg {
    position: relative;
    height: 100%;
    width: 100%;
    margin: auto;
    display: block;
}

/* Note circles */
svg > g > text {
    font: bold 20px sans-serif;
    cursor: default;
    letter-spacing: -1px;
}

svg > g > circle {
    transition-property: fill-opacity;
}

/* Note states */
.on {
    fill: url("#NoteOnGradient");
    animation: vibrate 0.08s linear infinite;
}
.partial { fill: #ddd; }
.off { fill: white; }

/* Subtle vibration for active chord root */
@keyframes vibrate {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(0.5px, -0.5px); }
    50% { transform: translate(-0.5px, 0.5px); }
    75% { transform: translate(0.5px, 0.5px); }
}

.cover {
    fill-opacity: 0;
    fill: white;
}

/* Major ring (outer) intensity - stroke width based on octaves pressed */
g[data-ring="major"] > circle[data-n="-1"] {
    stroke-width: 2;
    fill-opacity: 0;
    fill: url("#NoteOnGradient");
    transition: fill-opacity 10s cubic-bezier(.1,1,1,1);
}

g[data-ring="major"] > circle[data-n="0"] {
    stroke-width: 2;
    transition-duration: 10s;
}

g[data-ring="major"] > circle[data-n="0"].on + .cover {
    fill-opacity: 1;
    transition: fill-opacity .5s;
}

g[data-ring="major"] > circle[data-n="1"] {
    stroke-width: 2.25;
    fill-opacity: 1;
}

g[data-ring="major"] > circle[data-n="2"] {
    stroke-width: 3;
    fill-opacity: 1;
}

g[data-ring="major"] > circle[data-n="3"] {
    stroke-width: 3.5;
}

g[data-ring="major"] > circle[data-n="4"] {
    stroke-width: 4;
}

/* Inner ring (minor) specific styles */
g[data-ring="minor"] > text {
    font: bold 11px sans-serif;
    cursor: default;
    letter-spacing: -1.5px;
}

g[data-ring="minor"] > circle {
    transition-property: fill-opacity;
}

/* Inner ring intensity (thinner strokes for smaller circles) */
g[data-ring="minor"] > circle[data-n="-1"] {
    stroke-width: 1.5;
    fill-opacity: 0;
    fill: url("#NoteOnGradient");
    transition: fill-opacity 10s cubic-bezier(.1,1,1,1);
}

g[data-ring="minor"] > circle[data-n="0"] {
    stroke-width: 1.5;
    transition-duration: 10s;
}

g[data-ring="minor"] > circle[data-n="0"].on + .cover {
    fill-opacity: 1;
    transition: fill-opacity .5s;
}

g[data-ring="minor"] > circle[data-n="1"] {
    stroke-width: 1.75;
    fill-opacity: 1;
}

g[data-ring="minor"] > circle[data-n="2"] {
    stroke-width: 2.25;
    fill-opacity: 1;
}

g[data-ring="minor"] > circle[data-n="3"] {
    stroke-width: 2.75;
}

g[data-ring="minor"] > circle[data-n="4"] {
    stroke-width: 3;
}

/* Controls (top right buttons) */
#controls {
    position: absolute;
    top: 1em;
    right: 1em;
}

.button-wrapper {
    position: relative;
    display: inline-block;
    margin-left: 0.5em;
}

.button-wrapper:first-child {
    margin-left: 0;
}

#layoutToggle, #accidentalsToggle, #soundToggle {
    padding: 0.5em 1em;
    font-size: 14px;
    cursor: pointer;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    height: 36px;
    line-height: 1;
}

#layoutToggle:hover, #accidentalsToggle:hover, #soundToggle:hover {
    background: #555;
}

/* Button tooltips */
.tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5em;
    width: 280px;
    padding: 1em;
    background: #222;
    color: white;
    font-size: 13px;
    line-height: 1.4;
    border-radius: 4px;
    transition: opacity 0.2s;
    z-index: 100;
}

.button-wrapper:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* Note hover tooltip */
#noteTooltip {
    display: none;
    position: absolute;
    padding: 0.6em 0.9em;
    background: #222;
    color: white;
    font-family: sans-serif;
    border-radius: 4px;
    pointer-events: none;
    z-index: 100;
    text-align: center;
}

#noteTooltip .recipe {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: -1px;
}

#noteTooltip .name {
    font-size: 14px;
    color: #aaa;
    margin-top: 0.2em;
}

#noteTooltip.visible {
    display: block;
}

/* MIDI status */
#midiStatus {
    position: absolute;
    bottom: 0;
    left: 0;
    margin: 0.5em;
    padding: 0.5em;
    background: black;
    color: white;
    font-family: monospace;
    font-size: 12px;
}

/* Credit link */
#credit {
    position: absolute;
    bottom: 0.5em;
    right: 0.5em;
    font-size: 14px;
    color: #666;
    font-family: sans-serif;
}

#credit a {
    color: #666;
}

#credit a:hover {
    color: #000;
}
