.tg-root { margin-bottom: 40px; }
.tg-root * { box-sizing: border-box; }
body.tg-scroll-lock { overflow: hidden;}

.tg-wrap {
	width: 100%;
	max-width: 800px;
	margin: 12px auto 0;
	background: #fff;
	padding: 24px;
	border-radius: 15px;
	box-shadow: 0 5px 15px rgba(0,0,0,0.1);
	text-align: center;

	position: relative;
	overflow: hidden;
	border-radius: 20px;
	padding: 28px;

	background: linear-gradient(180deg, #ffffff 0%, #fffdfa 100%);

	box-shadow: 0 10px 30px rgba(0,0,0,0.04);
	border: 1px solid rgba(0,0,0,0.05);
}

.tg-wrap::before{
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 0;

	opacity: 0.1;

	background-image:
	url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Crect width='240' height='240' fill='none'/%3E%3Ctext x='20' y='80' font-size='60' fill='none' stroke='%232a5298' stroke-width='1.8' opacity='0.2'%3E%E3%84%B1%20%E3%84%B4%20%E3%84%B7%3C/text%3E%3Ctext x='40' y='150' font-size='60' fill='none' stroke='%232a5298' stroke-width='1.8' opacity='0.2'%3E%E3%84%B9%20%E3%85%81%20%E3%85%82%3C/text%3E%3Ctext x='70' y='210' font-size='60' fill='none' stroke='%232a5298' stroke-width='1.6' opacity='0.2'%3E%E3%85%85%20%E3%85%87%20%E3%85%88%3C/text%3E%3C/svg%3E");

	background-repeat: repeat;
	background-size: 240px 240px;

	transform: rotate(-8deg) scale(1.1);
	transform-origin: center;
}

.tg-wrap > *{
	position: relative;
	z-index: 1;
}

.tg-title { color: #333; margin: 10px 0 30px; font-size: 26px; }

.tg-info {
	display: flex;
	justify-content: center; 
	margin-bottom: 16px;
	font-weight: 700;
	font-size: 16px;
}

.tg-statusBox {
	display: flex;
	align-items: center;
	gap: 16px;
}

.tg-divider {
	color: #ccc;
}

/* 시간 색상 부드럽게 변화 */
.tg-time {
	transition: color 0.3s ease;
}
.tg-accWrap { display: block; text-align: center; }
.tg-timeWrap { position: absolute; right: 0; top: 0; }
.tg-time { transition: color 0.25s ease; }

.tg-sentence {
	font-size: 22px;
	min-height: 44px;
	margin: 18px 0;
	color: #333;
	line-height: 1.5;
	word-break: keep-all;
	white-space: pre-line;
}

.tg-input {
	width: 100%;
	max-width: 720px;
	font-size: 16px; /* iOS 줌 방지 */
	padding: 12px;
	border: 2px solid #ddd;
	border-radius: 8px;
}
.tg-input:focus { outline: none; border-color: #007bff; }

.tg-correct { color: #28a745; }
.tg-wrong { color: #dc3545; text-decoration: underline; }

.tg-btn {
	margin-top: 30px;
	margin-bottom: 10px;
	padding: 12px 18px;
	font-size: 16px;
	cursor: pointer;
	background-color: #007bff;
	color: white;
	border: none;
	border-radius: 8px;
	width: 100%;
	max-width: 150px;
}

.tg-popup {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.5);
	justify-content: center;
	align-items: center;
	z-index: 2147483647;
	padding: 16px;
}

.tg-popupContent {
	background: white;
	padding: 28px 20px 22px;
	border-radius: 20px;
	text-align: center;
	position: relative;
	width: min(420px, 100%);
	max-height: 80vh;
	overflow: auto;
}

.tg-popupMessage { margin: 40px 0 20px; white-space: pre-line; line-height: 1.8;}

.tg-popupTitle { margin: 10px 0 14px; font-size: 20px; }

.tg-popupClose{
	position: absolute;
	top: 10px;
	right: 10px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: #eee;
	color: #333;
	cursor: pointer;
	font-size: 18px;
	line-height: 36px;
	padding: 0;
}

.tg-circleBtn {
	margin-top: 10px;
	width: 150px;
	height: 50px;
	border-radius: 8px;
	border: none;
	background: #ff5722;
	color: white;
	font-size: 18px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 10px;

	padding: 0 18px;
	box-shadow: 3px 3px 4px rgba(255, 87, 34, 0.2);
}

.tg-circleBtn:hover{
	filter: brightness(0.98);
}

.tg-circleBtn:active{
	transform: translateY(1px);
}

/* 게임 문장 드래그(선택) 방지 */
.tg-sentence {
  	-webkit-user-select: none; /* iOS/Safari */
  	-ms-user-select: none;     /* 구형 MS */
  	user-select: none;         /* 표준 */
	-webkit-touch-callout: none;
}


@media (max-width: 480px) {
	.tg-wrap { padding: 18px; border-radius: 14px; }
	.tg-title { font-size: 22px; }
	.tg-sentence { font-size: 18px; margin: 14px 0; }
	.tg-info { font-size: 14px; }
	.tg-btn { max-width: 100%; }
	.tg-circleBtn { width: 92px; height: 92px; font-size: 16px; }
}