/* * Base */ *, *::after, *::before { box-sizing: border-box; margin: 0; padding: 0; } body { display: flex; flex-flow: column nowrap; background: hsl(180, 29%, 95%); font-family: "Courier New", Courier, monospace; font-size: 1rem; line-height: 1.618; min-height: 100vh; max-width: 100vw; } button { display: block; cursor: pointer; font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; } /* * Helpers */ .screen-reader-txt { border: 0; clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; overflow: hidden; padding: 0; position: absolute !important; word-break: normal; word-wrap: normal !important; } /* * Layout */ .branding { margin: 2rem auto clamp(2rem, 5vh, 5rem); } .branding__title { color: hsl(207, 85%, 47%); font-size: clamp(2.5rem, 3vw, 3rem); text-align: center; text-shadow: 1px 1px 1px hsl(207, 85%, 27%); } .main { display: flex; flex-flow: column nowrap; flex: 1; margin: 3rem 0; } .register { flex: 1; display: grid; grid-template-columns: repeat( auto-fill, min(calc(100vw - 2rem), calc(1200px / 2 - 4rem)) ); gap: 2rem; align-items: center; justify-content: center; justify-items: center; margin: auto; width: min(calc(100vw - 2rem), calc(1200px - 2rem)); } .form--register { justify-self: stretch; } .form { display: flex; flex-flow: column wrap; gap: clamp(1rem, 3vh, 2rem); } .form__fieldset { display: flex; flex-flow: row wrap; align-items: flex-end; gap: 2rem; border: 4px solid hsl(207, 85%, 45%); padding: 1.7rem clamp(0.5rem, 3vw, 1.5rem); position: relative; margin-top: 2.5rem; } .form__legend { background: hsl(180, 29%, 95%); border: 4px solid hsl(207, 85%, 45%); border-bottom-width: 0; color: hsl(207, 85%, 28%); font-size: 1.4rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; padding: 0.5rem 1.3rem; position: absolute; top: -40px; left: -4px; right: -4px; } .form__item { flex: 1 1 max-content; } .form__item:last-child:not(:only-of-type) { margin-left: auto; margin-bottom: 0.8rem; } .form__label { display: block; cursor: pointer; position: relative; letter-spacing: 1px; } .form__label--checkbox { display: initial; } .form__label--checkbox::before { position: absolute; top: -1px; left: -28px; display: block; content: ""; width: 1.2rem; height: 1.2rem; background: hsl(180, 29%, 95%); border: 3px solid hsl(207, 85%, 45%); color: hsl(207, 85%, 40%); font-size: 1.1rem; font-weight: 600; line-height: 0.85; text-align: center; } .form__input { background: hsl(180, 29%, 95%); border: 3px solid hsl(207, 85%, 45%); font-size: inherit; padding: 0.7rem 0.8rem; } .form__checkbox { order: 2; width: max-content; } .form__checkbox:checked ~ .form__label--checkbox::before { content: "x"; } .form__hint { font-size: 0.85rem; margin: 1rem 0 0; } .form__submit { margin: 1rem 0 0 auto; } .preview { background: hsl(207, 85%, 45%); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); width: clamp(18rem, 40vw, 30rem); height: clamp(18rem, 40vw, 30rem); position: relative; } .preview__content { display: flex; flex-flow: column wrap; align-items: center; justify-content: center; gap: 1.5rem; background: hsl(180, 29%, 95%); border-radius: 50%; font-size: clamp(1.2rem, 3vw, 2rem); width: 80%; height: 80%; padding: 1rem; position: relative; top: 10%; left: 10%; } .ia-badge { position: relative; } .ia-badge::after { display: block; content: "IA"; position: absolute; top: 0; right: -2.5rem; background: rgb(253, 206, 119); border-radius: 50%; font-size: 0.9rem; padding: 4px 8px; width: max-content; } .game { flex: 1; display: none; flex-flow: column nowrap; justify-content: space-between; align-items: center; gap: 2rem; margin: auto; padding: clamp(1rem, 3vh, 2rem) 0; width: min(calc(100vw - 2rem), 600px); } .scoring-board { font-family: "Courier New", Courier, monospace; font-size: 1.5rem; text-align: center; width: 100%; } .scoring-board__item { background: hsl(0, 0%, 100%); border: 5px solid hsl(207, 85%, 47%); border-radius: 3px; display: inline-block; margin-bottom: clamp(1rem, 3vh, 2rem); padding: 1rem 0; width: calc(50% - 1rem); position: relative; } .scoring-board__item:first-child { box-shadow: 1px 1px 0 2px hsl(207, 85%, 27%); } .scoring-board__item:not(:first-child) { box-shadow: -1px 1px 0 2px hsl(207, 85%, 27%); margin-left: 1rem; } .scoring-board__item:first-child::after { content: ""; position: absolute; top: 50%; left: 50%; right: -50%; background: hsl(207, 85%, 47%); box-shadow: 0 3px 0 0 hsl(207, 85%, 27%); height: 5px; z-index: -1; } .scoring-board__username { font-variant: small-caps; letter-spacing: 1px; } .scoring-board__score { font-size: 2rem; font-weight: 600; margin-top: 1rem; } .message-board { font-size: 1.4rem; text-align: center; margin: 1rem auto; } .actions { display: grid; grid-template-columns: repeat(3, 33%); justify-content: center; gap: clamp(1rem, 3vw, 2rem); font-size: 1.2rem; margin-bottom: clamp(1rem, 3vh, 2rem); } .actions__body { width: clamp(5rem, 15vw, 8rem); height: clamp(4.5rem, 12vw, 7rem); position: relative; } .actions__icon { font-size: clamp(2.2rem, 7vw, 3.2rem); filter: drop-shadow(1px 1px 1px hsl(207, 85%, 27%)); position: relative; top: 4px; } .settings { display: flex; flex-flow: row wrap; gap: 2rem; justify-content: center; } .footer { font-size: 0.9rem; text-align: center; margin: clamp(2rem, 5vh, 4rem) auto 2rem; } /* * Components */ .btn { font-weight: 600; transition: all 0.2s ease-in-out 0s; } .btn:focus { outline: none; } .btn--action { background: hsl(207, 85%, 45%); border: 2px solid hsl(207, 85%, 28%); border-radius: 100%; box-shadow: inset 0 0 0 3px hsl(207, 85%, 38%), 0 5px 0 0 hsl(207, 85%, 28%), 0 5px 0 2px hsl(207, 85%, 20%); } .btn--action:hover, .btn--action:focus { background: hsl(207, 85%, 52%); transform: translateY(2px); } .btn--action:hover { box-shadow: inset 0 0 0 3px hsl(207, 85%, 38%), 0 3px 0 0 hsl(207, 85%, 32%), 0 3px 0 2px hsl(207, 85%, 22%); } .btn--action:focus { box-shadow: inset 0 0 0 3px hsl(207, 85%, 38%), 0 3px 0 0 hsl(207, 85%, 32%), 0 3px 0 2px hsl(207, 85%, 22%), 0 3px 0 8px hsl(204, 42%, 68%); } .btn--action:active { box-shadow: inset 0 0 0 3px hsl(207, 85%, 38%), 0 0 0 0 hsl(207, 85%, 28%), 0 0 0 1px hsl(207, 85%, 20%); transform: translateY(8px); } .btn--new-game { border: 2px solid hsl(0, 50%, 45%); border-radius: 0.5rem; color: hsl(0, 50%, 45%); box-shadow: 1px 1px 0 1px hsl(0, 50%, 25%); padding: 0.75rem 1rem; } .btn--new-game:hover, .btn--new-game:focus { background: hsl(0, 35%, 90%); color: hsl(0, 50%, 25%); transform: translateX(-3px) translateY(-3px); } .btn--new-game:hover { box-shadow: 3px 3px 0 1px hsl(0, 50%, 25%); } .btn--new-game:focus { box-shadow: 3px 3px 0 1px hsl(0, 50%, 25%), 3px 3px 0 4px hsl(0, 11%, 75%); } .btn--new-game:active { background: hsl(204, 14%, 93%); color: hsl(0, 50%, 25%); box-shadow: none; transform: translateX(3px) translateY(3px); } .btn--register { border: 3px solid hsl(207, 85%, 50%); border-radius: 8px; background-color: hsl(207, 85%, 40%); box-shadow: inset 0 0 0 3px #fff, 1px 1px 0 1px hsl(207, 85%, 25%), 3px 3px 0 2px hsl(207, 85%, 30%); color: #fff; font-size: 1.2rem; font-variant: small-caps; font-weight: 600; text-shadow: 2px 2px 0 #000; width: max-content; padding: 1rem 2rem; } .btn--register:hover, .btn--register:focus { background-color: hsl(207, 85%, 47%); border-color: hsl(207, 85%, 57%); box-shadow: inset 0 0 0 3px #fff, 1px 1px 0 1px hsl(207, 85%, 25%), 5px 5px 0 2px hsl(207, 85%, 30%); transform: translateY(-3px) translateX(-3px); } .btn--register:active { background-color: hsl(207, 85%, 35%); border-color: hsl(207, 85%, 45%); box-shadow: inset 0 0 0 3px #fff, 1px 1px 0 1px hsl(207, 85%, 25%), 0 0 0 1px hsl(207, 85%, 30%); transform: translateY(3px) translateX(3px); }