/* used AI heavily throughout this file, as I built my project with CoPilot */

.sudoku-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;               /* span entire viewport width */
    height: 102px;
    z-index: 1000;

    /* center text horizontally and vertically */
    display: flex;
    align-items: center;
    justify-content: center;

    font-family: 'Josefin Sans', sans-serif;
    font-size: 48px;
    font-weight: 600;
    margin: 0;
    color: #000;
    background: #EB9C78;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* ensure content is pushed below the fixed header */
.frame {
    width: 1440px;
    height: 1024px;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
    padding-top: 122px; /* header height (102) + 20px spacing */
}

/* Sudoku board: size 680 x 641, positioned by requested offsets (top:199, left:175) */
.sudoku-container {
    position: absolute;
    top: 199px;    /* keep same offsets */
    left: 175px;   /* keep same offsets */
    width: 544px;   /* 680 * 0.8 = 544 (80% of original) */
    height: 513px;  /* 641 * 0.8 = 512.8 -> 513 */
    padding: 0;
    box-sizing: border-box;
    background: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* keep visual styles for grid but scale cells to the new container size */
.sudoku-grid {
    border-collapse: collapse;
    margin: 0;
    width: 100%;
    height: 100%;
    table-layout: fixed; /* equal column widths */
}
.sudoku-grid td {
    /* cells remain responsive to container so no need to hard-change widths */
    width: calc(100% / 9);
    height: calc(100% / 9);
    text-align: center;
    /* 25% larger numbers */
    font-size: 1.375em; /* 1.1em * 1.25 ≈ 1.375em */
    border: 1px solid #D99069;
    background: #FFE4D6;
    transition: background-color 150ms ease, color 150ms ease;
    box-sizing: border-box;
}

.h1 {
    color: #000;
text-align: center;
font-family: "Josefin Sans";
font-size: 128px;
font-style: normal;
font-weight: 600;
line-height: normal;
}

.titlepagetext {
    color: #000;
text-align: center;
font-family: "Josefin Sans";
font-size: 128px;
font-style: normal;
font-weight: 600;
line-height: normal;
}

.buttonfrontpage {
    width: 760px;
    height: 156px;
    border-radius: 38px;
    background: linear-gradient(90deg, rgba(254, 213, 156, 0.75) 0%, rgba(201, 97, 69, 0.75) 100%);
    border: none;              /* remove default border */
    cursor: pointer;

    /* center text inside the button */
    display: flex;
    justify-content: center;
    align-items: center;
    color: #000;
    font-family: "Josefin Sans", sans-serif;
    font-size: 45px;
    font-weight: 600;
    text-align: center;
    line-height: normal;

    /* center button horizontally on the page */
    margin: 40px auto 0;       /* 40px top margin, auto left/right, 0 bottom */
}

/* keep existing selection/related/result styles (no change) */
.cell-selected {
    background-color: #D99069 !important;
    color: #000;
}
.cell-related {
    background-color: #FAC8AE !important;
    color: #000;
}
.cell-correct {
    outline: 3px solid #79B461;
    background-color: rgba(52,199,89,0.12) !important;
}
.cell-incorrect {
    outline: 3px solid #FF6868;
    background-color: rgba(255,59,48,0.08) !important;
}

/* stronger borders for 3x3 */
.sudoku-grid tr:nth-child(3n) td {
    border-bottom: 2px solid #974525;
}
.sudoku-grid td:nth-child(3n) {
    border-right: 2px solid #974525;
}

/* Keypad positioning: use requested offsets (top:195, left:891, right:149, bottom:407)
   This yields keypad width = 1440 - 891 - 149 = 400, height = 1024 - 195 - 407 = 422 */
.sudoku-keypad {
  position: absolute;
  top: 195px;
  left: 891px;
  width: 400px;
  height: auto;                /* allow it to grow naturally */
  display: flex;
  flex-direction: column;
  align-items: center;         /* centers keypad + controls */
  justify-content: flex-start;
  overflow: visible;
}


/* 3x3 keypad grid (Stays centered inside the keypad area) */
.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 120px);
    grid-template-rows: repeat(3, 120px);
    gap: 20px;
    margin-top: 0;
    /* center the 3x3 block horizontally */
    justify-content: center;
    align-content: start;
}

/* keypad buttons unchanged */
.keypad-btn {
    width: 120px;
    height: 120px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 120ms ease, box-shadow 120ms ease;
}
.keypad-btn img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* controls are positioned relative to .frame (frame is position:relative) */
.keypad-controls {
  /* display: flex; */
  justify-content: center; /* center all buttons horizontally */
  align-items: center;     /* vertically align them if needed */
  gap: 20px;               /* 20px space between buttons */
  margin-top: 20px;        /* small gap under the 3x3 keypad */
  width: 100%;             /* take full width of parent */
  position: relative;      /* keep natural flow, no absolute positioning */
}





/* control button sizes (as requested) */
#generate-btn {
    width: 400px;
    height: 82px;
}
#check-btn,
#solve-btn {
    width: 235px;
    height: 82px;
}

/* ensure images fill the full button area */
.control-btn {
    padding: 0;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}
.control-btn img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#generate-btn {
    width: 400px;
    height: 82px;
}
#check-btn,
#solve-btn {
    width: 235px;
    height: 82px;
}
