/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/*---------- CUSTOM CSS STYLES ----------*/
:root {
    font-size: 10px;
    --header-fonts: 'Georgia', 'Times New Roman', serif;
    --body-fonts: 'Arial', sans-serif;
    --burgundy: #7B113A;
    --gold: #FFD700;
    --lt-burgundy: #A8415B;
    --yellow: #FFF8BA;
    --black: #000000;
    --white: #ffffff;
}

/*---------- SMALL SCREEN / GLOBAL STYLES ----------*/

body {
    font-family: var(--body-fonts);
    background-color: light-dark(var(--burgundy), var(--black));
    color: light-dark(var(--white), var(--lt-burgundy));
    box-sizing: border-box;
    text-align: center;
    line-height: 1.6;
}

header {
    background-color: var(--white);
    color: var(--burgundy);
    padding: 2rem 0 0 0;
}

/* Decorative divider between tagline and nav */
.header-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin: 1.2rem auto 0 auto;
    padding: 0 2rem;
    color: var(--lt-burgundy);
    font-size: 2rem;
}

.header-divider::before,
.header-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--lt-burgundy), transparent);
}

/* Gold underline accent on section headings inside main */
main section h2 {
    position: relative;
    display: inline-block;
    padding-bottom: 0.6rem;
    margin-bottom: 0.5rem;
}

main section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 6rem;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    border-radius: 2px;
}

main, footer{
    padding: 1rem;
    width: calc(100% - 2rem);
}

h1, h2, h3{
    font-family: var(--header-fonts);
    font-weight: bold;
    text-align: center;
    padding: 0 1rem;
}

h1 {
    font-size: 10rem;
    margin: 0 0 1rem 0;
}

h2{
    font-size: 8rem;
    margin: 0.75rem 0.25rem;
}

h3{
    font-size: 5rem;
    margin: 2rem 0.25rem 1rem 0.25rem;
}

nav {
    width: 100%;
    margin: 0 auto;
    border-top: 1px solid var(--lt-burgundy);
}

nav > ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 4px 0;
    gap: 2px;
    list-style: none;
}

nav > ul > li {
    flex: 1 1 auto;
    min-width: 10rem;
    position: relative;
}

/* Dropdown trigger */
.nav-dropdown > .nav-parent {
    display: block;
    color: var(--burgundy);
    padding: 0.6rem 0.4rem;
    font-size: 1.8rem;
    font-weight: bold;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.18s, color 0.18s;
}

.nav-dropdown:hover > .nav-parent,
.nav-dropdown:focus-within > .nav-parent {
    background-color: var(--burgundy);
    color: var(--gold);
}

/* Submenu */
.nav-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--white);
    border: 1px solid rgba(123,17,58,0.3);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    min-width: 16rem;
    z-index: 100;
    list-style: none;
    padding: 0.4rem 0;
}

.nav-dropdown:hover .nav-submenu,
.nav-dropdown:focus-within .nav-submenu {
    display: block;
}

.nav-submenu li a {
    display: block;
    color: var(--burgundy);
    font-size: 1.8rem;
    padding: 0.6rem 1.4rem;
    text-align: left;
    border-radius: 0;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s;
}

.nav-submenu li a:hover,
.nav-submenu li a:focus {
    background-color: var(--burgundy);
    color: var(--gold);
}

.nav-submenu li:first-child a { border-radius: 6px 6px 0 0; }
.nav-submenu li:last-child  a { border-radius: 0 0 6px 6px; }


a{
    font-family: var(--body-fonts);
    font-size:  2rem;
    text-align: center;
    text-decoration: none;
}

nav a {
    display: block;
    color: var(--burgundy);
    padding: 0.6rem 0.4rem;
    font-size: 1.8rem;
    border-radius: 3px;
    transition: background-color 0.18s, color 0.18s;
}

nav a:hover, nav a:focus {
    background-color: var(--burgundy);
    color: var(--gold);
}

li a:first-of-type{
    border-top: none;
}

main {
    width: 100%;
    margin: 1rem auto;
    padding: 1rem 0;
    background-color: var(--burgundy);
}

img{
    display: block;
    align-items: left;
    width: 15%;
    height: 15%;
}

main a{
    background-color: var(--white);
    color: var(--burgundy);
    text-decoration: none;
    margin: 0 auto;
}

main a:hover {
    background-color: var(--burgundy);
    color: var(--gold);
}

section {
    background: linear-gradient(160deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,215,0,0.18);
    border-radius: 8px;
    padding: 2.5rem 1.5rem;
    margin: 1rem auto;
}
/*---------- GAMES INTRO ----------*/

#gamesIntro {
    border: none;
    background: none;
    padding: 2rem 1rem 0.5rem;
}

#gamesIntro h2::after {
    width: 10rem;
}

#gamesIntro p {
    font-size: 2.6rem;
    color: rgba(255,255,255,0.88);
}

/*---------- GAME STYLES ----------*/

button {
    font-family: var(--body-fonts);
    font-size: 2rem;
    background-color: var(--white);
    color: var(--burgundy);
    border: none;
    padding: 0.75rem 2rem;
    margin: 1rem auto 0 auto;
    cursor: pointer;
    display: block;
    transition: background-color 0.2s, color 0.2s;
}

button:hover, button:focus {
    background-color: var(--burgundy);
    color: var(--gold);
}

/* Snake Eyes dice */
#random1, #random2 {
    display: inline-block;
    font-size: 8rem;
    line-height: 1;
    padding: 0 1rem;
    text-align: center;
}

#snakeEyesMsg {
    text-align: center;
    margin: 0.5rem auto;
    height: 1.5em;
    font-size: 3rem;
}

/* Magic 8-Ball */
#eightBall {
    width: 12rem;
    height: 12rem;
    background: radial-gradient(circle at 35% 35%, #444, #000);
    border-radius: 50%;
    color: var(--gold);
    font-family: var(--header-fonts);
    font-size: 6rem;
    font-weight: bold;
    line-height: 12rem;
    margin: 1rem auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    transition: transform 0.1s;
}

#eightBall.shaking {
    animation: shake 0.6s ease;
}

@keyframes shake {
    0%,100% { transform: rotate(0deg); }
    20%      { transform: rotate(-12deg) scale(1.05); }
    40%      { transform: rotate(12deg) scale(1.05); }
    60%      { transform: rotate(-8deg); }
    80%      { transform: rotate(8deg); }
}

#eightBallAnswer {
    font-size: 3rem !important;
    min-height: 2em;
    padding: 0.5rem !important;
}

/* Number Guessing */
#guessInput {
    display: block;
    width: 12rem;
    margin: 1rem auto;
    text-align: center;
    font-size: 3rem;
    height: 3.5rem;
    background-color: var(--white);
    border: 2px solid var(--gold);
    color: var(--black);
}

#guessResult, #guessCount {
    font-size: 2.5rem !important;
    min-height: 1.5em;
    padding: 0.25rem !important;
}

.game-btns {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.game-btns button {
    margin: 0.5rem 0;
}

/* Coin Flip */
#coin {
    font-size: 9rem;
    line-height: 1;
    margin: 1rem auto;
    display: block;
    text-align: center;
}

#coin.flipping {
    animation: coinSpin 0.6s ease;
}

@keyframes coinSpin {
    0%   { transform: rotateY(0deg) scale(1); }
    50%  { transform: rotateY(540deg) scale(1.2); }
    100% { transform: rotateY(1080deg) scale(1); }
}

#coinResult {
    font-size: 3rem !important;
    min-height: 1.5em;
    padding: 0.25rem !important;
}



/* ---- Hangman ---- */
#hangmanDrawing {
    margin: 0.5rem auto;
    width: 12rem;
}

#hangmanSvg {
    width: 100%;
    height: auto;
    color: var(--white);
    display: block;
}

#hangmanWord {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1rem auto 0.5rem;
}

.hm-letter {
    display: inline-block;
    width: 2.8rem;
    height: 3.2rem;
    border-bottom: 3px solid var(--gold);
    text-align: center;
    font-size: 2.4rem;
    font-family: var(--header-fonts);
    font-weight: bold;
    color: var(--white);
    line-height: 3.2rem;
    text-transform: uppercase;
}

#hangmanHint {
    font-size: 1.8rem;
    color: rgba(255,215,0,0.75);
    font-style: italic;
    margin-bottom: 0.25rem;
    min-height: 1.5em;
}

#hangmanMsg {
    font-size: 2.4rem !important;
    font-weight: bold;
    min-height: 1.5em;
    padding: 0.25rem !important;
}

#hangmanKeyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    max-width: 34rem;
    margin: 1rem auto 0.75rem;
}

.hm-key {
    font-family: var(--body-fonts);
    font-size: 1.8rem;
    font-weight: bold;
    width: 3.2rem;
    height: 3.2rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--white);
    color: var(--burgundy);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, opacity 0.15s;
    margin: 0;
}

.hm-key:hover:not(:disabled) {
    background-color: var(--burgundy);
    color: var(--gold);
}

.hm-key:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.hm-key.hm-correct {
    background-color: #4a9e5c;
    color: var(--white);
}

.hm-key.hm-wrong {
    background-color: #c0392b;
    color: var(--white);
}

/* ---- Sudoku ---- */
#sudokuControls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0.5rem auto 1rem;
    flex-wrap: wrap;
}

#sudokuControls label {
    font-size: 2rem;
    font-weight: bold;
    color: var(--gold);
    margin: 0;
    width: auto;
    display: inline;
}

#sudokuControls select {
    width: auto;
    font-size: 2rem;
    height: auto;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    background-color: var(--white);
    border: 2px solid var(--gold);
    color: var(--black);
    cursor: pointer;
    display: inline;
}

#sudokuGrid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 2px;
    max-width: 36rem;
    margin: 0 auto 0.5rem;
    border: 3px solid var(--gold);
    padding: 2px;
    background-color: var(--gold);
}

#sudokuGrid input {
    width: 100%;
    aspect-ratio: 1;
    text-align: center;
    font-size: 2rem;
    font-family: var(--header-fonts);
    font-weight: bold;
    border: 1px solid rgba(255,215,0,0.3);
    background-color: rgba(255,255,255,0.92);
    color: var(--burgundy);
    padding: 0;
    box-sizing: border-box;
    outline: none;
    transition: background-color 0.15s;
    -moz-appearance: textfield;
}

#sudokuGrid input::-webkit-inner-spin-button,
#sudokuGrid input::-webkit-outer-spin-button { -webkit-appearance: none; }

#sudokuGrid input:focus {
    background-color: var(--yellow);
}

#sudokuGrid input.given {
    background-color: rgba(123,17,58,0.12);
    color: var(--black);
    font-weight: bold;
    cursor: default;
}

#sudokuGrid input.error {
    background-color: rgba(220,50,50,0.25);
    color: #8B0000;
}

#sudokuGrid input.correct {
    background-color: rgba(50,180,50,0.2);
}

/* Thick borders for 3x3 box separation */
#sudokuGrid input.border-right  { border-right:  2px solid var(--burgundy); }
#sudokuGrid input.border-bottom { border-bottom: 2px solid var(--burgundy); }

#sudokuMsg {
    font-size: 2.5rem !important;
    min-height: 1.5em;
    padding: 0.25rem !important;
    font-weight: bold;
}

#coinScore {
    font-size: 2rem !important;
    color: rgba(255,255,255,0.75);
    padding: 0.5rem !important;
}
#contact {
    width: 100%;
    margin: 2rem auto 0 auto;
}

p {
    font-size: 2.4rem;
    line-height: 1.7;
    padding: 0.75rem 1rem;
    margin: 0 auto;
    max-width: 70ch;
}

/* ---- Contact Form ---- */
#contact h2 {
    margin-bottom: 0.5rem;
}

#contact > h3 {
    font-size: 3rem;
    font-family: var(--body-fonts);
    font-weight: normal;
    color: rgba(255,255,255,0.85);
    margin-bottom: 0.25rem;
}

#contact > p {
    font-size: 2rem;
    color: rgba(255,255,255,0.6);
    font-style: italic;
    padding: 0.25rem 1rem 1.5rem;
}

form {
    margin: 0 auto;
    max-width: 800px;
}

form div {
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,215,0,0.2);
    border-radius: 6px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    display: block;
    font-family: var(--body-fonts);
    font-size: 2rem;
    font-weight: bold;
    color: var(--gold);
    margin-top: 1.5rem;
    margin-bottom: 0.4rem;
    width: 100%;
    letter-spacing: 0.03em;
}

label:first-child {
    margin-top: 0;
}

input[type=text],
input[type=email],
input[type=tel],
select,
textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--body-fonts);
    font-size: 2rem;
    color: var(--black);
    background-color: var(--white);
    border: 2px solid transparent;
    border-bottom: 2px solid var(--yellow);
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type=text]:focus,
input[type=email]:focus,
input[type=tel]:focus,
select:focus,
textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(255,215,0,0.25);
}

select {
    height: 4rem;
    cursor: pointer;
}

textarea {
    height: 8rem;
    resize: vertical;
    line-height: 1.5;
}

fieldset {
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

legend {
    font-family: var(--body-fonts);
    font-size: 2rem;
    font-weight: bold;
    color: var(--gold);
    padding: 0 0.5rem;
    letter-spacing: 0.03em;
}

.radio-group {
    display: flex;
    gap: 3rem;
    margin-top: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.radio-group input[type=radio] {
    display: inline-block;
    width: auto;
    height: auto;
    margin: 0;
    accent-color: var(--gold);
    cursor: pointer;
}

.radio-group label {
    display: inline-block;
    font-size: 2rem;
    font-weight: normal;
    color: var(--white);
    margin: 0 0 0 0.5rem;
    width: auto;
    cursor: pointer;
    letter-spacing: normal;
}

input[type=submit] {
    font-family: var(--body-fonts);
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    display: block;
    width: 100%;
    background-color: var(--gold);
    color: var(--burgundy);
    border: none;
    padding: 1.25rem;
    margin-top: 1rem;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s, color 0.2s, transform 0.1s;
}

input[type=submit]:hover,
input[type=submit]:focus {
    background-color: var(--white);
    color: var(--burgundy);
    transform: translateY(-1px);
}

footer {
    text-align: center;
    background-color: rgba(0,0,0,0.25);
    border-top: 1px solid rgba(255,215,0,0.3);
    padding: 2rem 1rem 3rem;
    margin-top: 2rem;
    width: 100%;
}

footer .footer-motto {
    font-family: var(--header-fonts);
    font-style: italic;
    font-size: 2.4rem;
    color: var(--gold);
    margin-bottom: 1.2rem;
    letter-spacing: 0.04em;
}

footer .footer-divider {
    width: 6rem;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,215,0,0.5), transparent);
    margin: 1rem auto;
    border: none;
}

footer span {
    display: block;
    font-size: 1.8rem;
    font-family: var(--header-fonts);
    color: rgba(255,255,255,0.6);
    margin-top: 0.5rem;
}



/*---------- MEDIUM SCREEN STYLES ----------*/
@media screen and (min-width: 525px){
    nav{
        border: none;
    }

    nav ul {
        justify-content: center;
    }
}

/*---------- LARGE SCREEN STYLES ----------*/
@media screen and (min-width: 800px) {
    main {
        display: block;
        padding: 1.5rem;
    }

    /* Games intro — full width, centered */
    #gamesIntro {
        max-width: 700px;
        margin: 0 auto 1.5rem auto;
        border: none;
        background: none;
    }

    /* 2-column grid for the four game cards */
    .games-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .games-grid section {
        margin: 0;
    }

    section {
        margin: 0 0 1.5rem 0;
    }

    form {
        display: block;
        margin: 0 auto;
        max-width: 800px;
    }

    form div {
        padding: 2rem;
    }

    .radio-group {
        gap: 4rem;
    }

    #mySubmit {
        width: auto;
        min-width: 200px;
        padding: 1.25rem 4rem;
        margin-left: auto;
    }
}
