/******************************
 * PISTONCRAFT
 */

body {
    margin: 0px;
    padding: 0px;
    background-color: #666666;
    font-family: 'Droid Sans', sans-serif;
}

.lattice {
    position: absolute;
    display: block;
    -webkit-transform-origin: 0% 0%;
}

.cell {
    width: 94px;
    height: 94px;
    background-color: #f3f3f3;
    border: 3px solid #dddddd;
    display: block;
    position: absolute;
    z-index: 5;
}

.cell:hover {
    background-color: #f8f8f8;
    border: 3px solid #ff8900;
}

.building {
    -webkit-backface-visibility: hidden;
    width: 100px;
    height: 100px;
    display: block;
    position: absolute;
    z-index: 10;
}

/*******************************
 * ITEMS
 */

.item {
    -webkit-backface-visibility: hidden;
    width: 100px;
    height: 100px;
    display: block;
    position: absolute;
    z-index: 20;
    transition: 
        top 0.1s linear 0s, 
        left 0.1s linear 0s, 
        width 0.1s linear 0.1s,
        height 0.1s linear 0.1s,
        border-radius 0.1s linear 0.1s,
        margin 0.1s linear 0.1s,
        transform 0.1s linear 0.1s;
    -webkit-transition: 
        top 0.1s linear 0s, 
        left 0.1s linear 0s, 
        width 0.1s linear 0.1s,
        height 0.1s linear 0.1s,
        border-radius 0.1s linear 0.1s,
        margin 0.1s linear 0.1s,
        -webkit-transform 0.1s linear 0.1s;
    //box-shadow: 0px 0px 8px #333333;
    //background-color: #ff00ff; /* default items are a glaring pink because they shouldn't exist */
    opacity: 0.9;
}

.item.id2 { background-image: url('img/resource iron ore.png'); }
.item.id3 { background-image: url('img/resource crystal.png'); }
.item.id5 { background-image: url('img/resource silicon ore.png'); }
.item.id7 { background-image: url('img/resource gas.png'); }
.item.id26 { background-image: url('img/iron wheel.png'); }
.item.id39 { background-image: url('img/crystal lens.png'); }
.item.id65 { background-image: url('img/silicon wafer.png'); }
.item.id91 { background-image: url('img/gas warhead.png'); }
.item.id34 { background-image: url('img/iron plate.png'); }
.item.id51 { background-image: url('img/crystal lasing ruby.png'); }
.item.id85 { background-image: url('img/silicon image sensor.png'); }
.item.id119 { background-image: url('img/gas engine fuel.png'); }
.item.id38 { background-image: url('img/iron shell.png'); }
.item.id133 { background-image: url('img/gas rocket fuel.png'); }
.item.id1734 { background-image: url('img/laser.png'); }
.item.id3094 { background-image: url('img/engine part.png'); }
.item.id3458 { background-image: url('img/ammo.png'); }
.item.id3315 { background-image: url('img/camera.png'); }
.item.id5054 { background-image: url('img/rocket.png'); }
.item.id86190 { background-image: url('img/turret vanilla.png'); }
.item.id298045020 { background-image: url('img/turret autocannon.png'); }
.item.id17476732 { background-image: url('img/missile.png'); }
.item.id1506319531080 { background-image: url('img/turret missile.png'); }
.item.id149453460 { background-image: url('img/turret laser.png'); }
.item.id201110 { background-image: url('img/engine complete.png'); }


/*******************************
 * WIRE STYLES
 */

.wire {
    margin: 45px;
    position: absolute;
    z-index: 6;
    background-color: #484848;
    width: 10px;
    height: 10px;
    opacity: 0.4;
}

.wire>.northnode,
.wire>.southnode,
.wire>.eastnode,
.wire>.westnode {
    position: absolute;
    border: none;
    top: 0px;
    left: 0px;
    width: 10px;
    height: 10px;
}

.wire.north>.northnode {
    border-top: 45px solid #484848;
    top: -45px;
}
.wire.east>.eastnode {
    border-right: 45px solid #484848;
}
.wire.south>.southnode {
    border-bottom: 45px solid #484848;
}
.wire.west>.westnode {
    border-left: 45px solid #484848;
    left: -45px;
}

.wire.activated {
    background-color: #5384ee;
}
.wire.activated>.northnode,
.wire.activated>.eastnode,
.wire.activated>.southnode,
.wire.activated>.westnode {
    border-color: #5384ee;
}

/*******************************
 * CLOCK STYLES
 */

.building.clock {
    width: 94px;
    height: 94px;
    background-color: #ababab;
    border: 3px solid #484848;
    z-index: 9;
}

.building.clock>.northnode,
.building.clock>.southnode,
.building.clock>.eastnode,
.building.clock>.westnode {
    position: absolute;
    width: 10px;
    height: 10px;
    border: none;
    background-color: #484848;
}

.building.clock>.northnode.activated,
.building.clock>.southnode.activated,
.building.clock>.eastnode.activated,
.building.clock>.westnode.activated {
    background-color: #5384ee;
}

.building.clock>.northnode {
    left: 42px;
    top: 0px;
}
.building.clock>.southnode {
    left: 42px;
    top: 84px;
}
.building.clock>.westnode {
    top: 42px;
    left: 0px;
}
.building.clock>.eastnode {
    top: 42px;
    left: 84px;
}

/*******************************
 * MODIFIER GENERAL STYLES
 */

.building.modifier {
    width: 94px;
    height: 94px;
    background-color: #ababab;
    border: 3px solid #484848;
    z-index: 9;
}

.building.modifier>.inside {
    content: "?";
    color: #222222;
}

/* MODIFIER SPECIFIC STYLES */
.building.modifier.resource {
    z-index:100;
    opacity: 0.6;
}
.building.modifier.resource>.inside {
    width: 94px;
    height: 94px;
    text-align: center;
    line-height: 94px;
    font-size: 20px;
}
.building.modifier.resource.steel {
    background-color: #888a90;
    border: 3px solid #686a70;
}
.building.modifier.resource.glass {
    background-color: #afd6e0;
    border: 3px solid #8fb6c0;
}
.building.modifier.resource.silicon {
    background-color: #c8c8a0;
    border: 3px solid #a8a880;
}
.building.modifier.resource.gas {
    background-color: #ef8520;
    border: 3px solid #cf6500;
}


.building.modifier.stack {
    z-index: 30;
    background: none;
}
.building.modifier.stack>.inside {
    position: absolute;
    top: 87px;
    left: 67px;
    width: 30px;
    height: 20px;
    background: rgba(0,0,0,0.7);
    font-size: 15px;
    color: #ffffff;
    text-align: center;
    z-index: 40;
}

.building.modifier.trash>.inside {
    content: none;
    width: 68px;
    height: 68px;
    margin: 10px;
    display: block;
    border-radius: 20px;
    border: 3px solid #000000;
    background-color: #000000;
    box-shadow: 0px 0px 5px #333333;
}

.building.modifier.bullet>.inside {
    content: none;
    width: 44px;
    height: 54px;
    margin: 12px 17px 22px 27px;
    display: block;
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    border: 3px solid #000000;
    background-color: #797979;
    box-shadow: inset 0px 0px 25px #333333;
    transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
}

.building.modifier.circle>.inside {
    content: none;
    width: 54px;
    height: 54px;
    margin: 17px;
    display: block;
    border-radius: 30px;
    border: 3px solid #000000;
    background-color: #797979;
    box-shadow: inset 0px 0px 25px #333333;
}

.building.modifier.square>.inside {
    content: none;
    width: 44px;
    height: 44px;
    margin: 22px;
    display: block;
    border: 3px solid #000000;
    background-color: #797979;
    box-shadow: inset 0px 0px 25px #333333;
}

/*******************************
 * PISTON GENERAL STYLES
 */

.building.piston {
    z-index: 30;
}

.building.piston>.piston-body {
    display: block;
    position: absolute;
    background-color: #cccccc;
    border: 3px solid #555555;
    z-index: 2;
}

.building.piston>.piston-head {
    display: block;
    position: absolute;
    background-color: #888888;
    border: 3px solid #555555;
    transition: top 0.1s linear, left 0.1s linear;
    -webkit-transition: top 0.1s linear, left 0.1s linear;
    z-index: 2;
}

.building.piston>.piston-stalk {
    display: block;
    position: absolute;
    background-color: #777777;
    border: 3px solid #444444;
    transition: top 0.1s linear, left 0.1s linear, width 0.1s linear, height 0.1s linear;
    -webkit-transition: top 0.1s linear, left 0.1s linear, width 0.1s linear, height 0.1s linear;
    z-index: 1;
}

.building.piston.disabled {
    opacity: 0.6;
}

.building.piston.disabled>.piston-stalk,
.building.piston.disabled>.piston-head {
    transition: none;
    -webkit-transition: none;
}

/* piston NORTH */

.building.piston.north>.piston-body {
    width: 94px;
    height: 74px;
    top: 20px;
}

.building.piston.north>.piston-head {
    width: 94px;
    height: 14px;
    top: 0px;
}

.building.piston.north.extended>.piston-head {
    top: -100px;
}

.building.piston.north>.piston-stalk {
    width: 24px;
    height: 94px;
    top: 0px;
    left: 35px;
}

.building.piston.north.extended>.piston-stalk {
    height: 194px;
    top: -100px;
}

/* piston SOUTH */

.building.piston.south>.piston-body {
    width: 94px;
    height: 74px;
}

.building.piston.south>.piston-head {
    width: 94px;
    height: 14px;
    top: 80px;
}

.building.piston.south.extended>.piston-head {
    top: 180px;
}

.building.piston.south>.piston-stalk {
    width: 24px;
    height: 94px;
    top: 0px;
    left: 35px;
}

.building.piston.south.extended>.piston-stalk {
    height: 194px;
}

/* piston WEST */

.building.piston.west>.piston-body {
    width: 74px;
    height: 94px;
    left: 20px;
}

.building.piston.west>.piston-head {
    width: 14px;
    height: 94px;
    left: 0px;
}

.building.piston.west.extended>.piston-head {
    left: -100px;
}

.building.piston.west>.piston-stalk {
    width: 94px;
    height: 24px;
    top: 35px;
    left: 0px;
}

.building.piston.west.extended>.piston-stalk {
    width: 194px;
    left: -100px;
}

/* piston EAST */

.building.piston.east>.piston-body {
    width: 74px;
    height: 94px;
}

.building.piston.east>.piston-head {
    width: 14px;
    height: 94px;
    left: 80px;
}

.building.piston.east.extended>.piston-head {
    left: 180px;
}

.building.piston.east>.piston-stalk {
    width: 94px;
    height: 24px;
    top: 35px;
    left: 0px;
}

.building.piston.east.extended>.piston-stalk {
    width: 194px;
}

/*************************************
 * USER INTERFACE
 */

#ui {
    position: fixed;
    top: 0px;
    left: 0px;
    background-color: rgba(255,255,255,0.75);
    border-bottom: 3px solid #555555;
    z-index: 1000;
    box-shadow: 0px 0px 8px #333333;
    -webkit-transform-origin: 0% 0%;
}

#ui>.divider {
    display: inline-block;
    height: 100px;
    width: 3px;
    background-color: rgba(0,0,0,0.16);
    margin: 10px;
}

#ui>a.uibutton {
    display: inline-block;
    height: 100px;
    width: 100px;
    margin: 10px;
}

#ui>a.uibutton>span.description {
    position: absolute;
    top: 120px;
    width: 100px;
    //height: 30px;
    line-height: 30px;
    color: #ffffff;
    background-color: rgba(0,0,0,0.7);
    text-align: center;
    display: none;
    -webkit-transform-origin: 50% 0%;
}
#ui>a.uibutton:hover>span.description {
    display: block;
}

#ui>a.uibutton.selected {
    box-shadow: 0px 0px 8px #ff8900;
}

#ui>#run {
    display: inline-block;
    border: 3px solid #555555;
    height: 94px;
    width: 194px;
    margin: 10px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

#ui>#run>.inside {
    height: 94px;
    width: 294px;
    margin: 0px;
    position: absolute;
    top: 0px;
    left: 0px;
    font-size: 20px;
    font-weight: bold;
    transition: top 0.1s linear, left 0.1s linear, width 0.1s linear, height 0.1s linear;
    -webkit-transition: top 0.1s linear, left 0.1s linear, width 0.1s linear, height 0.1s linear;
}

#ui>#run>.inside>.stopped {
    height: 94px;
    width: 94px;
    background-color: #cc4532;
    color: #ffffff;
    position: absolute;
    top: 0px;
    left: 0px;
    line-height: 94px;
    text-align: center;
}
#ui>#run:hover>.inside>.stopped {
    background-color: #ff3300;
}
#ui>#run>.inside>.nibblet {
    height: 88px;
    width: 94px;
    background-color: #cccccc;
    border: 3px solid #bbbbbb;
    position: absolute;
    top: 0px;
    left: 94px;
}
#ui>#run:hover>.inside>.nibblet {
    background-color: #eeeeee;
}
#ui>#run>.inside>.running {
    height: 94px;
    width: 94px;
    background-color: #45cc32;
    color: #ffffff;
    position: absolute;
    top: 0px;
    left: 194px;
    line-height: 94px;
    text-align: center;
}
#ui>#run:hover>.inside>.running {
    background-color: #33ff00;
}

#ui>#run.true>.inside {
    left: -94px;
}

#ui>#clear {
    display: inline-block;
    border: 3px solid #555555;
    height: 94px;
    width: 94px;
    margin: 10px;
    border-radius: 50px;
    font-size: 30px;
    background-color: #cc4532;
    color: #ffffff;
    line-height: 94px;
    text-decoration: none;
    text-align: center;
    vertical-align: top;
}

#ui>#clear:hover {
    background-color: #ff3300;
}

#ui>#saveload {
    display: inline-block;
    border: 3px solid #555555;
    height: 94px;
    width: 94px;
    margin: 10px;
    border-radius: 50px;
    font-size: 30px;
    background-color: #222222;
    color: #00ff00;
    line-height: 94px;
    text-decoration: none;
    text-align: center;
    vertical-align: top;
}

#ui>#saveload:hover {
    background-color: #000000;
}

#ui>#state {
    overflow: hidden;
    max-height: 0px;
    white-space: pre;
    font-family: monospace;
    background-color: #222222;
    color: #00ff00;
    font-size: 20px;
    padding: 0px 10px 0px 10px;
    transition: max-height 0.1s linear, padding 0.1s linear;
    -webkit-transition: max-height 0.1s linear, padding 0.1s linear;
}
#ui>#state.show {
    max-height: 300px;
    padding: 10px;
}
