*{padding:0;margin:0;box-sizing:border-box}body{background:#222;font-family:consolas}.tic-tac-toe{width:fit-content;margin:40px auto;text-align:center}.tic-tac-toe h1{color:#eee}.tic-tac-toe button{padding:8px 12px;margin:25px;background:transparent;border:2px solid #eee;color:#eee;width:100px;border-radius:5px;transition:.2s;font-weight:700;cursor:pointer}.tic-tac-toe button:hover{background:#eee;color:#222}.tic-tac-toe .game{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;width:fit-content;margin:0 auto}.turn{display:flex;justify-content:center;margin:15px auto;width:fit-content;position:relative;border-radius:10px}.turn .square,.winner .square{width:70px;height:70px;pointer-events:none;border-color:transparent}.turn .square span.x:before,.turn .square span.x:after{background:#222;transition:.2s}.turn .square span.o{transition:.2s;border-color:#222}.turn:after{position:absolute;content:"";width:50%;height:100%;top:0;background:#49ff58;border-radius:9px;z-index:-1;transition:.2s}.turn.left:after{left:0}.turn.left span.o{border-color:#eee}.turn.right span.x:before,.turn.right span.x:after{background:#eee}.turn.right:after{left:50%}.winner{position:absolute;width:100vw;height:100vh;top:0;left:0;display:grid;place-items:center;background-color:#000000b3}.winner .text{background:#111;width:70%;max-width:400px;height:300px;border:2px solid #eee;border-radius:10px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:20px}.winner .text h2{font-size:2.5em;margin:15px 0;color:#eee}.winner .win{margin:0 auto;width:fit-content;border:2px solid #eee;border-radius:10px;display:flex;gap:15px}.square{width:100px;height:100px;border:2px solid #eee;border-radius:5px;display:grid;place-items:center;cursor:pointer}.square span{display:block;position:relative;width:70%;height:70%;border-radius:50%;border:8px solid transparent}.square span.x:after,.square span.x:before{position:absolute;content:"";width:150%;height:8px;top:50%;left:50%;transform:translate(-50%,-50%) rotate(-45deg);background:#62fffc;border-radius:5px}.square span.x:after{transform:translate(-50%,-50%) rotate(45deg);opacity:1}.square span.o{border-color:#ffa02e}
