:root {
	--tile-size-3: 45px;
	--tile-size-4: 40px;
	--tile-size-5: 30px;
	--tile-size-default: 20px;
}

body {
	background-color: #faf8ef;
	color: #776e65;
	font-family: 'Helvetica Neue', Arial, sans-serif;
	margin: 0;
	padding: 0;
	text-align: center;
}

h1 {
	font-size: 40px;
	margin-bottom: 15px;
	margin-top: 0;
}

.header {
	align-items: center;
	display: flex;
	gap: 20px;
	justify-content: center;
	margin-bottom: 20px;
}

.score-container {
	font-size: 24px;
	font-weight: bold;
}

button {
	background-color: #8f7a66;
	border: none;
	border-radius: 5px;
	color: white;
	cursor: pointer;
	font-size: 16px;
	font-weight: bold;
	padding: 10px 20px;
	transition: background-color .2s;
}

button:hover {
	background-color: #9f8b77;
}

.main-content {
	align-items: flex-start;
	display: flex;
	gap: 30px;
	justify-content: center;
	margin-bottom: 20px;
}

.game-container {
	align-items: center;
	display: flex;
	justify-content: center;
}

.ai-recommendation {
	background-color: #bbada0;
	border-radius: 6px;
	color: #f9f6f2;
	padding: 15px;
	width: 250px;
}

.ai-recommendation h2 {
	border-bottom: 2px solid #eee4da;
	margin-bottom: 15px;
	margin-top: 0;
	padding-bottom: 10px;
	text-align: center;
}

.recommendation-item {
	border-radius: 3px;
	display: flex;
	font-size: 20px;
	justify-content: space-between;
	margin-bottom: 10px;
	padding: 5px;
}

.recommendation-item span:last-child {
	font-weight: bold;
}

.ai-message-text {
	color: #f67c5f;
	font-size: 18px;
	font-weight: bold;
	margin-top: 15px;
	text-align: center;
}

.grid-container {
	background-color: #bbada0;
	border: 15px solid #bbada0;
	border-radius: 6px;
	display: grid;
	gap: 15px;
	grid-template-columns: repeat(4, 100px);
	grid-template-rows: repeat(4, 100px);
	position: relative;
}

.grid-cell {
	align-items: center;
	background-color: rgba(238, 228, 218, .35);
	border-radius: 3px;
	color: #776e65;
	cursor: pointer;
	display: flex;
	font-size: 45px;
	font-weight: bold;
	height: 100px;
	justify-content: center;
	user-select: none;
	width: 100px;
}

/* タイルの色設定 */
.tile-2 {
	background-color: #eee4da;
}

.tile-4 {
	background-color: #ede0c8;
}

.tile-8 {
	background-color: #f2b179;
	color: #f9f6f2;
}

.tile-16 {
	background-color: #f59563;
	color: #f9f6f2;
}

.tile-32 {
	background-color: #f67c5f;
	color: #f9f6f2;
}

.tile-64 {
	background-color: #f65e3b;
	color: #f9f6f2;
}

.tile-128 {
	background: linear-gradient(135deg, #ff9a9e, #fecfef);
	color: #f9f6f2;
}

.tile-256 {
	background: linear-gradient(135deg, #ff758c, #ff7eb3);
	color: #f9f6f2;
}

.tile-512 {
	background: linear-gradient(135deg, #ff9a44, #fc6076);
	color: #f9f6f2;
}

.tile-1024 {
	background: linear-gradient(135deg, #43e97b, #38f9d7);
	color: #f9f6f2;
	font-size: var(--tile-size-4);
}

.tile-2048 {
	background: linear-gradient(135deg, #4776e6, #8e54e9);
	color: #f9f6f2;
	font-size: var(--tile-size-4);
}

.tile-4096 {
	background: linear-gradient(135deg, #f7971e, #ffd200);
	color: #f9f6f2;
	font-size: var(--tile-size-4);
}

.tile-8192 {
	background: linear-gradient(135deg, #00c6ff, #0072ff);
	color: #f9f6f2;
	font-size: var(--tile-size-4);
}

.tile-16384 {
	background: linear-gradient(135deg, #f83600, #f9d423);
	color: #f9f6f2;
	font-size: var(--tile-size-5);
}

.tile-32768 {
	background: linear-gradient(135deg, #fc5c7d, #6a82fb);
	color: #f9f6f2;
	font-size: var(--tile-size-5);
}

.tile-65536 {
	background: linear-gradient(135deg, #ff9a9e, #fcd77f, #42e695, #38f9d7);
	color: #f9f6f2;
	font-size: var(--tile-size-5);
	text-shadow: #555 1px 1px 3px;
}

.tile-default {
	background: linear-gradient(135deg, #ff9a9e, #fcd77f, #fbc2eb, #a1c4fd);
	color: #f9f6f2;
	font-size: var(--tile-size-default);
	text-shadow: #555 1px 1px 3px;
	word-break: break-all;
}

.instructions {
	background-color: #eee4da;
	border-radius: 5px;
	margin-left: auto;
	margin-right: auto;
	margin-top: 30px;
	max-width: 800px;
	padding: 20px;
	text-align: left;
}

.tile-input-container {
	align-items: center;
	display: flex;
	gap: 10px;
	margin-bottom: 15px;
}

.tile-input-container label {
	font-weight: bold;
}

.tile-input-container input {
	border: 1px solid #bbada0;
	border-radius: 3px;
	font-size: 16px;
	padding: 5px;
	width: 100px;
}

/* Recommendation Highlighting */
.highlight-best {
	background-color: #ffd700 !important;
	border-radius: 5px;
	font-weight: bold;
}

.highlight-worst {
	background-color: #ffb6c1 !important;
	border-radius: 5px;
}
