body { background: #eef2f3; font-family: Arial, sans-serif; text-align: center; color: #222; margin: 0; padding: 0; } h1 { margin-top: 2rem; color: #3498db; font-size: 2.5rem; line-height: 1.2; } /* Board responsive styles */ #board { display: grid; grid-template-columns: repeat(3, minmax(60px, 22vw)); grid-template-rows: repeat(3, minmax(60px, 22vw)); gap: 0.8em; justify-content: center; margin: 2rem auto 1.5rem auto; max-width: 95vw; } /* Cell responsive styles */ .cell { width: 100%; height: 100%; background: #fff; border-radius: 0.5em; box-shadow: 0 2px 8px #bbb; font-size: 8em; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; } .cell:hover, .cell:focus { background: #f1fafe; } #status { font-size: 1.15em; min-height: 2em; margin-bottom: 1em; word-break: break-word; } #restart-btn { background: #3498db; color: #fff; font-size: 1em; border: none; border-radius: 0.7em; padding: 0.7em 2em; cursor: pointer; transition: background 0.2s; } #restart-btn:hover, #restart-btn:focus { background: #297fb8; } /* SMALL DEVICES (phones) */ @media (max-width: 480px) { h1 { font-size: 1.5rem; margin-top: 1rem; } #board { grid-template-columns: repeat(3, minmax(40px, 28vw)); grid-template-rows: repeat(3, minmax(40px, 28vw)); gap: 0.5em; margin: 1rem auto; } .cell { font-size: 10em; border-radius: 0.35em; } #status { font-size: 1em; min-height: 1.2em; margin-bottom: 0.7em; } #restart-btn { font-size: 0.95em; padding: 0.6em 1.2em; } } /* TABLETS */ @media (max-width: 768px) { h1 { font-size: 2rem; } #board { grid-template-columns: repeat(3, minmax(50px, 22vw)); grid-template-rows: repeat(3, minmax(50px, 22vw)); } .cell { font-size: 10em; } } /* BIG SCREENS */ @media (min-width: 1200px) { #board { grid-template-columns: repeat(3, 110px); grid-template-rows: repeat(3, 110px); gap: 1em; } .cell { font-size: 3em; } }