body { background: #eef2f3; font-family: Arial, sans-serif; text-align: center; color: #222; margin: 0; padding: 0; } h1 { margin-top: 2rem; color: #d7263d; font-size: 2.1rem; line-height: 1.2; } /* Tablero responsive */ #board { display: grid; grid-template-columns: repeat(7, minmax(35px, 11vw)); grid-template-rows: repeat(6, minmax(35px, 11vw)); gap: 0.6em; justify-content: center; margin: 2rem auto 1.3rem auto; background: #1565c0; padding: 1.2em 0; border-radius: 15px; max-width: 100vw; box-sizing: border-box; } /* Celda responsive */ .cell { width: 100%; height: 100%; background: #fff; border-radius: 50%; box-shadow: 0 2px 8px #bbb; font-size: 4.2em; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s; } .cell:hover, .cell:focus { background: #ffe082; } #status { font-size: 1.1em; min-height: 2em; margin-bottom: 1em; word-break: break-word; } #restart-btn { background: #d7263d; color: #fff; font-size: 1em; border: none; border-radius: 7px; padding: 0.7em 2em; cursor: pointer; transition: background 0.2s; margin-bottom: 2em; } #restart-btn:hover, #restart-btn:focus { background: #920c22; } /* Celulares */ @media (max-width: 520px) { h1 { font-size: 1.2rem; margin-top: 1rem; } #board { grid-template-columns: repeat(7, minmax(22px, 12vw)); grid-template-rows: repeat(6, minmax(22px, 12vw)); gap: 0.25em; padding: 0.5em 0; border-radius: 10px; margin: 1rem auto 1rem auto; max-width: 100vw; } .cell { font-size: 4.2em; border-radius: 50%; } #status { font-size: 0.97em; min-height: 1.2em; margin-bottom: 0.8em; } #restart-btn { font-size: 0.9em; padding: 0.45em 1em; border-radius: 5px; margin-bottom: 1em; } } /* Tablets */ @media (max-width: 900px) { h1 { font-size: 1.4rem; } #board { grid-template-columns: repeat(7, minmax(28px, 11vw)); grid-template-rows: repeat(6, minmax(28px, 11vw)); } .cell { font-size: 4.2em; } } /* Pantallas grandes */ @media (min-width: 1200px) { #board { grid-template-columns: repeat(7, 64px); grid-template-rows: repeat(6, 64px); gap: 1em; } .cell { font-size: 2em; } } /* Controles de IA y marcador */ #controls { margin: 1rem auto 0.5rem auto; display: flex; align-items: center; justify-content: center; gap: 8px; } #controls select#difficulty { font-size: 1em; padding: 6px 10px; border-radius: 8px; border: 1px solid #ddd; } #score { margin: 0.6rem auto 0.4rem auto; font-size: 1em; color: #444; } /* Botones-celda accesibles */ .cell { border: none; outline: none; } .cell:focus-visible { box-shadow: 0 0 0 4px rgba(21, 101, 192, 0.35); } /* Resaltado de combinación ganadora */ .win { background: #c8e6ff; box-shadow: 0 0 0 2px rgba(61, 90, 254, 0.25), 0 2px 10px rgba(61, 90, 254, 0.16); } @media (prefers-color-scheme: dark) { #controls select#difficulty { background: #20233a; color: #eaeaf0; border-color: #2c3252; } #score { color: #a0a3b0; } .cell:focus-visible { box-shadow: 0 0 0 4px rgba(61, 90, 254, 0.35); } .win { background: #172441; box-shadow: 0 0 0 2px rgba(61, 90, 254, 0.35), 0 2px 12px rgba(61, 90, 254, 0.22); } }