
/* Basic layout */

:root {
	--settings-height: 25vh;

	--color: #666666;
	--petal: 0;
}

* {
	margin: 0;
	padding: 0;
}

html {
	font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif;
}

body {
	background: #444;
	text-align: center;
}

button {
	color: #888;
	background: none;
	border: .3vh solid #888;
	border-radius: 1vh;
	outline: none;
	cursor: pointer;
}







.buttons {
    position: relative;
    top: 4vh;

	opacity: 0;
	transition: opacity 1s;
}

.connected .buttons {
	opacity: 1;
}


/* Requirements */

#requirements {
	margin-top: 1vh;
	display: none;
}
.unsupported #requirements {
	display: block;
}


/* Content */

.content {
	opacity: 0.3;
	transition: opacity .5s, fill .5s;
}

body.connected .content {
	opacity: 1;
}


/* Petals */


#stem * {
	stroke: #333;
	stroke-width: 0.5vh;
	fill: none;
}

#bulb {
	opacity: 1;
	transition: opacity 5s;
	fill: var(--color);
}
.open #bulb {
	opacity: 0.7;
}


.petal {
	opacity: 0.7;
	transition: transform 6s, fill 1s, d 6s, opacity 6s;
	stroke: rgba(255,255,255,0.15);
}
.petal.left {
	transform-origin: 42% 73%;
}
.petal.middle {
	opacity: 0.8;
	transform-origin: 50% 82%;
}
.petal.right {
	transform-origin: 58% 73%;
}
.open .petal.left {
	transform: rotate(calc(-0.6deg * var(--petal)));
	opacity: 0.8;
	d: path('M355.5,476.5c0,0-20.5,0.8-26.7,0.8c-32.3,0-54.9-29.9-60.9-43.4c-18.8-42.8-24.1-88.6-1-174.6c19.8-73.8,103.7-155.4,107.5-158.1c3.8-2.7,9.7-5.5,9.7,5.9S293.9,383,355.5,476.5z');
}
.open .petal.middle {
	transform: scaleY(calc(1.0 - (0.004 * var(--petal)))) rotate(-2deg);
	opacity: 1;
	d: path('M461.3,476.5c0,0,120.1-51.1-54.7-378.4c-1.4-2.7-6.1-3-6.1-3c-2,0-5.5,0.4-6.9,3.1C218.9,425.4,339,476.5,339,476.5s29.8,29.9,61.1,29.9S461.3,476.5,461.3,476.5z');
}
.open .petal.right {
	transform: rotate(calc(0.6deg * var(--petal)));
	opacity: 0.8;
	d: path('M444.5,476.5c0,0,20.5,0.8,26.7,0.8c32.3,0,54.9-29.9,60.9-43.4c18.8-42.8,24.1-88.6,1-174.6c-19.8-73.8-103.7-155.4-107.5-158.1c-3.8-2.7-9.7-5.5-9.7,5.9S506.2,383,444.5,476.5z');
}

.petal.back {
	opacity: 0;
}

.open .petal.back.left {
	transform: rotate(calc(-0.58deg * var(--petal)));
	opacity: 0.5;
}
.open .petal.back.middle {
	transform: scaleY(calc(1.0 - (0.004 * var(--petal)))) rotate(2deg);
	opacity: 0.5;
}
.open .petal.back.right {
	transform: rotate(calc(0.62deg * var(--petal)));
	opacity: 0.5;
}


#shadow feDropShadow {
	flood-color: var(--color);
    flood-opacity: 0.7;
}
#shadow feDropShadow:first-child {
	flood-color: #fff;
    flood-opacity: 0.1;
}
body.on .petal.front.middle {
	filter:url(#shadow);
}

.content .lightbulb {
	position: absolute;
	top: 10vh;
	left: 10vw;
	width: 80vw;
	height: calc(100vh - var(--settings-height) - 20vh);
}

.content svg {
	position: absolute;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}



/* Settings */

.settings {
	position: absolute;
	top: calc(100vh - var(--settings-height));
	width: 100%;
	min-height: var(--settings-height);
	background: #333;

	transition: opacity .3s ease-in-out;
	opacity: 0.3;
	pointer-events: none;
}
body.connected .settings {
	opacity: 1;
	pointer-events: auto;
}


/* Open /close */

.content button {
	margin: 0vh 0.5vh 1.5vh 0.5vh;
    background: #383838;
	border-color: #444;
    color: #ccc;
    height: 3vh;
	font-size: 1.2vh;
	line-height: 100%;
	padding: 0 1vh;
	
	display: inline-flex;
    align-items: center;
    justify-content: center;
}
.content button span {
	font-size: 2.2vh;
	line-height: 1.4vh;
	margin-right: 0.4vh;
}
.content button svg {
    position: static;
    width: 2vh;
    height: 2vh;
    margin-right: 0.4vh;
	
	fill: none;
    stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-miterlimit: 10;
}
.content button#open,
.content button#close {
    background: #333;
	border-color: #333;
    color: #fff;
	height: 6vh;
	font-size: 2vh;
	padding: 0 2vh;
}
.content button#open svg,
.content button#close svg {
    width: 2.3vh;
    height: 2.3vh;
}

#close {
	display: none;
}
.open #open {
	display: none;
}
.open #close {
	display: inline-flex;
}

/* Pills */

.pills {
	margin-top: -2.4vh;
	margin-bottom: 0;
	display: flex;
}
.pills button {
	margin: 0;
	padding: 1vh 2vh;
	border-radius: 0;
	border-left: none;
	font-size: 2vh;
	background: #333;
}
.pills button:first-of-type {
	border-left: .3vh solid #888;
	border-top-left-radius: 1vh;
	border-bottom-left-radius: 1vh;
	margin-left: auto;
}
.pills button:last-of-type {
	border-top-right-radius: 1vh;
	border-bottom-right-radius: 1vh;
	margin-right: auto;
}

body.color button#color,
body.customize button#customize {
	background: #888;
	color: #fff;
}





/* Views */

.views {
	padding: 6vh 0;
	min-height: 6vh;
	display: block;
}
.views > div {
	display: none;
}

body.color div#colorView,
body.customize div#customizeView {
	display: block;
}



/* Colors */

#colorView div {
	display: inline-block;
	white-space: nowrap;
}

#colorView button.color {
	width: 6vh;
	height: 6vh;
	margin: -1vh 1vh 4vh;
	vertical-align: top;
}

#colorView button#off {
	background-color: #000;
	fill: none;
	stroke: #ccc;
	stroke-width: 2;
}

#colorView button#off svg {
	width: 3vh;
	height: 3vh;
}

#colorView p {
	color: #aaa;
	font-size: 1vh;
}

/* Settings */

#customizeView input {
	width: 15vh;
	margin-left: 2vh;
}
